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 |
|---|---|---|---|---|---|
ptisserand/ansible | lib/ansible/template/vars.py | 39 | 4935 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
samuel1208/scikit-learn | sklearn/metrics/scorer.py | 211 | 13141 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
ennoborg/gramps | gramps/plugins/textreport/recordsreport.py | 9 | 13718 | # encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program - Records plugin
#
# Copyright (C) 2008-2011 Reinhard Müller
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2012 Brian G. Matherly
# Copyright (C) 2013-2016 Paul Franklin
#
# This program is free software; you can redistribute it and/or mod... | gpl-2.0 |
axiom-data-science/paegan | paegan/cdm/dsg/collections/base/nested_point_collection.py | 3 | 1754 | import itertools
import collections
from paegan.cdm.dsg.collections.base.feature_collection import FeatureCollection
from paegan.cdm.dsg.collections.base.point_collection import PointCollection
from paegan.cdm.dsg.features.base.point import Point
from paegan.utils.asalist import AsaList
class NestedPointCollection(Fe... | gpl-3.0 |
chrisnatali/networkx | networkx/linalg/tests/test_algebraic_connectivity.py | 54 | 10790 | from contextlib import contextmanager
from math import sqrt
import networkx as nx
from nose import SkipTest
from nose.tools import *
methods = ('tracemin_pcg', 'tracemin_chol', 'tracemin_lu', 'lanczos', 'lobpcg')
try:
from numpy.random import get_state, seed, set_state, shuffle
@contextmanager
def save_r... | bsd-3-clause |
nfletton/django-oscar | src/oscar/apps/dashboard/views.py | 32 | 7437 | from datetime import timedelta
from decimal import Decimal as D, ROUND_UP
from django.utils.timezone import now
from django.views.generic import TemplateView
from oscar.core.loading import get_model
from django.db.models import Avg, Sum, Count
from oscar.core.compat import get_user_model
from oscar.apps.promotions.mo... | bsd-3-clause |
iitjee/steppinsPython | SystemProgramming/Parallel System/00 intro.py | 1 | 2190 | Most computers spend a lot of time doing nothing. If you start a system monitor tool and watch the CPU utilization, you’ll see
what I mean—it’s rare to see one hit 100 percent, even when you are running multiple programs.* There are just too many delays
built into software: disk accesses, network traffic, database qu... | gpl-3.0 |
jc0n/scrapy | tests/test_utils_signal.py | 121 | 2741 | from testfixtures import LogCapture
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet import defer, reactor
from pydispatch import dispatcher
from scrapy.utils.signal import send_catch_log, send_catch_log_deferred
class SendCatchLogTest(unittest.TestCase):
@defe... | bsd-3-clause |
Dino0631/RedRain-Bot | cogs/lib/youtube_dl/extractor/orf.py | 17 | 10860 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
HEADRequest,
unified_strdate,
strip_jsonp,
int_or_none,
float_or_none,
determine_ext,
remove_end,
unescapeHTML,
)
class ORFTVthekI... | gpl-3.0 |
Viktor-Evst/fixed-luigi | luigi/tools/luigi_grep.py | 12 | 2854 | #!/usr/bin/env python
import argparse
import json
from collections import defaultdict
from luigi import six
from luigi.six.moves.urllib.request import urlopen
class LuigiGrep(object):
def __init__(self, host, port):
self._host = host
self._port = port
@property
def graph_url(self):
... | apache-2.0 |
PythonScanClient/PyScanClient | Test/test_commands.py | 1 | 14881 | from __future__ import print_function
import unittest
import xml.etree.ElementTree as ET
from scan.commands import *
# These tests compare the XML as strings, even though for example
# both "<comment><text>Hello</text></comment>"
# and "<comment>\n <text>Hello</text>\n</comment>"
# would be acceptable XML representat... | epl-1.0 |
GHsimone/LCCS3basicCoder | __init__.py | 1 | 1622 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
LCCS3_BasicCoder
A QGIS plugin
The plugin loads a LCCS3 legend, creates a form with all LCCS3 classes and allows the user to code selected polygons
---... | gpl-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-iothub/azure/mgmt/iothub/operations/certificates_operations.py | 2 | 23304 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
sergio-incaser/odoo | addons/point_of_sale/report/__init__.py | 381 | 1238 | # -*- 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 |
odootr/odoo | addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py | 337 | 3434 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
slyphon/pants | src/python/pants/backend/python/register.py | 5 | 2297 | # 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)
from pants.backend.c... | apache-2.0 |
thinkopensolutions/geraldo | site/newsite/django_1_0/tests/regressiontests/humanize/tests.py | 19 | 3125 | import unittest
from datetime import timedelta, date
from django.template import Template, Context, add_to_builtins
from django.utils.dateformat import DateFormat
from django.utils.translation import ugettext as _
from django.utils.html import escape
add_to_builtins('django.contrib.humanize.templatetags.humanize')
cl... | lgpl-3.0 |
girving/tensorflow | tensorflow/python/ops/distributions/beta.py | 6 | 14810 | # 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 |
jerowe/bioconda-recipes | recipes/biopet-vcfstats/1.2/biopet-vcfstats.py | 80 | 3367 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-vcfstats JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/pep... | mit |
YuriGural/erpnext | erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py | 10 | 10589 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe, erpnext
import frappe.defaults
from frappe.utils import cint, flt, cstr, today
from erpnext.stock.doctype.purchase_recei... | gpl-3.0 |
yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/zeitgeist/mimetypes.py | 3 | 10501 | # -.- coding: utf-8 -.-
# Zeitgeist
#
# Copyright © 2010 Markus Korn <thekorn@gmx.de>
# Copyright © 2010 Canonical Ltd.
# By Mikkel Kamstrup Erlandsen <mikkel.kamstrup@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public L... | mit |
sodafree/backend | build/lib.linux-i686-2.7/django/contrib/gis/tests/distapp/tests.py | 96 | 19051 | from __future__ import absolute_import
from django.db import connection
from django.db.models import Q
from django.contrib.gis.geos import GEOSGeometry, LineString
from django.contrib.gis.measure import D # alias for Distance
from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatial... | bsd-3-clause |
davidvon/pipa-pay-server | admin/api/cards.py | 1 | 18567 | # -*- coding: utf-8 -*-
import datetime
import time
import traceback
from flask import request
from flask.ext.restful import Resource
from api import API_PREFIX
from api.order import create_order
from app import restful_api, db, logger
from cache.order import cache_qrcode_code, get_cache_order
from cache.weixin impor... | apache-2.0 |
ntt-sic/nova | nova/tests/api/openstack/compute/contrib/test_cloudpipe_update.py | 27 | 2817 | # Copyright 2012 IBM Corp.
#
# 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 t... | apache-2.0 |
shadowmint/nwidget | lib/pyglet-1.4.4/contrib/wydget/wydget/widgets/progress.py | 29 | 1570 | from pyglet.gl import *
from wydget import loadxml
from wydget import util
from wydget.widgets.label import Label
class Progress(Label):
name = 'progress'
def __init__(self, parent, value=0.0, show_value=True,
bar_color='gray', bgcolor=(.3, .3, .3, 1), color='white',
width=None, height... | apache-2.0 |
winndows/cinder | cinder/db/sqlalchemy/migrate_repo/versions/034_volume_type_add_desc_column.py | 31 | 1274 | # 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 |
faun/django_test | build/lib/django/template/loader.py | 16 | 8033 | # Wrapper for loading templates from storage of some sort (e.g. filesystem, database).
#
# This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use.
# Each loader is expected to have this interface:
#
# callable(name, dirs=[])
#
# name is the template name.
# dirs is an optional list of directories ... | bsd-3-clause |
StanislavQA/python_task | timeweb2.py | 1 | 2037 | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
import unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class timeweb2(unittest.TestCase):
def setUp(self):
self.wd = WebDriver()
sel... | apache-2.0 |
Lilykos/inspire-next | inspire/modules/workflows/views/holdingpen_edit.py | 1 | 3372 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2015 CERN.
#
# INSPIRE is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
ljwolf/pysal | pysal/spreg/ml_error.py | 6 | 19663 | """
ML Estimation of Spatial Error Model
"""
__author__ = "Luc Anselin luc.anselin@asu.edu,\
Serge Rey srey@asu.edu, \
Levi Wolf levi.john.wolf@asu.edu"
import numpy as np
import numpy.linalg as la
from scipy import sparse as sp
from scipy.sparse.linalg import splu as SuperLU
import pysal ... | bsd-3-clause |
electron/libchromiumcontent | script/lib/filesystem.py | 2 | 1582 | """Filesystem related helper functions.
"""
import contextlib
import errno
import os
import shutil
import sys
import tarfile
import tempfile
import urllib2
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
def rm_f(path):
try:
os.remove(path)
... | mit |
sharpdeep/seafile | scripts/upgrade/db_update_helper.py | 18 | 10798 | #coding: UTF-8
import sys
import os
import ConfigParser
import glob
HAS_MYSQLDB = True
try:
import MySQLdb
except ImportError:
HAS_MYSQLDB = False
HAS_SQLITE3 = True
try:
import sqlite3
except ImportError:
HAS_SQLITE3 = False
class EnvManager(object):
def __init__(self):
self.upgrade_dir... | gpl-2.0 |
ic-hep/DIRAC | DataManagementSystem/scripts/dirac-admin-user-quota.py | 9 | 1201 | #!/usr/bin/env python
########################################################################
# $HeadURL$
########################################################################
__RCSID__ = "$Id$"
import DIRAC
from DIRAC.Core.Base import Script
Script.setUsageMessage( """
Show storage quotas for specified users or f... | gpl-3.0 |
cmbclh/vnpy1.7 | vnpy/trader/gateway/ltsGateway/ltsGateway.py | 7 | 47839 | # encoding: UTF-8
'''
vn.lts的gateway接入
'''
import os
import json
from vnpy.api.lts import MdApi, QryApi, TdApi, defineDict
from vnpy.trader.vtFunction import getTempPath, getJsonPath
from vnpy.trader.vtGateway import *
# 以下为一些VT类型和LTS类型的映射字典
# 价格类型映射
priceTypeMap= {}
priceTypeMap[PRICETYPE_LIMITPRICE] = defineDict... | mit |
FedoraScientific/salome-kernel | src/KERNEL_PY/iparameters.py | 1 | 9144 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | lgpl-2.1 |
vigilv/scikit-learn | sklearn/datasets/base.py | 196 | 18554 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import shutil
from os import environ
from os.pa... | bsd-3-clause |
google-research/robel | robel/robot_env.py | 1 | 21356 | # Copyright 2019 The ROBEL 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 applicable law or agreed to in wr... | apache-2.0 |
rismalrv/edx-platform | common/lib/xmodule/xmodule/peer_grading_module.py | 56 | 29601 | import json
import logging
from datetime import datetime
from django.utils.timezone import UTC
from lxml import etree
from pkg_resources import resource_string
from xblock.fields import Dict, String, Scope, Boolean, Float, Reference
from xmodule.capa_module import ComplexEncoder
from xmodule.fields import Date, Tim... | agpl-3.0 |
CallaJun/hackprince | indico/numpy/polynomial/tests/test_hermite_e.py | 123 | 17069 | """Tests for hermite_e module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.hermite_e as herme
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run... | lgpl-3.0 |
Ayrx/cryptography | src/_cffi_src/commoncrypto/cf.py | 8 | 3224 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <CoreFoundation/CoreFoundation.h>
"""
TYPES = ""... | bsd-3-clause |
kingmotley/SickRage | sickbeard/providers/torrentproject.py | 1 | 4736 | # coding=utf-8
# Author: Gonçalo M. (aka duramato/supergonkas) <supergonkas@gmail.com>
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 Fo... | gpl-3.0 |
sidartaoliveira/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py | 33 | 5092 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
refstudycentre/versification | util.py | 1 | 11774 |
import numpy as np
import unicodecsv
import codecs
import goslate
import sqlite3
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
def imp_load(filename):
texts = []
books = []
chapters = []
verses = []
# Read in a whole bible
w... | gpl-2.0 |
msabramo/github3.py | github3/git.py | 5 | 6891 | # -*- coding: utf-8 -*-
"""
github3.git
===========
This module contains all the classes relating to Git Data.
See also: http://developer.github.com/v3/git/
"""
from __future__ import unicode_literals
from json import dumps
from base64 import b64decode
from .models import GitHubObject, GitHubCore, BaseCommit
from .u... | bsd-3-clause |
oesteban/mriqc | mriqc/qc/anatomical.py | 1 | 21553 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
# pylint: disable=no-member
r"""
Measures based on noise measurements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _iqms_cjv:
- :py:func:`~mriqc.qc.anatomical.cj... | bsd-3-clause |
analogdevicesinc/gnuradio | gr-analog/examples/fmtest.py | 40 | 7941 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 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 ... | gpl-3.0 |
eng-tools/sfsimodels | tests/test_interaction.py | 1 | 2586 | from sfsimodels import models
import sfsimodels as sm
import json
import numpy as np
def test_link_building_and_soil():
number_of_storeys = 6
interstorey_height = 3.4 # m
n_bays = 3
fb = models.FrameBuilding(number_of_storeys, n_bays)
fb.id = 1
fb.interstorey_heights = interstorey_height * n... | mit |
incaser/odoo-odoo | addons/l10n_de/__init__.py | 693 | 1057 | # -*- encoding: 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 t... | agpl-3.0 |
stianvi/ansible-modules-core | cloud/openstack/os_object.py | 58 | 4111 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... | gpl-3.0 |
philoniare/horizon | openstack_dashboard/test/integration_tests/tests/test_sahara_image_registry.py | 37 | 2145 | # 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 |
tensorflow/agents | tf_agents/replay_buffers/replay_buffer.py | 1 | 13019 | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
vitaly4uk/django | django/contrib/gis/db/backends/spatialite/base.py | 445 | 3615 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper,
)
from django.utils import six
from .client import SpatiaL... | bsd-3-clause |
salguarnieri/intellij-community | python/lib/Lib/xml/sax/__init__.py | 117 | 3413 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | apache-2.0 |
keisuke-umezawa/chainer | tests/chainer_tests/initializer_tests/test_constant.py | 4 | 3718 | import unittest
from chainer import backend
from chainer.backends import cuda
from chainer import initializers
from chainer import testing
from chainer.testing import attr
import numpy
@testing.parameterize(*testing.product({
'dtype': [numpy.float16, numpy.float32, numpy.float64],
}))
class TestIdentity(unittest... | mit |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Lib/xml/dom/minicompat.py | 209 | 3330 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | gpl-3.0 |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/distutils/core.py | 80 | 8909 | """distutils.core
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script). Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""
import os
import sys
... | lgpl-3.0 |
skuarch/namebench | nb_third_party/dns/tsigkeyring.py | 248 | 1658 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
kemalakyol48/python-for-android | python-modules/twisted/twisted/news/database.py | 49 | 33743 | # -*- test-case-name: twisted.news.test -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
News server backend implementations.
"""
import getpass, pickle, time, socket
import os
import StringIO
from email.Message import Message
from email.Generator import Generator
from zope.in... | apache-2.0 |
Dellware78/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
gladk/palabos | scons/scons-local-2.1.0/SCons/Tool/sgicc.py | 21 | 1878 | """SCons.Tool.sgicc
Tool-specific initialization for MIPSPro cc on SGI.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The ... | agpl-3.0 |
hujiajie/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/power_monitor/cros_power_monitor.py | 17 | 6081 | # 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 collections
import logging
import re
from telemetry import decorators
from telemetry.internal.platform.power_monitor import sysfs_power_monitor
cla... | bsd-3-clause |
dongritengfei/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/botinfo_unittest.py | 121 | 2047 | # 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 |
edbrannin/Robotframework-SQLAlchemy-Library | src/SQLAlchemyLibrary/__init__.py | 1 | 2769 | # Copyright (c) 2010 Franz Allan Valencia See
#
# 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... | apache-2.0 |
sv-dev1/odoo | addons/mrp_repair/__init__.py | 380 | 1087 | # -*- 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... | agpl-3.0 |
ibladesi/TF101-HighOC-3P2 | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(... | gpl-2.0 |
jakirkham/nanshe | nanshe/registerer.py | 3 | 5569 | """
The ``registerer`` module allows the registration algorithm to be run.
===============================================================================
Overview
===============================================================================
The ``main`` function actually starts the algorithm and can be called
exter... | bsd-3-clause |
diegocortassa/TACTIC | 3rd_party/site-packages/pytz/__init__.py | 5 | 34206 | '''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
import sys
import datetime
import os.path
from pytz.exceptions import AmbiguousTim... | epl-1.0 |
EvanK/ansible | lib/ansible/modules/net_tools/nios/nios_naptr_record.py | 68 | 5884 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
elinebakker/paparazzi | sw/tools/calibration/report_imu_scaled.py | 24 | 4378 | #! /usr/bin/env python
# This file is part of Paparazzi.
#
# Paparazzi 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 (at your option)
# any later version.
#
# Paparazzi is distributed i... | gpl-2.0 |
jaimahajan1997/sympy | sympy/functions/special/gamma_functions.py | 22 | 32460 | from __future__ import print_function, division
from sympy.core import Add, S, sympify, oo, pi, Dummy
from sympy.core.function import Function, ArgumentIndexError
from sympy.core.numbers import Rational
from sympy.core.power import Pow
from sympy.core.compatibility import range
from .zeta_functions import zeta
from .e... | bsd-3-clause |
synctree/synctree-awsebcli | ebcli/operations/deployops.py | 1 | 1403 | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | apache-2.0 |
diego-d5000/MisValesMd | env/lib/python2.7/site-packages/MySQLdb/times.py | 76 | 3488 | """times module
This module provides some Date and Time classes for dealing with MySQL data.
Use Python datetime module to handle date and time columns."""
import math
from time import localtime
from datetime import date, datetime, time, timedelta
from _mysql import string_literal
Date = date
Time = tim... | mit |
Esri/ArcREST | samples/update_user_password.py | 5 | 1203 | """
Update a users passwords
version 3.5.x
Python 2/3
"""
from __future__ import print_function
from arcresthelper import securityhandlerhelper
import arcrest
if __name__ == "__main__":
username = ''# Username
proxy_port = None
proxy_url = None
securityinfo = {}
securityinfo['security_... | apache-2.0 |
ghchinoy/tensorflow | tensorflow/contrib/timeseries/examples/known_anomaly.py | 24 | 7880 | # 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 |
infoxchange/lettuce | tests/integration/lib/Django-1.3/django/utils/log.py | 152 | 3494 | import logging
import sys
from django.core import mail
# Make sure a NullHandler is available
# This was added in Python 2.7/3.2
try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
# Make sure that dictConfig is availabl... | gpl-3.0 |
haniehrajabi/ryu | ryu/app/simple_isolation.py | 22 | 14069 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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 |
ezequielpereira/Time-Line | libs64/wx/lib/pubsub/core/topicexc.py | 9 | 3557 | '''
:copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE.txt for details.
'''
from topicutils import stringize
class ListenerNotValidatable(RuntimeError):
'''
Raised when an attempt is made to validate a listener relative to a
topic that doesn't have (y... | gpl-3.0 |
naliboff/dealii | contrib/python-bindings/tests/cell_accessor_wrapper.py | 17 | 3314 | # ---------------------------------------------------------------------
#
# Copyright (C) 2016 by the deal.II authors
#
# This file is part of the deal.II library.
#
# The deal.II library is free software; you can use it, redistribute
# it, and/or modify it under the terms of the GNU Lesser General
# Public License as ... | lgpl-2.1 |
maciekcc/tensorflow | tensorflow/tools/test/system_info_lib.py | 101 | 4760 | # 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 |
t794104/ansible | lib/ansible/modules/network/fortios/fortios_firewall_policy6.py | 24 | 37823 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
skjena/Assemblyx86 | triMatMult/result.py | 9 | 1238 | class Result(object):
"""
a wrapper to contain the results of a test
@testName: the name of the test run
@correct: True if the output of matched the solution; False otherwise
@timeTaken is either
the number of seconds it took the program to run
'Timed Out' if the program took too long to compl... | gpl-2.0 |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/scipy/io/matlab/tests/test_streams.py | 109 | 5442 | """ Testing
"""
from __future__ import division, print_function, absolute_import
import os
import sys
import zlib
from io import BytesIO
if sys.version_info[0] >= 3:
cStringIO = BytesIO
else:
from cStringIO import StringIO as cStringIO
from tempfile import mkstemp
import numpy as np
from numpy.testing i... | mit |
ArvinDevel/incubator-pulsar | dashboard/django/stats/migrations/0001_initial.py | 13 | 11195 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-21 21:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | apache-2.0 |
lorisercole/thermocepstrum | thermocepstrum/i_o/read_lammps_dump.py | 1 | 19682 | # -*- coding: utf-8 -*-
################################################################################
###
### ReadLAMMPSDump - v0.1.8 - May 03, 2018
###
################################################################################
###
### a package to read LAMMPS Dump files
### (it assumes that the data colu... | gpl-3.0 |
coruus/pyasn1-modules | tools/pkcs10dump.py | 26 | 1109 | #!/usr/bin/python
#
# Read ASN.1/PEM X.509 certificate requests (PKCS#10 format) on stdin,
# parse each into plain text, then build substrate from it
#
from pyasn1.codec.der import decoder, encoder
from pyasn1_modules import rfc2314, pem
import sys
if len(sys.argv) != 1:
print("""Usage:
$ cat certificateRequest.p... | bsd-2-clause |
petecummings/django-cms | cms/tests/test_publisher.py | 32 | 44420 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from djangocms_text_ckeditor.models import Text
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.management.base import CommandError
from django.core.management ... | bsd-3-clause |
KamranMackey/CloudBot | plugins/wordnik.py | 4 | 6404 | import re
import random
import requests
import urllib.parse
from cloudbot import hook
from cloudbot.util import web
API_URL = 'http://api.wordnik.com/v4/'
WEB_URL = 'https://www.wordnik.com/words/{}'
ATTRIB_NAMES = {
'ahd-legacy': 'AHD/Wordnik',
'century': 'Century/Wordnik',
'wiktionary': 'Wiktionary/W... | gpl-3.0 |
sserrot/champion_relationships | venv/Lib/site-packages/pip/_vendor/ipaddress.py | 30 | 79875 | # 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 |
glatard/nipype | nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py | 9 | 1577 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import BinaryMaths
def test_BinaryMaths_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=... | bsd-3-clause |
zooba/PTVS | Python/Templates/Django/ProjectTemplates/Python/Web/StarterDjangoProject/project-wsgi.py | 10 | 1121 | """
WSGI config for $safeprojectname$ project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPL... | apache-2.0 |
leesavide/pythonista-docs | Documentation/matplotlib/mpl_examples/api/custom_scale_example.py | 9 | 6401 | from __future__ import unicode_literals
import numpy as np
from numpy import ma
from matplotlib import scale as mscale
from matplotlib import transforms as mtransforms
from matplotlib.ticker import Formatter, FixedLocator
class MercatorLatitudeScale(mscale.ScaleBase):
"""
Scales data in range -pi/2 to pi/2 (... | apache-2.0 |
strahlex/machinekit | src/emc/usr_intf/gscreen/keybindings.py | 28 | 3632 | # Gscreen is Copyright (c) 20013 Chris Morley
#
# Gscreen is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Gscreen is distributed i... | lgpl-2.1 |
LEXmono/q | urllib3/contrib/ntlmpool.py | 312 | 4478 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
from __future__ import absolute_import
from logging import getLogger
from ntlm import ntlm
from .. import HTTPSConnectionPool
from ..packages.six.moves.http_client import HTTPSConnecti... | apache-2.0 |
MAECProject/MAECProject.github.io | documentation/idioms/av_classification/maec_av_classification.py | 1 | 1818 | # Code for MAEC AV Classification Idiom
from maec.package.package import Package
from maec.package.malware_subject import MalwareSubject
from maec.package.analysis import Analysis
from maec.bundle.bundle import Bundle
from maec.bundle.av_classification import AVClassification
from cybox.core import Object
from cybox.ob... | bsd-3-clause |
borosnborea/SwordGO_app | example/kivymap/.buildozer/venv/lib/python2.7/site-packages/pip/_vendor/distlib/version.py | 132 | 23711 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Implementation of a flexible versioning scheme providing support for PEP-440,
setuptools-compatible and semantic versioning.
"""
import logging
import re
from .compat import string_types
... | gpl-3.0 |
halvertoluke/edx-platform | common/djangoapps/student/tests/test_reset_password.py | 34 | 11864 | """
Test the various password reset flows
"""
import json
import re
import unittest
from django.core.cache import cache
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.contrib.auth.hashers import UNU... | agpl-3.0 |
christiandev/l10n-brazil | __unported__/l10n_br_account_product/sped/nfe/validator/txt.py | 2 | 12103 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2012 Renato Lima - Akretion #
# ... | agpl-3.0 |
arthurdarcet/riverrun | riverrun/http/utils.py | 1 | 1593 | import bson
import cherrypy
import functools
import json
import logging
import traceback
logger = logging.getLogger(__name__)
def json_exposed(fn):
@cherrypy.expose
@functools.wraps(fn)
def wrapper(*args, **kwargs):
try:
code = 200
value = fn(*args, **kwargs)
excep... | mit |
tow/dnspython | tests/test_rrset.py | 59 | 2282 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | isc |
tudorvio/tempest | tempest/api/volume/test_volumes_list.py | 10 | 9131 | # Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/LIC... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.