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
caphrim007/ansible
lib/ansible/modules/cloud/azure/azure_rm_autoscale.py
7
26866
#!/usr/bin/python # # Copyright (c) 2017 Yuwei Zhou, <yuwzho@microsoft.com> # # 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
raj454raj/eden
modules/webkit_url2png.py
53
2510
#!/usr/bin/env python import sys import signal from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import QWebPage def save_webpage_screenshot(url, width, height, file_name = None): """Saves a screenshot of the webpage given in url into filename+".png" width and height, if given, ar...
mit
dfdeshom/solrcloudpy
solrcloudpy/collection/stats.py
1
1889
""" Get different statistics about the underlying index in a collection """ from future.utils import iteritems from solrcloudpy.utils import _Request, SolrResult class SolrIndexStats(object): """ Get different statistics about the underlying index in a collection """ def __init__(self, connection, nam...
bsd-3-clause
asgardproject/asgard-blog
blog/forms.py
2
2259
from django import forms from django.utils.translation import ugettext_lazy as _ # Stop Words courtesy of: # http://www.dcs.gla.ac.uk/idom/ir_resources/linguistic_utils/stop_words STOP_WORDS = r"""\b(a|about|above|across|after|afterwards|again| against|all|almost|alone|along|already|also|although|always|am| among|am...
bsd-3-clause
vvuk/servo
tests/wpt/web-platform-tests/2dcontext/tools/gentestutils.py
11
33741
# Copyright (c) 2010 Philip Taylor # Released under the BSD license and W3C Test Suite License: see LICENSE.txt # Current code status: # # This was originally written for use at # http://philip.html5.org/tests/canvas/suite/tests/ # # It has been adapted for use with the Web Platform Test Suite suite at # https://githu...
mpl-2.0
Pexego/alimentacion
product_format/__openerp__.py
2
1402
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved # $Marta Vázquez Rodríguez$ <marta@pexego.es> # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
AICP/external_chromium_org
build/mac/tweak_info_plist.py
42
10163
#!/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. # # Xcode supports build variable substitutions and CPP; sadly, that doesn't work # because: # # 1. Xcode wants to do the Info.pli...
bsd-3-clause
akesandgren/easybuild-easyblocks
easybuild/easyblocks/n/nwchem.py
3
26070
## # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
jgcaaprom/android_external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/ios_browser_backend.py
28
4773
# Copyright 2014 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 contextlib import json import logging import re import urllib2 from telemetry.core import util from telemetry.core.backends.chrome import chrome_brow...
bsd-3-clause
kidig/rrtop100
setup.py
1
1563
""" RadioRecord Top Hits Downloader """ from setuptools import find_packages, setup dependencies = ['click==6.6', 'aiohttp==0.22.5', 'lxml==3.6.1'] setup( name='rrtop100', version='0.1.0', url='https://github.com/kidig/rrtop100', license='BSD', author='Dmitrii Gerasimenko', author_email='kiddi...
apache-2.0
morenopc/edx-platform
common/lib/capa/capa/tests/test_correctmap.py
61
5833
""" Tests to verify that CorrectMap behaves correctly """ import unittest from capa.correctmap import CorrectMap import datetime class CorrectMapTest(unittest.TestCase): """ Tests to verify that CorrectMap behaves correctly """ def setUp(self): self.cmap = CorrectMap() def test_set_inpu...
agpl-3.0
Subito/ansible-modules-extras
system/pam_limits.py
57
7494
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Sebastien Rohaut <sebastien.rohaut@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 ...
gpl-3.0
racker/kafka
tests/kafkatest/services/monitor/jmx.py
14
4472
# 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 use ...
apache-2.0
deathsec/instagram-py
InstagramPy/InstagramPySession.py
1
10708
# The MIT License. # Copyright (C) 2017 The Future Shell , DeathSec. # # @filename : InstagramPySession.py # @description : creates a new session , checks for configuration and gets critical data # , loads save and saves data too. import json import os import uuid import hashlib import requests from s...
mit
nguyentu1602/statsmodels
statsmodels/stats/inter_rater.py
34
17035
# -*- coding: utf-8 -*- """Inter Rater Agreement contains -------- fleiss_kappa cohens_kappa aggregate_raters: helper function to get data into fleiss_kappa format to_table: helper function to create contingency table, can be used for cohens_kappa Created on Thu Dec 06 22:57:56 2012 Author: Josef Perktold Li...
bsd-3-clause
dfalt974/SickRage
lib/pgi/clib/gir/giregisteredtypeinfo.py
20
1096
# Copyright 2012 Christoph Reiter # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. from ..glib import gchar_p...
gpl-3.0
cisco-open-source/selenium
py/selenium/webdriver/common/desired_capabilities.py
35
3196
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requ...
apache-2.0
dobermanapp/django-doberman
setup.py
2
1557
#!/usr/bin/env python from setuptools import setup, find_packages requirements = ['Django>=1.7.0', ] try: from unittest import mock except ImportError: requirements.append('mock') setup( name="django-doberman", version="0.5.9", author="Nicolas Mendoza", author_email="niccolasmendoza@gmail.com...
mit
neumerance/deploy
.venv/lib/python2.7/site-packages/docutils/parsers/rst/languages/gl.py
130
3711
# -*- coding: utf-8 -*- # Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 4229 $ # Date: $Date: 2005-12-23 00:46:16 +0100 (Fri, 23 Dec 2005) $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, pleas...
apache-2.0
yanheven/glance
glance/tests/unit/test_context.py
18
6208
# Copyright 2010-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...
apache-2.0
cainmatt/django
django/db/models/fields/related.py
5
118182
from __future__ import unicode_literals import warnings from functools import partial from operator import attrgetter from django import forms from django.apps import apps from django.core import checks, exceptions from django.core.exceptions import FieldDoesNotExist from django.db import connection, connections, rou...
bsd-3-clause
Nebelhom/WordPuzzleCreator
lib/werkzeug/debug/console.py
314
5557
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
apache-2.0
suncycheng/intellij-community
python/testData/inspections/PyPropertyDefinitionInspection26/test.py
22
6220
import abc class A(object): def __init__(self): self._x = 1 @property def foo(self): return self._x @foo.setter def foo(self, x): self._x = x @foo.deleter def foo(self): pass @property def boo(self): return self._x <warning descr="Names of function and decorator don't matc...
apache-2.0
forrestv/bitcoin
contrib/testgen/gen_base58_test_vectors.py
1000
4343
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
mit
Bismarrck/tensorflow
tensorflow/python/debug/cli/evaluator_test.py
89
11162
# 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
giacomov/astromodels
astromodels/core/parameter_transformation.py
2
1122
import numpy as np class ParameterTransformation(object): def forward(self, external_value): raise NotImplementedError("You have to implement this") def backward(self, internal_value): raise NotImplementedError("You have to implement this") class LogarithmicTransformation(ParameterTransf...
bsd-3-clause
avadacatavra/servo
tests/wpt/web-platform-tests/tools/manifest/vcs.py
11
3257
import os import subprocess from .sourcefile import SourceFile class Git(object): def __init__(self, repo_root, url_base): self.root = os.path.abspath(repo_root) self.git = Git.get_func(repo_root) self.url_base = url_base @staticmethod def get_func(repo_path): def git(cmd...
mpl-2.0
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/numpy/distutils/fcompiler/absoft.py
89
5525
# http://www.absoft.com/literature/osxuserguide.pdf # http://www.absoft.com/documentation.html # Notes: # - when using -g77 then use -DUNDERSCORE_G77 to compile f2py # generated extension modules (works for f2py v2.45.241_1936 and up) import os from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompile...
mit
sugartom/tensorflow-alien
tensorflow/examples/learn/text_classification.py
39
5106
# 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 appl...
apache-2.0
Belxjander/Kirito
Python-3.5.0-main/Lib/distutils/tests/test_config.py
90
3148
"""Tests for distutils.pypirc.pypirc.""" import sys import os import unittest import tempfile from distutils.core import PyPIRCCommand from distutils.core import Distribution from distutils.log import set_threshold from distutils.log import WARN from distutils.tests import support from test.support import run_unittes...
gpl-3.0
biicode/bii-server
test/model/social_account_test.py
2
2004
import unittest from biicode.server.model.social_account import SocialAccount, SocialAccountToken from biicode.server.model.epoch.utc_datetime import UtcDatetime import datetime class SocialAccountTest(unittest.TestCase): def setUp(self): self.utc_datetime = UtcDatetime.deserialize(datetime.datetime.now()...
mit
PythonicNinja/django-ddp
dddp/management/commands/dddp.py
1
5318
"""Django DDP WebSocket service.""" from __future__ import print_function, absolute_import import collections import inspect import optparse import random import signal import socket from django.core.management.base import BaseCommand from django.db import connection, close_old_connections from django.utils.module_l...
mit
mrkm4ntr/incubator-airflow
airflow/migrations/versions/03bc53e68815_add_sm_dag_index.py
8
1274
# 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 u...
apache-2.0
Bjay1435/capstone
rootfs/usr/lib/python3.4/email/_parseaddr.py
125
17199
# Copyright (C) 2002-2007 Python Software Foundation # Contact: email-sig@python.org """Email address parsing code. Lifted directly from rfc822.py. This should eventually be rewritten. """ __all__ = [ 'mktime_tz', 'parsedate', 'parsedate_tz', 'quote', ] import time, calendar SPACE = ' ' EMPTYS...
mit
glatard/nipype
nipype/interfaces/mne/tests/test_auto_WatershedBEM.py
9
1571
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.mne.base import WatershedBEM def test_WatershedBEM_inputs(): input_map = dict(args=dict(argstr='%s', ), atlas_mode=dict(argstr='--atlas', ), environ=dict(nohash=True, usedefault=...
bsd-3-clause
stuarteberg/numpy
numpy/lib/tests/test_stride_tricks.py
40
14732
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import ( run_module_suite, assert_equal, assert_array_equal, assert_raises, assert_ ) from numpy.lib.stride_tricks import ( as_strided, broadcast_arrays, _broadcast_shape, broadcast_to ) def assert_s...
bsd-3-clause
oseledets/pybtex
pybtex/database/input/bibtexml.py
1
2801
# Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to ...
mit
zzzeek/test
mako/ext/beaker_cache.py
2
1947
"""Provide a :class:`.CacheImpl` for the Beaker caching system.""" from mako import exceptions from mako.cache import CacheImpl _beaker_cache = None class BeakerCacheImpl(CacheImpl): """A :class:`.CacheImpl` provided for the Beaker caching system. This plugin is used by default, based on the default ...
mit
espadrine/opera
chromium/src/third_party/libvpx/source/libvpx/third_party/googletest/src/xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
xombiemp/CouchPotatoServer
libs/requests/sessions.py
43
24273
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
gpl-3.0
MSOpenTech/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_contentstore.py
87
8284
""" Test contentstore.mongo functionality """ import logging from uuid import uuid4 import unittest import mimetypes from tempfile import mkdtemp import path import shutil from opaque_keys.edx.locator import CourseLocator, AssetLocator from opaque_keys.edx.keys import AssetKey from xmodule.tests import DATA_DIR from ...
agpl-3.0
ai-ku/langvis
jython-2.1/Lib/gzip.py
4
12370
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time import zlib import __builtin__ __all__ = ["GzipFile","o...
mit
lambder/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Options/BoolOption.py
61
2003
# # 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 deal in the Software without restriction, including # without li...
apache-2.0
CyanogenMod/android_external_chromium_org
tools/android/adb_profile_chrome/profiler.py
9
2949
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from adb_profile_chrome import trace_packager from adb_profile_chrome import ui from pylib import constants def _StartTracing(controllers, inte...
bsd-3-clause
Zord13appdesa/python-for-android
python-modules/twisted/twisted/test/test_socks.py
59
17748
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.protocol.socks}, an implementation of the SOCKSv4 and SOCKSv4a protocols. """ import struct, socket from twisted.trial import unittest from twisted.test import proto_helpers from twisted.internet import defer, a...
apache-2.0
abawchen/leetcode
solutions/147_insertion_sort_list.py
1
26591
# Sort a linked list using insertion sort. # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: # @param {ListNode} head # @return {ListNode} def insertionSortList(self, head): if not head: return...
mit
sushramesh/lwc
lib/python2.7/site-packages/pip/utils/outdated.py
191
5555
from __future__ import absolute_import import datetime import json import logging import os.path import sys from pip._vendor import lockfile from pip._vendor.packaging import version as packaging_version from pip.compat import total_seconds, WINDOWS from pip.index import PyPI from pip.locations import USER_CACHE_DIR...
mit
certik/python-theora
examples/chop.py
1
1424
#! /usr/bin/env python """ Analog to the oggz-chop program. Example: examples/chop.py -o s.ogv -s 20 -e 30 video.ogv See "./chop.py -h" for help. """ from optparse import OptionParser from theora import Theora, TheoraEncoder def convert(infile, outfile, start, end): print "converting %s to %s, between the tim...
bsd-3-clause
tiagoarasilva/django-boilerplate
project_name/lib/audit/middleware.py
1
3075
# Copyright (c) 2009 James Aylett <http://tartarus.org/james/computers/django/> # # 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 ri...
mit
jpush/jbox
Server/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1776
6840
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
xindus40223115/w16b_test
static/Brython3.1.0-20150301-090019/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
akosel/incubator-airflow
airflow/www_rbac/decorators.py
9
4418
# -*- coding: utf-8 -*- # # 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
kuangrewawa/OnosFw
tools/test/topos/obelisk.py
38
2612
#!/usr/bin/env python from mininet.topo import Topo class ObeliskTopo( Topo ): def __init__( self ): Topo.__init__( self ) topSwitch = self.addSwitch('s1',dpid='1000'.zfill(16)) leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16)) rightTopSwitch = self.addSwitch('s5',dpid='50...
apache-2.0
CeltonMcGrath/TACTIC
src/pyasm/biz/preference.py
6
3572
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
AnuchitPrasertsang/robotframework-selenium2library
src/Selenium2Library/locators/tableelementfinder.py
31
3986
from selenium.common.exceptions import NoSuchElementException from Selenium2Library import utils from elementfinder import ElementFinder class TableElementFinder(object): def __init__(self, element_finder=None): if not element_finder: element_finder = ElementFinder() self._element_find...
apache-2.0
Ldpe2G/mxnet
python/mxnet/rtc.py
15
4121
"""Interface to runtime cuda kernel compile module.""" from __future__ import absolute_import import ctypes from .base import _LIB, NDArrayHandle, RtcHandle, mx_uint, c_array, check_call class Rtc(object): """MXRtc object in mxnet. This class allow you to write CUDA kernels in Python and call them with ND...
apache-2.0
idem2lyon/persomov
libs/cache/__init__.py
99
8343
""" copied from werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from cache.posixemulation import rename from itertools import izip from time import time import os import re import...
gpl-3.0
tkjone/guides-django
series_2/p_03/myproject/server/config/settings/base.py
4
8713
# -*- coding: utf-8 -*- """ Django settings for myproject project. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ from __future__ import absolute_import, unicode_...
mit
gangadhar-kadam/smrterp
erpnext/buying/doctype/purchase_order/purchase_order.py
3
9024
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt from frappe import msgprint, _, throw from frappe.model.mapper import get_mapped_doc from erpnext.co...
agpl-3.0
ericmckean/syzygy
syzygy/build/generate_coverage.py
4
15218
#!python # Copyright 2012 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...
apache-2.0
rushiagr/keystone
keystone/tests/unit/test_contrib_s3_core.py
10
2130
# Copyright 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 agreed to in...
apache-2.0
molobrakos/home-assistant
homeassistant/components/nest/binary_sensor.py
7
5052
"""Support for Nest Thermostat binary sensors.""" from itertools import chain import logging from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.const import CONF_MONITORED_CONDITIONS from . import ( CONF_BINARY_SENSORS, DATA_NEST, DATA_NEST_CONFIG, NestSensorDevice) _LOGGER ...
apache-2.0
JohnOrlando/gnuradio-bitshark
gnuradio-examples/python/usrp/usrp_benchmark_usb.py
11
3302
#!/usr/bin/env python # # Copyright 2004,2005 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 opt...
gpl-3.0
ioram7/keystone-federado-pgid2013
build/paste/build/lib.linux-x86_64-2.7/paste/debug/testserver.py
28
3385
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ WSGI Test Server This builds upon paste.util.baseserver to customize it for r...
apache-2.0
bjori/grpc
src/python/grpcio_test/grpc_test/framework/foundation/_later_test.py
35
5102
# Copyright 2015, 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...
bsd-3-clause
dfc/beets
test/test_info.py
25
3581
# This file is part of beets. # Copyright 2015, Thomas Scholtes. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
mit
parmegv/keymanager
setup.py
1
4865
# -*- coding: utf-8 -*- # setup.py # Copyright (C) 2013 LEAP # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This ...
gpl-3.0
nikolas/django-extensions
django_extensions/mongodb/models.py
28
2544
""" Django Extensions abstract base mongoengine Document classes. """ import datetime from django.utils.translation import ugettext_lazy as _ from mongoengine.document import Document from mongoengine.fields import DateTimeField, IntField, StringField from mongoengine.queryset import QuerySetManager from django_exten...
mit
aflaxman/scikit-learn
sklearn/metrics/regression.py
47
19967
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
bsd-3-clause
tima/ansible
test/units/module_utils/facts/test_ansible_collector.py
25
12747
# -*- coding: utf-8 -*- # # # 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 distributed in the hope that it wi...
gpl-3.0
fujicoin/electrum-fjc
electrum/x509.py
3
11467
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
mit
slyphon/pants
src/python/pants/goal/run_tracker.py
4
13092
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import o...
apache-2.0
wgwoods/anaconda
dracut/driver_updates.py
3
21945
#!/usr/bin/python3 # # Copyright (C) 2015 by Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any late...
gpl-2.0
anhngduc/google-python-exersice
google-python-exercises/basic/solution/string2.py
208
3094
#!/usr/bin/python2.4 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic string exercises # D. verbing # Given a string, if its length is a...
apache-2.0
mtougeron/python-openstacksdk
openstack/tests/unit/auth/test_service_filter.py
2
7250
# 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
trac-hacks/trac-oidc
trac_oidc/tests/test_authenticator.py
1
7340
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Geoffrey T. Dairiki # """ """ from __future__ import absolute_import import json import logging from urlparse import parse_qsl, urlsplit, urlunsplit import mock from oauth2client.client import FlowExchangeError import pytest @pytest.fixture def redirect_url(): retu...
bsd-3-clause
diagramsoftware/odoo
addons/portal/tests/__init__.py
261
1078
# -*- 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
pratikmallya/hue
desktop/core/ext-py/python-ldap-2.3.13/Lib/ldif.py
44
13729
""" ldif - generate and parse LDIF data (see RFC 2849) See http://www.python-ldap.org/ for details. $Id: ldif.py,v 1.56 2010/07/19 08:23:22 stroeder Exp $ Python compability note: Tested with Python 2.0+, but should work with Python 1.5.2+. """ __version__ = '2.3.12' __all__ = [ # constants 'ldif_pattern', #...
apache-2.0
smart-developerr/my-first-blog
Lib/site-packages/django/contrib/staticfiles/utils.py
335
1976
import fnmatch import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured def matches_patterns(path, patterns=None): """ Return True or False depending on whether the ``path`` should be ignored (if it matches any pattern in ``ignore_patterns``). """ if patt...
gpl-3.0
kennethreitz/python-logplex
logplex/packages/requests/packages/charade/eucjpprober.py
206
3768
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. ...
bsd-2-clause
xin3liang/platform_external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/style/checkers/xcodeproj_unittest.py
48
3070
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
Bysmyyr/blink-crosswalk
Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
17
38706
# Copyright (C) 2012 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 ...
bsd-3-clause
Lab603/PicEncyclopedias
jni-build/jni/include/tensorflow/python/client/session.py
3
47046
# 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...
mit
nischalsheth/contrail-controller
src/config/schema-transformer/logger.py
3
5204
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # """ Schema Transformer monitor logger """ from sandesh_common.vns.ttypes import Module from cfgm_common.vnc_logger import ConfigServiceLogger from schema_transformer.config_db import DBBaseST, VirtualNetw...
apache-2.0
promptworks/keystone
keystone/cli.py
2
22753
# Copyright 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 agreed to in...
apache-2.0
phalt/django
tests/forms_tests/tests/tests.py
6
16659
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass from d...
bsd-3-clause
femtotrader/rabbit4mt4
receive/Python/receive_logs.py
1
2274
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import traceback import logging.config import pika import sys import argparse import datetime def get_logging_level_from_name(name): try: name = name.upper() except: name = "CRITICAL" level = logging.getLevelName(name) ...
gpl-2.0
pganssle/bdateutil
tests.py
1
17387
# bdateutil # --------- # Adds business day logic and improved data type flexibility to # python-dateutil. 100% backwards compatible with python-dateutil, # simply replace dateutil imports with bdateutil. # # Author: ryanss <ryanssdev@icloud.com> # Website: https://github.com/ryanss/bdateutil # License: MIT (s...
mit
ernw/dizzy
dizzy/interaction_state.py
1
2155
# interaction_state.py # # Copyright 2018 Daniel Mende <mail@c0decafe.de> # # 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 re...
bsd-3-clause
xuxiao19910803/edx
lms/djangoapps/branding/__init__.py
45
2858
from xmodule.modulestore.django import modulestore from xmodule.course_module import CourseDescriptor from django.conf import settings from opaque_keys.edx.locations import SlashSeparatedCourseKey from microsite_configuration import microsite def get_visible_courses(): """ Return the set of CourseDescriptors...
agpl-3.0
vitaly4uk/django
tests/aggregation_regress/tests.py
66
53789
from __future__ import unicode_literals import datetime import pickle from decimal import Decimal from operator import attrgetter from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Q, Avg, Coun...
bsd-3-clause
M3nin0/supreme-broccoli
Web/Flask/site_/lib/python3.5/site-packages/sqlalchemy/ext/declarative/clsregistry.py
55
10817
# ext/declarative/clsregistry.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Routines to handle the string class registry used by declarative. ...
apache-2.0
poo12138/gem5-stable
src/sim/probe/Probe.py
62
2370
# -*- mode:python -*- # Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementatio...
bsd-3-clause
mattesno1/CouchPotatoServer
couchpotato/core/settings.py
42
8457
from __future__ import with_statement import ConfigParser from hashlib import md5 from CodernityDB.hash_index import HashIndex from couchpotato.api import addApiView from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable imp...
gpl-3.0
naokimiyasaka/sublime-text
Backup/20140106101521/ConvertToUTF8/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...
mit
Kazade/NeHe-Website
google_appengine/lib/cherrypy/cherrypy/process/win32.py
93
5870
"""Windows service. Requires pywin32.""" import os import win32api import win32con import win32event import win32service import win32serviceutil from cherrypy.process import wspbus, plugins class ConsoleCtrlHandler(plugins.SimplePlugin): """A WSPBus plugin for handling Win32 console events (like Ctrl-C).""" ...
bsd-3-clause
Cuuuurzel/KiPyCalc
sympy/diffgeom/tests/test_hyperbolic_space.py
74
2447
''' unit test describing the hyperbolic half-plane with the Poincare metric. This is a basic model of hyperbolic geometry on the (positive) half-space {(x,y) \in R^2 | y > 0} with the Riemannian metric ds^2 = (dx^2 + dy^2)/y^2 It has constant negative scalar curvature = -2 https://en.wikipedia.org/wiki/Poincare_ha...
mit
1974kpkpkp/pygments.rb
vendor/pygments-main/pygments/styles/bw.py
364
1355
# -*- coding: utf-8 -*- """ pygments.styles.bw ~~~~~~~~~~~~~~~~~~ Simple black/white only style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment, Strin...
mit
ak2703/edx-platform
common/lib/symmath/symmath/symmath_check.py
126
12542
#!/usr/bin/python # -*- coding: utf-8 -*- # # File: symmath_check.py # Date: 02-May-12 (creation) # # Symbolic mathematical expression checker for edX. Uses sympy to check for expression equality. # # Takes in math expressions given as Presentation MathML (from ASCIIMathML), converts to Content MathML using Snuggl...
agpl-3.0
blaggacao/OpenUpgrade
addons/mrp_byproduct/__openerp__.py
259
1819
# -*- 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