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 |
|---|---|---|---|---|---|
google-research/language | language/capwap/utils/text_utils.py | 1 | 11097 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | apache-2.0 |
miptliot/edx-platform | lms/djangoapps/course_api/blocks/transformers/navigation.py | 24 | 3146 | """
TODO
"""
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
from .block_depth import BlockDepthTransformer
class DescendantList(object):
"""
Contain
"""
def __init__(self):
self.items = []
class BlockNavigationTransformer(BlockStructureTran... | agpl-3.0 |
dmlc/mxnet | example/ssd/dataset/mscoco.py | 36 | 4503 | # 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 |
openbaoz/titanium_mobile | android/runtime/v8/tools/jsmin.py | 52 | 10644 | #!/usr/bin/python2.4
# Copyright 2009 the V8 project authors. 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... | apache-2.0 |
buildhappy/ice | ruby/test/Ice/optional/run.py | 3 | 1035 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 |
ondra-novak/chromium.src | tools/telemetry/telemetry/core/backends/webdriver/webdriver_browser_backend.py | 47 | 2031 | # 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.
from telemetry.core import forwarders
from telemetry.core.backends import browser_backend
from telemetry.core.backends.webdriver import webdriver_tab_list_ba... | bsd-3-clause |
reprogrammer/pbbs | benchmarks/suffixArray/common/runTests.py | 98 | 10981 | import subprocess
import sys
import random
import os
def onPprocessors(command,p) :
if os.environ.has_key("OPENMP"):
os.putenv("OMP_NUM_THREADS", "%d" %p)
return command
elif os.environ.has_key("CILK"):
return command + " -cilk_set_worker_count " + `p`
elif os.environ.has_key("MKLROOT"):
return... | mit |
jeremycline/pulp | playpen/stresstests/crash-nss.py | 10 | 2698 | #!/usr/bin/python -tt
import optparse
import pycurl
import sys
from threading import Thread
import time
import traceback
class TestThread(Thread):
def __init__ (self, threadid, url, cacert, cert, key):
Thread.__init__(self)
self.threadid = threadid
self.stopped = False
self.url = ur... | gpl-2.0 |
ahamilton55/ansible | lib/ansible/modules/cloud/amazon/redshift.py | 45 | 16914 | #!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games 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 License, or
# (at your option) any later version.
#
# ... | gpl-3.0 |
emijrp/ArchiveBot | pipeline/archivebot/wpull/plugin.py | 3 | 2318 | import argparse
import functools
import hashlib
import sys
from wpull.database.sqltable import SQLiteURLTable
from wpull.document.html import HTMLReader
import wpull.processor.rule
from archivebot.dupespotter.dupes import DupesInMemory, DupesOnDisk
import archivebot.dupespotter.dupespotter
class NoFsyncSQLTable(SQL... | mit |
vmindru/ansible | lib/ansible/modules/network/f5/bigiq_utility_license_assignment.py | 22 | 20990 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
BrownDwarf/Starfish | attic/generate_webpage.py | 2 | 2031 | import jinja2
import yaml
import sys
import glob
import os
import subprocess
import numpy as np
'''Takes the output of a run and generates a viewable webpage. To be called by MCMC.py at the end of a run.'''
if len(sys.argv) > 1:
confname= sys.argv[1]
else:
confname = 'config.yaml'
f = open(confname)
config =... | bsd-3-clause |
boundlessgeo/QGIS | python/plugins/db_manager/db_plugins/spatialite/connector.py | 6 | 27423 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
ktan2020/legacy-automation | win/Lib/bsddb/test/test_dbshelve.py | 3 | 12297 | """
TestCases for checking dbShelve objects.
"""
import os, string, sys
import random
import unittest
from test_all import db, dbshelve, test_support, verbose, \
get_new_environment_path, get_new_database_path
if sys.version_info < (2, 4) :
from sets import Set as set
#----------... | mit |
naslanidis/ansible | lib/ansible/modules/cloud/google/gce_eip.py | 21 | 6825 | #!/usr/bin/python
# Copyright 2017 Google Inc.
#
# 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 vers... | gpl-3.0 |
haisland0909/Denoising-Dirty-Documents | script/prediction.py | 1 | 5057 | # coding: UTF8
from sklearn.pipeline import FeatureUnion
from sklearn.grid_search import GridSearchCV
from sklearn import preprocessing
from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor
import sklearn.linear_model
import img_to_pickle as i_p
import features as f
import classify
import prepr... | apache-2.0 |
sfepy/sfepy | sfepy/base/multiproc_mpi.py | 4 | 15406 | """
Multiprocessing functions.
"""
import logging
import os
import six
try:
from mpi4py import MPI
mpi_comm = MPI.COMM_WORLD
mpi_rank = mpi_comm.Get_rank()
mpi_status = MPI.Status()
use_multiprocessing = mpi_comm.Get_size() > 1
except:
use_multiprocessing = False
global_multiproc_dict = {}
mp... | bsd-3-clause |
tgbugs/hypush | hyputils/memex/models/user.py | 1 | 8621 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import re
import sqlalchemy as sa
from sqlalchemy.ext.hybrid import Comparator, hybrid_property
from sqlalchemy.ext.declarative import declared_attr
from hyputils.memex._compat import string_types
from hyputils.memex.db import Base
from ... | mit |
jarshwah/django | tests/postgres_tests/test_aggregates.py | 14 | 12772 | from django.contrib.postgres.aggregates import (
ArrayAgg, BitAnd, BitOr, BoolAnd, BoolOr, Corr, CovarPop, RegrAvgX,
RegrAvgY, RegrCount, RegrIntercept, RegrR2, RegrSlope, RegrSXX, RegrSXY,
RegrSYY, StatAggregate, StringAgg,
)
from django.db.models.expressions import F, Value
from django.test.utils import A... | bsd-3-clause |
alexlo03/ansible | lib/ansible/plugins/inventory/generator.py | 24 | 5479 | # Copyright (c) 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
DOCUMENTATION = '''
name: generator
plugin_type: inventory
version_added: "2.6"
shor... | gpl-3.0 |
shelbycruver/real-python-test | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.py | 915 | 12621 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBu... | gpl-2.0 |
noroutine/ansible | lib/ansible/utils/module_docs_fragments/openswitch.py | 166 | 4001 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.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 late... | gpl-3.0 |
kriberg/eve-armada | armada/logistics/models.py | 1 | 2472 | from django.db import models
from django.contrib import admin
from armada.capsuler.models import UserPilot, \
UserCorporation, \
UserAPIKey, \
Capsuler
class LogisticsTeam(models.Model):
name = models.CharField(max_length=200)
corporation = models.ForeignKey(UserCorporation)
creato... | agpl-3.0 |
xinghuacai/python_gray_3 | pydbg/system_dll.py | 2 | 4023 | #
# PyDBG
# Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com>
#
# $Id$
#
# 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 late... | gpl-2.0 |
pforret/python-for-android | python-modules/twisted/twisted/internet/cfreactor.py | 49 | 17464 | # -*- test-case-name: twisted.internet.test.test_core -*-
# Copyright (c) 2010 Twisted Matrix Laboratories
# See LICENSE for details.
"""
A reactor for integrating with U{CFRunLoop<http://bit.ly/cfrunloop>}, the
CoreFoundation main loop used by MacOS X.
This is useful for integrating Twisted with U{PyObjC<http://pyob... | apache-2.0 |
dochang/ansible | lib/ansible/utils/path.py | 11 | 1525 | # (c) 2012-2014, 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) an... | gpl-3.0 |
norayr/unisubs | utils/behaviors.py | 5 | 3871 | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | agpl-3.0 |
sapcc/monasca-agent | monasca_agent/collector/checks_d/prometheus.py | 1 | 8246 | """
Plugin to scrape prometheus endpoint
"""
# This file uses 'print' as a function rather than a statement, a la Python3
from __future__ import print_function
import math
import requests
# import prometheus client dependency dynamically
from monasca_agent.common import util
from requests import RequestException
tr... | bsd-3-clause |
etos/django | tests/custom_migration_operations/operations.py | 518 | 2171 | from django.db.migrations.operations.base import Operation
class TestOperation(Operation):
def __init__(self):
pass
def deconstruct(self):
return (
self.__class__.__name__,
[],
{}
)
@property
def reversible(self):
return True
d... | bsd-3-clause |
dashpay/electrum-dash | gui/qt/history_list.py | 2 | 6874 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | mit |
marcusmueller/gnuradio | gr-fec/python/fec/extended_async_encoder.py | 6 | 2644 | #!/usr/bin/env python
#
# Copyright 2014 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 option)
# ... | gpl-3.0 |
jwren/intellij-community | python/testData/inspections/PyTypeCheckerInspection/ComprehensionsOverAsyncGenerator.py | 10 | 1059 | async def asyncgen():
yield 10
async def run():
{i for i in <warning descr="Expected type 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>}
[i for i in <warning descr="Expected type 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>]
... | apache-2.0 |
40223139/203739test | static/Brython3.1.3-20150514-095342/Lib/stat.py | 765 | 4304 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... | gpl-3.0 |
sahilshekhawat/sympy | sympy/physics/tests/test_hydrogen.py | 83 | 4122 | from sympy import exp, integrate, oo, S, simplify, sqrt, symbols
from sympy.core.compatibility import range
from sympy.physics.hydrogen import R_nl, E_nl, E_nl_dirac
from sympy.utilities.pytest import raises
n, r, Z = symbols('n r Z')
def feq(a, b, max_relative_error=1e-12, max_absolute_error=1e-12):
a = float(a... | bsd-3-clause |
xujb/odoo | addons/hr_recruitment/report/__init__.py | 442 | 1107 | # -*- encoding: 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 |
vivyly/fancast | fancast/casting/views.py | 1 | 6503 | import simplejson
from django.views import generic
from django.http import HttpResponse
from django.views.decorators.csrf import (csrf_exempt,
requires_csrf_token)
from rest_framework import (viewsets,
generics,
)
from re... | bsd-3-clause |
hbhzwj/imalse | tools/FlowExporter.py | 3 | 5451 | #!/usr/bin/env python
""" An simple script to export flow, for test use only
"""
from __future__ import print_function, division
from subprocess import check_call
def export_to_txt(f_name, txt_f_name):
# cmd = """tshark -o column.format:'"No.", "%%m", "Time", "%%t", "Source", "%%s", "Destination", "%%d", "srcport... | gpl-3.0 |
molobrakos/home-assistant | homeassistant/components/opentherm_gw/climate.py | 6 | 6250 | """Support for OpenTherm Gateway climate devices."""
import logging
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
STATE_COOL, STATE_HEAT, STATE_IDLE, SUPPORT_TARGET_TEMPERATURE)
from homeassistant.const import (
ATTR_TEMPERATURE, CONF_NAME, PREC... | apache-2.0 |
blab/nextstrain-augur | builds/dengue/dengue.process.py | 1 | 9677 | from __future__ import print_function
import os, sys
# we assume (and assert) that this script is running from the virus directory, i.e. inside H7N9 or zika
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import base.process
from base.process import process
import argparse
import numpy as np
from deng... | agpl-3.0 |
skudriashev/incubator-airflow | setup.py | 2 | 9592 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
AnthonyBroadCrawford/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_whitespace_filter.py | 453 | 5642 | from __future__ import absolute_import, division, unicode_literals
import unittest
from html5lib.filters.whitespace import Filter
from html5lib.constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
try:
unittest.TestCase.assertEqual
except AttributeError:
unittest.TestCase.assertEqual =... | mpl-2.0 |
wanghaven/nupic | tests/unit/nupic/data/generators/pattern_machine_test.py | 35 | 3561 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
dlyle65535/metron | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params.py | 18 | 1243 | #!/usr/bin/env python
"""
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");... | apache-2.0 |
silentfuzzle/calibre | src/calibre/gui2/dialogs/edit_authors_dialog.py | 14 | 13862 | #!/usr/bin/env python2
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
__license__ = 'GPL v3'
from PyQt5.Qt import (Qt, QDialog, QTableWidgetItem, QAbstractItemView, QIcon,
QDialogButtonBox, QFrame, QLabel, QTimer, QMenu, QApplication,
... | gpl-3.0 |
pepetreshere/odoo | addons/point_of_sale/tests/test_frontend.py | 2 | 21456 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
from odoo.api import Environment
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
from datetime import date, timedelta
import odoo.tests
class TestPointOfSaleHttpCommon(odoo.tests.HttpCase):
... | agpl-3.0 |
LowerSilesians/geo-squizzy | build_big_data/main.py | 1 | 2041 | import random
import json
from models import CITY
class Duplicates:
def __init__(self):
self.storage = dict()
pass
class Feature:
def __init__(self, *args, **kwargs):
self.data = dict({"type": "Feature", "properties": dict(), "geometry": {"type": kwargs['type'], "coordinates": []}})
... | mit |
mrh1997/cymu | libclang/build-and-test-clang.py | 1 | 1065 | import subprocess
import sys
from os.path import dirname, join
prj_path = dirname(sys.argv[0])
if len(sys.argv) == 1 or sys.argv[1] != 'no-rebuild':
subprocess.check_call(['vagrant', 'powershell', '-c', 'cmd.exe', '-c',
r'C:\vagrant\build.cmd'])
sys.path.append(join(prj_path, r'src\tools... | gpl-3.0 |
abstract-open-solutions/commission | sale_commission/models/res_partner.py | 8 | 2601 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Pexego Sistemas Informáticos (<http://www.pexego.es>).
# Copyright (C) 2015 Avanzosc (<http://www.avanzosc.es>)
# Copyright (C) 2015 Pedro ... | agpl-3.0 |
sunclx/neon | neon/backends/autodiff.py | 10 | 17706 | # ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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.o... | apache-2.0 |
nash-x/hws | nova/openstack/common/report/__init__.py | 77 | 1098 | # Copyright 2013 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 agre... | apache-2.0 |
Parlin-Galanodel/scrapy | scrapy/utils/console.py | 12 | 3403 | from functools import wraps
from collections import OrderedDict
def _embed_ipython_shell(namespace={}, banner=''):
"""Start an IPython Shell"""
try:
from IPython.terminal.embed import InteractiveShellEmbed
from IPython.terminal.ipapp import load_default_config
except ImportError:
fr... | bsd-3-clause |
nvoron23/scipy | scipy/integrate/tests/test_quadrature.py | 54 | 7664 | from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import cos, sin, pi
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_almost_equal, assert_allclose, assert_
from scipy.integrate import (quadrature, romberg, romb, newton_cote... | bsd-3-clause |
DMLoy/ECommerceBasic | lib/python2.7/site-packages/pip/vendor/html5lib/treebuilders/etree.py | 79 | 12620 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBui... | mit |
pombreda/django-hotclub | libs/external_libs/docutils-0.4/test/test_parsers/test_rst/test_directives/test_sidebars.py | 5 | 1598 | #! /usr/bin/env python
# Author: David Goodger
# Contact: goodger@python.org
# Revision: $Revision: 3206 $
# Date: $Date: 2005-04-12 01:16:11 +0200 (Tue, 12 Apr 2005) $
# Copyright: This module has been placed in the public domain.
"""
Tests for the "sidebar" directive.
"""
from __init__ import DocutilsTestSupport
... | mit |
fbagirov/scikit-learn | benchmarks/bench_glm.py | 297 | 1493 | """
A comparison of different methods in GLM
Data comes from a random square matrix.
"""
from datetime import datetime
import numpy as np
from sklearn import linear_model
from sklearn.utils.bench import total_seconds
if __name__ == '__main__':
import pylab as pl
n_iter = 40
time_ridge = np.empty(n_it... | bsd-3-clause |
diogovk/ansible | lib/ansible/playbook/block.py | 15 | 11975 | # (c) 2012-2014, 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) an... | gpl-3.0 |
sjsrey/pysal | pysal/lib/common.py | 4 | 3385 | import copy
import sys
import time
# external imports
import numpy as np
import numpy.linalg as la
import scipy as sp
import scipy.stats as stats
from libpysal.cg.kdtree import KDTree
from scipy.spatial.distance import pdist, cdist
import pandas
try:
from patsy import PatsyError
except ImportError:
PatsyErr... | bsd-3-clause |
appneta/boto | boto/manage/__init__.py | 271 | 1108 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
hzhuang1/linux | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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(os.envir... | gpl-2.0 |
jhauberg/cards.py | cards/templatefield.py | 1 | 2868 | # coding=utf-8
"""
This module provides functions for working with template fields.
"""
import re
from typing import Iterator
class TemplateField: # pylint: disable=too-few-public-methods
""" Represents a field in a template. """
def __init__(self,
name: str=None,
contex... | mit |
chriscauley/django-shop | docs/OLD-out-of-date/snippets/modules.py | 20 | 6045 | # django_shop/checkout/__init__.py
# django_shop/checkout/__init__.py
from django_shop.checkout.site import CheckoutSite, checkoutsite
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
not present. This forces an import on them to register any admin bits they
... | bsd-3-clause |
ylcolala/scrapy | scrapy/spiders/crawl.py | 56 | 3521 | """
This modules implements the CrawlSpider which is the recommended spider to use
for scraping typical web sites that requires crawling pages.
See documentation in docs/topics/spiders.rst
"""
import copy
from scrapy.http import Request, HtmlResponse
from scrapy.utils.spider import iterate_spider_output
from scrapy.... | bsd-3-clause |
ctb/cvxpy | cvxpy/performance_tests/test_robustness.py | 10 | 2918 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... | gpl-3.0 |
hdinsight/hue | desktop/libs/libopenid/src/libopenid/views.py | 33 | 2179 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
mrunge/horizon_lib | horizon_lib/tables/actions.py | 1 | 38071 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
shaunstanislaus/grab | test/grab_xml_processing.py | 13 | 1189 | # coding: utf-8
from test.util import build_grab
from test.util import BaseGrabTestCase
class GrabXMLProcessingTestCase(BaseGrabTestCase):
def setUp(self):
self.server.reset()
def test_xml_with_declaration(self):
self.server.response['get.data'] =\
b'<?xml version="1.0" encoding="... | mit |
hjanime/VisTrails | vistrails/db/versions/v0_9_1/domain/log.py | 2 | 2562 | ###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
ccn-2m/django | django/db/backends/postgresql_psycopg2/version.py | 331 | 1502 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL 8.3.6
# EnterpriseDB 8.3
# PostgreSQL 8.3 beta4
# PostgreSQL 8.4beta1
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... | bsd-3-clause |
LibriCerule/Cerulean_Tracking | env/lib/python3.5/site-packages/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | mit |
jart/tensorflow | tensorflow/python/platform/control_imports.py | 154 | 1105 | # 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 |
drexly/tonginBlobStore | lib/django/conf/locale/el/formats.py | 446 | 1477 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd/m/Y'
TIME_FORMAT = 'P'
DATETIME... | bsd-3-clause |
uni-peter-zheng/autotest | frontend/tko/models_utils.py | 4 | 2982 | """
Simple utility wrappers around the TKO models
"""
from autotest.frontend.tko.models import Job, Test, Machine, TestLabel
def job_get_by_tag(tag):
'''
Return a job based on its tag
'''
try:
job = Job.objects.get(tag=tag)
return job
except Job.DoesNotExist:
return None
... | gpl-2.0 |
mastero9017/hammerhead | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
rcoscali/external-chromium-trace | trace-viewer/build/generate_standalone_timeline_view.py | 10 | 2875 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import parse_deps
import sys
import os
srcdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../src"))
... | bsd-3-clause |
marcuskelly/recover | Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | 327 | 26955 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Access to Python's configuration information."""
import codecs
import os
import re
import sys
from os.path import pardir, realpath
try:
import configparser
except ImportError:
import Conf... | bsd-2-clause |
omasanori/gyp | test/msvs/external_builder/gyptest-all.py | 260 | 1878 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Verifies that msvs_external_builder being set will invoke the provided
msvs_external_builder_build_cmd and msvs_external_builder_clean_c... | bsd-3-clause |
marwoodandrew/superdesk-aap | server/aap/publish/formatters/anpa_formatter_test.py | 1 | 15888 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from d... | agpl-3.0 |
tboyce1/home-assistant | tests/components/test_configurator.py | 8 | 4365 | """The tests for the Configurator component."""
# pylint: disable=protected-access
import unittest
import homeassistant.components.configurator as configurator
from homeassistant.const import EVENT_TIME_CHANGED, ATTR_FRIENDLY_NAME
from tests.common import get_test_home_assistant
class TestConfigurator(unittest.Test... | apache-2.0 |
JosmanPS/scikit-learn | sklearn/semi_supervised/label_propagation.py | 128 | 15312 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
repotvsupertuga/repo | plugin.video.zen/resources/lib/indexers/navigator.py | 1 | 14704 | # -*- coding: utf-8 -*-
'''
zen Add-on
Copyright (C) 2016 zen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later v... | gpl-2.0 |
Southpaw-TACTIC/TACTIC | src/tactic/ui/cgapp/loader_button_wdg.py | 2 | 2252 | ###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... | epl-1.0 |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/_markerlib/markers.py | 1769 | 3979 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... | apache-2.0 |
ErwanAliasr1/yum | yum/pkgtag_db.py | 12 | 4981 | #!/usr/bin/python -tt
# 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 distributed in the hope that i... | gpl-2.0 |
heimdali/ITK | Wrapping/Generators/Python/Tests/FlatStructuringElement.py | 19 | 1690 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
avneesh91/django | tests/multiple_database/routers.py | 48 | 1862 | from django.db import DEFAULT_DB_ALIAS
class TestRouter:
"""
Vaguely behave like primary/replica, but the databases aren't assumed to
propagate changes.
"""
def db_for_read(self, model, instance=None, **hints):
if instance:
return instance._state.db or 'other'
return '... | bsd-3-clause |
gsmartway/odoo | openerp/report/printscreen/ps_form.py | 381 | 5211 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
StefanRijnhart/OpenUpgrade | addons/stock_account/stock_account.py | 26 | 18407 | # -*- 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 |
crccheck/atx-bandc | bandc/apps/agenda/tests/test_utils.py | 1 | 3059 | import datetime
import os.path
from unittest import mock
from django.test import TestCase
from ..factories import BandCFactory
from ..utils import (
MeetingCancelled,
parse_date,
clean_text,
process_page,
get_number_of_pages,
_save_page,
)
from .. import scrape_logger
BASE_DIR = os.path.dirn... | bsd-3-clause |
arthru/OpenUpgrade | addons/account/project/wizard/project_account_analytic_line.py | 362 | 2343 | # -*- 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 |
LeeKamentsky/CellProfiler | cellprofiler/utilities/singleton.py | 3 | 9103 | # No CellProfiler copyright notice here because this file is in the
# public domain (see below).
'''
A Python Singleton mixin class that makes use of some of the ideas
found at http://c2.com/cgi/wiki?PythonSingleton. Just inherit
from it and you have a singleton. No code is required in
subclasses to create singleton b... | gpl-2.0 |
pallets/click | tests/test_defaults.py | 2 | 1079 | import click
def test_basic_defaults(runner):
@click.command()
@click.option("--foo", default=42, type=click.FLOAT)
def cli(foo):
assert type(foo) is float
click.echo(f"FOO:[{foo}]")
result = runner.invoke(cli, [])
assert not result.exception
assert "FOO:[42.0]" in result.outp... | bsd-3-clause |
SlimRemix/android_external_chromium_org | components/crash/tools/generate_breakpad_symbols.py | 43 | 7519 | #!/usr/bin/env python
# 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.
"""A tool to generate symbols for a binary suitable for breakpad.
Currently, the tool only supports Linux, Android, and Mac. Support f... | bsd-3-clause |
Zord13appdesa/python-for-android | python3-alpha/python3-src/Lib/test/threaded_import_hangers.py | 57 | 1428 | # This is a helper module for test_threaded_import. The test imports this
# module, and this module tries to run various Python library functions in
# their own thread, as a side effect of being imported. If the spawned
# thread doesn't complete in TIMEOUT seconds, an "appeared to hang" message
# is appended to the m... | apache-2.0 |
iradul/qtwebkit | Tools/Scripts/webkitpy/tool/steps/build.py | 119 | 2636 | # 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... | gpl-2.0 |
Nolski/airmozilla | airmozilla/manage/tests/views/test_uploads.py | 10 | 2500 | from nose.tools import eq_, ok_
from django.contrib.auth.models import User
from funfactory.urlresolvers import reverse
from airmozilla.main.models import Event
from airmozilla.uploads.models import Upload
from .base import ManageTestCase
class TestUploads(ManageTestCase):
def test_uploads(self):
user,... | bsd-3-clause |
chen0031/nupic | examples/opf/experiments/classification/scalar_TP_0/description.py | 32 | 1681 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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 |
dalegregory/odoo | addons/hr_attendance/report/attendance_errors.py | 377 | 3669 | # -*- 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 |
ideas4u/pyspider | tests/test_bench.py | 73 | 1272 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2014-12-10 01:34:09
import os
import sys
import time
import click
import shutil
import inspect
import unittest2 as unittest
from pyspider import run
fro... | apache-2.0 |
dllsf/odootest | addons/account/project/wizard/project_account_analytic_line.py | 362 | 2343 | # -*- 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 |
omnirom/android_external_chromium-org | third_party/cython/src/Cython/Compiler/MemoryView.py | 95 | 33761 | from Errors import CompileError, error
import ExprNodes
from ExprNodes import IntNode, NameNode, AttributeNode
import Options
from Code import UtilityCode, TempitaUtilityCode
from UtilityCode import CythonUtilityCode
import Buffer
import PyrexTypes
import ModuleNode
START_ERR = "Start must not be given."
STOP_ERR = "A... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.