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 |
|---|---|---|---|---|---|
sursum/buckanjaren | buckanjaren/lib/python3.5/site-packages/wheel/egg2wheel.py | 471 | 2633 | #!/usr/bin/env python
import os.path
import re
import sys
import tempfile
import zipfile
import wheel.bdist_wheel
import shutil
import distutils.dist
from distutils.archive_util import make_archive
from argparse import ArgumentParser
from glob import iglob
egg_info_re = re.compile(r'''(?P<name>.+?)-(?P<ver>.+?)
(-... | mit |
fogcitymarathoner/djfb | facebook_example/django_facebook/model_managers.py | 2 | 4124 | from django.db.models.query_utils import Q
from django.core.cache import cache
from django.db import models
import operator
import random
from datetime import timedelta
from django_facebook.utils import compatible_datetime as datetime
from django.contrib.contenttypes.models import ContentType
import logging
fr... | bsd-3-clause |
EShamaev/ardupilot | Tools/LogAnalyzer/tests/TestParams.py | 32 | 3263 | from LogAnalyzer import Test, TestResult
import DataflashLog
from VehicleType import VehicleType
import math # for isnan()
class TestParams(Test):
'''test for any obviously bad parameters in the config'''
def __init__(self):
Test.__init__(self)
self.name = "Parameters"
# helper functio... | gpl-3.0 |
ict-felix/stack | ofreg/registration/views/password_reset.py | 4 | 1103 | from django.shortcuts import *
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.conf import settings
from ofreg.registration.models.password_reset import *
from ofreg import util
def forgotten(request):
if request.method == 'POST':
form = PasswordResetForm(request.POST)... | apache-2.0 |
wdzhou/mantid | Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py | 1 | 11567 | #pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
import os
import sys
import stresstesting
from mantid.simpleapi import *
from mantid.api import Workspace,IEventWorkspace
from Direct.PropertyManager import PropertyManager
import ISIS_MariReduction as mr
try:
from imp... | gpl-3.0 |
ameroyer/ReCA | Data/prepare_foodmart.py | 1 | 17403 | from __future__ import print_function
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Preprocess Foodmart data to extract the POMDP model.
"""
__author__ = "Amelie Royer"
__email__ = "amelie.royer@ist.ac.at"
import sys, os
import csv
import gzip
import argparse
import numpy as np
from collections import defaultdic... | gpl-3.0 |
rouge8/pip | src/pip/_vendor/requests/__init__.py | 17 | 4074 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP Library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> ... | mit |
duramato/SickRage | lib/requests/packages/chardet/langhungarianmodel.py | 2763 | 12536 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
darrenturn90/eloipool-merged-vtc | jsonrpc_setworkaux.py | 1 | 1138 | # Eloipool - Python Bitcoin pool server
# Copyright (C) 2011-2012 Luke Dashjr <luke-jr+eloipool@utopios.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | agpl-3.0 |
gauravbose/digital-menu | tests/queries/models.py | 44 | 16564 | """
Various complex queries that have been problematic in the past.
"""
from __future__ import unicode_literals
import threading
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class DumbCategory(models.Model):
pass
class ProxyCategory(Du... | bsd-3-clause |
liveck/OpenHIPS | test/spray-js.py | 4 | 2165 | ##########################################################################
#### Felipe Andres Manzano * felipa.andres.manzano@gmail.com ####
##########################################################################
## Add a heap spraying javascript to the document as OpenAction putting
## the js is in a ... | gpl-3.0 |
salmanwahed/micolog | app/gmemsess.py | 14 | 3217 | # gmemsess.py - memcache-backed session Class for Google Appengine
# Version 1.4
# Copyright 2008 Greg Fawcett <greg@vig.co.nz>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | mit |
DarioGT/docker-carra | src/protoExt/localisation/fr.py | 1 | 12034 | # -*- coding' : utf-8 -*-
__language ={
'languaje' : 'fr',
'Title_Main_Menu' : 'Menu principal',
'MenuTree_DD_Text' : 'Glisser pour réorganiser',
'Tooltip_New_Folder' : 'Nouvelle UDP',
'Tooltip_New_Option' : 'Nouvelle option',
'Tooltip_Edit_Node' : 'Modifier noeud',
'Tooltip... | mit |
gioman/QGIS | tests/src/python/test_qgsdelimitedtextprovider.py | 2 | 30210 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsDelimitedTextProvider.
.. note:: 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 versi... | gpl-2.0 |
haad/ansible | test/runner/shippable.py | 117 | 2708 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Verify the current Shippable run has the required number of jobs."""
from __future__ import absolute_import, print_function
# noinspection PyCompatibility
import argparse
import errno
import json
import os
import sys
from lib.http import (
HttpClient,
)
from lib.... | gpl-3.0 |
numpy/numpy-refactor | numpy/core/setup.py | 53 | 19785 | import imp
import os
import sys
import warnings
from os.path import dirname, exists, join, isdir
from distutils.dep_util import newer
from distutils.sysconfig import get_config_var
from numpy.distutils import log
from numpy.distutils.system_info import get_info
from setup_common import is_released
# XXX: ugly, we u... | bsd-3-clause |
MCDong/barbican | functionaltests/api/v1/functional/test_orders.py | 2 | 26158 | # Copyright (c) 2014 Rackspace, 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 wr... | apache-2.0 |
mattduan/proof | adapter/Adapter.py | 1 | 6801 | """
<code>Adapter</code> defines the interface for a Proof database
adapter. Support for new databases is added by subclassing
<code>Adapter</code> and implementing its abstract interface, and by
registering the new database adapter and its corresponding
driver in the service configuration.
<p>The Proof database adap... | bsd-3-clause |
privateip/ansible | lib/ansible/modules/storage/infinidat/infini_host.py | 34 | 4429 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@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... | gpl-3.0 |
andresriancho/PyGithub | github/RepositoryKey.py | 1 | 4027 | # -*- coding: utf-8 -*-
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub 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 Softwar... | gpl-3.0 |
perezg/infoxchange | BASE/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/models.py | 222 | 1934 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class GeometryColumns(models.Model):
"""
T... | apache-2.0 |
koorukuroo/networkx_for_unicode | build/lib/networkx/generators/random_clustered.py | 46 | 4093 | # -*- coding: utf-8 -*-
"""Generate graphs with given degree and triangle sequence.
"""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import random
import networkx as nx
__author_... | bsd-3-clause |
se4u/pylearn2 | pylearn2/scripts/datasets/browse_small_norb.py | 44 | 6901 | #!/usr/bin/env python
import sys
import argparse
import pickle
import warnings
import exceptions
import numpy
try:
from matplotlib import pyplot
except ImportError as import_error:
warnings.warn("Can't use this script without matplotlib.")
pyplot = None
from pylearn2.datasets import norb
warnings.warn("T... | bsd-3-clause |
whitepages/nova | nova/tests/unit/api/openstack/compute/dummy_schema.py | 94 | 1276 | # Copyright 2014 IBM
#
# 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 w... | apache-2.0 |
miipl-naveen/optibizz | addons/base_import_module/tests/test_module/__openerp__.py | 377 | 1290 | # -*- 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 |
sjlehtin/django | tests/gis_tests/gdal_tests/test_srs.py | 80 | 12842 | import unittest
from django.contrib.gis.gdal import (
CoordTransform, GDALException, SpatialReference, SRSException,
)
class TestSRS:
def __init__(self, wkt, **kwargs):
self.wkt = wkt
for key, value in kwargs.items():
setattr(self, key, value)
WGS84_proj = '+proj=longlat +ellps=... | bsd-3-clause |
chouseknecht/ansible | contrib/inventory/ovirt.py | 37 | 9839 | #!/usr/bin/env python
# Copyright 2015 IIX 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 ver... | gpl-3.0 |
kareemallen/beets | beets/importer.py | 2 | 53637 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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 t... | mit |
dmacd/FB-try1 | php-lithium/setup.py | 5 | 1893 | import subprocess
import sys
import os
import setup_util
from os.path import expanduser
home = expanduser("~")
def start(args, logfile, errfile):
setup_util.replace_text("php-lithium/app/config/bootstrap/connections.php", "192.168.100.102", ""+ args.database_host +"")
setup_util.replace_text("php-lithium/deploy/n... | bsd-3-clause |
JioCloud/nova | nova/tests/unit/scheduler/test_scheduler.py | 15 | 8022 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/pip/_vendor/lockfile/pidlockfile.py | 488 | 6221 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | agpl-3.0 |
BMJHayward/django | tests/get_earliest_or_latest/tests.py | 326 | 7008 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, IndexErrorArticle, Person
class EarliestOrLatestTests(TestCase):
"""Tests for the earliest() and latest() objects methods"""
def tearDown(self):
"""Makes sure Article... | bsd-3-clause |
scs/uclinux | user/python/python-2.4.4/Lib/test/test_strop.py | 31 | 5624 | import warnings
warnings.filterwarnings("ignore", "strop functions are obsolete;",
DeprecationWarning,
r'test.test_strop|unittest')
import strop
import unittest
from test import test_support
class StropFunctionTestCase(unittest.TestCase):
def test_atoi(self):
... | gpl-2.0 |
asimihsan/masspinger | deps/win32/apr/build/gen-build.py | 1 | 6900 | #!/usr/bin/env python
#
# USAGE: gen-build.py TYPE
#
# where TYPE is one of: make, dsp, vcproj
#
# It reads build.conf from the current directory, and produces its output
# into the current directory.
#
import os
import ConfigParser
import getopt
import string
import glob
import re
#import ezt
#... | mit |
openshs/openshs | app/blender/bgui/gl_utils.py | 8 | 1232 | # This file handles differences between BGL and PyOpenGL, and provides various
# utility functions for OpenGL
try:
from bgl import *
USING_BGL = True
except ImportError:
from OpenGL.GL import *
from OpenGL.GLU import *
from PyQt4 import QtOpenGL # Make sure we have PyQt4 available, otherwise PyOpenGL is too slow... | gpl-2.0 |
syl20bnr/nupic | nupic/regions/ImageSensorExplorers/RepetitiveSweep.py | 15 | 6522 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
makinacorpus/odoo | addons/account/__init__.py | 418 | 1423 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
shsingh/ansible | lib/ansible/plugins/action/network.py | 9 | 7329 | #
# (c) 2018 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 |
OmnesRes/onco_lnc | mirna/cox/LGG/cox_regression.py | 1 | 10226 | ## A script for finding every cox coefficient and pvalue for every miRNA in LGG Tier 3 data downloaded Jan. 6th, 2016
## Load necessary modules
from rpy2 import robjects as ro
import numpy as np
import os
ro.r('library(survival)')
import re
##This call will only work if you are running python from the command line.
... | mit |
nanolearningllc/edx-platform-cypress-2 | common/lib/capa/capa/tests/test_targeted_feedback.py | 196 | 25678 | """
Tests the logic of the "targeted-feedback" attribute for MultipleChoice questions,
i.e. those with the <multiplechoiceresponse> element
"""
import unittest
import textwrap
from . import test_capa_system, new_loncapa_problem, load_fixture
class CapaTargetedFeedbackTest(unittest.TestCase):
'''
Testing clas... | agpl-3.0 |
birdonwheels5/p2pool-dgbScrypt | nattraverso/ipdiscover.py | 288 | 4180 | """
Generic methods to retreive the IP address of the local machine.
TODO: Example
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
import random, socket, logging, itertools
from twisted.internet... | gpl-3.0 |
AOKP/external_gtest | test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 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... | bsd-3-clause |
peterfpeterson/mantid | dev-docs/source/conf.py | 3 | 6773 | # -*- mode: python -*-
# -*- coding: utf-8 -*-
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
from sphinx import __version__ as sphinx_version
import sphinx_bootstrap_theme
from distutils.version import LooseVersion
# -- General configuration --------... | gpl-3.0 |
geggo/pyface | pyface/xrc_dialog.py | 5 | 3908 | #-----------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# Author: Scott Swarts <swarts@enthought.com>
#
#-----------------------------------------------------------------------------
"""A dialog that is loaded from an XRC resour... | bsd-3-clause |
invisiblek/python-for-android | python-modules/pybluez/bluetooth/bluez.py | 67 | 20745 | import sys
import struct
import binascii
from btcommon import *
import _bluetooth as _bt
import array
import fcntl
_constants = [ 'HCI', 'RFCOMM', 'L2CAP', 'SCO', 'SOL_L2CAP', 'SOL_RFCOMM',\
'L2CAP_OPTIONS' ]
for _c in _constants: exec "%s = _bt.%s" % (_c, _c)
del _constants
# ============== SDP service registrat... | apache-2.0 |
afroisalreadyinu/stashpy | stashpy/tests/load/load_test.py | 1 | 3429 | """In order to run the load tests, start stashpy and ElasticSearch
locally and run this file"""
import os
from time import sleep
import random
import socket
from urllib.request import urlopen, Request
from urllib.error import HTTPError
from urllib.parse import urlencode
from datetime import datetime
from matplotlib imp... | gpl-3.0 |
mlperf/training_results_v0.6 | Google/benchmarks/transformer/implementations/tpu-v3-32-transformer/transformer/utils/flags.py | 6 | 4047 | """Common command-line flags."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
flags = tf.flags
FLAGS = flags.FLAGS
flags.DEFINE_bool("registry_help", False,
"If True, logs the contents of the registry and exits... | apache-2.0 |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/skia/gm/display_json_results.py | 136 | 3693 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility to display a summary of JSON-format GM results, and exit with
a nonzero errorcode if there were non-ignored failures in ... | bsd-3-clause |
hj3938/zulip | zerver/management/commands/import_dump.py | 114 | 6662 | from __future__ import absolute_import
from optparse import make_option
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db import connection
from django.conf import settings
from zerver.lib.actions import do_create_stream
from zerver.models import Realm... | apache-2.0 |
openqt/algorithms | leetcode/python/lc887-super-egg-drop.py | 1 | 1693 | # coding=utf-8
import unittest
"""887. Super Egg Drop
https://leetcode.com/problems/super-egg-drop/description/
You are given `K` eggs, and you have access to a building with `N` floors from
`1` to `N`.
Each egg is identical in function, and if an egg breaks, you cannot drop it
again.
You know that there exists a f... | gpl-3.0 |
dpassante/ansible | lib/ansible/cli/scripts/ansible_connection_cli_stub.py | 18 | 12922 | #!/usr/bin/env python
# Copyright: (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
__requires__ = ['ansible_base']
import fcntl
import hashlib
import os
impor... | gpl-3.0 |
julkiewicz/arcanist | scripts/breakout.py | 16 | 6517 | #!/usr/bin/env python
import sys
import time
import select
import curses
import curses.wrapper
entities = []
grid = []
class Wall:
def collide(self, ball):
return False
class Block:
killed = 0
total = 0
def __init__(self, x, y, w, h, c):
self.x = x
self.y = y
self.w =... | apache-2.0 |
oudalab/fajita | pythonAPI/flask/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 365 | 4744 | from __future__ import absolute_import
import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is... | mit |
mheap/ansible | lib/ansible/modules/network/netscaler/netscaler_cs_policy.py | 124 | 9505 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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 |
devoid/nova | nova/tests/api/openstack/compute/plugins/v3/test_extended_status.py | 16 | 4602 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
qiulimao/weblocust | tests/test_utils.py | 10 | 2413 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2015-01-18 16:53:49
import sys
import time
import unittest2 as unittest
from pyspider.libs import utils
class TestFetcher(unittest.TestCase):
def t... | apache-2.0 |
twoerner/bitbake | lib/bb/COW.py | 16 | 8148 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# This is a copy on write dictionary and set which abuses classes to try and be nice and fast.
#
# Copyright (C) 2006 Tim Amsell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... | gpl-2.0 |
hvy/chainer | chainer/functions/connection/deconvolution_2d.py | 3 | 18093 | import numpy
import chainer
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import configuration
from chainer import function_node
import chainer.functions
from chainer.functions.connection import convolution_2d
from chainer import memory_layouts
from chainer.utils import argument
f... | mit |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/hplip/base/slp.py | 1 | 5638 | # -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2007 Hewlett-Packard Development Company, L.P.
#
# 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 opt... | gpl-3.0 |
luzfcb/pip | pip/compat/__init__.py | 248 | 3402 | """Stuff that differs in different Python versions and platform
distributions."""
from __future__ import absolute_import, division
import os
import sys
from pip._vendor.six import text_type
try:
from logging.config import dictConfig as logging_dictConfig
except ImportError:
from pip.compat.dictconfig import ... | mit |
40223219/2015cd_midterm2- | static/Brython3.1.1-20150328-091302/Lib/operator.py | 674 | 7736 | #!/usr/bin/env python3
"""
Operator Interface
This module exports a set of functions corresponding to the intrinsic
operators of Python. For example, operator.add(x, y) is equivalent
to the expression x+y. The function names are those used for special
methods; variants without leading and trailing '__' are also p... | agpl-3.0 |
mutirri/bokeh | tests/glyphs/Patches.py | 43 | 1055 | import numpy as np
from bokeh.document import Document
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid
from bokeh.models.glyphs import Patches
from bokeh.plotting import show
N = 9
x = np.linspace(-2, 2, N)
y = x**2
xpts = np.array([-.09, -.12, .0, .12, .09])
ypts = np.array([-.1, .... | bsd-3-clause |
dhxkgozj/DirEngine | DirEngine/Header/Archinfo/ArchX64.py | 1 | 2548 | # -*- coding: utf-8 -*-
try:
import capstone as _capstone
except ImportError:
_capstone = None
from ...error import Error
from ._arch import _arch
class ArchX64(_arch):
_backend = None
bits = 64
name = "X64"
memory_endess = None
sizeof = {'int' : 32, 'long' : 64, 'long long' : 64}
... | bsd-3-clause |
rmackay9/ardupilot-balloon-finder | scripts/balloon_config.py | 2 | 5022 | """
BalloonConfig class : handles config for the balloon_finder project
balloon_finder.cnf file is created in the local directory
other classes or files wishing to use this class should add
import balloon_config
"""
from os.path import expanduser
import ConfigParser
class BalloonConfig(object):
def __init... | gpl-3.0 |
alintuhut/alfred-password-manager | src/workflow/web.py | 12 | 18973 | # encoding: utf-8
#
# Copyright (c) 2014 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2014-02-15
#
"""
A lightweight HTTP library with a requests-like interface.
"""
from __future__ import print_function
import codecs
import json
import mimetypes
import ... | mit |
pvtodorov/indra | indra/tests/test_assemble_corpus.py | 1 | 24582 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import pickle
from indra.tools import assemble_corpus as ac
from indra.statements import *
from copy import deepcopy
a = Agent('a', db_refs={'HGNC': '1234', 'TEXT': 'a'})
b = Agent('b', db_refs={'UP': 'P15056', 'TEX... | bsd-2-clause |
mikewiebe-ansible/ansible | lib/ansible/modules/cloud/amazon/aws_direct_connect_link_aggregation_group.py | 10 | 18383 | #!/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)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['pre... | gpl-3.0 |
SickGear/SickGear | lib/subliminal/exceptions.py | 170 | 1050 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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... | gpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/haystack/templatetags/more_like_this.py | 13 | 3255 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django import template
from haystack.utils.app_loading import haystack_get_model
from haystack.query import SearchQuerySet
register = template.Library()
class MoreLikeThisNode(template.Node):
def __init__... | bsd-3-clause |
analurandis/Tur | backend/venv/Lib/site-packages/unidecode/x004.py | 249 | 4071 | data = (
'Ie', # 0x00
'Io', # 0x01
'Dj', # 0x02
'Gj', # 0x03
'Ie', # 0x04
'Dz', # 0x05
'I', # 0x06
'Yi', # 0x07
'J', # 0x08
'Lj', # 0x09
'Nj', # 0x0a
'Tsh', # 0x0b
'Kj', # 0x0c
'I', # 0x0d
'U', # 0x0e
'Dzh', # 0x0f
'A', # 0x10
'B', # 0x11
'V', # 0x12
'G', # 0x... | mit |
jamesliu/mxnet | example/multivariate_time_series/src/metrics.py | 17 | 2108 | # !/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
# "... | apache-2.0 |
mderomph-coolblue/dd-agent | tests/core/test_bucket_aggregator.py | 10 | 42149 | # -*- coding: utf-8 -*-
# stdlib
import random
import time
import unittest
# 3p
from nose.plugins.attrib import attr
import nose.tools as nt
# project
from aggregator import DEFAULT_HISTOGRAM_AGGREGATES
from dogstatsd import MetricsBucketAggregator
@attr(requires='core_integration')
class TestUnitMetricsBucketAggre... | bsd-3-clause |
nck0405/ChennaiEden | modules/templates/RMSAmericas/menus.py | 1 | 28929 | # -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
red_cross_filter = {"organisation_type.name" : "Red Cross / Red Crescent"}
# ==============================================================... | mit |
hustodemon/spacewalk | client/rhel/rhn-client-tools/test/testClientCaps.py | 30 | 3776 | #!/usr/bin/python
import os
import settestpath
import unittest
from up2date_client import clientCaps
from up2date_client import up2dateAuth
test_clientCaps_d = "etc-sysconfig-rhn/clientCaps.d"
class TestClientCaps(unittest.TestCase):
def setUp(self):
self.__setupData()
def __setupData(self):
... | gpl-2.0 |
quanvm009/codev7 | openerp/addons/account/res_config.py | 37 | 22423 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
soldag/home-assistant | tests/components/axis/test_device.py | 5 | 14005 | """Test Axis device."""
from copy import deepcopy
from unittest import mock
import axis as axislib
from axis.api_discovery import URL as API_DISCOVERY_URL
from axis.applications import URL_LIST as APPLICATIONS_URL
from axis.applications.vmd4 import URL as VMD4_URL
from axis.basic_device_info import URL as BASIC_DEVICE... | apache-2.0 |
chrys87/orca-beep | test/keystrokes/gtk-demo/role_column_header.py | 1 | 5264 | #!/usr/bin/python
"""Test of column header output."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("End"))
sequence.append(KeyComboAction("Up"))
sequence.append(KeyComboAction("<Shift>Right"))
sequence.append(KeyComboAction("Down"))
sequence.append(KeyComboA... | lgpl-2.1 |
iansf/sky_engine | third_party/jinja2/exceptions.py | 977 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... | bsd-3-clause |
QuLogic/cartopy | lib/cartopy/mpl/contour.py | 2 | 3963 | # Copyright Cartopy Contributors
#
# This file is part of Cartopy and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
from matplotlib.contour import QuadContourSet
import matplotlib.path as mpath
import numpy as np
class GeoContourSet(... | lgpl-3.0 |
inspirehep/invenio | modules/bibsort/lib/bibsort_daemon.py | 18 | 15982 | ## -*- mode: python; coding: utf-8; -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2012 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
## Li... | gpl-2.0 |
windyuuy/opera | chromium/src/third_party/scons-2.0.1/engine/SCons/Script/Main.py | 61 | 48844 | """SCons.Script
This file implements the main() function used by the scons script.
Architecturally, this *is* the scons script, and will likely only be
called from the external "scons" wrapper. Consequently, anything here
should not be, or be considered, part of the build engine. If it's
something that we expect ot... | bsd-3-clause |
IPRPraha/opendata-publisher | py_tools/UpdateVrstva.py | 1 | 10277 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 22 10:01:23 2015
@author: soukup
Upravil:
07.04.2015 f:D
- uprava url pro metadatove sluzby na http://app.iprpraha.cz/geoportal
- uprava volani systemovych cest na r''
- "\\" nahrazeno os.sep
"""
import requests
from xml.etree import ElementTr... | apache-2.0 |
nikolas/raven-python | raven/utils/serializer/manager.py | 21 | 2642 | """
raven.utils.serializer.manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from contextlib import closing
from raven.utils import six
__all__ = ('r... | bsd-3-clause |
ader1990/cloudbase-init | cloudbaseinit/utils/windows/vds.py | 4 | 11577 | # Copyright (c) 2013 Cloudbase Solutions Srl
#
# 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 applicab... | apache-2.0 |
Changaco/oh-mainline | vendor/packages/python-social-auth/social/tests/backends/test_yammer.py | 92 | 4006 | import json
from social.tests.backends.oauth import OAuth2Test
class YammerOAuth2Test(OAuth2Test):
backend_path = 'social.backends.yammer.YammerOAuth2'
expected_username = 'foobar'
access_token_body = json.dumps({
'access_token': {
'user_id': 1010101010,
'view_groups': Tru... | agpl-3.0 |
zhenzhai/edx-platform | lms/djangoapps/mailing/management/commands/mailchimp_sync_announcements.py | 155 | 2534 | """
Synchronizes the announcement list with all active students.
"""
import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from .mailchimp_sync_course import (
connect_mailchimp, get_cleaned,
get_subscribe... | agpl-3.0 |
fuziontech/sentry | src/sentry/api/endpoints/shared_group_details.py | 12 | 1289 | from __future__ import absolute_import, print_function
from rest_framework.response import Response
from sentry.api.base import Endpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import (
serialize, SharedEventSerializer, SharedGroupSerializer
)
from sentry.models import G... | bsd-3-clause |
scottferg/web-console | django/contrib/gis/geos/base.py | 13 | 1750 | from ctypes import c_void_p
from types import NoneType
from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
# Trying to import GDAL libraries, if available. Have to place in
# try/except since this package may be used outside GeoDjango.
try:
from django.contrib.gis import gdal
except Im... | bsd-3-clause |
darmaa/odoo | addons/document/document.py | 35 | 83889 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
nmiranda/dedupe | dedupe/crossvalidation.py | 3 | 4280 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
from builtins import range
import numpy
import logging
import warnings
import dedupe.core
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def gridSearch(training_data,
learner,
origi... | mit |
shahar-stratoscale/nova | nova/network/security_group/openstack_driver.py | 28 | 1617 | # Copyright 2013 Nicira, 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 a... | apache-2.0 |
NCI-Cloud/horizon | openstack_dashboard/dashboards/project/data_processing/nodegroup_templates/tests.py | 18 | 8343 | # 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
# distributed under t... | apache-2.0 |
flochaz/horizon | openstack_dashboard/dashboards/project/data_processing/clusters/workflows/create.py | 8 | 8311 | # 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
# distributed under the... | apache-2.0 |
Ballz0fSteel/Umeko | lib/pip/_vendor/requests/packages/urllib3/connection.py | 511 | 11617 | from __future__ import absolute_import
import datetime
import logging
import os
import sys
import socket
from socket import error as SocketError, timeout as SocketTimeout
import warnings
from .packages import six
try: # Python 3
from http.client import HTTPConnection as _HTTPConnection
from http.client import... | gpl-3.0 |
lituan/tools | pisa/pisa_xml.py | 1 | 8205 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
parse pisa interface xml file
"""
import os
import sys
from bs4 import BeautifulSoup
from collections import OrderedDict
from collections import Counter
import cPickle as pickle
from multiprocessing import Pool
def parse_interface(pisa_f):
soup = BeautifulSoup(ope... | cc0-1.0 |
landryb/QGIS | python/plugins/processing/algs/taudem/dinftranslimaccum.py | 12 | 4907 | # -*- coding: utf-8 -*-
"""
***************************************************************************
dinftranslimaccum.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*******... | gpl-2.0 |
rbarlow/pulp | devel/pulp/devel/doc_check.py | 17 | 4598 | from itertools import chain
import ast, _ast
import os
import sys
ERR_NO_PARAM_TEMPLATE = "Function %s is missing sphinx param definition for argument %s (%s:%i)"
ERR_NO_TYPE_TEMPLATE = "Function %s is missing sphinx type definition for argument %s (%s:%i)"
ERR_NO_RTYPE_TEMPLATE = "Function %s is missing sphinx type ... | gpl-2.0 |
dymkowsk/mantid | Testing/SystemTests/tests/analysis/ValidateParameterFiles.py | 2 | 2322 | #pylint: disable=no-init,invalid-name
from __future__ import (absolute_import, division, print_function)
from mantid import config
import os
import stresstesting
import glob
EXPECTED_EXT = '.expected'
class ValidateParameterFiles(stresstesting.MantidStressTest):
xsdFile=''
def skipTests(self):
try:... | gpl-3.0 |
pelmers/dxr | dxr/plugins/xpidl/__init__.py | 3 | 1714 | """XPIDL plugin: analyze XPIDL files using the mozilla-central xpidl parser.
This plugin analyzes XPIDL files by attempting to parse all files ending in '.idl' using the
xpidl parser. Then it delicately walks the productions in the AST to pull out relevant
information, such as interface and member declarations, and sh... | mit |
koniiiik/django | django/contrib/auth/management/commands/changepassword.py | 65 | 2685 | from __future__ import unicode_literals
import getpass
from django.contrib.auth import get_user_model
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.