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 |
|---|---|---|---|---|---|
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/astroid/mixins.py | 5 | 4832 | # Copyright (c) 2010-2011, 2013-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2016 Cara Vinson <ceridwenv@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob... | mit |
crakensio/django_training | lib/python2.7/site-packages/django/contrib/admin/filters.py | 101 | 16322 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... | cc0-1.0 |
tato69/myfirstrepo | day3/makeasentece.py | 1 | 1633 | import random
s_nouns = ["A dude", "My mom", "The king", "Some guy", "A cat with rabies", "A sloth", "Your homie", "This cool guy my gardener met yesterday", "Superman"]
p_nouns = ["These dudes", "Both of my moms", "All the kings of the world", "Some guys", "All of a cattery's cats", "The multitude of sloths living un... | apache-2.0 |
ebar0n/django | tests/model_forms/models.py | 26 | 13647 | import datetime
import os
import tempfile
import uuid
from django.core import validators
from django.core.exceptions import ValidationError
from django.core.files.storage import FileSystemStorage
from django.db import models
temp_storage_dir = tempfile.mkdtemp()
temp_storage = FileSystemStorage(temp_storage_dir)
ART... | bsd-3-clause |
jut-io/jut-python-tools | jut/cli.py | 1 | 17203 | """
main entry point for jut tools
"""
import argparse
import sys
import traceback
from jut import defaults, config
from jut.commands import configs, jobs, programs, run, upload
from jut.common import error, is_debug_enabled
from jut.exceptions import JutException
def parse_key_value(string):
"""
interna... | mit |
ariknem/backports | lib/bpgit.py | 5 | 11614 | import subprocess, re, os, tempfile
class GitError(Exception):
pass
class SHAError(GitError):
pass
class ExecutionError(GitError):
def __init__(self, errcode):
self.error_code = errcode
def _check(process):
if process.returncode != 0:
raise ExecutionError(process.returncode)
_sha_re =... | gpl-2.0 |
sudheerchintala/LearnEraPlatForm | cms/djangoapps/contentstore/views/tests/test_container_page.py | 11 | 8126 | """
Unit tests for the container page.
"""
import re
import datetime
from pytz import UTC
from contentstore.views.tests.utils import StudioPageTestCase
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import ItemFactory
class ContainerPageTestCase(StudioPageTestCase):
"... | agpl-3.0 |
fniephaus/alfred-gmail | src/google/auth/compute_engine/credentials.py | 12 | 8709 | # Copyright 2016 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 or agreed to in writing,... | mit |
catapult-project/catapult | common/py_utils/py_utils/refactor/annotated_symbol/class_definition.py | 3 | 1291 | # 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.
from __future__ import absolute_import
import symbol
from py_utils.refactor.annotated_symbol import base_symbol
__all__ = [
'Class',
]
class Class(b... | bsd-3-clause |
kpengboy/pox-exercise | pox/host_tracker/host_tracker.py | 44 | 13799 | # Copyright 2011 Dorgival Guedes
# Copyright 2013 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 app... | apache-2.0 |
svanlochem/Paparazzi | sw/airborne/test/stabilization/setup.py | 83 | 2143 | from distutils.core import setup, Extension
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy
from os import path, getenv
# if PAPARAZZI_SRC not set, then assume the tree containing this
# file is a reasonable substitute
pprz_src = getenv("PAPARAZZI_SRC", path.normpath(path.joi... | gpl-2.0 |
Commonists/VICbot | vic_bot/viutil.py | 2 | 3458 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os
sys.path.append(os.environ['HOME'] + '/core')
import pywikibot
import urllib
import re
import htmlentitydefs
"""
vi-util.py
by Eusebius and Dschwen
utility methods for the processing of Valued Images.
TODO: use SQL instead of API
Methods ava... | gpl-2.0 |
mozilla/kuma | kuma/attachments/tests/test_templates.py | 1 | 1910 | import pytest
from pyquery import PyQuery as pq
from kuma.core.urlresolvers import reverse
from kuma.core.utils import to_html
from kuma.wiki.models import Revision
from . import make_test_file
from ..models import Attachment
@pytest.mark.security
def test_xss_file_attachment_title(admin_client, constance_config, r... | mpl-2.0 |
eugene1g/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/gen_gtest_pred_impl.py | 294 | 21993 | #!/usr/bin/env python
#
# Copyright 2006, 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 |
s0enke/boto | boto/configservice/layer1.py | 79 | 17243 | # Copyright (c) 2015 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 limitation the rights ... | mit |
codervince/flashingredlight | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py | 371 | 8967 | import datetime
import sys
import socket
from socket import timeout as SocketTimeout
import warnings
from .packages import six
try: # Python 3
from http.client import HTTPConnection as _HTTPConnection, HTTPException
except ImportError:
from httplib import HTTPConnection as _HTTPConnection, HTTPException
cla... | mit |
aomelchenko/python_koans | python2/koans/about_classes.py | 1 | 4830 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog(object):
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
fido = self.Dog()
self.assertEqual('Dog... | mit |
gohin/django | django/contrib/sitemaps/views.py | 352 | 2953 | import datetime
from calendar import timegm
from functools import wraps
from django.contrib.sites.shortcuts import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.http import Http404
from django.template.response import TemplateResponse
fr... | bsd-3-clause |
littlstar/chromium.src | media/tools/layout_tests/test_expectations_unittest.py | 165 | 1697 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from test_expectations import TestExpectations
class TestTestExpectations(unittest.TestCase):
def testParseLi... | bsd-3-clause |
Alshak/clowdflows | workflows/migrations/0029_auto__chg_field_workflow_template_parent__add_field_abstractinput_orde.py | 6 | 16796 | # -*- 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):
# Changing field 'Workflow.template_parent'
db.alter_column('workflows_workflow', 'template_parent_id', sel... | mit |
assad2012/ggplot | ggplot/geoms/geom_linerange.py | 12 | 2881 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
from .geom import geom
from ggplot.utils import is_categorical
import numpy as np
class geom_linerange(geom):
"""Plot intervals represented by vertical lines
Parameters
---------
... | bsd-2-clause |
bpsinc-native/src_tools_gyp | test/msvs/list_excluded/gyptest-all.py | 347 | 1292 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that msvs_list_excluded_files=0 doesn't list files that would
normally be in _excluded_files, and that if that flag is not set,... | bsd-3-clause |
FabriceSalvaire/python-project-template | RootModule/Config/Messages.py | 1 | 1373 | ####################################################################################################
#
# @Project@ - @ProjectDescription@.
# Copyright (C) Fabrice Salvaire 2013
#
####################################################################################################
####################################... | gpl-3.0 |
mouthwateringmedia/python-docx | example-makedocument.py | 1 | 3666 | #!/usr/bin/env python2.6
'''
This file makes an docx (Office 2007) file from scratch, showing off most of python-docx's features.
If you need to make documents from scratch, use this file as a basis for your work.
Part of Python's docx module - http://github.com/mikemaccana/python-docx
See LICENSE for licensing infor... | mit |
kissmetrics/spark | examples/src/main/python/mllib/gradient_boosting_classification_example.py | 106 | 2485 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
juju/python-libjuju | juju/provisioner.py | 1 | 11307 | import os
import re
import shlex
import tempfile
import uuid
from subprocess import CalledProcessError
import paramiko
from .client import client
arches = [
[re.compile(r"amd64|x86_64"), "amd64"],
[re.compile(r"i?[3-9]86"), "i386"],
[re.compile(r"(arm$)|(armv.*)"), "armhf"],
[re.compile(r"aarch64"), ... | apache-2.0 |
jendap/tensorflow | tensorflow/contrib/opt/python/training/lazy_adam_optimizer.py | 25 | 5827 | # 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 |
Nowheresly/odoo | addons/account/account_cash_statement.py | 283 | 15868 | # encoding: utf-8
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
techdragon/django | tests/sitemaps_tests/base.py | 380 | 1079 | from django.apps import apps
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.test import TestCase, modify_settings, override_settings
from .models import I18nTestModel, TestModel
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'})
@override_settings(ROO... | bsd-3-clause |
cmarzullo/saltscaffold | setup.py | 1 | 1417 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")
read_md = lambda f: open(f, 'r').read... | gpl-3.0 |
robertjpayne/rethinkdb | drivers/python/rethinkdb/handshake.py | 10 | 11666 | import base64
import binascii
import hashlib
import hmac
import random
import struct
import sys
import threading
from . import ql2_pb2
from .errors import *
try:
xrange
except NameError:
xrange = range
class HandshakeV0_4(object):
VERSION = ql2_pb2.VersionDummy.Version.V0_4
PROTOCOL = ql2_pb2.Version... | apache-2.0 |
soellman/copernicus | cpc/server/message/tracking.py | 2 | 2655 | # This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
# by the Free Soft... | gpl-2.0 |
Mitali-Sodhi/CodeLingo | Dataset/python/test_connection (9).py | 12 | 1535 | from __future__ import with_statement
from tests.unit import unittest
from boto.ses.connection import SESConnection
from boto.ses import exceptions
class SESConnectionTest(unittest.TestCase):
ses = True
def setUp(self):
self.ses = SESConnection()
def test_get_dkim_attributes(self):
res... | mit |
luotao1/Paddle | python/paddle/fluid/tests/unittests/test_tdm_child_op.py | 2 | 5082 | # Copyright (c) 2020 PaddlePaddle 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 app... | apache-2.0 |
sanguinariojoe/FreeCAD | src/Mod/Arch/importWebGL.py | 9 | 44100 | #***************************************************************************
#* Copyright (c) 2013 Yorik van Havre <yorik@uncreated.net> *
#* Copyright (c) 2020 Travis Apple <travisapple@gmail.com> *
#* *
#* This pr... | lgpl-2.1 |
dhamonex/zoneminder-rpm-database-init | src/zm_dbinit/mysql_configuration.py | 1 | 1650 | # -*- coding: utf-8 -*-
import configparser
import os.path, shutil, os
class MySQLConfiguration:
""" Handles MySQL Configuration file """
ClientSection = "client"
def __init__(self, userprompt, mysqlConfigFile):
self.configfile = mysqlConfigFile
self.config = configparser.SafeConfigParser()
... | gpl-2.0 |
xaxa89/mitmproxy | release/hooks/hook-cryptography.py | 11 | 1659 | # Taken from the latest pyinstaller master on 2016-11-27 (0729a2b).
# flake8: noqa
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing ... | mit |
iotcloud/jstorm | jstorm-core/src/main/py/storm/DistributedRPC.py | 19 | 7834 | #
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:utf8strings
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import... | apache-2.0 |
foursquare/luigi | luigi/contrib/hadoop.py | 1 | 37779 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
whitepages/nova | nova/tests/unit/objects/test_tag.py | 58 | 3758 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
tzewangdorje/SIPserv | Twisted-13.1.0/twisted/test/test_unix.py | 41 | 14557 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorUNIX} and L{IReactorUNIXDatagram}.
"""
import stat, os, sys, types
import socket
from twisted.internet import interfaces, reactor, protocol, error, address, defer, utils
from twisted.python import lockf... | gpl-3.0 |
RPGOne/scikit-learn | sklearn/decomposition/tests/test_dict_learning.py | 46 | 9267 | import numpy as np
from sklearn.exceptions import ConvergenceWarning
from sklearn.utils import check_array
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from... | bsd-3-clause |
glemaitre/UnbalancedDataset | examples/over-sampling/plot_smote.py | 2 | 2231 | """
=====
SMOTE
=====
An illustration of the SMOTE method and its variant.
"""
# Authors: Fernando Nogueira
# Christos Aridas
# Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: MIT
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.decomposition imp... | mit |
nugget/home-assistant | tests/components/geo_location/test_geo_json_events.py | 4 | 10414 | """The tests for the geojson platform."""
from asynctest.mock import patch, MagicMock, call
from homeassistant.components import geo_location
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.geo_location.geo_json_events import \
SCAN_INTERVAL, ATTR_EXTERNAL_ID, SIGNAL_DEL... | apache-2.0 |
bewantbe/eogRichExif | eogRichExif.py | 1 | 12212 | '''
eogRichExif
A eog (Eye of GNOME Image Viewer) plugin which shows many Exif info in side pane.
Thanks to the eogMetaEdit plugin.
'''
'''
eogRichExif is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation... | gpl-3.0 |
spickartz/fast-lib | vendor/mosquitto-1.4.12/test/lib/08-ssl-connect-cert-auth.py | 10 | 2283 | #!/usr/bin/env python
# Test whether a client produces a correct connect and subsequent disconnect when using SSL.
# Client must provide a certificate.
# The client should connect to port 1888 with keepalive=60, clean session set,
# and client id 08-ssl-connect-crt-auth
# It should use the CA certificate ssl/test-roo... | lgpl-3.0 |
grahamsellers/Emerald | Emerald/gtest-1.6.0/test/gtest_break_on_failure_unittest.py | 1050 | 7214 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
tatsuy/ardupilot | Tools/autotest/param_metadata/rstemit.py | 31 | 9441 | #!/usr/bin/env python
from __future__ import print_function
import re
from param import known_param_fields, known_units
from emit import Emit
import cgi
# Emit docs in a RST format
class RSTEmit(Emit):
def blurb(self):
return """This is a complete list of the parameters which can be set (e.g. via the MAVL... | gpl-3.0 |
prakritish/ansible | lib/ansible/plugins/connection/lxd.py | 133 | 4283 | # (c) 2016 Matt Clay <matt@mystile.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 version.
#
... | gpl-3.0 |
jhrozek/samba-ldb-mdb | python/samba/ntacls.py | 12 | 10652 | # Unix SMB/CIFS implementation.
# Copyright (C) Matthieu Patou <mat@matws.net> 2009-2010
#
#
# 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... | gpl-3.0 |
jithinbp/vLabtool-v0 | v0/templates/template_sensors.py | 2 | 4020 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'sensors.ui'
#
# Created: Tue Aug 18 02:58:31 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attrib... | gpl-3.0 |
razz0/DataMining | apriori_sequential.py | 1 | 8210 | """Implementation of the Apriori algorithm for sequential patterns, F(k-1) x F(k-1) variant.
Model sequences like ((1, 2, 3), (4, 5), (4, 6)).
To get course sequences with empty elements as (0,):
course_seqs = [x.course_sequence for x in s.students]
course_seqs2 = [tuple([seq or (0,) for seq in x.course_sequence]) fo... | gpl-2.0 |
arsenetar/dupeguru | core/tests/ignore_test.py | 3 | 4355 | # Copyright 2016 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import io
from xml.etree import ElementTree... | gpl-3.0 |
openstack-hyper-v-python/numpy | numpy/core/tests/test_arrayprint.py | 69 | 6858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.testing import *
from numpy.compat import sixu
class TestArrayRepr(object):
def test_nan_inf(self):
x = np.array([np.nan, np.inf])
assert_equal(repr(x... | bsd-3-clause |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/test_json/test_decode.py | 1 | 4355 | import decimal
from io import StringIO
from collections import OrderedDict
from test.test_json import PyTest, CTest
class TestDecode:
def test_decimal(self):
rval = self.loads('1.1', parse_float=decimal.Decimal)
self.assertTrue(isinstance(rval, decimal.Decimal))
self.assertEqual(rval, deci... | apache-2.0 |
benoitsteiner/tensorflow | tensorflow/python/training/momentum.py | 15 | 4512 | # 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 |
kingmotley/SickRage | lib/jsonrpclib/SimpleJSONRPCServer.py | 72 | 8676 | import jsonrpclib
from jsonrpclib import Fault
from jsonrpclib.jsonrpc import USE_UNIX_SOCKETS
import SimpleXMLRPCServer
import SocketServer
import socket
import logging
import os
import types
import traceback
import sys
try:
import fcntl
except ImportError:
# For Windows
fcntl = None
def get_version(reque... | gpl-3.0 |
CMSS-BCRDB/RDSV1.0 | trove/guestagent/strategies/replication/mysql_base.py | 4 | 5877 | # Copyright 2014 Tesora, 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 ... | apache-2.0 |
Tao-Ma/gpdb | gpMgmt/bin/gppylib/db/catalog.py | 3 | 2559 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
""" Provides Access Utilities for Examining and Modifying the GP Catalog.
"""
import copy
import dbconn
from gppylib import gplog
logger=gplog.get_default_logger()
class CatalogError(Exception): pass
def basicSQLExec(conn,sql):
... | apache-2.0 |
aperigault/ansible | test/lib/ansible_test/_data/pytest/plugins/ansible_pytest_coverage.py | 4 | 1423 | """Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
def pytest_configure():
"""Configure this pytest plugin."""
try:
import coverage
e... | gpl-3.0 |
ckuethe/gnuradio | gr-utils/python/utils/pyqt_filter.py | 87 | 32755 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyqt_filter.ui'
#
# Created: Thu Mar 17 10:51:17 2011
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, Main... | gpl-3.0 |
kishori82/MetaPathways_Python.3.0 | utilities/compute_status.py | 1 | 18299 | #!/usr/bin/python
# File created on 27 Jan 2012.
from __future__ import division
__author__ = "Kishori M Konwar"
__copyright__ = "Copyright 2013, MetaPathways"
__credits__ = ["r"]
__version__ = "1.0"
__maintainer__ = "Kishori M Konwar"
__status__ = "Release"
try:
import sys, os, re, math, gzip
from glob imp... | mit |
andreas-h/pelican-plugins | liquid_tags/test_notebook.py | 311 | 3042 | import re
from pelican.tests.support import unittest
from . import notebook
class TestNotebookTagRegex(unittest.TestCase):
def get_argdict(self, markup):
match = notebook.FORMAT.search(markup)
if match:
argdict = match.groupdict()
src = argdict['src']
star... | agpl-3.0 |
jantuomi/py3status | py3status/modules/imap.py | 10 | 2598 | # -*- coding: utf-8 -*-
"""
Display the unread messages count from your IMAP account.
Configuration parameters:
- cache_timeout : how often to run this check
- criterion : status of emails to check for
- format : format to display
- hide_if_zero : don't show on bar if 0
- imap_server : IMAP server ... | bsd-3-clause |
twistedogic/packstack | packstack/installer/validators.py | 9 | 8023 | # -*- coding: utf-8 -*-
"""
Contains all core validation functions.
"""
import os
import re
import socket
import logging
import tempfile
import traceback
import basedefs
from . import utils
from .setup_controller import Controller
from .exceptions import ParamValidationError
__all__ = ('ParamValidationError', 'va... | apache-2.0 |
NMGRL/pychron | pychron/hardware/core/communicators/opc_communicator.py | 2 | 3560 | # ===============================================================================
# Copyright 2017 ross
#
# 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/LICE... | apache-2.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/django/test/testcases.py | 157 | 24882 | import re
import sys
from urlparse import urlsplit, urlunsplit
from xml.dom.minidom import parseString, Node
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.core.signals import request_started
from django.core.urlresolvers import clear_url_cache... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_fileinput.py | 81 | 34338 | '''
Tests for fileinput module.
Nick Mathewson
'''
import os
import sys
import re
import fileinput
import collections
import builtins
import unittest
try:
import bz2
except ImportError:
bz2 = None
try:
import gzip
except ImportError:
gzip = None
from io import BytesIO, StringIO
from fileinput import F... | gpl-2.0 |
alexrao/YouCompleteMe | third_party/ycmd/third_party/jedi/test/test_regression.py | 13 | 5379 | """
Unit tests to avoid errors of the past. These are also all tests that didn't
found a good place in any other testing module.
"""
import os
import sys
import textwrap
from .helpers import TestCase, cwd_at
import pytest
import jedi
from jedi._compatibility import u
from jedi import Script
from jedi import api
from... | gpl-3.0 |
DoubleNegativeVisualEffects/gaffer | startup/gui/nodeGraph.py | 5 | 2773 | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | bsd-3-clause |
rogerwang/chromium | third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_offsets.py | 46 | 3428 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# 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
# ... | bsd-3-clause |
toonst/RIOT | tests/bench_runtime_coreapis/tests/01-run.py | 14 | 1348 | #!/usr/bin/env python3
# Copyright (C) 2018 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
# The default timeout is not enough for... | lgpl-2.1 |
colejohnson66/pyew | envi/archs/arm/emu.py | 17 | 21205 |
"""
The initial arm module.
"""
import struct
import envi
from envi.archs.arm import ArmModule
from envi.archs.arm.regs import *
from envi.archs.arm.thumbdisasm import * #this gets both arm and thumb
# CPU state (memory, regs inc SPSRs and banked registers)
# CPU mode (User, FIQ, IRQ, supervisor, Abort, Undef... | gpl-2.0 |
vrenaville/ngo-addons-backport | addons/l10n_ch/__openerp__.py | 160 | 2936 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# Translation contributors: brain-te... | agpl-3.0 |
facetothefate/contrail-controller | src/opserver/test/test_analytics_stats.py | 4 | 15422 | #!/usr/bin/env python
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
#
# analytics_stattest.py
#
# System tests for analytics
#
import os
import sys
import threading
threading._DummyThread._Thread__stop = lambda x: 42
import signal
import gevent
from gevent import monkey
monkey.patch_all()
impo... | apache-2.0 |
bebby520/essay_devel | venv/lib/python2.7/site-packages/wheel/pep425tags.py | 220 | 2861 | """Generate and work with PEP 425 Compatibility Tags."""
import sys
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
def get_abbr_impl():
"""Return abbreviated implementation name."""
if hasattr(sys, 'pypy_ve... | apache-2.0 |
hep-gc/glint-horizon | openstack_dashboard/dashboards/project/access_and_security/tabs.py | 8 | 4569 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Versio... | apache-2.0 |
domibarton/ansible | lib/ansible/playbook/playbook_include.py | 17 | 5916 | # (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 |
YYKI/blog-webapp | www/apis.py | 1 | 2900 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'syuson'
'''
JSON API definition
'''
import json, logging, inspect, functools
class APIError(Exception):
"""
the base APIError which contains error(required), data(optional) and message(optional)
"""
def __init__(self, error, data='', mes... | gpl-3.0 |
ruschelp/cortex-vfx | python/IECoreMaya/FnProceduralHolder.py | 9 | 9910 | ##########################################################################
#
# Copyright (c) 2008-2010, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
faylau/oVirt3.3WebAPITest | src/TestData/Host/ITC03010304_CreateHost_NameVerify.py | 1 | 2575 | #encoding:utf-8
__authors__ = ['"Liu Fei" <fei.liu@cs2c.com.cn>']
__version__ = "V0.1"
'''
# ChangeLog:
#---------------------------------------------------------------------------------
# Version Date Desc Author
#------------------------------------------------------... | apache-2.0 |
luyifan/zulip | zerver/models.py | 113 | 49724 | from __future__ import absolute_import
from django.db import models
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, UserManager, \
PermissionsMixin
from django.dispatch import receiver
from zerver.lib.cache import cache_with_key, flush_user_profile, flush_realm, \
user... | apache-2.0 |
bblay/iris | lib/iris/tests/test_hybrid.py | 2 | 9222 | # (C) British Crown Copyright 2010 - 2013, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... | gpl-3.0 |
madan96/sympy | sympy/external/tests/test_autowrap.py | 20 | 6481 | import sympy
import tempfile
import os
from sympy import symbols, Eq
from sympy.external import import_module
from sympy.tensor import IndexedBase, Idx
from sympy.utilities.autowrap import autowrap, ufuncify, CodeWrapError
from sympy.utilities.pytest import skip
numpy = import_module('numpy', min_module_version='1.6.1... | bsd-3-clause |
Yunchao/hackingchicago | Server/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 1366 | 120842 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... | mit |
Socrate2803/plugin.video.netflixbmc | resources/lib/pyasn1/debug.py | 185 | 1541 | import sys
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Debug:
defaultPr... | gpl-2.0 |
openshift/openshift-tools | ansible/roles/lib_oa_openshift/src/test/unit/test_oc_adm_router.py | 15 | 18749 | #!/usr/bin/env python
'''
Unit tests for oc adm router
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylin... | apache-2.0 |
aniketroxx/civic-sa77 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
J861449197/edx-platform | common/djangoapps/student/tests/factories.py | 60 | 4205 | """Provides factories for student models."""
from student.models import (User, UserProfile, Registration,
CourseEnrollmentAllowed, CourseEnrollment,
PendingEmailChange, UserStanding,
CourseAccessRole)
from course_modes.models import Cou... | agpl-3.0 |
gx1997/chrome-loongson | tools/valgrind/test_suppressions.py | 11 | 4692 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from collections import defaultdict
import os
import re
import sys
import path_utils
import suppressions
def ReadReportsFromFil... | bsd-3-clause |
rabrahm/ceres | utils/FastRotators/spfr.py | 1 | 18831 | from pylab import *
import pyfits
from PyAstronomy import pyasl
import scipy
from scipy import interpolate
from scipy import ndimage
from scipy import signal
import pickle
from matplotlib.backends.backend_pdf import PdfPages
import os
#from pyevolve import G1DList
#from pyevolve import GSimpleGA
from multiprocessing i... | mit |
hallovveen31/HELLRAZOR | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
thedep2/CouchPotatoServer | libs/suds/xsd/deplist.py | 204 | 4052 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 in the hope that it will ... | gpl-3.0 |
nexcess/r1soft-admin-console | rac/forms.py | 1 | 3719 | # -*- coding: utf-8 -*-
# Nexcess.net r1soft-admin-console
# Copyright (C) 2015 Nexcess.net L.L.C.
#
# 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 y... | gpl-2.0 |
teampheenix/StarCraft-Casting-Tool | scctool/matchgrabber/alpha.py | 1 | 6950 | """Provide match grabber for AlphaTL."""
import logging
from datetime import datetime, timedelta, timezone
from urllib.request import urlopen, urlretrieve
import scctool.settings
import scctool.settings.translation
from scctool.matchgrabber.custom import MatchGrabber as MatchGrabberParent
# create logger
module_logge... | gpl-3.0 |
five-elephants/a_game | pygame_hello.py | 1 | 2613 | #!/usr/bin/env python
import pygame
from pygame.locals import *
import random
class Wandering_text:
def __init__(self, text, color, center, bbox):
self.font = pygame.font.Font(None, 36)
self.surface = self.font.render(text, 1, color)
self.pos = self.surface.get_rect(center=center)
... | gpl-3.0 |
muravjov/ansible | lib/ansible/runner/action_plugins/debug.py | 119 | 2142 | # Copyright 2012, Dag Wieers <dag@wieers.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 versi... | gpl-3.0 |
CitrineInformatics/refkit | lookup/arxiv.py | 1 | 4957 | """
Functions for working with the arXiv.org api.
"""
import urllib
import requests
from xml.etree import ElementTree
from refkit.util import arxivid
from refkit.metadata import Metadata
from refkit.format import author
def search(lookup):
"""
Search for a reference on arXiv.org given a lookup str... | mit |
mujiansu/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/bz2_codec.py | 501 | 2993 | """ Python 'bz2_codec' Codec - bz2 compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import ... | apache-2.0 |
lordB8r/polls | ENV/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/zip.py | 63 | 14638 | import sys
import re
import fnmatch
import os
import shutil
import zipfile
from pip.util import display_path, backup_dir, rmtree
from pip.log import logger
from pip.exceptions import InstallationError
from pip.basecommand import Command
class ZipCommand(Command):
"""Zip individual packages."""
name = 'zip'
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.