repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
eayunstack/fuel-web | nailgun/nailgun/task/manager.py | 2 | 48214 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | apache-2.0 |
pdinges/class-language | visitor/util.py | 1 | 1477 | # -*- coding: utf-8 -*-
# Copyright (c) 2008--2012 Peter Dinges <pdinges@acm.org>
#
# 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 l... | gpl-3.0 |
whitlockjc/kubernetes | hack/boilerplate/boilerplate_test.py | 629 | 1362 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
ormnv/os_final_project | django/db/backends/oracle/compiler.py | 112 | 2995 | from django.db.models.sql import compiler
# The izip_longest was renamed to zip_longest in py3
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
class SQLCompiler(compiler.SQLCompiler):
def resolve_columns(self, row, fields=()):
# If this ... | bsd-3-clause |
mhaberler/machinekit | src/machinetalk/messagebus/python-mockup/commandsubmitter.py | 10 | 2369 | import os, time
import zmq
from machinetalk.protobuf.message_pb2 import Container
from machinetalk.protobuf.types_pb2 import *
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-c", "--cmd", dest="cmduri", default="tcp://127.0.0.1:5571",
help="command URI")
parser.add_opt... | lgpl-2.1 |
rolandovillca/python_basic_introduction | web/client_post_with_urllib2.py | 4 | 9620 | '''
urllib2 - Library for opening URLs
A library for opening URLs that can be extended by defining custom protocol
handlers.
The urllib2 module defines functions and classes which help in opening URLs
(mostly HTTP) in a complex world - basic and digest authentication,
redirections, cookies and more.
The urllib2 modu... | mit |
fsalamero/pilas | pilasengine/actores/maton.py | 5 | 3468 | # -*- encoding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import pilasengine
from pilasengine.actores.actor import Actor
from pilasengine.comportamientos.co... | lgpl-3.0 |
mkhutornenko/incubator-aurora | src/main/python/apache/aurora/executor/common/health_checker.py | 1 | 4022 | #
# 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 ... | apache-2.0 |
stharrold/ARCHIVED_bench_fastq | bench_fastq/utils.py | 2 | 15946 | #!/usr/bin/env python
"""Utils to parse the terminal output from bench_compress.sh
"""
from __future__ import print_function, division, absolute_import
import os
import sys
import json
import datetime as dt
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def parse_elapsed(elapsed):
"""Pars... | mit |
archyufa/CloudFerry | cloudferrylib/os/actions/detach_used_volumes.py | 12 | 1090 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
ESMG/ESMG-configs | CCS1/plot_vort.py | 1 | 2295 | import numpy as np
import netCDF4
import os
import sys
import subprocess
import pyroms
from pyroms_toolbox import jday2date
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
# draw line around map projection limb.
# color background of map projec... | gpl-3.0 |
houlixin/BBB-TISDK | linux-devkit/sysroots/cortexa8t2hf-vfp-neon-linux-gnueabi/usr/lib/python2.7/types.py | 304 | 2040 | """Define names for all type symbols known in the standard interpreter.
Types that are part of optional modules (e.g. array) are not listed.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check... | gpl-2.0 |
vimagick/youtube-dl | youtube_dl/postprocessor/ffmpeg.py | 68 | 20687 | from __future__ import unicode_literals
import io
import os
import subprocess
import time
from .common import AudioConversionError, PostProcessor
from ..compat import (
compat_subprocess_get_DEVNULL,
)
from ..utils import (
encodeArgument,
encodeFilename,
get_exe_version,
is_outdated_version,
... | unlicense |
bendudson/BOUT-1.0 | tools/tokamak_grids/pyGridGen/aeqdsk.py | 4 | 18365 | #!/usr/bin/env python
import re
import numpy
"""
@brief A-Eqdsk reader class
@version $Id$
Copyright © 2006-2008, Tech-X Corporation, Boulder, CO
See LICENSE file for conditions of use.
The official document describing a-eqdsk files:
http://fusion.gat.com/THEORY/efit/a_eqdsk.html
"""
class Aeqdsk:
d... | gpl-3.0 |
coreboot/chrome-ec | util/flash_cr50.py | 2 | 27330 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Flash Cr50 using gsctool or cr50-rescue.
gsctool example:
util/flash_cr50.py --image cr50.bin.prod
util/... | bsd-3-clause |
firerszd/kbengine | kbe/res/scripts/common/Lib/encodings/utf_16_be.py | 860 | 1037 | """ Python 'utf-16-be' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_be_encode
def decode(input, errors='strict'):
return codecs.utf_16_be_decode(input, errors, True)
class IncrementalEncod... | lgpl-3.0 |
klenks/jobsportal | venv/lib/python2.7/site-packages/pip/_vendor/ipaddress.py | 339 | 80176 | # Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
"""A fast, lightweight IPv4/IPv6 manipulation library in Python.
This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.
"""
from __future__ import unicode_literals
import itertools
import struct
__version... | mit |
wanghongjuan/crosswalk-test-suite | misc/sampleapp-android-tests/sampleapp/helloworld_pack.py | 1 | 2182 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
menegon/OWSLib | owslib/wms.py | 5 | 24196 | # -*- coding: iso-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com>
#
# Authors : Sean Gillies <sgillies@frii.com>
# Julien Anguenot <ja@nuxeo.com>
#
# Contact email: sgillie... | bsd-3-clause |
RoyalKing/zerorpc-python | tests/test_events.py | 39 | 5196 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
murfz/Sick-Beard | lib/enzyme/mkv.py | 163 | 30439 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
# Copyright 2003-2006 Jason Tackaberry <tack@urandom.ca>
#
# This file is part of enzyme.
#
# en... | gpl-3.0 |
adan91/gd-pdfview | scripts/tohtml.py | 32 | 1738 | import sys, os, re
HEADER="""<head>
<style>
body { background-color:#fffff0; color:black; margin:16pt; }
a { text-decoration:none; color:darkblue; }
a.line { position:relative; padding-top:300px; }
.comment { color:green; font-style:italic; }
.comment a { color:darkgreen; }
</style>
</head>
<body><pre><pre>"""
FOOTER... | agpl-3.0 |
adobe/chromium | chrome/browser/resources/file_manager/bin/squashdir.py | 21 | 1788 | #!/usr/bin/env python
# Copyright (c) 2011 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 glob
import os
import shutil
import stat
import sys
def usage():
print("""Usage: squashdir.py <dest-dir> <source-dir> ...... | bsd-3-clause |
vandersonmota/silk | silk/model_factory.py | 1 | 10193 | import json
import logging
import sys
import traceback
from django.core.urlresolvers import resolve
from silk import models
from silk.collector import DataCollector
from silk.config import SilkyConfig
Logger = logging.getLogger('silk')
content_types_json = ['application/json',
'application/x-... | mit |
nathandaddio/puzzle_app | puzzle_app/puzzle_app/tests/schemas/test_hitori_schemas.py | 1 | 1692 | import pytest
from marshmallow import ValidationError
from puzzle_app.schemas.hitori import (
HitoriGameBoardCellSchema,
HitoriGameBoardSchema,
HitoriSolveSchema
)
def _new_dict_without_keys(dictionary, keys):
new_dict = dict(dictionary)
for key in keys:
del new_dict[key]
return ne... | mit |
HeatherHillers/RoamMac | tests/test_featurecursor.py | 3 | 1233 | import pytest
from mock import Mock
from roam.infodock import FeatureCursor, NoFeature
import tests.objects
layer = tests.objects.newmemorylayer()
layer = tests.objects.addfeaturestolayer(layer, 2)
features = layer.getFeatures()
featureone = features.next()
featuretwo = features.next()
@pytest.fixture
def cursor()... | gpl-2.0 |
kostaspl/SpiderMonkey38 | python/mozbuild/mozbuild/test/compilation/test_warnings.py | 8 | 6581 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import unittest
from mozfile.mozfile import NamedTemporaryFile
from mozbuild.compilation.warnings import Com... | mpl-2.0 |
kurli/blink-crosswalk | Tools/Scripts/webkitpy/layout_tests/servers/pywebsocket.py | 25 | 3496 | # 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
getsentry/zeus | zeus/factories/filecoverage.py | 1 | 1220 | import factory
import factory.fuzzy
from faker import Factory
faker = Factory.create()
from random import randint
from zeus import models
from .base import ModelFactory
from .types import GUIDFactory
class FileCoverageFactory(ModelFactory):
id = GUIDFactory()
filename = factory.LazyAttribute(
lamb... | apache-2.0 |
rameshakulapc/PDFViewer | jni/mupdf/freetype/src/tools/docmaker/docmaker.py | 463 | 2766 | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | gpl-2.0 |
santiavenda2/griffith | lib/people.py | 4 | 5798 | # -*- coding: UTF-8 -*-
__revision__ = '$Id$'
# Copyright (c) 2005-2009 Vasco Nunes, Piotr Ożarowski
#
# 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... | gpl-2.0 |
andlima/olheiro | olheiro.py | 1 | 3435 | #!/usr/bin/python
import os
import mercado
ARQUIVO_MOD = 'olheiro.mod'
ARQUIVO_DAT = 'olheiro.dat'
GLPSOL_EXEC = 'glpsol -m %s -d %s' % (ARQUIVO_MOD, ARQUIVO_DAT)
LISTA_CONJUNTOS = ['S_Jogadores', 'S_Posicoes', 'S_Formacoes']
LISTA_PARAMETROS = ['P_Patrimonio', 'P_Preco', 'P_Media',
'Pe_Posicao',... | bsd-3-clause |
100health/RedoxBlog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/img.py | 94 | 18053 | # -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Formatter
from pygments.util import ge... | mit |
CENDARI/portia | slybot/slybot/fieldtypes/text.py | 23 | 2358 | """
Text types
"""
from scrapely.extractors import text as extract_text, safehtml
class _BaseTextProcessor(object):
"""basic text processor, defines identity functions, some of which
are overridden in subclasses
"""
def extract(self, text):
"""Matches and extracts any string, as it is"""
... | bsd-3-clause |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/test/test_argparse.py | 20 | 151865 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
import codecs
import inspect
import os
import shutil
import stat
import sys
import textwrap
import tempfile
import unittest
import argparse
from StringIO import StringIO
class StdIOBuffer(StringIO):
pass
from test import test_support
class TestCase(unitte... | gpl-2.0 |
mrcslws/htmresearch | projects/thing_classification/thing_convergence.py | 3 | 13625 | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 program is free software: you can redistribute it and/or modify
# it under the ... | agpl-3.0 |
alxgu/ansible | test/units/modules/network/f5/test_bigip_lx_package.py | 38 | 3742 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
osvalr/odoo | addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py | 337 | 3122 | # -*- 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 |
GuessWhoSamFoo/pandas | pandas/tests/frame/conftest.py | 1 | 5594 | import numpy as np
import pytest
from pandas import DataFrame, NaT, compat, date_range
import pandas.util.testing as tm
@pytest.fixture
def float_frame():
"""
Fixture for DataFrame of floats with index of unique strings
Columns are ['A', 'B', 'C', 'D'].
"""
return DataFrame(tm.getSeriesData())
... | bsd-3-clause |
MusculoskeletalAtlasProject/mapclient | tests/test_resources/updater_test/fieldworkpcregfemur2landmarksstep-master/mapclientplugins/fieldworkpcregfemur2landmarksstep/resources_rc.py | 3 | 7857 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Tue Jul 8 07:21:06 2014
# by: The Resource Compiler for PySide (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore
qt_resource_data = "\x00\x00\x08\xe2\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00@\x... | gpl-3.0 |
uwafsl/MissionPlanner | Lib/site-packages/numpy/lib/tests/test_financial.py | 83 | 1912 | from numpy.testing import *
import numpy as np
class TestFinancial(TestCase):
def test_rate(self):
assert_almost_equal(np.rate(10,0,-3500,10000),
0.1107, 4)
def test_irr(self):
v = [-150000, 15000, 25000, 35000, 45000, 60000]
assert_almost_equal(np.irr(v),
... | gpl-3.0 |
r-mart/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 162 | 9771 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises_regexp
... | bsd-3-clause |
Sorsly/subtle | google-cloud-sdk/lib/surface/app/versions/start.py | 3 | 3908 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | mit |
dimagol/trex-core | scripts/astf/http_manual_commands_connect_rst.py | 2 | 1855 | # Example connect and reset. should show syn-syn/ack-rst
from trex_astf_lib.api import *
# we can send either Python bytes type as below:
http_req = b'GET /3384 HTTP/1.1\r\nHost: 22.0.0.3\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.... | apache-2.0 |
jonasjj/oslo-quant | spiders/osloquant/middlewares.py | 1 | 1907 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class OsloquantSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy... | gpl-3.0 |
wuhengzhi/chromium-crosswalk | third_party/WebKit/Source/build/scripts/in_file_unittest.py | 78 | 3166 | #!/usr/bin/env python
# Copyright (C) 2013 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 |
EnTeQuAk/django-allauth | docs/conf.py | 3 | 7802 | # -*- coding: utf-8 -*-
#
# django-allauth documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 6 22:58:42 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | mit |
anderson1008/NOCulator | hring/src/Script/my_print.py | 1 | 8437 | #!/usr/bin/python
import sys
import os
import re
import fnmatch
import string
import matplotlib.pyplot as plt
def print_period(stat):
# use to profile the application running solo.
# stat is an iterator or array
i = 0
for item in stat:
plt.plot(item, label=str(i))
p... | mit |
wunderlins/learning | python/zodb/lib/linux64/setuptools/command/build_py.py | 87 | 7983 | from glob import glob
from distutils.util import convert_path
import distutils.command.build_py as orig
import os
import fnmatch
import textwrap
import io
import distutils.errors
import collections
import itertools
from setuptools.extern.six.moves import map
try:
from setuptools.lib2to3_ex import Mixin2to3
except... | gpl-2.0 |
gfyoung/pandas | pandas/tests/arrays/integer/test_function.py | 5 | 6401 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays import FloatingArray
@pytest.mark.parametrize("ufunc", [np.abs, np.sign])
# np.sign emits a warning with nans, <https://github.com/numpy/numpy/issues/15127>
@pytest.mark.filterwarnings("ignore:invalid value enco... | bsd-3-clause |
varunarya10/tempest | tempest/api/identity/admin/v3/test_projects_negative.py | 9 | 3528 | # Copyright 2013 OpenStack, LLC
# 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 b... | apache-2.0 |
dnephin/openLETS | src/openlets/core/db.py | 1 | 7160 | """
Database Acess Layer
"""
import datetime
import itertools
import operator
from django.db.models import Q
from django.db import transaction
from django.core.exceptions import ObjectDoesNotExist
from openlets.core import models
def get_balance(persona, personb, currency):
"""Load a balance between two persons.
... | bsd-3-clause |
DJMelonz/basic-blog | django/views/generic/list.py | 98 | 5863 | import re
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, View
c... | bsd-3-clause |
mathuin/pyment | django/inventory/models.py | 1 | 7620 | from django.urls import reverse
from django.db import models
from meadery.models import Product
from django.core.exceptions import ValidationError
class Warehouse(models.Model):
number = models.IntegerField()
slug = models.SlugField(max_length=50, unique=True, help_text="Unique value for warehouse page URL, c... | mit |
rschnapka/account-closing | account_cutoff_accrual_picking/__init__.py | 10 | 1081 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Cut-off Accrual Picking module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software:... | agpl-3.0 |
gsmartway/odoo | addons/account/report/account_general_ledger.py | 183 | 15416 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 CamptoCamp
# Copyright (c) 2006-2010 OpenERP S.A
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all po... | agpl-3.0 |
cchurch/ansible | lib/ansible/modules/cloud/google/gcp_mlengine_model.py | 7 | 11591 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
haad/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 |
Fanris/PySchedUI | PySchedGUI/UI/Menus/PathCompleter.py | 2 | 1417 | # -*- coding: utf-8 -*-
'''
Created on 2013-04-22 14:54
@summary:
@author: Martin predki
'''
from PySchedGUI.PySchedUI import FileUtils
import os
import readline
import atexit
class PathCompleter(object):
'''
@summary: Implements history path auto completion for all user input
'''
def __init__(s... | lgpl-3.0 |
sosy-lab/benchexec | benchexec/tools/tbf_testsuite_validator.py | 3 | 2508 | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import re
import benchexec.result as result
import benchexec.util as util
import benchexec... | apache-2.0 |
rhurkes/chasegame | venv/lib/python2.7/site-packages/rsa/cli.py | 79 | 12016 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | mit |
jswope00/GAI | common/test/acceptance/pages/studio/auto_auth.py | 10 | 2168 | """
Auto-auth page (used to automatically log in during testing).
"""
import re
import urllib
from bok_choy.page_object import PageObject
from . import BASE_URL
class AutoAuthPage(PageObject):
"""
The automatic authorization page.
When allowed via the django settings file, visiting
this url will crea... | agpl-3.0 |
Rasor1911/stagger | test/__init__.py | 16 | 1483 | #
# __init__.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#... | bsd-2-clause |
PHSTARS/hovercraft | hovercraft/__init__.py | 3 | 6030 | import argparse
import gettext
import os
import sys
import threading
import time
from collections import defaultdict
from http.server import HTTPServer, SimpleHTTPRequestHandler
from tempfile import TemporaryDirectory
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from .gene... | mit |
mrroach/CentralServer | csrv/model/cards/runner/card01020.py | 1 | 2867 | from csrv.model import actions
from csrv.model import timing_phases
from csrv.model.cards import card_info
from csrv.model.cards import event
class ChooseUnrezzedIce(timing_phases.BasePhase):
"""Choose unrezzed ice to force the corp to rez or trash it."""
DESCRIPTION = 'Choose unrezzed ice to force the corp to r... | apache-2.0 |
Nitaco/ansible | lib/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | 5 | 10551 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@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 |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/twisted/internet/test/test_newtls.py | 12 | 6693 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet._newtls}.
"""
from __future__ import division, absolute_import
from twisted.trial import unittest
from twisted.internet import interfaces
from twisted.internet.test.reactormixins import ReactorBuilder
from twiste... | gpl-2.0 |
mglukhikh/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/pl/forms.py | 273 | 5444 | """
Polish-specific form helpers
"""
import re
from django.forms import ValidationError
from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
class PLProvinceSelect(Select):
"""
A select widget with list of P... | apache-2.0 |
flumotion-mirror/flumotion | flumotion/test/test_component_httpserver_httpcached_httputils.py | 3 | 11944 | # -*- Mode: Python; test-case-name: flumotion.test.test_common -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified und... | lgpl-2.1 |
cs564/heron | third_party/pex/setup.py | 11 | 1509 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'CHANGES.rst')) as fp:
LONG_DESCRIPTION = fp.read()
# This seems to be a fairly standard ver... | apache-2.0 |
wpjesus/codematch | ietf/doc/lastcall.py | 1 | 2727 | # helpers for handling last calls on Internet Drafts
import datetime
from django.db.models import Q
from ietf.doc.models import Document, State, DocEvent, LastCallDocEvent, WriteupDocEvent
from ietf.doc.models import save_document_in_history
from ietf.doc.models import IESG_SUBSTATE_TAGS
from ietf.person.models impo... | bsd-3-clause |
pizcogirl/Astron | test/test_messagedirector.py | 4 | 21866 | #!/usr/bin/env python2
import unittest
from socket import *
from common.unittests import ProtocolTest
from common.astron import *
CONFIG = """\
messagedirector:
bind: 127.0.0.1:57123
connect: 127.0.0.1:57124
"""
class TestMessageDirector(ProtocolTest):
@classmethod
def setUpClass(cls):
listen... | bsd-3-clause |
mdietrichc2c/OCB | openerp/report/render/makohtml2html/makohtml2html.py | 443 | 4762 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
MIPS/external-chromium_org | tools/site_compare/drivers/win32/mouse.py | 189 | 6462 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""SiteCompare module for simulating mouse input.
This module contains functions that can be used to simulate a user
navigating us... | bsd-3-clause |
ticklemepierce/osf.io | scripts/prereg/reject_draft_registrations.py | 9 | 1717 | """ A script for testing DraftRegistrationApprovals. Automatically adds comments to and rejects
pending DraftRegistrationApprovals
"""
import sys
import logging
import datetime as dt
from website.app import init_app
from website.models import DraftRegistration, Sanction, User
logger = logging.getLogger(__name__)
logg... | apache-2.0 |
tylerjereddy/scipy | scipy/linalg/tests/test_decomp_update.py | 12 | 68330 | import itertools
import numpy as np
from numpy.testing import assert_, assert_allclose, assert_equal
from pytest import raises as assert_raises
from scipy import linalg
import scipy.linalg._decomp_update as _decomp_update
from scipy.linalg._decomp_update import qr_delete, qr_update, qr_insert
def assert_unitary(a, rt... | bsd-3-clause |
CourseTalk/edx-platform | cms/djangoapps/contentstore/tests/utils.py | 32 | 17927 | '''
Utilities for contentstore tests
'''
import json
import textwrap
from mock import Mock
from django.conf import settings
from django.contrib.auth.models import User
from django.test.client import Client
from opaque_keys.edx.locations import SlashSeparatedCourseKey, AssetLocation
from contentstore.utils import reve... | agpl-3.0 |
frenkowski/Tyrannus_Kernel_MM | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
manjunaths/tensorflow | tensorflow/python/training/server_lib_sparse_job_test.py | 133 | 1605 | # 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 |
kkdd/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/axscript/client/pydumper.py | 35 | 2124 | # pydumper.py
#
# This is being worked on - it does not yet work at all, in ay way
# shape or form :-)
#
# A new script engine, derived from the standard scripting engine,
# which dumps information.
# This generally can be used to grab all sorts of useful details about
# an engine - expose bugs in it or Python, dump t... | apache-2.0 |
urfonline/api | config/settings/base.py | 1 | 11017 | """
Django settings for api project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (api/config/settings/b... | mit |
hgl888/crosswalk-android-extensions | build/idl-generator/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py | 42 | 4812 | # Copyright (C) 2010 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 |
fintech-circle/edx-platform | openedx/core/djangoapps/embargo/migrations/0001_initial.py | 20 | 6043 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django_countries.fields
import django.db.models.deletion
from django.conf import settings
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration):
... | agpl-3.0 |
brian-l/django-1.4.10 | tests/modeltests/test_client/views.py | 39 | 7984 | from xml.dom.minidom import parseString
from django.contrib.auth.decorators import login_required, permission_required
from django.core import mail
from django.forms import fields
from django.forms.forms import Form
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
from django.shortcuts ... | bsd-3-clause |
caphrim007/ansible | test/units/parsing/utils/test_jsonify.py | 119 | 1499 | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
signalfx/Diamond | src/diamond/gmetric.py | 14 | 7363 | #!/usr/bin/env python
# coding=utf-8
# This is the MIT License
# http://www.opensource.org/licenses/mit-license.php
#
# Copyright (c) 2007,2008 Nick Galbreath
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal... | mit |
bussiere/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/sndhdr.py | 257 | 5973 | """Routines to help recognizing sound files.
Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.
The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- nu... | mit |
jshiv/turntable | test/lib/python2.7/site-packages/scipy/fftpack/setup.py | 20 | 1552 | #!/usr/bin/env python
# Created by Pearu Peterson, August 2002
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fftpack',parent_package, t... | mit |
crafty78/ansible | lib/ansible/modules/packaging/os/layman.py | 23 | 8066 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Jakub Jirutka <jakub@jirutka.cz>
#
# 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 Lice... | gpl-3.0 |
igboyes/virtool | virtool/pathoscope.py | 2 | 13498 | import collections
import copy
import csv
import math
import os
import shutil
def rescale_samscore(u, nu, max_score, min_score):
if min_score < 0:
scaling_factor = 100.0 / max_score - min_score
else:
scaling_factor = 100.0 / max_score
for read_index in u:
if min_score < 0:
... | mit |
itpubs/reflecting | apps/users/views.py | 1 | 7234 | from django.shortcuts import render, HttpResponseRedirect, reverse, HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.hashers import make_password
from django.contrib.auth.backends import ModelBackend
from users.models... | mit |
ably-forks/node-gyp | gyp/test/variables/filelist/gyptest-filelist.py | 102 | 1583 | #!/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.
"""
Test variable expansion of '<|(list.txt ...)' syntax commands.
"""
import os
import sys
import TestGyp
test = TestGyp.TestGyp(format=... | mit |
ahmed-mahran/hue | desktop/core/ext-py/lxml/src/lxml/tests/test_dtd.py | 30 | 4579 | # -*- coding: utf-8 -*-
"""
Test cases related to DTD parsing and validation
"""
import unittest, sys, os.path
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, StringIO, BytesIO, _bytes, doctest
from common_imports ... | apache-2.0 |
AOSPU/external_chromium_org | tools/telemetry/telemetry/core/platform/power_monitor/monsoon_power_monitor.py | 11 | 4251 | # 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 json
import multiprocessing
import tempfile
import time
from telemetry.core import exceptions
from telemetry.core.platform.profiler import monsoon
im... | bsd-3-clause |
nortikin/sverchok | node_scripts/SNLite_templates/demo/recursive_subdivision.py | 1 | 1833 | """
in quad_verts v
in quad_faces s
in seed s d=1 n=2
in random_factor s d=0.1 n=2
in iterations s d=1 n=2
out verts v
out edges s
out faces s
"""
from sverchok.utils.modules.geom_utils import interp_v3_v3v3 as lerp
from sverchok.utils.sv_mesh_utils import mesh_join
from sverchok.utils.sv_bmesh_utils import remove_dou... | gpl-3.0 |
imclab/ckanext-comments | ckanext/comments/tests/logic/test_threads.py | 2 | 2933 | from nose.tools import assert_raises
from pylons import config
import ckan.model as model
from ckan.logic import get_action, NotAuthorized
import ckanext.comments.tests.test_data as test_data
class TestCommentThread(object):
@classmethod
def setup_class(cls):
model.repo.new_revision()
test_d... | gpl-3.0 |
larrybradley/astropy | astropy/stats/bls/__init__.py | 12 | 2112 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# The BoxLeastSquares periodogram functionality has been moved to
# astropy.timeseries.periodograms.bls. The purpose of this file is to provide backward-
# compatibility during a transition phase. We can't emit a deprecation warning
# simply on import of ... | bsd-3-clause |
objmagic/heron | heron/common/tests/python/utils/communicator_unittest.py | 10 | 2048 | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
lizzha/azure-linux-extensions | CustomScript/azure/http/batchclient.py | 47 | 13769 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/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>.+?)
(-... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.