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 |
|---|---|---|---|---|---|
pandaxcl/gyp | test/builddir/gyptest-default.py | 50 | 2674 | #!/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.
"""
Verify the settings that cause a set of programs to be created in
a specific build directory, and that no intermediate built files
get c... | bsd-3-clause |
xen0l/ansible | lib/ansible/modules/cloud/google/gce_instance_template.py | 45 | 18982 | #!/usr/bin/python
# Copyright: 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': ['preview'],
... | gpl-3.0 |
khchine5/xl | lino_xl/lib/ana/models.py | 1 | 11111 | # -*- coding: UTF-8 -*-
# Copyright 2017-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from lino.api import dd, rt
from ... | bsd-2-clause |
dysya92/monkeys | flask/lib/python2.7/site-packages/six.py | 320 | 27344 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... | bsd-3-clause |
mathLab/RBniCS | rbnics/utils/test/run_and_compare_to_gold.py | 1 | 5296 | # Copyright (C) 2015-2021 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
import shutil
import glob
try:
import git
except ImportError:
# Full git support is only required by regold action;
# null and compare actions do not require any git sup... | lgpl-3.0 |
rahushen/ansible | lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py | 5 | 27591 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
CollinsIchigo/hdx_2 | venv/lib/python2.7/site-packages/_markerlib/markers.py | 1769 | 3979 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... | mit |
cschnei3/forseti-security | tests/inventory/pipelines/test_data/fake_configs.py | 3 | 1090 | #!/usr/bin/env python
# Copyright 2017 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 a... | apache-2.0 |
alistairlow/tensorflow | tensorflow/python/framework/random_seed_test.py | 25 | 2520 | # 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 |
jeasoft/odoo | addons/base_vat/__openerp__.py | 262 | 2897 | # -*- 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 |
txenoo/django-radio | radioco/apps/users/models.py | 1 | 2458 | # Radioco - Broadcasting Radio Recording Scheduling system.
# Copyright (C) 2014 Iago Veloso Abalo
#
# 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 yo... | gpl-3.0 |
rosarior/mayan | apps/tags/links.py | 2 | 2178 | from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from acls.permissions import ACLS_VIEW_ACL
from .permissions import (PERMISSION_TAG_CREATE, PERMISSION_TAG_ATTACH,
PERMISSION_TAG_REMOVE, PERMISSION_TAG_DELETE, PERMISSION_TAG_EDIT,
PERMISSION_TAG_VIEW)
tag_list =... | gpl-3.0 |
jvgomez/jvgomez_page_source | pelican-plugins/liquid_tags/notebook.py | 1 | 9750 | """
Notebook Tag
------------
This is a liquid-style tag to include a static html rendering of an IPython
notebook in a blog post.
Syntax
------
{% notebook filename.ipynb [ cells[start:end] ]%}
The file should be specified relative to the ``notebooks`` subdirectory of the
content directory. Optionally, this subdire... | gpl-2.0 |
talhasch/pyhttps | pyhttps.py | 1 | 2306 | import argparse
import atexit
import logging
import os
import sys
import tempfile
from subprocess import call
from version import version
logging.basicConfig(level=logging.INFO)
PY3 = sys.version_info[0] == 3
parser = argparse.ArgumentParser(description='')
parser.add_argument('--host', dest='host', default='localh... | mit |
alkaitz/starloot | src/gameengine/webSocketServer/lib/tornado-3.0.1/build/lib/tornado/testing.py | 4 | 20477 | #!/usr/bin/env python
"""Support classes for automated testing.
* `AsyncTestCase` and `AsyncHTTPTestCase`: Subclasses of unittest.TestCase
with additional support for testing asynchronous (`.IOLoop` based) code.
* `ExpectLog` and `LogTrapTestCase`: Make test logs less spammy.
* `main()`: A simple test runner (wra... | apache-2.0 |
dreamsxin/kbengine | kbe/res/scripts/common/Lib/test/test_hashlib.py | 72 | 22074 | # Test hashlib module
#
# $Id$
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import array
import hashlib
import itertools
import os
import sys
try:
import threading
except ImportError:
threading = None
import unittest
import warnings
from ... | lgpl-3.0 |
ryfeus/lambda-packs | Tensorflow_LightGBM_Scipy_nightly/source/scipy/odr/__init__.py | 19 | 4343 | """
=================================================
Orthogonal distance regression (:mod:`scipy.odr`)
=================================================
.. currentmodule:: scipy.odr
Package Content
===============
.. autosummary::
:toctree: generated/
Data -- The data to fit.
RealData -- Dat... | mit |
Kazade/NeHe-Website | google_appengine/lib/django_0_96/django/contrib/auth/handlers/modpython.py | 33 | 1760 | from mod_python import apache
import os
def authenhandler(req, **kwargs):
"""
Authentication handler that checks against Django's auth database.
"""
# mod_python fakes the environ, and thus doesn't process SetEnv. This fixes
# that so that the following import works
os.environ.update(req.subp... | bsd-3-clause |
aprefontaine/TMScheduler | django/test/simple.py | 17 | 12744 | import sys
import signal
import unittest
from django.conf import settings
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases import OutputChecker, DocTestRunner, TestCase
... | bsd-3-clause |
petewarden/tensorflow | tensorflow/python/debug/lib/debug_gradients_test.py | 11 | 15831 | # 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 |
macarthur-lab/leiden_sc | setup.py | 1 | 1393 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst').read()
history = open('HISTORY.rst... | bsd-3-clause |
colehertz/Stripe-Tester | venv/lib/python3.5/site-packages/pip-7.1.0-py3.5.egg/pip/_vendor/requests/packages/urllib3/response.py | 478 | 16459 | try:
import http.client as httplib
except ImportError:
import httplib
import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
)
from .packages.six import string_type... | mit |
UstadMobile/eXePUB | exe/webui/mywebbrowser.py | 5 | 23438 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###! /usr/bin/python2.7
"""Interfaces for launching and remotely controlling Web browsers.
JRJ: Fichero parcheado de webbrowser.py para que acepte chrome y chromium"""
# Maintained by Georg Brandl.
import os
import shlex
import sys
import stat
import subprocess
import time
imp... | gpl-2.0 |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_stockwell.py | 20 | 1690 | """
=======================================================
Time frequency with Stockwell transform in sensor space
=======================================================
This script shows how to compute induced power and intertrial coherence
using the Stockwell transform, a.k.a. S-Transform.
"""
# Authors: Denis A.... | bsd-3-clause |
zouzhberk/ambaridemo | demo-server/src/main/resources/stacks/BIGTOP/0.8/services/GANGLIA/package/scripts/ganglia_monitor.py | 1 | 7069 | """
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 this ... | apache-2.0 |
shingonoide/odoo | addons/mail/mail_vote.py | 439 | 1647 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-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 |
pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/reloop-closured/lib/python2.7/smtplib.py | 74 | 30703 | #! /usr/bin/env python
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RC... | agpl-3.0 |
toshywoshy/ansible | lib/ansible/module_utils/network/junos/argspec/vlans/vlans.py | 23 | 1549 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by ... | gpl-3.0 |
Tranzystorek/servo | tests/wpt/web-platform-tests/tools/pytest/testing/code/test_excinfo.py | 165 | 30814 | # -*- coding: utf-8 -*-
import _pytest
import py
import pytest
from _pytest._code.code import FormattedExcinfo, ReprExceptionInfo
queue = py.builtin._tryimport('queue', 'Queue')
failsonjython = pytest.mark.xfail("sys.platform.startswith('java')")
from test_source import astonly
try:
import importlib
except Impo... | mpl-2.0 |
madPO/cod4 | votePlugin.py | 1 | 8741 | #
# votePlugin for BigBrotherBot(B3) (www.bigbrotherbot.net)
# Copyright (C) 2013 Simon "madPO" Zor'kin
#
# 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
# (a... | gpl-2.0 |
aaronkaplan/intelmq-beta | intelmq/bots/parsers/malwaredomainlist__/parser.py | 1 | 1774 | import unicodecsv
from cStringIO import StringIO
from intelmq.lib.bot import Bot, sys
from intelmq.lib.message import Event
from intelmq.lib.harmonization import DateTime
from intelmq.bots import utils
class MalwareDomainListParserBot(Bot):
def process(self):
report = self.receive_message()
if no... | agpl-3.0 |
Werkov/PyQt4 | contrib/lang/lang.py | 17 | 5333 | #!/usr/bin/env python
# switch translations dynamically in a PyQt4 application
#
# PyQt version by Hans-Peter Jansen <hpj@urpla.net>
#
# Based on an example from jpn on July 17 2006 found here:
#
# http://www.qtcentre.org/wiki/index.php?title=Dynamic_translation_in_Qt4_applications
#
# Since the original version didn... | gpl-2.0 |
pkappesser/youtube-dl | youtube_dl/extractor/m6.py | 147 | 1952 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class M6IE(InfoExtractor):
IE_NAME = 'm6'
_VALID_URL = r'http://(?:www\.)?m6\.fr/[^/]+/videos/(?P<id>\d+)-[^\.]+\.html'
_TEST = {
'url': 'http://www.m6.fr/emission-les_reines_du_shopping/videos... | unlicense |
DavidNorman/tensorflow | tensorflow/python/ops/distributions/bernoulli.py | 17 | 7105 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
kinsamanka/machinekit | src/emc/usr_intf/stepconf/build_HAL.py | 8 | 29367 | #!/usr/bin/env python
#
# This is stepconf, a graphical configuration editor for LinuxCNC
# Copyright 2007 Jeff Epler <jepler@unpythonic.net>
# stepconf 1.1 revamped by Chris Morley 2014
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | lgpl-2.1 |
nuess0r/raspberry_preserve | www/cgi/serverside_js.py | 1 | 1364 | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright 2014 Daniel Fairchild
#
# This file is part of raspberry_preserve.
#
# 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, or (a... | gpl-2.0 |
dharmabumstead/ansible | test/units/modules/web_infrastructure/test_jenkins_plugin.py | 70 | 7046 | import collections
from io import BytesIO
from ansible.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin
def pass_function(*args, **kwargs):
pass
GITHUB_DATA = {"url": u'https://api.github.com/repos/ansible/ansible',
"response": b"""
{
"id": 3638964,
"name": "ansible",
"full_n... | gpl-3.0 |
Duoxilian/home-assistant | tests/components/config/test_group.py | 10 | 4081 | """Test Z-Wave config panel."""
import asyncio
import json
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from tests.common import mock_http_component_app
VIEW_NAME = 'api:config:group:config'
@asyncio.coroutine
def test_get_dev... | mit |
soldag/home-assistant | homeassistant/components/nest/sensor_sdm.py | 3 | 4246 | """Support for Google Nest SDM sensors."""
from typing import Optional
from google_nest_sdm.device import Device
from google_nest_sdm.device_traits import HumidityTrait, TemperatureTrait
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS... | apache-2.0 |
cyberark-bizdev/ansible | lib/ansible/module_utils/facts/network/aix.py | 143 | 5982 | # 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 distributed in the hope that ... | gpl-3.0 |
felixfontein/ansible | lib/ansible/galaxy/dependency_resolution/__init__.py | 20 | 2137 | # -*- coding: utf-8 -*-
# Copyright: (c) 2020-2021, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Dependency resolution machinery."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
try:
from typing import TY... | gpl-3.0 |
LPgenerator/django-mmc | mmc/admin.py | 1 | 3184 | __author__ = 'gotlium'
from django.contrib import admin
from mmc.models import MMCLog, MMCScript, MMCHost, MMCEmail
class MMCLogAdmin(admin.ModelAdmin):
list_display = (
'script', 'hostname', 'success', 'elapsed',
'memory', 'cpu_time', 'start', 'end', 'is_fixed')
list_filter = ('success', 'is... | gpl-2.0 |
schristiaens/raft | core/tester/CSRFTester.py | 11 | 3532 | #
# Author: Nathan Hamiel
#
# Copyright (c) 2013 RAFT Team
#
# This file is part of RAFT.
#
# RAFT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
mazaclub/mazabot-core | test/test_schedule.py | 9 | 2808 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... | bsd-3-clause |
dwillmer/rust | src/etc/regex-match-tests.py | 58 | 3565 | #!/usr/bin/env python2
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... | apache-2.0 |
Sarah-Alsinan/muypicky | lib/python3.6/site-packages/setuptools/command/test.py | 55 | 8535 | import os
import operator
import sys
import contextlib
import itertools
from distutils.errors import DistutilsOptionError
from unittest import TestLoader
from setuptools.extern import six
from setuptools.extern.six.moves import map, filter
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
... | mit |
mkaluza/external_chromium_org | tools/telemetry/telemetry/core/heap/chrome_js_heap_snapshot_parser_unittest.py | 38 | 2528 | # Copyright 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.
import json
import unittest
from telemetry.core.heap import chrome_js_heap_snapshot_parser
class ChromeJsHeapSnapshotParserUnittest(unittest.TestCase):
d... | bsd-3-clause |
picoCTF/picoCTF-web | api/config.py | 1 | 4633 | """
CTF API Configuration File
Note this is just a python script. It does config things.
"""
from api.common import WebException
import api
import datetime
import json
import api.app
""" FLASK """
#api.app.session_cookie_domain = "0.0.0.0"
api.app.session_cookie_path = "/"
api.app.session_cookie_name = "flask"
#... | mit |
zzzombat/lucid-python-django | django/contrib/gis/gdal/libgdal.py | 156 | 3390 | import os, re, sys
from ctypes import c_char_p, CDLL
from ctypes.util import find_library
from django.contrib.gis.gdal.error import OGRException
# Custom library path set?
try:
from django.conf import settings
lib_path = settings.GDAL_LIBRARY_PATH
except (AttributeError, EnvironmentError, ImportError):
lib... | bsd-3-clause |
garthylou/pootle | pootle/apps/pootle_translationproject/urls.py | 7 | 1200 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django.conf.urls ... | gpl-3.0 |
wolfiex/AlarmPi | gcal_quickstart.py | 1 | 2718 |
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
import datetime
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
ex... | mit |
gushedaoren/django-rest-auth | rest_auth/app_settings.py | 29 | 1322 | from django.conf import settings
from rest_auth.serializers import (
TokenSerializer as DefaultTokenSerializer,
UserDetailsSerializer as DefaultUserDetailsSerializer,
LoginSerializer as DefaultLoginSerializer,
PasswordResetSerializer as DefaultPasswordResetSerializer,
PasswordResetConfirmSerializer... | mit |
robweber/maraschino | lib/sqlalchemy/log.py | 39 | 6820 | # sqlalchemy/log.py
# Copyright (C) 2006-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
# Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logging control and... | mit |
nhenezi/kuma | vendor/packages/translate-toolkit/translate/convert/php2po.py | 7 | 4751 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | mpl-2.0 |
xzturn/tensorflow | tensorflow/lite/testing/op_tests/nearest_upsample.py | 17 | 3155 | # Copyright 2019 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 |
OCA/l10n-usa | account_banking_ach_direct_debit/models/account_payment_order.py | 1 | 2575 | # Copyright 2018 Thinkwell Designs <dave@thinkwelldesigns.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models, _
class AccountPaymentOrder(models.Model):
_inherit = 'account.payment.order'
@api.multi
def generate_payment_file(self):
"""
... | agpl-3.0 |
johndpope/tensorflow | tensorflow/contrib/learn/python/learn/basic_session_run_hooks.py | 118 | 1403 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
MartinNowak/mongo-connector | tests/util.py | 69 | 1175 | # Copyright 2013-2014 MongoDB, 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 writin... | apache-2.0 |
bnkr/servequnit | tests/http.py | 2 | 8919 | import os, contextlib
from tempfile import NamedTemporaryFile
from mock import patch, Mock
from unittest import TestCase
from six.moves import urllib
from servequnit.server import ReusableServer, HandlerSettings
from servequnit.http import QunitRequestHandler
from servequnit.factory import js_server
from ._util impor... | mit |
nprimmer/rubik | rubik.py | 1 | 3059 | #!/usr/bin/env python
from colorama import init
init()
from colorama import Fore, Back, Style
face_size = 5
indent = " " * face_size
separator = Back.RESET + " "
line_sep = " " * ((face_size * 2) + 2)
current_face = 'front'
base_cube = {'top':Back.WHITE,'bottom':Back.GREEN,'left':Back.CYAN,'right':Back.MAGENTA,'fron... | gpl-2.0 |
consbio/seedsource-core | seedsource_core/django/seedsource/utils.py | 1 | 1315 | import os
from django.conf import settings
from ncdjango.models import Service
from netCDF4 import Dataset
from .models import Region
def get_elevation_at_point(point):
try:
region = get_regions_for_point(point)[0]
except IndexError:
return None
service = Service.objects.get(name='{}_de... | bsd-3-clause |
bowang/tensorflow | tensorflow/python/keras/_impl/keras/engine/training_test.py | 13 | 52417 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
hurricup/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/ar/forms.py | 309 | 3903 | # -*- coding: utf-8 -*-
"""
AR-specific Form helpers.
"""
from django.forms import ValidationError
from django.core.validators import EMPTY_VALUES
from django.forms.fields import RegexField, CharField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
class... | apache-2.0 |
atsolakid/edx-platform | common/lib/xmodule/xmodule/tests/test_bulk_assertions.py | 173 | 5627 | import ddt
import itertools
from xmodule.tests import BulkAssertionTest, BulkAssertionError
STATIC_PASSING_ASSERTIONS = (
('assertTrue', True),
('assertFalse', False),
('assertIs', 1, 1),
('assertEqual', 1, 1),
('assertEquals', 1, 1),
('assertIsNot', 1, 2),
('assertIsNone', None),
('as... | agpl-3.0 |
s20121035/rk3288_android5.1_repo | external/chromium_org/native_client_sdk/src/build_tools/tests/easy_template_test.py | 53 | 3559 | #!/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 cStringIO
import difflib
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD... | gpl-3.0 |
theuni/bitcoin | contrib/testgen/base58.py | 2139 | 2818 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... | mit |
drufat/sympy | sympy/utilities/randtest.py | 32 | 5449 | """ Helpers for randomized testing """
from __future__ import print_function, division
from random import uniform
import random
from sympy.core.numbers import I
from sympy.simplify.simplify import nsimplify
from sympy.core.containers import Tuple
from sympy.core.numbers import comp
from sympy.core.symbol import Symb... | bsd-3-clause |
MikeC84/mac_kernel_lge_hammerhead | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
zadgroup/edx-platform | cms/djangoapps/contentstore/management/commands/fix_not_found.py | 108 | 1110 | """
Script for fixing the item not found errors in a course
"""
from django.core.management.base import BaseCommand, CommandError
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
from xmodule.modulestore import ModuleStoreEnum
# To run from command line: ./manage.py cms fix... | agpl-3.0 |
ricorx7/rti_python | ADCP/Predictor/MaxVelocity.py | 2 | 6635 | import json
import os
import math
import pytest
def calculate_max_velocity(**kwargs):
"""
Calculate the maximum velocity the ADCP can measure including the boat speed in m/s. This speed is the
speed the ADCP is capable of measuring, if the speed exceeds this value, then the data will be incorrect
due... | bsd-3-clause |
thfield/sf-base-election-data | pyelect/utils.py | 2 | 4805 | """Project-wide helper functions."""
import logging
import os
import yaml
_log = logging.getLogger()
FILE_MANUAL = 'manual'
FILE_AUTO_GENERATED = 'auto_generated'
FILE_AUTO_UPDATED = 'auto_updated'
FILE_TYPES = (FILE_MANUAL, FILE_AUTO_UPDATED, FILE_AUTO_GENERATED)
DIR_PRE_DATA = 'pre_data'
KEY_META_COMMENTS = 'c... | bsd-3-clause |
fitoria/askbot-devel | askbot/templatetags/extra_tags.py | 5 | 4049 | import math
from django import template
from django.template import RequestContext
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from askbot.utils import functions
from askbot.... | gpl-3.0 |
mhoffman/catmap | catmap/scalers/generalized_linear_scaler.py | 1 | 21573 | from .scaler_base import *
from catmap.data import regular_expressions
from catmap.functions import parse_constraint
from math import isnan
import pylab as plt
class GeneralizedLinearScaler(ScalerBase):
"""
:TODO:
"""
def __init__(self,reaction_model = None):
ScalerBase.__init__(self,reacti... | gpl-3.0 |
vrsys/avango | attic/examples/display/test_app_3.py | 6 | 2049 | # -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | lgpl-3.0 |
django-nonrel/django | django/dispatch/dispatcher.py | 102 | 11075 | import weakref
import threading
from django.dispatch import saferef
from django.utils.six.moves import xrange
WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
def _make_id(target):
if hasattr(target, '__func__'):
return (id(target.__self__), id(target.__func__))
return id(target)... | bsd-3-clause |
r3tard/BartusBot | lib/google/protobuf/internal/message_listener.py | 264 | 3367 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
ebar0n/django | tests/template_backends/test_jinja2.py | 94 | 3451 | from unittest import skipIf
from django.template import TemplateSyntaxError
from django.test import RequestFactory
from .test_dummy import TemplateStringsTests
try:
import jinja2
except ImportError:
jinja2 = None
Jinja2 = None
else:
from django.template.backends.jinja2 import Jinja2
@skipIf(jinja2 ... | bsd-3-clause |
polyval/CNC | flask/Lib/site-packages/sqlalchemy/orm/descriptor_props.py | 38 | 25141 | # orm/descriptor_props.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
"""Descriptor properties are more "auxiliary" properties
that exist as confi... | apache-2.0 |
jmehnle/ansible | lib/ansible/modules/network/nxos/nxos_vrf.py | 23 | 8238 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
harvard-vpal/bridge-adaptivity | bridge_adaptivity/module/models.py | 1 | 21212 | import hashlib
import importlib
import inspect
import logging
import math
import os
import uuid
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import fields
... | bsd-3-clause |
toofar/qutebrowser | qutebrowser/keyinput/basekeyparser.py | 1 | 9449 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | gpl-3.0 |
tawsifkhan/scikit-learn | examples/applications/plot_outlier_detection_housing.py | 243 | 5577 | """
====================================
Outlier detection on a real data set
====================================
This example illustrates the need for robust covariance estimation
on a real data set. It is useful both for outlier detection and for
a better understanding of the data structure.
We selected two sets o... | bsd-3-clause |
vidartf/hyperspy | hyperspy/misc/utils.py | 1 | 28688 | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
tavaresdong/courses-notes | ucb_cs61A/projects/ants/tests/02.py | 4 | 2267 | test = {
'name': 'Problem 2',
'points': 2,
'suites': [
{
'cases': [
{
'code': r"""
>>> # Simple test for Place
>>> place0 = Place('place_0')
>>> print(place0.exit)
None
>>> print(place0.entrance)
None
>>> place1 = Pl... | mit |
lincoln-lil/flink | flink-python/pyflink/fn_execution/coders.py | 1 | 21445 | ################################################################################
# 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... | apache-2.0 |
nichit93/Implementation-of-TRED-in-ns-3 | src/mobility/bindings/modulegen__gcc_LP64.py | 38 | 321845 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
gvir/dailyreader | venv/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py | 1002 | 25650 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os... | mit |
TeamRegular/android_kernel_lge_g4stylus | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
2013Commons/hue | desktop/libs/hadoop/src/hadoop/yarn/clients.py | 1 | 2102 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
sassoftware/conary | conary/repository/netrepos/reposlog.py | 2 | 3924 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 |
tectronics/mythbox | resources/lib/twisted/twisted/python/shortcut.py | 81 | 2455 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Creation of Windows shortcuts.
Requires win32all.
"""
from win32com.shell import shell
import pythoncom
import os
def open(filename):
"""Open an existing shortcut for reading.
@return: The shortcut object
@rtype: Sh... | gpl-2.0 |
endlessm/chromium-browser | third_party/catapult/tracing/tracing/mre/threaded_work_queue_unittest.py | 4 | 1078 | # Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from tracing.mre import threaded_work_queue
class ThreadedWorkQueueTests(unittest.TestCase):
def testSingleThreaded(self):
wq = ... | bsd-3-clause |
geometrybase/gensim | gensim/summarization/summarizer.py | 33 | 7396 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import logging
from gensim.summarization.pagerank_weighted import pagerank_weighted as _pagerank
from gensim.summarization.textcleaner import clean_text_by_sentences as _clean_text_by_sentences
fr... | gpl-3.0 |
aaronorosen/horizon-congress | horizon/test/tests/middleware.py | 4 | 2488 | # Copyright 2012 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 |
adsabs/mission-control | mc/tests/stubdata/github_commit_payload.py | 3 | 2254 | payload='''{
"sha": "d0e1b1f82ddd1f2c42afbe15f624b120db66fbb4",
"url": "https://api.github.com/repos/adsabs/adsws/git/commits/d0e1b1f82ddd1f2c42afbe15f624b120db66fbb4",
"html_url": "https://github.com/adsabs/adsws/commit/d0e1b1f82ddd1f2c42afbe15f624b120db66fbb4",
"author": {
"name": "Vladimir Sudilovsky",
... | mit |
claws/AutobahnPython | examples/twisted/websocket/ping/client.py | 16 | 1839 | ###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... | apache-2.0 |
futursolo/FutureFinity | examples/get_post_form.py | 1 | 1404 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2016 Futur Solo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 |
watonyweng/horizon | openstack_dashboard/test/integration_tests/tests/test_sahara_job_binaries.py | 50 | 3397 | # 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 |
sebrandon1/neutron | neutron/extensions/segment.py | 4 | 8943 | # Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 |
typester/emacs | etc/emacs3.py | 6 | 8537 | """
Warning: This file is automatically generated from emacs2.py with the
2to3 script. Do not hand edit.
"""
"""Definitions used by commands sent to inferior Python in python.el."""
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# Author: Dave Love <fx@gnu.org>
# This file is par... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.