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 |
|---|---|---|---|---|---|
fyfcauc/android_external_chromium-org | tools/telemetry/telemetry/core/heap/chrome_js_heap_snapshot_parser_unittest.py | 38 | 2528 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import unittest
from telemetry.core.heap import chrome_js_heap_snapshot_parser
class ChromeJsHeapSnapshotParserUnittest(unittest.TestCase):
d... | bsd-3-clause |
Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/persisted/aot.py | 24 | 18605 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
AOT: Abstract Object Trees
The source-code-marshallin'est abstract-object-serializin'est persister
this side of Marmalade!
"""
from __future__ import division, absolute_import
import typ... | gpl-3.0 |
OpenFacetracker/facetracker-core | lib/youtube-dl/youtube_dl/extractor/tagesschau.py | 44 | 4945 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_filesize
class TagesschauIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tagesschau\.de/multimedia/(?:sendung/ts|video/video)(?P<id>-?[0-9]+)\.html'
_TESTS = [{
... | gpl-2.0 |
40223101/w16b_test | static/Brython3.1.1-20150328-091302/Lib/VFS_import.py | 738 | 3059 | import os
from browser import doc
#_scripts=doc.createElement('script')
#_scripts.src="/src/py_VFS.js"
#_scripts.type="text/javascript"
#doc.get(tag='head')[0].appendChild(_scripts)
VFS=dict(JSObject(__BRYTHON__.py_VFS))
class VFSModuleFinder:
def __init__(self, path_entry):
print("in VFSModuleFinder")
... | agpl-3.0 |
rohe/pysaml2-3 | tests/mdtest.py | 1 | 20175 | foo = {'https://connect.sunet.se/shibboleth': {'spsso': [{
'single_logout_service': [
... | bsd-2-clause |
ecoal95/servo | tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/filters/lint.py | 77 | 3631 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from . import base
from ..constants import namespaces, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class Filter(base.Filter):
"""Lints the token stream for errors
... | mpl-2.0 |
azureplus/hue | desktop/core/ext-py/Paste-2.0.1/setup.py | 31 | 4813 | # Procedure to release a new version:
#
# - run tests: run tox
# - update version in setup.py (__version__)
# - update tag_build in setup.cfg
# - modify setup.py: set RELEASE to True
# - check that "python setup.py sdist" contains all files tracked by
# the SCM (Mercurial): update MANIFEST.in if needed
# - update cha... | apache-2.0 |
popazerty/test-gui | lib/python/Components/Converter/TranspBAServiceInfo.py | 4 | 6493 | from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService
from Components.Element import cached
WIDESCREEN = [3, 4, 7, 8, 0xB, 0xC, 0xF, 0x10]
class TranspBAServiceInfo(Converter, object):
HAS_TELETEXT = 0
IS_MULTICHANNEL = 1
IS_CRYPTED = 2
IS_WIDESCREEN = 3
SU... | gpl-2.0 |
wangjun/python-pinyin | setup.py | 2 | 2060 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from codecs import open
import sys
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import pypinyin
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_w... | mit |
jbiason/chesttimer | api/tests/api_base.py | 1 | 3931 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Base class for the API tests."""
# ChestTimer, an agenda creator for GW2 chests.
# Copyright (C) 2014 Julio Biason
#
# 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 Fr... | gpl-3.0 |
anthonybishopric/pyboxfs | fs/expose/fuse/fuse3.py | 29 | 22435 | # Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE... | bsd-3-clause |
badock/nova | nova/tests/objects/test_fixed_ip.py | 4 | 15179 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
jeongchanKim/TizenRT | external/protobuf/python/google/protobuf/internal/symbol_database_test.py | 70 | 5650 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | apache-2.0 |
NLeSC/PattyAnalytics | patty/segmentation/dbscan.py | 1 | 4641 | """
Point cloud segmentation using the DBSCAN clustering algorithm.
DBSCAN - Density-Based Spatial Clustering of Applications with Noise.
Finds core samples of high density and expands clusters from them.
Good for data which contains clusters of similar density.
See the scikit-learn documentation for reference:
http:... | apache-2.0 |
gaddman/ansible | lib/ansible/modules/network/cloudengine/ce_bgp_af.py | 7 | 133202 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
evensonbryan/yocto-autobuilder | lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/sql/util.py | 6 | 30472 | # sql/util.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .. import exc, schema, util, sql
from ..util import topological
from . import express... | gpl-2.0 |
dominicrodger/django-magazine | magazine/migrations/0002_add_issue_published.py | 1 | 2482 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Issue.published'
db.add_column('magazine_issue', 'published', self.gf('django.db.models.fi... | mit |
gavin-feng/odoo | addons/mrp_operations/report/__init__.py | 443 | 1131 | # -*- 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 |
doganov/edx-platform | lms/djangoapps/notifier_api/tests.py | 49 | 9811 | import itertools
import ddt
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
from django_comment_common.models import Role, Permission
from lang_pref import LANGU... | agpl-3.0 |
wwitzel3/awx | awx/main/tests/functional/commands/test_commands.py | 1 | 1792 | import sys
import pytest
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.management import call_command
from awx.main.management.commands.update_password import UpdatePassword
def run_command(name, *args, **options):
command_runner = options.pop('c... | apache-2.0 |
szilveszter/django | django/db/backends/oracle/compiler.py | 22 | 2227 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False):
"""
Creates the SQL for this query. Returns the SQL string and list
of parameters. This is overridden from the original Query class
to han... | bsd-3-clause |
fausecteam/ctf-gameserver | src/ctf_gameserver/controller/controller.py | 1 | 8414 | import datetime
import logging
import time
import os
import prometheus_client
import prometheus_client.core
import psycopg2
from psycopg2 import errorcodes as postgres_errors
from ctf_gameserver.lib import daemon
from ctf_gameserver.lib.args import get_arg_parser_with_db, parse_host_port
from ctf_gameserver.lib.datab... | isc |
samanehsan/osf.io | scripts/migrate_unregistered.py | 61 | 4757 | #!/usr/bin/env
# -*- coding: utf-8 -*-
"""Migrates old-style unregistered users (dictionaries in Node#contributor_list)
to actual User records.
"""
import logging
from modularodm.exceptions import ValidationValueError
from website import app, models
from framework import auth
from framework.auth import Auth
from tests... | apache-2.0 |
lucychambers/lucychambers.github.io | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.2/vendor/pygments-main/pygments/lexers/_vimbuiltins.py | 57 | 39777 | # Split up in multiple functions so it's importable by jython, which has a
# per-method size limit.
def _getauto():
return [('BufAdd','BufAdd'),('BufCreate','BufCreate'),('BufDelete','BufDelete'),('BufEnter','BufEnter'),('BufFilePost','BufFilePost'),('BufFilePre','BufFilePre'),('BufHidden','BufHidden'),('BufLeave'... | gpl-2.0 |
epitron/youtube-dl | youtube_dl/extractor/myspace.py | 51 | 8412 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
parse_iso8601,
)
class MySpaceIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
myspace\.com/[^/]+/
... | unlicense |
varunarya10/nova_test_latest | nova/api/openstack/compute/plugins/v3/block_device_mapping_v1.py | 37 | 2595 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
istinspring/grab | tests/grab_pickle.py | 2 | 1086 | # coding: utf-8
try:
import cPickle as pickle
except ImportError:
import pickle
from six.moves.queue import Queue
from tests.util import BaseGrabTestCase, exclude_grab_transport
from tests.util import build_grab
class TestGrab(BaseGrabTestCase):
def setUp(self):
self.server.reset()
@exclude_... | mit |
PenguPilot/overo-kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
tesidroni/mp | Lib/site-packages/numpy/distutils/fcompiler/absoft.py | 89 | 5525 |
# http://www.absoft.com/literature/osxuserguide.pdf
# http://www.absoft.com/documentation.html
# Notes:
# - when using -g77 then use -DUNDERSCORE_G77 to compile f2py
# generated extension modules (works for f2py v2.45.241_1936 and up)
import os
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompile... | gpl-3.0 |
stuntman723/rap-analyzer | rap_analyzer/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/introspection.py | 539 | 1977 | import sys
import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
from django.utils import six
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDS... | mit |
adaur/SickRage | lib/github/Status.py | 74 | 2548 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
jeaye/jtl | .ycm_extra_conf.py | 5 | 3051 | import os
import ycm_core
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-pedantic',
'-std=c++1y',
#'-stdlib=libc++',
'-x',
'c++',
'-Iinclude',
'-Itest/include',
'-Ilib/jest/include',
'-isystem',
'../BoostParts',
'-isystem',
'/System/Library/Frameworks/Python.framework/Headers',
'-isystem',
'../llvm/include',
'-isystem',
... | mit |
nurbsurf/cred-circle.com | node_modules/cordova/node_modules/plugman/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/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 the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | mit |
isupeene/cli_mastermind | mastermind.py | 1 | 2768 | #!/usr/bin/python
from sys import stdin
from random import randrange
readline = lambda: stdin.readline().strip()
PERFECT_GUESS_MARKER = ">"
PARTIAL_GUESS_MARKER = "X"
INCORRECT_GUESS_MARKER = " "
class Board:
def __init__(self, solution, number_of_guesses=10):
self.solution = solution
self.guesses = [Board.em... | mit |
hassoon3/odoo | addons/l10n_fr/report/base_report.py | 57 | 5582 | # -*- 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
#... | agpl-3.0 |
georgewhewell/CouchPotatoServer | couchpotato/core/downloaders/deluge/__init__.py | 10 | 3245 | from .main import Deluge
def start():
return Deluge()
config = [{
'name': 'deluge',
'groups': [
{
'tab': 'downloaders',
'list': 'download_providers',
'name': 'deluge',
'label': 'Deluge',
'description': 'Use <a href="http://www.deluge-torr... | gpl-3.0 |
cogmission/nupic | src/nupic/swarming/hypersearch/SwarmTerminator.py | 18 | 5565 | # ----------------------------------------------------------------------
# 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 progra... | agpl-3.0 |
wangjun/odoo | addons/account_anglo_saxon/invoice.py | 85 | 13420 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C)
# 2004-2010 Tiny SPRL (<http://tiny.be>).
# 2009-2010 Veritos (http://veritos.nl).
# All Rights Reserved
#
# This program is free software: you can redistri... | agpl-3.0 |
CouchPotato/CouchPotatoServer | libs/apscheduler/triggers/cron/__init__.py | 103 | 5182 | from datetime import date, datetime
from apscheduler.triggers.cron.fields import *
from apscheduler.util import datetime_ceil, convert_to_datetime, iteritems
class CronTrigger(object):
FIELD_NAMES = ('year', 'month', 'day', 'week', 'day_of_week', 'hour',
'minute', 'second')
FIELDS_MAP = {'... | gpl-3.0 |
khalibartan/Antidote-DM | Antidotes DM/youtube_dl/extractor/vube.py | 110 | 6927 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
int_or_none,
ExtractorError,
)
class VubeIE(InfoExtractor):
IE_NAME = 'vube'
IE_DESC = 'Vube.com'
_VALID_URL = r'http://vube\.com/(?:[^/]+/)+(?P<id>[... | gpl-2.0 |
tung7970/mbed-os | tools/host_tests/host_tests_plugins/module_reset_mps2.py | 73 | 2576 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 |
debugger22/sympy | sympy/series/acceleration.py | 98 | 3314 | """
Convergence acceleration / extrapolation methods for series and
sequences.
References:
Carl M. Bender & Steven A. Orszag, "Advanced Mathematical Methods for
Scientists and Engineers: Asymptotic Methods and Perturbation Theory",
Springer 1999. (Shanks transformation: pp. 368-375, Richardson
extrapolation: pp. 375-3... | bsd-3-clause |
salimrahal/pythonUtil | pythonLib/operator/LogicalOperators.py | 1 | 3084 | '''
Created on Jul 5, 2016
@author: salim
'''
class ComputeMargin(object):
'''
classdocs
'''
def __init__(self, price_subtotal, margin):
'''
Constructor
'''
self.price_subtotal = price_subtotal
self.margin = margin
def _compute_margin_percent(... | gpl-3.0 |
YihaoLu/statsmodels | statsmodels/sandbox/nonparametric/kernels.py | 33 | 19377 | # -*- coding: utf-8 -*-
"""
This models contains the Kernels for Kernel smoothing.
Hopefully in the future they may be reused/extended for other kernel based
method
References:
----------
Pointwise Kernel Confidence Bounds
(smoothconf)
http://fedc.wiwi.hu-berlin.de/xplore/ebooks/html/anr/anrhtmlframe62.html
"""
# ... | bsd-3-clause |
usc-isi/essex-baremetal-support | nova/tests/monkey_patch_example/__init__.py | 29 | 1151 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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/... | apache-2.0 |
Cuuuurzel/KiPyCalc | sympy/physics/quantum/tests/test_innerproduct.py | 28 | 1483 | from sympy import I, Integer, latex, pretty
from sympy.physics.quantum.innerproduct import InnerProduct
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.state import Bra, Ket, StateBase
def test_innerproduct():
k = Ket('k')
b = Bra('b')
ip = InnerProduct(b, k)
assert isinsta... | mit |
JingZhou0404/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/fuse_gtest_files.py | 314 | 8813 | #!/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... | bsd-3-clause |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/django/contrib/gis/geos/point.py | 105 | 4400 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
from django.utils import six
from django.utils.six.moves import xrange
class Point(GEOSGeometry):
_minlength = 2
_m... | mit |
aricchen/openHR | openerp/addons/base_calendar/__openerp__.py | 58 | 2107 | # -*- 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 |
takis/django | tests/requests/tests.py | 18 | 34315 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import time
from datetime import datetime, timedelta
from io import BytesIO
from itertools import chain
from django.core.exceptions import SuspiciousOperation
from django.core.handlers.wsgi import LimitedStream, WSGIRequest
from django.http import (
... | bsd-3-clause |
byndcivilization/toy-infrastructure | flask-app/venv/lib/python3.6/site-packages/pip/_vendor/distlib/util.py | 327 | 52991 | #
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
try:
... | gpl-3.0 |
cmusatyalab/dermshare | app/dermshare-ws.py | 2 | 6392 | #!/usr/bin/env python
#
# DermShare -- WebSocket server for mobile devices
#
# Copyright (c) 2015 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTR... | epl-1.0 |
MichaelNedzelsky/intellij-community | plugins/hg4idea/testData/bin/mercurial/hgweb/protocol.py | 93 | 3171 | #
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import cgi, cStringIO, zlib, urllib
from mercurial import util, w... | apache-2.0 |
aykol/pymatgen | pymatgen/analysis/chemenv/utils/tests/test_math_utils.py | 2 | 4766 | #!/usr/bin/env python
__author__ = 'waroquiers'
import unittest2 as unittest
from pymatgen.analysis.chemenv.utils.math_utils import prime_factors, divisors, get_center_of_arc, get_linearly_independent_vectors
from pymatgen.analysis.chemenv.utils.math_utils import scale_and_clamp, smoothstep, smootherstep, cosinus_st... | mit |
tuxfux-hlp-notes/python-batches | archieves/batch-62/modules/mysheets/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py | 2763 | 12536 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
IronLanguages/ironpython3 | Src/StdLib/Lib/test/test_email/test__header_value_parser.py | 11 | 115840 | import string
import unittest
from email import _header_value_parser as parser
from email import errors
from email import policy
from test.test_email import TestEmailBase, parameterize
class TestTokens(TestEmailBase):
# EWWhiteSpaceTerminal
def test_EWWhiteSpaceTerminal(self):
x = parser.EWWhiteSpace... | apache-2.0 |
Vassy/odoo | addons/lunch/wizard/lunch_validation.py | 440 | 1296 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
un33k/CouchPotatoServer | couchpotato/core/_base/_core.py | 14 | 12280 | from uuid import uuid4
import os
import platform
import signal
import time
import traceback
import webbrowser
import sys
from couchpotato.api import addApiView
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.variable import cleanHost, md5, isSubFolder
from couchpotato.core.logger i... | gpl-3.0 |
revolutionaryG/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/svnrevision.py | 143 | 1923 | # 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 |
bak1an/django | tests/template_tests/filter_tests/test_truncatewords_html.py | 40 | 1542 | from django.template.defaultfilters import truncatewords_html
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_truncate_zero(self):
self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 0), '')
def test_truncate(self):
... | bsd-3-clause |
xin3liang/platform_external_eigen | debug/gdb/printers.py | 12 | 6300 | # -*- coding: utf-8 -*-
# This file is part of Eigen, a lightweight C++ template library
# for linear algebra.
#
# Copyright (C) 2009 Benjamin Schindler <bschindler@inf.ethz.ch>
#
# 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
... | bsd-3-clause |
hiei23/servo | tests/wpt/css-tests/css-fonts-3_dev/xhtml1/reference/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
jacobajit/ion | intranet/apps/notifications/models.py | 1 | 1283 | # -*- coding: utf-8 -*-
import hashlib
import json
from django.db import models
from ..users.models import User
class NotificationConfig(models.Model):
user = models.OneToOneField(User)
gcm_token = models.CharField(max_length=250, blank=True, null=True)
gcm_time = models.DateTimeField(blank=True, null=... | gpl-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/keyedcache/views.py | 2 | 3251 | from django import forms
from django.conf import settings
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
import key... | agpl-3.0 |
dtaht/ns-3-dev | scratch/burstmemoryestimators.py | 2 | 3015 | import os
import os.path
import sys
from scapy.all import *
import numpy as np
import matplotlib.pyplot as plt
import itertools
import math
import json
def burstest(fn,tau,time=False):
packets = rdpcap(fn)
reader = ((p.time, PPP(str(p))) for p in iter(packets))
filtered = ((t, pkt) for t, pkt in reader if
... | gpl-2.0 |
CKehl/pylearn2 | pylearn2/training_algorithms/tests/test_sgd.py | 2 | 60662 | from __future__ import print_function
import numpy as np
from theano.compat.six.moves import cStringIO, xrange
import theano.tensor as T
from theano.tests import disturb_mem
from theano.tests.record import Record, RecordMode
from pylearn2.compat import first_key
from pylearn2.costs.cost import Cost, SumOfCosts, Defau... | bsd-3-clause |
ewandor/git-french-law | LegifranceClient/__init__.py | 1 | 2270 | from datetime import datetime
from mechanize import Browser
from FrenchLawModel import Text, Article, Version, Law
from page import ConstitutionPage, ArticlePage
class LegifranceClient(object):
host = 'http://www.legifrance.gouv.fr/'
def __init__(self):
self.user_agent = 'Mozilla/4.0 (compatible; M... | gpl-2.0 |
ghickman/django | django/contrib/admin/views/main.py | 12 | 16406 | import sys
from collections import OrderedDict
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters,
)
from djang... | bsd-3-clause |
byterom/android_external_chromium_org | chrome/common/extensions/docs/server2/cron_servlet.py | 25 | 7662 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
import traceback
from app_yaml_helper import AppYamlHelper
from appengine_wrappers import IsDeadlineExceededError, logservice, taskqueue
from br... | bsd-3-clause |
openatv/enigma2 | lib/python/Components/NetworkTime.py | 35 | 1566 | from Components.Console import Console
from config import config
from enigma import eTimer, eDVBLocalTimeHandler, eEPGCache
from Tools.StbHardware import setRTCtime
from time import time, ctime
# _session = None
#
def AutoNTPSync(session=None, **kwargs):
global ntpsyncpoller
ntpsyncpoller = NTPSyncPoller()
ntpsyncp... | gpl-2.0 |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/distutils/tests/test_extension.py | 168 | 2768 | """Tests for distutils.extension."""
import unittest
import os
import warnings
from test.support import check_warnings, run_unittest
from distutils.extension import read_setup_file, Extension
class ExtensionTestCase(unittest.TestCase):
def test_read_setup_file(self):
# trying to read a Setup file
... | apache-2.0 |
huobaowangxi/scikit-learn | sklearn/feature_selection/from_model.py | 224 | 4316 | # Authors: Gilles Louppe, Mathieu Blondel
# License: BSD 3 clause
import numpy as np
from ..base import TransformerMixin
from ..externals import six
from ..utils import safe_mask, check_array
from ..utils.validation import NotFittedError, check_is_fitted
class _LearntSelectorMixin(TransformerMixin):
# Note beca... | bsd-3-clause |
Aerotenna/APM_OcPoC_Zynq | Tools/scripts/update_wiki.py | 275 | 2870 | #!/usr/bin/env python
'''
update a wordpress wiki page
Andrew Tridgell
May 2013
See http://codex.wordpress.org/XML-RPC_WordPress_API/Posts
'''
import xmlrpclib, sys
from optparse import OptionParser
parser = OptionParser("update_wiki.py [options] <file>")
parser.add_option("--username", help="Wordpress username", de... | gpl-3.0 |
sevengram/astrotortilla | astrotortilla/gui/DlgHelpAbout.py | 1 | 2797 | import wx
import wx.richtext
import gettext
t = gettext.translation('astrotortilla', 'locale', fallback=True)
_ = t.gettext
def create(parent):
return DlgHelpAbout(parent)
[wxID_DLGHELPABOUT, wxID_DLGHELPABOUTCLOSE, wxID_DLGHELPABOUTRICHTEXTCTRL1,
wxID_DLGHELPABOUTSTATICTEXT1,
] = [wx.NewId() for _init_ctrls... | gpl-2.0 |
davvi/Hardway3 | ex41.py | 1 | 2335 | #!/usr/bin/env python
import random
from urllib.request import urlopen
import sys
WORD_URL = "http://learncodethehardway.org/words.txt"
WORDS = []
PHRASES = {
"class %%%(%%%):":
"Make a class named %%% that is-a %%%",
"class %%%(object):\n\tdef __init__(self, ***)":
"class %%% has-a __init__... | mit |
tmpgit/intellij-community | python/helpers/pydev/pycompletion.py | 56 | 1339 | #!/usr/bin/python
'''
@author Radim Kubacki
'''
import _pydev_imports_tipper
import traceback
import StringIO
import sys
import urllib
import pycompletionserver
#=======================================================================================================================
# GetImports
#======================... | apache-2.0 |
RaspPiTor/PythonPasswords | DictionaryAttack.py | 1 | 1538 | def getwords():
file=open('words.txt', 'r')
words=file.read().splitlines()
file.close()
file=open('allwords.txt', 'r')
allwords=eval(file.read())
file.close()
for i in words:
if i in allwords:
allwords.remove(i)
return words+allwords
def getreplacements():
file=o... | gpl-3.0 |
spring-week-topos/cinder-week | cinder/tests/zonemanager/test_brcd_fc_zone_driver.py | 2 | 9050 | # (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | apache-2.0 |
h3biomed/ansible | test/units/parsing/test_mod_args.py | 27 | 4411 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from ansible.errors import Ansi... | gpl-3.0 |
philanthropy-u/edx-platform | openedx/core/djangoapps/ccxcon/tasks.py | 4 | 1570 | """
This file contains celery tasks for ccxcon
"""
from celery.task import task
from celery.utils.log import get_task_logger
from opaque_keys.edx.keys import CourseKey
from requests.exceptions import ConnectionError, HTTPError, RequestException, TooManyRedirects
from openedx.core.djangoapps.ccxcon import api
log = g... | agpl-3.0 |
kybriainfotech/iSocioCRM | openerp/tools/__init__.py | 337 | 1447 | # -*- 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... | agpl-3.0 |
klothe/mongokit | mongokit/mongo_exceptions.py | 2 | 2026 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# 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 abov... | bsd-3-clause |
marcinn/nashvegas | nashvegas/utils.py | 6 | 3738 | from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model
from django.db import connections, router, models, DEFAULT_DB_ALIAS
from django.utils.datastructures import SortedDict
def get_sql_for_new_models(apps=None):
"""
Unashamedly copied and tweaked from dj... | mit |
OpenUpgrade/OpenUpgrade | addons/account_analytic_plans/wizard/__init__.py | 445 | 1117 | # -*- 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 |
upliftaero/MissionPlanner | Lib/site-packages/numpy/core/code_generators/ufunc_docstrings.py | 57 | 85797 | # Docstrings for generated ufuncs
docdict = {}
def get(name):
return docdict.get(name)
def add_newdoc(place, name, doc):
docdict['.'.join((place, name))] = doc
add_newdoc('numpy.core.umath', 'absolute',
"""
Calculate the absolute value element-wise.
Parameters
----------
x : array_like... | gpl-3.0 |
MarginC/foursquared | util/common.py | 262 | 2820 | #!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | apache-2.0 |
hasadna/django | tests/regressiontests/db_typecasts/tests.py | 108 | 2429 | # Unit tests for typecast functions in django.db.backends.util
import datetime
from django.db.backends import util as typecasts
from django.utils import six
from django.utils import unittest
TEST_CASES = {
'typecast_date': (
('', None),
(None, None),
('2005-08-11', datetime.date(2005, 8,... | bsd-3-clause |
4talesa/rethinkdb | drivers/python/rethinkdb/docs.py | 26 | 216510 | # This file was generated by _scripts/gen_python.py from the rethinkdb documentation in http://github.com/rethinkdb/docs
# hash: "140f347f437f35d813c9d4c2472793a0d8026f6b"
import rethinkdb
docsSource = [
(rethinkdb.net.Connection.close, b'conn.close(noreply_wait=True)\n\nClose an open connection.\n\nClosing a conne... | agpl-3.0 |
Laurawly/tvm-1 | python/tvm/error.py | 2 | 3758 | # 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 |
SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/PIL/ImageMode.py | 18 | 1296 | #
# The Python Imaging Library.
# $Id$
#
# standard mode descriptors
#
# History:
# 2006-03-20 fl Added
#
# Copyright (c) 2006 by Secret Labs AB.
# Copyright (c) 2006 by Fredrik Lundh.
#
# See the README file for information on usage and redistribution.
#
# mode descriptor cache
_modes = {}
##
# Wrapper for mode st... | mit |
SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/cms/migrations/0002_auto_start.py | 525 | 20033 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | mit |
AmberJBlue/aima-python | submissions/Ottenlips/myNN.py | 10 | 4316 | from sklearn import datasets
from sklearn.neural_network import MLPClassifier
import traceback
from submissions.Ottenlips import billionaires
from submissions.Ottenlips import billionaires
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
bill = DataFrame()
list_of_billion... | mit |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/test/test_readline.py | 101 | 1704 | """
Very minimal unittests for parts of the readline module.
These tests were added to check that the libedit emulation on OSX and
the "real" readline have the same interface for history manipulation. That's
why the tests cover only a small subset of the interface.
"""
import unittest
from test.support import run_unit... | apache-2.0 |
motion2015/edx-platform | common/test/acceptance/pages/lms/course_wiki.py | 146 | 2170 | """
Wiki tab on courses
"""
from .course_page import CoursePage
from ...pages.studio.utils import type_in_codemirror
class CourseWikiPage(CoursePage):
"""
Course wiki navigation and objects.
"""
url_path = "wiki"
def is_browser_on_page(self):
"""
Browser is on the wiki page if t... | agpl-3.0 |
nervenXC/Ensembler2 | MSMSeeder/attic/RefineExplicitMD.py | 2 | 1462 | #!/usr/bin/env python
#
# Refine models with explicit-solvent MD simulations
#
# Daniel L. Parton <daniel.parton@choderalab.org> - 21 Mar 2014
#
import MSMSeeder
import MSMSeeder.attic.refinement
# ========
# Parse command-line arguments
# ========
import argparse
argparser = argparse.ArgumentParser(description='Con... | gpl-2.0 |
aykol/pymatgen | pymatgen/phasediagram/tests/test_plotter.py | 2 | 3991 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
import unittest2 as unittest
import os
import numpy as np
from pymatgen import Element
from pymatgen.phasediagram.entries import PDEntryIO, PDEntry
from pymatgen.phased... | mit |
larsmans/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_W.py | 10 | 9813 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import atleast_2d, arange, sum, cos, exp, pi
from .go_benchmark import Benchmark
class Watson(Benchmark):
r"""
Watson objective function.
This class defines the Watson [1]_ global optimization problem. T... | bsd-3-clause |
ThomasA/pyunlocbox | doc/conf.py | 1 | 1160 | # -*- coding: utf-8 -*-
import pyunlocbox
extensions = ['sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.mathjax',
'sphinx.ext.inheritance_diagram',
'sphinxcontrib.bibtex']
extensions.append('sphinx.ext.autodoc')
autodoc_default_flags = ['members', ... | bsd-3-clause |
wzod/fsf | fsf-server/modules/EXTRACT_ZIP.py | 4 | 5277 | #!/usr/bin/env python
#
# Author: Jason Batchelor
# Company: Emerson
# Description: Simple module to run on zip files and return metadata as a dictionary.
# Date: 12/16/2014
'''
Copyright 2015 Emerson Electric Co.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.