repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
keeeener/nicki | platform/external/webkit/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py | 15 | 19900 | # Copyright (C) 2009 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 f... | gpl-2.0 |
henfredemars/Fork-Lang | llvm/test/CodeGen/SystemZ/Large/branch-range-09.py | 9 | 3483 | # Test 32-bit COMPARE LOGICAL AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0... | apache-2.0 |
ol-loginov/intellij-community | plugins/hg4idea/testData/bin/hgext/bugzilla.py | 93 | 34937 | # bugzilla.py - bugzilla integration for mercurial
#
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
# Copyright 2011-2 Jim Hague <jim.hague@acm.org>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''hooks for integrating ... | apache-2.0 |
spaceone/mils-secure | app/rapi.py | 2 | 18254 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import configuration as config
import logging
from google.appengine.api import users, memcache
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp.util import run_wsgi_app
from lovely.jsonrpc import wsgi
import models
from utils import dec, parse_i... | mit |
simod/geonode | scripts/backup-restore/gn20_to_24.py | 6 | 8830 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
sigma-random/pwnypack | tests/test_target.py | 1 | 2335 | import mock
from nose.tools import raises
import pwny
def test_default_arch_x86():
with mock.patch('platform.machine') as platform_mock:
platform_mock.return_value = 'i386'
assert pwny.Target().arch is pwny.Target.Arch.x86
def test_default_arch_x86_64():
with mock.patch('platform.machine') a... | mit |
peterjoel/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/python/integration.py | 30 | 13137 | import pytest
from _pytest import python
from _pytest import runner
class TestOEJSKITSpecials(object):
def test_funcarg_non_pycollectobj(self, testdir): # rough jstests usage
testdir.makeconftest(
"""
import pytest
def pytest_pycollect_makeitem(collector, name, obj):
... | mpl-2.0 |
colinligertwood/odoo | addons/hr_gamification/__openerp__.py | 62 | 1622 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/chromite/cbuildbot/stages/stage_results_unittest.py | 1 | 17477 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for the stage results."""
from __future__ import print_function
import os
import signal
import StringIO
import sys
im... | bsd-3-clause |
USStateDept/FPA_Core | openspending/command/search.py | 2 | 2007 | from openspending.command.util import create_submanager
from openspending.command.util import CommandException
from flask import current_app
import flask_whooshalchemy as whoo
from openspending.command.geometry import create as createCountries
manager = create_submanager(description='User operations')
@manager.comm... | agpl-3.0 |
Chilledheart/chromium | third_party/closure_linter/closure_linter/closurizednamespacesinfo.py | 107 | 19655 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
xutian/virt-test | virttest/remote_build.py | 14 | 10451 | import os
import re
from autotest.client import utils
import remote
import aexpect
import data_dir
import hashlib
import logging
class BuildError(Exception):
def __init__(self, error_info):
super(BuildError, self).__init__(error_info)
self.error_info = error_info
def __str__(self):
e... | gpl-2.0 |
SummerZheng/iRun_YN | app/static/py/Vertex.py | 1 | 1496 | ###
# Class node
###
from math import sin, cos, sqrt, atan2, radians
R = 6373000
maxVal = 99999.9
class Vertex:
#cor is a tuple of (lon, lat)
def __init__(self, cor):
self.id = cor
self.connectedTo = {}
def addNeighbor(self, nbrID, dist=0, score=0):
self.connectedTo[nbrID] = [dist... | mit |
rosmo/ansible | lib/ansible/modules/windows/win_disk_image.py | 52 | 2042 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# 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': 'core'}
DOCUMENTATI... | gpl-3.0 |
stevereyes01/pycbc | tools/timing/match_perf.py | 10 | 3186 | #!/usr/bin/env python
from pycbc.scheme import *
from pycbc.types import *
from pycbc.filter import *
from pycbc.psd import *
import pycbc
from math import log
import numpy
import numpy.random
import sys
from optparse import OptionParser
from math import sin
import gc
parser = OptionParser()
import logging
logging.bas... | gpl-3.0 |
lbechberger/ConceptualSpaces | conceptual_spaces/test/correlation_analysis.py | 1 | 6052 | # -*- coding: utf-8 -*-
"""
Creates scatter plots comparing the results of different variants for computing conceptual betweenness.
Created on Thu Sep 5 20:35:37 2019
@author: lbechberger
"""
import sys
sys.path.append("..")
import cs.cs
import random
import matplotlib.pyplot as plt
from itertools import combinatio... | mit |
nwokeo/supysonic | venv/lib/python2.7/site-packages/PIL/SunImagePlugin.py | 8 | 4318 | #
# The Python Imaging Library.
# $Id$
#
# Sun image file handling
#
# History:
# 1995-09-10 fl Created
# 1996-05-28 fl Fixed 32-bit alignment
# 1998-12-29 fl Import ImagePalette module
# 2001-12-18 fl Fixed palette loading (from Jean-Claude Rimbault)
#
# Copyright (c) 1997-2001 by Secret Labs AB
# Copyright (c... | agpl-3.0 |
jbarcia/Empire | lib/modules/code_execution/invoke_shellcodemsil.py | 22 | 3011 | import re
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-ShellcodeMSIL',
'Author': ['@mattifestation'],
'Description': ('Execute shellcode within the context of the running PowerShell '
... | bsd-3-clause |
mvidalgarcia/indico | indico/modules/events/contributions/forms.py | 2 | 11006 | # 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 unicode_literals
from datetime import timedelta
from flask import request
from wt... | mit |
RanadeepPolavarapu/kuma | vendor/packages/translate/storage/xliff.py | 22 | 31049 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2005-2011 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... | mpl-2.0 |
amanuel/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/packaging/tarbz2.py | 61 | 1803 | """SCons.Tool.Packaging.tarbz2
The tarbz2 SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to d... | apache-2.0 |
NeCTAR-RC/nova | nova/tests/unit/virt/libvirt/test_imagecache.py | 7 | 42584 | # Copyright 2012 Michael Still and Canonical 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
#
# ... | apache-2.0 |
2014c2g23/2015cda | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_assertions.py | 738 | 15398 | import datetime
import warnings
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... | gpl-3.0 |
jamesblunt/sympy | sympy/printing/tests/test_mathematica.py | 93 | 2612 | from sympy.core import (S, pi, oo, symbols, Function,
Rational, Integer, Tuple)
from sympy.integrals import Integral
from sympy.concrete import Sum
from sympy.functions import exp, sin, cos
from sympy import mathematica_code as mcode
x, y, z = symbols('x,y,z')
f = Function('f')
def test_Inte... | bsd-3-clause |
40223151/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/case.py | 743 | 48873 | """Test case implementation"""
import sys
import functools
import difflib
import pprint
import re
import warnings
import collections
from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
_count_diff_hashable)
__unittest = True
DIFF_OMITTED = ('\nDiff is %s charact... | gpl-3.0 |
jbassen/edx-platform | common/test/acceptance/tests/lms/test_lms_edxnotes.py | 84 | 44359 | """
Test LMS Notes
"""
from uuid import uuid4
from datetime import datetime
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest
from ...fixtures.course import CourseFixture, XBlockFixtureDesc
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.course_nav import CourseNavPage
from .... | agpl-3.0 |
LouisPlisso/pytomo | pytomo/fpdf/fonts.py | 34 | 26574 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
# Fonts:
fpdf_charwidths = {}
fpdf_charwidths['courier']={}
for i in xrange(0,256):
fpdf_charwidths['courier'][chr(i)]=600
fpdf_charwidths['courierB']=fpdf_charwidths['courier']
fpdf_charwidths['courierI']=fpdf_charwidths['courier']
fpdf_c... | gpl-2.0 |
BaconPancakes/valor | lib/pip/_vendor/colorama/ansitowin32.py | 450 | 9668 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
def ... | gpl-3.0 |
hypnotika/namebench | libnamebench/site_connector.py | 175 | 4048 | # Copyright 2010 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 by applicable law or ... | apache-2.0 |
nanobox-io/nanobox-pkgsrc-base | nodejs7/patches/patch-tools_gyp_pylib_gyp_generator_make.py | 16 | 1181 | $NetBSD: patch-tools_gyp_pylib_gyp_generator_make.py,v 1.3 2013/12/12 11:52:37 jperkin Exp $
Add support for NetBSD and DragonFly.
Ensure we use the system libtool on OSX.
--- tools/gyp/pylib/gyp/generator/make.py.orig 2013-12-12 05:20:06.000000000 +0000
+++ tools/gyp/pylib/gyp/generator/make.py
@@ -174,7 +174,7 @@ c... | mit |
stanlee321/pysolper | latrop/lib/dist/tipfy/template.py | 9 | 21622 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
loulich/Couchpotato | libs/requests/packages/urllib3/request.py | 853 | 5751 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... | gpl-3.0 |
amirrpp/django-oscar | tests/unit/wishlist_tests.py | 69 | 1388 | from django.test import TestCase
from oscar.apps.wishlists.models import WishList
from oscar.core.compat import get_user_model
User = get_user_model()
class TestAWishlist(TestCase):
def test_can_generate_a_random_key(self):
key = WishList.random_key(6)
self.assertTrue(len(key) == 6)
class Tes... | bsd-3-clause |
yzl0083/orange | Orange/OrangeCanvas/scheme/tests/test_annotations.py | 26 | 1426 | """
Tests for scheme annotations.
"""
from ...gui import test
from .. import SchemeArrowAnnotation, SchemeTextAnnotation
class TestAnnotations(test.QCoreApplication):
def test_arrow(self):
arrow = SchemeArrowAnnotation((0, 0), (10, 10))
self.assertTrue(arrow.start_pos == (0, 0))
self.a... | gpl-3.0 |
devosoft/Pepper | tests/preprocessor_test.py | 1 | 14658 | # This file is a part of the Pepper project, https://github.com/devosoft/Pepper
# (C) Michigan State University, under the MIT License
# See LICENSE.txt for more information
from bunch import Bunch
from pathlib import Path
from unittest.mock import MagicMock
import os
import pytest
import shutil
import subprocess
imp... | mit |
knossos-project/knossos_python_tools | setup.py | 3 | 2581 | #!/usr/bin/env python
import os
import sys
import setuptools
from setuptools import find_packages, setup, Extension
from pkg_resources import parse_version
# Setuptools >=18.0 is needed for Cython to work correctly.
if parse_version(setuptools.__version__) < parse_version('18.0'):
print('\nYour installed Setupto... | gpl-2.0 |
unsiloai/syntaxnet-ops-hack | tensorflow/contrib/keras/python/keras/regularizers.py | 58 | 2778 | # 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 |
raw1z/ultisnips | pythonx/UltiSnips/snippet/parsing/_base.py | 21 | 2505 | #!/usr/bin/env python
# encoding: utf-8
"""Common functionality of the snippet parsing codes."""
from UltiSnips.position import Position
from UltiSnips.snippet.parsing._lexer import tokenize, TabStopToken
from UltiSnips.text_objects import TabStop
from UltiSnips.text_objects import Mirror
from UltiSnips.snippet.par... | gpl-3.0 |
pizzathief/scipy | scipy/integrate/tests/test_quadrature.py | 2 | 8426 | import numpy as np
from numpy import cos, sin, pi
from numpy.testing import (assert_equal, assert_almost_equal, assert_allclose,
assert_, suppress_warnings)
from scipy.integrate import (quadrature, romberg, romb, newton_cotes,
cumtrapz, quad, simps, fixed_quad,
... | bsd-3-clause |
epssy/hue | apps/jobbrowser/src/jobbrowser/models.py | 5 | 22542 | #!/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 |
Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/database_backups/workflows/create_backup.py | 11 | 3194 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Rackspace Hosting
#
# 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 |
jcshen007/cloudstack | plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/sglib.py | 7 | 7010 | #!/usr/bin/env python
# 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
# "Li... | apache-2.0 |
sgarrity/bedrock | bedrock/firefox/urls.py | 1 | 7825 | # 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 django.conf.urls import url
import bedrock.releasenotes.views
from bedrock.mozorg.util import page
from bedrock.rel... | mpl-2.0 |
emonty/ansible | hacking/fix_test_syntax.py | 135 | 3563 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2017, Matt Martz <matt@sivel.net>
#
# 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 Licens... | gpl-3.0 |
open-pli/enigma2 | lib/python/Components/ActionMap.py | 45 | 2560 | from enigma import eActionMap
class ActionMap:
def __init__(self, contexts = [ ], actions = { }, prio=0):
self.actions = actions
self.contexts = contexts
self.prio = prio
self.p = eActionMap.getInstance()
self.bound = False
self.exec_active = False
self.enabled = True
def setEnabled(self, enabled):
... | gpl-2.0 |
gurneyalex/OpenUpgrade | addons/mail/tests/test_mail_message.py | 38 | 27445 | # -*- 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 |
tseaver/google-cloud-python | logging/tests/unit/handlers/test_handlers.py | 2 | 4970 | # Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
timthelion/FreeCAD | src/Mod/Ship/shipCreateTank/TaskPanel.py | 8 | 6620 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2016 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
gilneidp/FinalProject | ALL_FILES/pox/misc/mac_blocker.py | 46 | 3794 | # Copyright 2012 James McCauley
#
# 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 writi... | mit |
magicrub/MissionPlanner | Lib/encodings/mbcs.py | 103 | 1258 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs ... | gpl-3.0 |
neumerance/deploy | .venv/lib/python2.7/site-packages/requests/packages/urllib3/contrib/ntlmpool.py | 59 | 4740 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... | apache-2.0 |
drdelta/notenso | src/platform/win32/SConsTools/SwigTool.py | 7 | 5611 | import os
import re
import SCons.Builder
import SCons.Scanner
from Helpers import addInstanceMethodToEnv
def buildSwigExtension( env,
swigInterfaceFile,
source = None,
isCpp = True,
**kwargs ):
"""
Bui... | bsd-3-clause |
Mohamed711/Quiz-Program | vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.7/vendor/v8/tools/testrunner/server/work_handler.py | 123 | 5569 | # 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... | cc0-1.0 |
jmartinm/invenio-master | modules/miscutil/lib/plotextractor.py | 13 | 53628 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011 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 opt... | gpl-2.0 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/lib_openshift/library/oc_version.py | 7 | 49326 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
ropik/chromium | third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_SPARC_asm.py | 33 | 9068 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004
# 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 limitation
# on the... | bsd-3-clause |
ShiYw/Sigil | 3rdparty/python/Lib/lib2to3/fixes/fix_throw.py | 203 | 1582 | """Fixer for generator.throw(E, V, T).
g.throw(E) -> g.throw(E)
g.throw(E, V) -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))
g.throw("foo"[, V[, T]]) will warn about string exceptions."""
# Author: Collin Winter
# Local imports
from .. import pytree
from ..pgen2 import token
from .. im... | gpl-3.0 |
davidbliu/maestro-nng | maestro/__main__.py | 1 | 4482 | #!/usr/bin/env python
# Copyright (C) 2013 SignalFuse, Inc.
#
# Docker container orchestration utility.
import argparse
import jinja2
import logging
import sys
import os
import yaml
from . import exceptions, maestro
from . import name, version
# Define the commands
ACCEPTED_COMMANDS = ['status', 'fullstatus', 'star... | lgpl-3.0 |
chen2aaron/SnirteneCodes | Fragment/MySQLdb_Pra.py | 1 | 1034 | import MySQLdb
conn = MySQLdb.connect(host="localhost", user="root", passwd="123456",db="cc",port=3306,charset="utf8")
cur = conn.cursor()
# cur.execute("insert into users (username,password,email) values (%s,%s,%s)",("python","123456","python@gmail.com"))
# conn.commit()
# cur.executemany("insert into users (username... | gpl-2.0 |
rxuriguera/bibtexIndexMaker | src/bibim/ie/tests/test_context.py | 1 | 3474 |
# Copyright 2010 Ramon Xuriguera
#
# This file is part of BibtexIndexMaker.
#
# BibtexIndexMaker 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 lat... | gpl-3.0 |
Modified-MW-DF/modified-MDF | MWDF Project/MasterworkDwarfFortress/Utilities/Quickfort/src/qfconvert/xml2obj.py | 3 | 3404 | ## {{{ http://code.activestate.com/recipes/534109/ (r8)
import re
import xml.sax.handler
def xml2obj(src):
"""
A simple function to converts XML data into native Python object.
"""
non_id_char = re.compile('[^_0-9a-zA-Z]')
def _name_mangle(name):
return non_id_char.sub('_', ... | mit |
shsingh/ansible | lib/ansible/modules/cloud/misc/cloud_init_data_facts.py | 101 | 3392 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, René Moser <mail@renemoser.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 = {'metadata_version': '1.1',
... | gpl-3.0 |
jit/pyew | vstruct/unittest.py | 17 | 2352 |
import vstruct
from cStringIO import StringIO
from vstruct.primitives import *
def test(vs, hexstr):
vshex = vs.vsEmit().encode('hex')
if vshex != hexstr:
raise Exception('FAIL')
print 'PASS!'
v = vstruct.VStruct()
v.uint8 = v_uint8(1)
v.uint16 = v_uint16(2)
v.uint24 = v_uint24(3)
v.uint32 = v_... | gpl-2.0 |
ksh/gpirecertification | tests/functional/model_student_work.py | 7 | 3838 | # Copyright 2013 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 by applicable law or ... | apache-2.0 |
eprivalov/sendec | loginsys/forms.py | 1 | 2847 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.contrib import auth
class UserCreationFormNew(forms.ModelForm):
"""
A form that creates a user, with no privileges, from the given use... | apache-2.0 |
nadeemsyed/swift | test/unit/common/middleware/test_quotas.py | 8 | 15565 | # 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 |
dancingdan/tensorflow | tensorflow/compiler/tests/pooling_ops_test.py | 22 | 20324 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
a-doumoulakis/tensorflow | tensorflow/examples/tutorials/mnist/mnist_deep.py | 33 | 6130 | # 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 |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/requests-2.2.1-py2.7.egg/requests/packages/urllib3/response.py | 316 | 10537 | # urllib3/response.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import zlib
import io
from .exceptions import DecodeError
from .packages.six ... | gpl-2.0 |
jhoos/django | tests/unmanaged_models/tests.py | 296 | 2174 | from __future__ import unicode_literals
from django.db import connection
from django.test import TestCase
from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created w... | bsd-3-clause |
UASLab/ImageAnalysis | video/import_apt.py | 1 | 1267 | #!/usr/bin/env python3
import argparse
import gzip
argparser = argparse.ArgumentParser(description='import apt.dat.gz from FlightGear')
argparser.add_argument('--file', help='fgfs apt.dat.gz file')
args = argparser.parse_args()
ft2m = 0.3048
ident = ''
alt = ''
count = 0
lat_sum = 0
lon_sum = 0
print 'Ident,Lat,Lo... | mit |
viz-dev/viz | qa/rpc-tests/mempool_reorg.py | 41 | 4514 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly)... | mit |
gurneyalex/odoo | addons/event_sale/__manifest__.py | 5 | 1311 | # -*- coding: utf-8 -*-
{
'name': 'Events Sales',
'version': '1.1',
'category': 'Marketing/Events',
'website': 'https://www.odoo.com/page/events',
'description': """
Creating registration with sales orders.
========================================
This module allows you to automate and connect you... | agpl-3.0 |
OpenTrons/opentrons_sdk | api/src/opentrons/api/calibration.py | 1 | 11815 | import functools
import logging
from copy import copy
from typing import Optional
from opentrons.util import calibration_functions
from opentrons.config import feature_flags as ff
from opentrons.broker import Broker
from opentrons.types import Point, Mount, Location
from opentrons.protocol_api import labware
from open... | apache-2.0 |
NeuralEnsemble/python-neo | neo/core/baseneo.py | 2 | 14038 | """
This module defines :class:`BaseNeo`, the abstract base class
used by all :module:`neo.core` classes.
"""
from copy import deepcopy
from datetime import datetime, date, time, timedelta
from decimal import Decimal
import logging
from numbers import Number
import numpy as np
ALLOWED_ANNOTATION_TYPES = (int, float,... | bsd-3-clause |
mattpap/sympy-polys | sympy/concrete/products.py | 1 | 3802 | from sympy.core import Expr, S, C, Mul, sympify
from sympy.polys import quo, roots
from sympy.simplify import powsimp
class Product(Expr):
"""Represents unevaluated product.
"""
def __new__(cls, term, *symbols, **assumptions):
term = sympify(term)
if term.is_Number:
if term i... | bsd-3-clause |
travisfcollins/gnuradio | gr-wxgui/python/wxgui/waterfall_window.py | 47 | 10668 | #
# Copyright 2008 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 option)
# any later version.
#
#... | gpl-3.0 |
TestInABox/openstackinabox | openstackinabox/tests/utils/test_directory.py | 1 | 1798 | import os
import os.path
import ddt
import mock
from openstackinabox.tests.base import TestBase
from openstackinabox.utils import directory
@ddt.ddt
class TestTempDirectory(TestBase):
def setUp(self):
super(TestTempDirectory, self).setUp()
def tearDown(self):
super(TestTempDirectory, self... | apache-2.0 |
Jumpscale/ays9 | tests/test_services/test_directory_structure/actions.py | 1 | 3901 | def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
# some default logic for simple actions
return {
'test': ['install']
}
def t... | apache-2.0 |
MechanisM/bleach | bleach/tests/test_links.py | 3 | 4636 | from nose.tools import eq_
import urllib
from bleach import Bleach, url_re
b = Bleach()
class cleach(Bleach):
def filter_url(self, url):
return u'http://bouncer/?u=%s' % urllib.quote_plus(url)
c = cleach()
def test_url_re():
def no_match(s):
match = url_re.search(s)
if match:
... | bsd-3-clause |
cjh1/VTK | Examples/GUI/Python/ImagePlaneWidget.py | 14 | 10228 | #!/usr/bin/env python
# This code is a direct translation of the Tcl code in
# ImagePlaneWidget.tcl. It could easily be written using a nice class
# to do the job but the present code should definitely make for an
# illustrative example.
# This example demonstrates how to use the vtkImagePlaneWidget
# to probe a 3D ... | bsd-3-clause |
jordiclariana/ansible | lib/ansible/modules/cloud/misc/virt_pool.py | 48 | 22292 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Maciej Delmanowski <drybjed@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 th... | gpl-3.0 |
gregdek/ansible | lib/ansible/plugins/lookup/vars.py | 55 | 3004 | # (c) 2017 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
DOCUMENTATION = """
lookup: vars
author: Ansible Core
version_added: "2.5"
short_description: L... | gpl-3.0 |
roselleebarle04/django | django/conf/locale/el/formats.py | 446 | 1477 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd/m/Y'
TIME_FORMAT = 'P'
DATETIME... | bsd-3-clause |
CSC301H-Fall2013/JuakStore | site-packages/django/db/utils.py | 100 | 6204 | import os
import pkgutil
from threading import local
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.utils._os import upath
from django.utils import six
DEFAULT_DB_ALIAS = 'default'
# Define some exceptions that mi... | mit |
itucsdb1611/itucsdb1611 | classes/operations/project_operations.py | 1 | 4444 |
import psycopg2 as dbapi2
import datetime
from classes.model_config import dsn
class project_operations:
def __init__(self):
self.last_key = None
def add_project(self, Project):
with dbapi2.connect(dsn) as connection:
cursor = connection.cursor()
cursor.execute(
... | gpl-3.0 |
andensinlimite/metaespacio | metaespacio/metaespacio/settings.py | 2 | 4507 | """
Django settings for metaespacio project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | agpl-3.0 |
geekboxzone/lollipop_external_chromium_org | third_party/markdown/extensions/codehilite.py | 109 | 10820 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
dennisfrancis/PacketManipulator | umit/pm/core/atoms.py | 2 | 12717 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008, 2009 Adriano Monteiro Marques
#
# Author: Francesco Piccinno <stack.box@gmail.com>
#
# 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 Found... | gpl-2.0 |
agbell/karaka | karaka/api/apiconfig.py | 4 | 1689 | #
# Karaka Skype-XMPP Gateway: API configuration handler
# <http://www.vipadia.com/products/karaka.html>
#
# Copyright (C) 2008-2009 Vipadia Limited
# Richard Mortier <mort@vipadia.com>
# Neil Stratford <neils@vipadia.com>
#
## This program is free software; you can redistribute it and/or
## modify it under the terms ... | gpl-2.0 |
Multirom-mi4i/android_kernel_xiaomi_ferrari | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # 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 |
sbrisard/janus | examples/fftw_python_benchmark_mpi.py | 1 | 1237 | import sys
import time
import numpy as np
import janus.fft.parallel
from mpi4py import MPI
def benchmark(shape, niter):
comm = MPI.COMM_WORLD
root = 0
transform = janus.fft.parallel.create_real(shape, comm)
local_sizes = comm.gather((transform.ishape[0], transform.offset0))
if comm.rank == root... | bsd-3-clause |
snnn/tensorflow | tensorflow/contrib/data/python/kernel_tests/assert_element_shape_test.py | 8 | 8680 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
alxgu/ansible | lib/ansible/modules/network/f5/bigip_device_group_member.py | 38 | 8383 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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_version': '1.1',
... | gpl-3.0 |
Lyrositor/moul-scripts | Python/system/random.py | 10 | 32008 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | gpl-3.0 |
pllim/astropy | astropy/io/fits/column.py | 3 | 98069 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import operator
import re
import sys
import warnings
import weakref
import numbers
from functools import reduce
from collections import OrderedDict
from contextlib import suppress
import numpy as np
from numpy import char as chararray
from .... | bsd-3-clause |
LennonChin/Django-Practices | MxShop/apps/goods/views.py | 1 | 2837 | from .serializers import GoodsSerializer, CategorySerializer
from rest_framework import mixins
from rest_framework import generics, viewsets, filters
from rest_framework.response import Response
from rest_framework.pagination import PageNumberPagination
from rest_framework.authentication import TokenAuthentication... | apache-2.0 |
timgraham/django-cms | cms/utils/admin.py | 4 | 4743 | # -*- coding: utf-8 -*-
import json
from collections import defaultdict
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.sites.models import Site
from django.http import HttpResponse
from django.template.loader import get_template
from django.utils.encoding import smart_str
from cms.models im... | bsd-3-clause |
petrjasek/superdesk-ntb | server/ntb/io/feed_parsers/afp_newsml.py | 2 | 1977 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2018 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superdesk imp... | agpl-3.0 |
alheinecke/tensorflow-xsmm | tensorflow/contrib/distributions/python/ops/uniform.py | 11 | 6929 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.