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 |
|---|---|---|---|---|---|
knowsis/django | tests/mail/tests.py | 48 | 36821 | # coding: utf-8
from __future__ import unicode_literals
import asyncore
from email.mime.text import MIMEText
import os
import shutil
import smtpd
import sys
import tempfile
import threading
from django.core import mail
from django.core.mail import (EmailMessage, mail_admins, mail_managers,
EmailMultiAlternati... | bsd-3-clause |
IONISx/edx-platform | openedx/core/lib/extract_tar.py | 135 | 2427 | """
Safe version of tarfile.extractall which does not extract any files that would
be, or symlink to a file that is, outside of the directory extracted in.
Adapted from:
http://stackoverflow.com/questions/10060069/safely-extract-zip-or-tar-using-python
"""
from os.path import abspath, realpath, dirname, join as joinpa... | agpl-3.0 |
zchking/odoo | addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py | 391 | 1308 | #
# Use this module to retrive the fields you need according to the type
# of the OpenOffice operation:
# * Insert a Field
# * Insert a RepeatIn
#
import xmlrpclib
import time
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
def get(object, level=3, ending=None, ending_excl=None, recur=None, roo... | agpl-3.0 |
EliteTK/PyBot | Modules/requests/packages/urllib3/util/retry.py | 699 | 9924 | import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Re... | gpl-3.0 |
samthor/intellij-community | python/lib/Lib/_strptime.py | 90 | 19538 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | apache-2.0 |
vitorio/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/api.py | 359 | 2965 | """Import this module for easy access to TLS Lite objects.
The TLS Lite API consists of classes, functions, and variables spread
throughout this package. Instead of importing them individually with::
from tlslite.TLSConnection import TLSConnection
from tlslite.HandshakeSettings import HandshakeSettings
f... | apache-2.0 |
kitefishlabs/CorpusDB2 | corpusdb2/nodegraph.py | 1 | 6336 | # nodegraph.py - nodegraphs
# CorpusDB2 - Corpus-based processing for audio.
"""
Graph of Nodes.
Nodes encapsulate audio processsing.
1:M relationship to source file (optional).
1:1 relationship to (potential) DataCollections.
"""
__version__ = '1.0'
__author__ = 'Thomas Stoll'
__copyright__... | gpl-3.0 |
blackbliss/callme | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langthaimodel.py | 2930 | 11275 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
hynekcer/django | tests/admin_inlines/models.py | 276 | 6824 | """
Testing of admin inline formsets.
"""
from __future__ import unicode_literals
import random
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@pyt... | bsd-3-clause |
giacomov/3ML | threeML/utils/spectrum/pha_spectrum.py | 1 | 34989 | from __future__ import division
from builtins import range
from past.utils import old_div
import collections
import astropy.io.fits as fits
import numpy as np
import os
import warnings
import six
from threeML.io.progress_bar import progress_bar
from threeML.utils.OGIP.response import OGIPResponse, InstrumentResponse... | bsd-3-clause |
pjuu/pjuu | tests/test_parser.py | 1 | 5540 | # -*- coding: utf8 -*-
"""Post backend tests.
:license: AGPL v3, see LICENSE for more details
:copyright: 2014-2021 Joe Doherty
"""
from pjuu.auth.backend import create_account, activate
from pjuu.lib.parser import (parse_hashtags, parse_links, parse_mentions,
parse_post)
from tests im... | agpl-3.0 |
hunch/hunch-gift-app | django/contrib/gis/db/backends/postgis/creation.py | 12 | 2905 | from django.conf import settings
from django.db.backends.postgresql.creation import DatabaseCreation
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_opts = 'GIST_GEOMETRY_OPS'
def sql_indexes_for_field(self, model, f, style):
"Return any spatial index creation ... | mit |
PiafPowaz/MultiCode | multicode.py | 1 | 2682 | #DEFINE_TYPE_CODE#py
#sDEFINE_TYPE_CODE#py
# -*- coding: utf-8 -*-
import platform
import os
def main():
if int(platform.python_version_tuple()[0]) < 3:
fullPathFile = raw_input("File's path :")
else:
fullPathFile = input("File's path :")
pathFileNoExt = fullPathFile.split('.')[0]
nameFileNoExt = p... | gpl-3.0 |
nigelb/simpleui | simpleui/cli_impl/impl.py | 1 | 2102 | # simpleui implements a number of simple UI patterns with fallback to CLI if the
# selected GUI fails.
#
# Copyright (C) 2012 NigelB
#
# 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 vers... | gpl-3.0 |
lowitty/sendtrap | lib/pysnmp/entity/rfc3413/ntforg.py | 3 | 16905 | import sys
from pyasn1.compat.octets import null
from pysnmp.entity.rfc3413 import config
from pysnmp.proto.proxy import rfc2576
from pysnmp.proto.api import v2c
from pysnmp.proto import error
from pysnmp import nextid
from pysnmp import debug
getNextHandle = nextid.Integer(0x7fffffff)
class NotificationOriginator:
... | mit |
40223148/2015cda_g5 | static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py | 735 | 35170 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | gpl-3.0 |
kosgroup/odoo | addons/stock/models/stock_location.py | 4 | 13345 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil import relativedelta
from odoo import api, fields, models, _
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class Location(models.Model):
_name = "stock.location"... | gpl-3.0 |
sfluo/Mr.Bot | crypto/pycrypto-2.6/build/lib.macosx-10.7-intel-2.7/Crypto/Hash/hashalgo.py | 124 | 3984 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | bsd-3-clause |
reddraggone9/youtube-dl | youtube_dl/extractor/infoq.py | 92 | 2315 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urlparse,
)
class InfoQIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?infoq\.com/(?:[^/]+/)+(?P<id>[^/]+)'
_TESTS = [{
'url': 'http://www.... | unlicense |
phoenixstar7/libsvm | tools/subset.py | 124 | 3202 | #!/usr/bin/env python
import os, sys, math, random
from collections import defaultdict
if sys.version_info[0] >= 3:
xrange = range
def exit_with_help(argv):
print("""\
Usage: {0} [options] dataset subset_size [output1] [output2]
This script randomly selects a subset of the dataset.
options:
-s method : method of... | bsd-3-clause |
anaran/kuma | vendor/packages/translate/filters/test_prefilters.py | 33 | 1123 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""tests decoration handling functions that are used by checks"""
from translate.filters import prefilters
def test_removekdecomments():
assert prefilters.removekdecomments(u"Some sṱring") == u"Some sṱring"
assert prefilters.removekdecomments(u"_: Commenṱ\\n\nSo... | mpl-2.0 |
hpcloud-mon/tempest | tempest/api_schema/response/compute/version.py | 16 | 2153 | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 |
peiyuwang/pants | tests/python/pants_test/backend/python/tasks/interpreter_cache_test_mixin.py | 17 | 1196 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
class In... | apache-2.0 |
implemento/domino | app/app/urls.py | 1 | 1107 | from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
# Serializers define the API representation.
class UserSerializer(serializers.HyperlinkedModelSeria... | gpl-3.0 |
dimmddr/roadSignsNN | prepare_images.py | 1 | 8513 | import cv2
import matplotlib.pyplot as plt
import numpy as np
from numpy.lib.stride_tricks import as_strided
import nn
from settings import COVER_PERCENT
IMG_WIDTH = 1025
IMG_HEIGHT = 523
IMG_LAYERS = 3
SUB_IMG_WIDTH = 48
SUB_IMG_HEIGHT = 48
SUB_IMG_LAYERS = 3
WIDTH = 2
HEIGHT = 1
LAYERS = 0
XMIN = 0
YMIN = 1
XMAX ... | mit |
ZHAW-INES/rioxo-uClinux-dist | user/python/python-2.4.4/Lib/test/test_operations.py | 5 | 2028 | # Python test set -- part 3, built-in operations.
print '3. Operations'
print 'XXX Mostly not yet implemented'
print '3.1 Dictionary lookups succeed even if __cmp__() raises an exception'
class BadDictKey:
already_printed_raising_error = 0
def __hash__(self):
return hash(self.__class__)
def _... | gpl-2.0 |
eric-haibin-lin/mxnet | example/profiler/profiler_ndarray.py | 27 | 11345 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
coreos/autotest | client/setup.py | 3 | 2278 | from distutils.core import setup
import os
try:
import autotest.common as common
except ImportError:
import common
from autotest.client.shared import version
# Mostly needed when called one level up
if os.path.isdir('client'):
client_dir = 'client'
else:
client_dir = '.'
autotest_dir = os.path.join(... | gpl-2.0 |
throoze/SongStore | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
leafjungle/luigi | luigi/mock.py | 48 | 5473 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
jsrudani/HadoopHDFSProject | dev-support/relnotes.py | 62 | 7865 | #!/usr/bin/python
# 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, sof... | apache-2.0 |
wlach/treeherder | treeherder/model/error_summary.py | 2 | 8237 | import json
import logging
import re
from django.conf import settings
from django.core.urlresolvers import reverse
logger = logging.getLogger(__name__)
LEAK_RE = re.compile(r'\d+ bytes leaked \((.+)\)$')
CRASH_RE = re.compile(r'.+ application crashed \[@ (.+)\]$')
MOZHARNESS_RE = re.compile(
r'^\d+:\d+:\d+[ ]+(... | mpl-2.0 |
ambitioninc/kmatch | kmatch/tests/mixin_tests.py | 1 | 1208 | import unittest
from kmatch import KmatchTestMixin
class MixinTestUsingMixin(KmatchTestMixin, unittest.TestCase):
def test_matches(self):
"""
Test .assertMatches() using the mixin on a true match
"""
self.assertKmatches(['<=', 'f', 0], {'f': -1})
def test_matches_raises_erro... | mit |
mrkm4ntr/incubator-airflow | tests/test_utils/hdfs_utils.py | 8 | 7310 | #
# 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... | apache-2.0 |
tima/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py | 16 | 13352 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
fredrik-johansson/mpmath | mpmath/calculus/quadrature.py | 1 | 42371 | import math
from ..libmp.backend import xrange
class QuadratureRule(object):
"""
Quadrature rules are implemented using this class, in order to
simplify the code and provide a common infrastructure
for tasks such as error estimation and node caching.
You can implement a custom quadrature rule by ... | bsd-3-clause |
Endika/OpenUpgrade | addons/l10n_fr/report/compute_resultant_report.py | 374 | 4004 | # -*- coding: utf-8 -*-
#
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users w... | agpl-3.0 |
justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/pylint/checkers/newstyle.py | 3 | 6974 | # Copyright (c) 2005-2014 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | gpl-3.0 |
piffey/ansible | lib/ansible/modules/cloud/amazon/aws_ses_identity_policy.py | 78 | 7303 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: aws_ses_identity_policy
s... | gpl-3.0 |
oktie/linkedct | ctdjango/chardet/universaldetector.py | 190 | 6635 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | apache-2.0 |
OBIGOGIT/etch | binding-python/runtime/src/test/python/tests/binding/support/TestValidator_string.py | 6 | 1079 | # Licensed to the Apache Software Foundation (ASF) under one *
# or more contributor license agreements. See the NOTICE file *
# distributed with this work for additional information *
# regarding copyright ownership. The ASF licenses this file *
# to you under the Apache License, Version 2.0 (the ... | apache-2.0 |
Observer-Wu/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py | 121 | 3180 | # 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 th... | bsd-3-clause |
skarra/CalDAVClientLibrary | caldavclientlibrary/client/account.py | 1 | 1580 | ##
# Copyright (c) 2006-2013 Apple 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 l... | apache-2.0 |
pierreg/tensorflow | tensorflow/python/kernel_tests/summary_ops_test.py | 10 | 3656 | # 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 |
marc-sensenich/ansible | lib/ansible/modules/database/influxdb/influxdb_user.py | 15 | 5857 | #!/usr/bin/python
# (c) 2017, Vitaliy Zhhuta <zhhuta () gmail.com>
# insipred by Kamil Szczygiel <kamil.szczygiel () intel.com> influxdb_database module
# 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
__meta... | gpl-3.0 |
googleinterns/learnbase | learnbase/src/main/webapp/WEB-INF/Lib/macurl2path.py | 332 | 3275 | """Macintosh-specific module for conversion between pathnames and URLs.
Do not import directly; use urllib instead."""
import urllib
import os
__all__ = ["url2pathname","pathname2url"]
def url2pathname(pathname):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not r... | apache-2.0 |
cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/scripts/addons/netrender/slave.py | 2 | 17536 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-3.0 |
diegoguimaraes/django | tests/validators/tests.py | 14 | 14725 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime, timedelta
import re
import types
from unittest import TestCase
from django.core.exceptions import ValidationError
from django.core.validators import (
BaseValidator, EmailValidator, MaxLengthValidator, MaxValueValidator... | bsd-3-clause |
heli522/scikit-learn | examples/model_selection/plot_roc.py | 96 | 4487 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... | bsd-3-clause |
yinsu/grpc | src/python/grpcio_test/grpc_test/_junkdrawer/math_pb2.py | 47 | 8463 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
Nowheresly/odoo | addons/l10n_at/account_wizard.py | 379 | 1234 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
blitzagency/flowbee | flowbee/deciders/events.py | 1 | 13786 | """SWF Event Types
Possible Decider Events:
http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.poll_for_decision_task
WorkflowExecutionStarted
WorkflowExecutionCancelRequested
WorkflowExecutionCompleted
CompleteWorkflowExecutionFailed
WorkflowExecutionFailed
FailWorkflowExecutionFailed
Work... | mit |
afaheem88/tempest_neutron | tempest/api/compute/admin/test_networks.py | 8 | 2055 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | apache-2.0 |
Davidjohnwilson/sympy | sympy/functions/special/tests/test_delta_functions.py | 32 | 2856 | from sympy import (
adjoint, conjugate, DiracDelta, Heaviside, nan, pi, sign, sqrt,
symbols, transpose, Symbol, Piecewise, I, S, Eq
)
from sympy.utilities.pytest import raises
from sympy.core.function import ArgumentIndexError
x, y = symbols('x y')
def test_DiracDelta():
assert DiracDelta(1) == 0
a... | bsd-3-clause |
zubron/servo | tests/wpt/web-platform-tests/cors/resources/status.py | 220 | 1223 | def main(request, response):
response.headers.set("Access-Control-Allow-Origin", request.headers.get("origin") )
response.headers.set("Access-Control-Expose-Headers", "X-Request-Method")
if request.method == 'OPTIONS':
response.headers.set("Access-Control-Allow-Methods", "GET, CHICKEN, HEAD, POST,... | mpl-2.0 |
xodus7/tensorflow | tensorflow/contrib/bigtable/python/ops/bigtable_api.py | 4 | 28480 | # Copyright 2018 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 |
yanchen036/tensorflow | tensorflow/python/kernel_tests/check_ops_test.py | 2 | 53746 | # 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 |
andalexo/bgv | bgvDataDisp/guiqt.py | 1 | 8538 | """
The PyQt4 GUI classes for the bgvdata package.
"""
from __future__ import print_function, division
import logging
from os.path import splitext
try:
from PyQt4.QtGui import QMainWindow, QDockWidget
from PyQt4 import QtCore
except ImportError:
from PyQt5.QtWidgets import QMainWindow, QDockWidget
fr... | mit |
huongttlan/statsmodels | statsmodels/stats/tests/test_inter_rater.py | 34 | 11513 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 10 09:18:14 2012
Author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal
from statsmodels.stats.inter_rater import (fleiss_kappa, cohens_kappa,
to_table, aggregate_raters)
cla... | bsd-3-clause |
t0in4/django | tests/admin_checks/models.py | 281 | 1836 | """
Tests of ModelAdmin system checks logic.
"""
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Album(models.Model):
title = models.CharFie... | bsd-3-clause |
meziti/bigbullions-test | p2pool/bitcoin/worker_interface.py | 230 | 5901 | from __future__ import division
import StringIO
import json
import random
import sys
from twisted.internet import defer
import p2pool
from p2pool.bitcoin import data as bitcoin_data, getwork
from p2pool.util import expiring_dict, jsonrpc, pack, variable
class _Provider(object):
def __init__(self, parent, long_p... | gpl-3.0 |
polynomial/nixops | nixops/resources/gce_image.py | 3 | 3281 | # -*- coding: utf-8 -*-
# Automatic provisioning of GCE Images.
import os
import libcloud.common.google
from nixops.util import attr_property
from nixops.gce_common import ResourceDefinition, ResourceState
class GCEImageDefinition(ResourceDefinition):
"""Definition of a GCE Image"""
@classmethod
def g... | lgpl-3.0 |
sergio-incaser/odoo | openerp/service/__init__.py | 380 | 1613 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you c... | agpl-3.0 |
MihaiMoldovanu/ansible | test/units/modules/cloud/amazon/test_kinesis_stream.py | 28 | 9780 | import pytest
import unittest
boto3 = pytest.importorskip("boto3")
botocore = pytest.importorskip("botocore")
import ansible.modules.cloud.amazon.kinesis_stream as kinesis_stream
aws_region = 'us-west-2'
class AnsibleKinesisStreamFunctions(unittest.TestCase):
def test_convert_to_lower(self):
example =... | gpl-3.0 |
sciurus/python_koans | python3/runner/sensei.py | 59 | 9937 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import re
import sys
import os
import glob
from . import helper
from .mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
from libs.colorama import init, Fore, Style
init() # init colorama
class Sensei(MockableTestResu... | mit |
tqchen/tvm | tests/python/topi/python/test_topi_group_conv2d.py | 1 | 11141 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
landism/pants | tests/python/pants_test/binaries/test_binary_util.py | 8 | 8219 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | apache-2.0 |
goodwinnk/intellij-community | python/helpers/py2only/docutils/languages/nl.py | 200 | 1865 | # $Id: nl.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Martijn Pieters <mjpieters@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must ... | apache-2.0 |
percipient/raven-python | raven/contrib/bottle/utils.py | 25 | 1045 | """
raven.contrib.bottle.utils
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from raven.utils.compat import _urlparse
from raven.utils.wsgi import get_header... | bsd-3-clause |
sauloal/pycluster | pypy-1.9_64/lib-python/2.7/plat-mac/lib-scriptpackages/Explorer/Microsoft_Internet_Explorer.py | 82 | 3140 | """Suite Microsoft Internet Explorer Suite: Events defined by Internet Explorer
Level 1, version 1
Generated from /Applications/Internet Explorer.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'MSIE'
class Microsoft_Internet_Explorer_Events:
def GetSource(self,... | mit |
ujenmr/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_certificate_facts.py | 29 | 3228 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty... | gpl-3.0 |
kajgan/e2 | lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py | 44 | 11758 | from os import path as os_path
from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection, ConfigBoolean, ConfigNothing, NoSave
# The "VideoEnhancement" is the interface to /proc/stb/vmpeg/0.
class VideoEnhancement:
firstRun = True
def __init__(self):
self.last_modes_preferred = [ ]
... | gpl-2.0 |
oudalab/phyllo | phyllo/extractors/anselmDB.py | 1 | 5827 | import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
from phyllo.phyllo_logger import logger
import nltk
from itertools import cycle
nltk.download('punkt')
from nltk import sent_tokenize
anselmSOUP=""
idx = -1
cha_array=[]
suburl = []
verse = []
... | apache-2.0 |
binghongcha08/pyQMD | GWP/2D/1.0.1/comp.py | 29 | 1292 | ##!/usr/bin/python
import numpy as np
import pylab as plt
data = np.genfromtxt(fname='t100/wf.dat')
data1 = np.genfromtxt(fname='t300/wf.dat')
data2 = np.genfromtxt(fname='t500/wf.dat')
data3 = np.genfromtxt(fname='t600/wf.dat')
data00 = np.genfromtxt('../spo_1d/t100')
data01 = np.genfromtxt('../spo_1d/t300')
data02 ... | gpl-3.0 |
SOKP/external_chromium_org | content/test/gpu/gpu_tests/webgl_conformance.py | 26 | 5126 | # 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 json
import optparse
import os
import sys
import webgl_conformance_expectations
from telemetry import benchmark as benchmark_module
from telemetr... | bsd-3-clause |
TinyOS-Camp/DDEA-DEV | Archive/[14_10_03] Data_Collection_Sample/DB access sample code/vtt/sampling_density_VTT.py | 1 | 6262 | import os
import sys
import json
from datetime import datetime
import time
import math
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pylab as pl
import pickle
######
### Configurations
######
UUID_FILE = 'finland_ids.csv'
#DATA_FOLDER = 'VTT_week/'
DATA_FOLDER = 'data_year/'
DATA_EXT = ... | gpl-2.0 |
jobiols/odoomrp-wip | mrp_byproduct_operations/__openerp__.py | 27 | 1453 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos (danielcampos@avanzosc.es) Date: 29/09/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | agpl-3.0 |
echristophe/lic | src/RectanglePacker.py | 5 | 11617 | """This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT A... | gpl-3.0 |
dhelbegor/omelette | project_name/settings/base.py | 1 | 3526 | """
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... | mit |
bohanapp/gaoyuan.org | node_modules/hexo-renderer-scss/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
dahlstrom-g/intellij-community | python/testData/refactoring/move/optimizeImportsAfterMoveInvalidatesMembersToBeMoved/after/src/src.py | 22 | 2358 | # -*- coding: utf-8 -*-
# (c) 2017 Tuomas Airaksinen
#
# This file is part of Serviceform.
#
# Serviceform 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)... | apache-2.0 |
globau/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_treewalkers.py | 429 | 13692 | from __future__ import absolute_import, division, unicode_literals
import os
import sys
import unittest
import warnings
from difflib import unified_diff
try:
unittest.TestCase.assertEqual
except AttributeError:
unittest.TestCase.assertEqual = unittest.TestCase.assertEquals
from .support import get_data_files... | mpl-2.0 |
lsinfo/odoo | addons/calendar/contacts.py | 389 | 1414 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
TeamExodus/external_chromium_org | tools/memory_inspector/memory_inspector/data/serialization.py | 89 | 4465 | # 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.
"""This module handles the JSON de/serialization of the core classes.
This is needed for both long term storage (e.g., loading/storing traces to local
files... | bsd-3-clause |
ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/python/Lib/distutils/command/check.py | 98 | 5557 | """distutils.command.check
Implements the Distutils 'check' command.
"""
__revision__ = "$Id$"
from distutils.core import Command
from distutils.dist import PKG_INFO_ENCODING
from distutils.errors import DistutilsSetupError
try:
# docutils is installed
from docutils.utils import Reporter
from docutils.pa... | mit |
thaim/ansible | lib/ansible/modules/network/fortios/fortios_system_replacemsg_icap.py | 13 | 10063 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 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... | mit |
mydongistiny/external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver.py | 21 | 4523 | # Copyright (C) 2014 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 |
amyliu345/zulip | zerver/views/events_register.py | 10 | 2542 | from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from typing import Text
from typing import Iterable, Optional, Sequence
from zerver.lib.actions import do_events_register
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from... | apache-2.0 |
pbrazdil/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/gc.py | 146 | 2038 | # Copyright (C) 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 of conditions and the... | bsd-3-clause |
benlangmuir/swift | utils/type-layout-fuzzer.py | 32 | 4228 | #!/usr/bin/env python
# This script outputs a Swift source with randomly-generated type definitions,
# which can be used for ABI or layout algorithm fuzzing.
# TODO: generate types with generics, existentials, compositions
from __future__ import print_function
import random
import sys
maxDepth = 5
maxMembers = 5
t... | apache-2.0 |
Bismarrck/tensorflow | tensorflow/python/ops/linalg/linear_operator.py | 3 | 33838 | # 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 |
thesuperzapper/tensorflow | tensorflow/python/kernel_tests/attention_ops_test.py | 85 | 7316 | # 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 |
staslev/incubator-beam | sdks/python/apache_beam/runners/dataflow/internal/clients/dataflow/dataflow_v1b3_messages.py | 5 | 195799 | #
# 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 us... | apache-2.0 |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/command/easy_install.py | 206 | 72706 | #!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://pythonhosted.org/setuptools/easy_install.html
"""
impo... | lgpl-3.0 |
meteokid/python-rpn | share/examples/fst_to_lalo.py | 1 | 4082 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Barbara Casati <Barbara.Casati@canada.ca>
# Author: Stephane Chamberland <stephane.chamberland@canada.ca>
"""
Interpolate RPNSTD rec to latlon points
"""
import sys
import optparse
import numpy as np
from scipy import interpolate
import rpnpy.librmn.all as rmn
if... | lgpl-2.1 |
tlangerak/Multi-Agent-Systems | build/lib.win-amd64-2.7/tlslite/utils/cipherfactory.py | 357 | 3177 | """Factory functions for symmetric cryptography."""
import os
import Python_AES
import Python_RC4
import cryptomath
tripleDESPresent = False
if cryptomath.m2cryptoLoaded:
import OpenSSL_AES
import OpenSSL_RC4
import OpenSSL_TripleDES
tripleDESPresent = True
if cryptomath.cryptlibpyLoaded:
impo... | lgpl-2.1 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/configSectionNameDialog.py | 150 | 3720 | """
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
"""
from Tkinter import *
import tkMessageBox
class GetCfgSectionNameDialog(Toplevel):
def __init__(self,parent,title,message,usedNames):
"""
message - string, informatio... | gpl-2.0 |
osiell/server-tools | base_user_reset_access/tests/test_base_user_reset_access.py | 21 | 1728 | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of base_user_reset_access,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# base_user_reset_access is free software:
# you can redistribute it an... | agpl-3.0 |
Shnatsel/cjdns | node_build/dependencies/libuv/build/gyp/test/win/gyptest-link-generate-manifest.py | 238 | 4708 | #!/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.
"""
Make sure we generate a manifest file when linking binaries, including
handling AdditionalManifestFiles.
"""
import TestGyp
import sys... | gpl-3.0 |
cedadev/cloudhands-web | cloudhands/web/main.py | 1 | 41523 | #!/usr/bin/env python3
# encoding: UTF-8
import argparse
import datetime
import functools
import logging
import operator
import os.path
import platform
import re
import sqlite3
import sys
import uuid
import bcrypt
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLA... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.