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 |
|---|---|---|---|---|---|
djwong/linux-xfs-dev | tools/perf/scripts/python/event_analyzing_sample.py | 185 | 7428 | # event_analyzing_sample.py: general event handler in python
# SPDX-License-Identifier: GPL-2.0
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other... | gpl-2.0 |
Ne02ptzero/Grog-Like | Angel/Libraries/freetype-2.4.8/src/tools/docmaker/tohtml.py | 395 | 18731 | # ToHTML (c) 2002, 2003, 2005, 2006, 2007, 2008
# David Turner <david@freetype.org>
from sources import *
from content import *
from formatter import *
import time
# The following defines the HTML header used by all generated pages.
html_header_1 = """\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/... | apache-2.0 |
mcgachey/edx-platform | lms/djangoapps/course_structure_api/v0/urls.py | 111 | 1635 | """
Courses Structure API v0 URI specification
"""
from django.conf import settings
from django.conf.urls import patterns, url
from course_structure_api.v0 import views
COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN
urlpatterns = patterns(
'',
url(r'^courses/$', views.CourseList.as_view(), name='list'),
... | agpl-3.0 |
bhargav2408/python-for-android | python3-alpha/python3-src/Lib/dbm/__init__.py | 45 | 5839 | """Generic interface to all dbm clones.
Use
import dbm
d = dbm.open(file, 'w', 0o666)
The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the cr... | apache-2.0 |
codename13/android_kernel_ba2x_2.0 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/zz_under_construction/zz_old/TensorFlow/Word2Vec/word2vec_basic.py | 8 | 8995 | # 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 |
arborh/tensorflow | tensorflow/python/profiler/option_builder.py | 25 | 16656 | # 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 |
yongshengwang/builthue | desktop/core/ext-py/tablib-develop/tablib/packages/xlwt/Workbook.py | 57 | 20514 | # -*- coding: windows-1252 -*-
'''
Record Order in BIFF8
Workbook Globals Substream
BOF Type = workbook globals
Interface Header
MMS
Interface End
WRITEACCESS
CODEPAGE
DSF
TABID
FNGROUPCOUNT
Workbook Protection Block
WINDOWPROTECT
PRO... | apache-2.0 |
infoxchange/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/views/urls.py | 38 | 5284 | # coding: utf-8
from os import path
from django.conf.urls.defaults import *
from models import *
import views
base_dir = path.dirname(path.abspath(__file__))
media_dir = path.join(base_dir, 'media')
locale_dir = path.join(base_dir, 'locale')
js_info_dict = {
'domain': 'djangojs',
'packages': ('regressionte... | gpl-3.0 |
ondoheer/flask-admin | flask_admin/contrib/mongoengine/ajax.py | 28 | 4204 | import mongoengine
from flask_admin._compat import string_types, as_unicode, iteritems
from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE
class QueryAjaxModelLoader(AjaxModelLoader):
def __init__(self, name, model, **options):
"""
Constructor.
:param fields:
... | bsd-3-clause |
sysadminmatmoz/OCB | addons/sales_team/sales_team.py | 2 | 2667 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
class crm_team(osv.Model):
_name = "crm.team"
_inherit = ['mail.thread', 'ir.needaction_mixin']
_description = "Sales Team"
_order = ... | agpl-3.0 |
jruben/jruben.github.io | node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/sql.py | 198 | 23461 | # -*- coding: utf-8 -*-
"""
pygments.lexers.sql
~~~~~~~~~~~~~~~~~~~
Lexers for various SQL dialects and related interactive sessions.
Postgres specific lexers:
`PostgresLexer`
A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL
lexer are:
- keywords and dat... | mit |
ahamilton55/ansible | lib/ansible/modules/network/avi/avi_network.py | 49 | 4780 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
mollie/mollie-api-python | mollie/api/objects/payment.py | 1 | 6068 | from .base import Base
class Payment(Base):
@classmethod
def get_resource_class(cls, client):
from ..resources.payments import Payments
return Payments(client)
STATUS_OPEN = "open"
STATUS_PENDING = "pending"
STATUS_CANCELED = "canceled"
STATUS_EXPIRED = "expired"
STATUS_F... | bsd-2-clause |
laiy/Database_Project | third_party/nltk/tag/hunpos.py | 5 | 5155 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the HunPos POS-tagger
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
# Dávid Márk Nemeskey <nemeskeyd@gmail.com> (modifications)
# Attila Zséder <zseder@gmail.com> (modifications)
# URL: <... | apache-2.0 |
roguesyko/reaper_kernel_lge_g3 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
andrecunha/idd3 | idd3/rules/universal/atomic_emitting_rulesets.py | 1 | 1614 | # -*- coding: utf-8 -*-
# IDD3 - Propositional Idea Density from Dependency Trees
# Copyright (C) 2014-2015 Andre Luiz Verucci da Cunha
#
# 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 ... | gpl-3.0 |
langner/cclib | test/regression.py | 1 | 144398 | # This file is part of cclib (http://cclib.github.io), a library for parsing
# and interpreting the results of computational chemistry packages.
#
# Copyright (C) 2020, the cclib development team
#
# The library is free software, distributed under the terms of
# the GNU Lesser General Public version 2.1 or later.... | bsd-3-clause |
mnapoli/mackup | mackup/main.py | 12 | 6208 | """Mackup.
Keep your application settings in sync.
Copyright (C) 2013-2015 Laurent Raufaste <http://glop.org/>
Usage:
mackup list
mackup [options] backup
mackup [options] restore
mackup [options] uninstall
mackup (-h | --help)
mackup --version
Options:
-h --help Show this screen.
-f --force Fo... | gpl-3.0 |
yodalee/servo | tests/wpt/css-tests/css21_dev/xhtml1print/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 |
denisff/python-for-android | python-build/python-libs/gdata/build/lib/gdata/tlslite/HandshakeSettings.py | 359 | 6364 | """Class for setting handshake parameters."""
from constants import CertificateType
from utils import cryptomath
from utils import cipherfactory
class HandshakeSettings:
"""This class encapsulates various parameters that can be used with
a TLS handshake.
@sort: minKeySize, maxKeySize, cipherNames, certifi... | apache-2.0 |
DIRACGrid/DIRAC | src/DIRAC/Interfaces/scripts/dirac_admin_get_job_pilots.py | 2 | 3073 | #!/usr/bin/env python
########################################################################
# File : dirac-admin-get-job-pilots
# Author : Stuart Paterson
########################################################################
"""
Retrieve info about pilots that have matched a given Job
Usage:
dirac-admin-ge... | gpl-3.0 |
ppcoin/ppcoin | test/functional/wallet_abandonconflict.py | 2 | 8155 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet... | mit |
chiragjogi/odoo | addons/purchase_requisition/wizard/__init__.py | 376 | 1112 | # -*- 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 |
Serag8/Bachelor | google_appengine/lib/grizzled/grizzled/exception.py | 19 | 1421 | # $Id: 2f91144fd898abfc5994a3a7de580cde341c5c07 $
"""
Provides some base exception classes.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Exports
# ---------------------------------------------------------------------------
__all__ = ['Exce... | mit |
areski/django | tests/gis_tests/geoapp/test_serializers.py | 245 | 3731 | from __future__ import unicode_literals
import json
from django.contrib.gis.geos import LinearRing, Point, Polygon
from django.core import serializers
from django.test import TestCase, mock, skipUnlessDBFeature
from django.utils import six
from .models import City, MultiFields, PennsylvaniaCity
@skipUnlessDBFeatur... | bsd-3-clause |
phoebusliang/parallel-lettuce | tests/integration/lib/Django-1.3/tests/modeltests/model_forms/models.py | 49 | 54171 | """
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... | gpl-3.0 |
mozmark/tls-observatory | vendor/github.com/google/certificate-transparency/python/utilities/logobserver/logobserver.py | 7 | 2496 | #!/usr/bin/env python
import gflags
from google.protobuf import text_format
import logging
import os
import sys
import requests
from ct.client.db import sqlite_connection as sqlitecon
from ct.client import prober
from ct.client.db import sqlite_log_db
from ct.client.db import sqlite_temp_db
from ct.client.db import sq... | mpl-2.0 |
axbaretto/beam | sdks/python/apache_beam/io/gcp/bigquery_read_it_test.py | 5 | 13636 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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,... | apache-2.0 |
darkleons/lama | addons/analytic/__init__.py | 424 | 1072 | # -*- 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 |
INM-6/elephant | elephant/sta.py | 2 | 13537 | # -*- coding: utf-8 -*-
"""
Functions to calculate spike-triggered average and spike-field coherence of
analog signals.
.. autosummary::
:toctree: _toctree/sta
spike_triggered_average
spike_field_coherence
:copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD... | bsd-3-clause |
hendradarwin/ITK | Wrapping/Generators/Python/Tests/CastImageFilter.py | 19 | 1145 | #==========================================================================
#
# 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 |
kuangrewawa/onos | tools/test/topos/optical.py | 36 | 2376 | #!/usr/bin/env python
''' file: optical.py '''
from mininet.topo import Topo
from mininet.node import RemoteController
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.link import Intf, Link
from mininet.util import irange
class NullIntf( Intf ):
... | apache-2.0 |
adamwwt/chvac | venv/lib/python2.7/site-packages/requests/packages/charade/jisfreq.py | 3131 | 47315 | ######################## 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 |
flar2/ElementalX-evita-8.0 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
sfl-drupal/drupalizer | drush.py | 1 | 6916 | # coding: utf-8
#
# Copyright (C) 2016 Savoir-faire Linux Inc. (<www.savoirfairelinux.com>).
#
# 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
# Licens... | gpl-3.0 |
elvishknight1/Terranova | venv/Lib/site-packages/pip/utils/outdated.py | 102 | 4954 | from __future__ import absolute_import
import datetime
import errno
import json
import logging
import os.path
import sys
from pip._vendor import lockfile
from pip._vendor import pkg_resources
from pip.compat import total_seconds
from pip.index import PyPI
from pip.locations import USER_CACHE_DIR, running_under_virtu... | artistic-2.0 |
yati-sagade/RyDyrect | django/core/management/commands/loaddata.py | 250 | 11042 | import sys
import os
import gzip
import zipfile
from optparse import make_option
from django.conf import settings
from django.core import serializers
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.db import connections, router, transaction, DEFAULT_DB_... | bsd-3-clause |
kewisch/bedrock | vendor-local/lib/python/south/tests/db.py | 93 | 44946 | import datetime
from warnings import filterwarnings
from south.db import db, generic
from django.db import connection, models, IntegrityError as DjangoIntegrityError
from south.tests import unittest, skipIf, skipUnless
from south.utils.py3 import text_type, with_metaclass
# Create a list of error classes from the va... | mpl-2.0 |
joevdh/HoloToolkit | Sharing/Src/External/RakNet-4.081/src/Samples/nacl_sdk/RakNet_NativeClient_VS2010/httpd.py | 32 | 10007 | #!/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 BaseHTTPServer
import imp
import logging
import multiprocessing
import optparse
import os
import SimpleHTTPServer # pylint:... | mit |
BlaXpirit/qbittorrent | src/searchengine/nova3/engines/demonoid.py | 20 | 6542 | #VERSION: 1.1
#AUTHORS: Douman (custparasite@gmx.se)
#CONTRIBUTORS: Diego de las Heras (diegodelasheras@gmail.com)
# 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 a... | gpl-2.0 |
aptana/Pydev | bundles/org.python.pydev.jython/Lib/string.py | 10 | 12746 | # module 'string' -- A collection of string operations
# Warning: most of the code you see here isn't normally used nowadays. With
# Python 1.6, many of these functions are implemented as methods on the
# standard string object. They used to be implemented by a built-in module
# called strop, but strop is now obsolet... | epl-1.0 |
squilter/ardupilot | Tools/Replay/CheckLogs.py | 27 | 5766 | #!/usr/bin/env python
'''
run Replay over a set of logs to check for code regressions
'''
import optparse, os, sys
parser = optparse.OptionParser("CheckLogs")
parser.add_option("--logdir", type='string', default='testlogs', help='directory of logs to use')
parser.add_option("--create-checked-logs", action='store_true... | gpl-3.0 |
floyd-fuh/afl-crash-analyzer | utilities/Logger.py | 1 | 2025 | #!/usr/bin/env python2.7
'''
AFL crash analyzer, crash triage for the American Fuzzy Lop fuzzer
Copyright (C) 2015 floyd
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 ve... | gpl-3.0 |
qwinner/GitPython | doc/source/conf.py | 4 | 6329 | # -*- coding: utf-8 -*-
#
# GitPython documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 24 11:51:01 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickl... | bsd-3-clause |
rjschof/gem5 | src/arch/x86/isa/insts/simd128/integer/data_transfer/move_non_temporal.py | 88 | 2447 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
thunfischbrot/spksrc | spk/haproxy/src/app/application/db.py | 34 | 6570 | # -*- coding: utf-8 -*-
from sqlalchemy import Column, Integer, Unicode, ForeignKey, event
from sqlalchemy.engine import create_engine, Engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.orm import relationship
import os.path
__all__ = ['Base... | bsd-3-clause |
aflaxman/scikit-learn | benchmarks/bench_sgd_regression.py | 50 | 5569 | # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
import gc
from time import time
from sklearn.linear_model import Ridge, SGDRegressor, ElasticNet
from sklearn.metrics import mean_squared_error
from sklearn.datasets.samples_generat... | bsd-3-clause |
Bitergia/allura | Allura/allura/ext/admin/admin_main.py | 1 | 36370 | import logging
from collections import defaultdict
from datetime import datetime
import pkg_resources
from pylons import c, g, request
from paste.deploy.converters import asbool
from tg import expose, redirect, flash, validate, config
from tg.decorators import with_trailing_slash, without_trailing_slash
from webob imp... | apache-2.0 |
ThomasSweijen/TPF | examples/adaptiveintegrator/simple-scene-plot-NewtonIntegrator.py | 6 | 2027 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('TkAgg')
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_Cundall... | gpl-2.0 |
bat-serjo/vivisect | vqt/application.py | 1 | 6519 | import os
import logging
from PyQt5 import QtCore
from PyQt5.QtWidgets import *
import vqt.cli as vq_cli
import vqt.main as vq_main
import vqt.saveable as vq_save
import vqt.hotkeys as vq_hotkeys
import vqt.menubuilder as vq_menu
from vqt.saveable import compat_isNone
logger = logging.getLogger(__name__)
class VQDo... | apache-2.0 |
UstadMobile/exelearning-ustadmobile-work | twisted/web/_stan.py | 44 | 10720 | # -*- test-case-name: twisted.web.test.test_stan -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An s-expression-like syntax for expressing xml in pure python.
Stan tags allow you to build XML documents using Python.
Stan is a DOM, or Document Object Model, implemented using basic Pyt... | gpl-2.0 |
google-code/android-scripting | python/src/Lib/distutils/dep_util.py | 53 | 3632 | """distutils.dep_util
Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: dep_util.py 58049 2007-09-08 00:34:17Z skip.montanaro $"
... | apache-2.0 |
flyfei/python-for-android | python-modules/twisted/twisted/internet/iocpreactor/reactor.py | 60 | 8986 | # -*- test-case-name: twisted.internet.test.test_iocp -*-
# Copyright (c) 2008-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Reactor that uses IO completion ports
"""
import warnings, socket, sys
from zope.interface import implements
from twisted.internet import base, interfaces, main, error
from... | apache-2.0 |
mvesper/invenio | modules/bibformat/lib/elements/bfe_duration.py | 3 | 3423 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio 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 (a... | gpl-2.0 |
zstyblik/infernal-twin | build/reportlab/build/lib.linux-i686-2.7/reportlab/pdfbase/_fontdata_enc_macexpert.py | 56 | 3058 | MacExpertEncoding = (None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,
'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', 'dollaroldstyle', 'dollarsuperior', '... | gpl-3.0 |
Kiiv/Sick-Beard | lib/subliminal/utils.py | 167 | 2027 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | gpl-3.0 |
gfonk/ansible | lib/ansible/plugins/callback/timer.py | 141 | 1030 | import os
import datetime
from datetime import datetime, timedelta
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This callback module tells you how long your plays ran for.
"""
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'aggregate'
CALLBACK_NAME = 'timer... | gpl-3.0 |
alindt/multibootusb | scripts/progressbar/compat.py | 13 | 1442 | # -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1... | gpl-2.0 |
musically-ut/numpy | numpy/core/tests/test_einsum.py | 8 | 25609 | from __future__ import division, absolute_import, print_function
import sys
import warnings
from decimal import Decimal
import numpy as np
from numpy.testing import *
class TestEinSum(TestCase):
def test_einsum_errors(self):
# Need enough arguments
assert_raises(ValueError, np.einsum)
ass... | bsd-3-clause |
dsprenkels/servo | tests/wpt/css-tests/css-text-decor-3_dev/html/support/generate-text-emphasis-style-property-tests.py | 841 | 3434 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-style-property-011 ~ 020 which
cover all possible values of text-emphasis-style property, except none
and <string>, with horizontal writing mode. It outputs a list of all
tests it generated in the format of Mozilla reftest.... | mpl-2.0 |
rbbratta/virt-test | libvirt/tests/src/virsh_cmd/domain/virsh_change_media.py | 2 | 6056 | import logging, os, shutil
from autotest.client.shared import error, utils
from virttest import libvirt_vm, virsh
from virttest.libvirt_xml import vm_xml
def run_virsh_change_media(test, params, env):
"""
Test command: virsh change-media.
The command changes the media used by CD or floppy drives.
Te... | gpl-2.0 |
ioam/param | tests/API1/testparamdepends.py | 1 | 2200 | """
Unit test for param.depends.
"""
import param
from . import API1TestCase
class TestParamDepends(API1TestCase):
def setUp(self):
class P(param.Parameterized):
a = param.Parameter()
b = param.Parameter()
@param.depends('a')
def single_parameter(self):
... | bsd-3-clause |
mrphrazer/miasm | miasm/expression/smt2_helper.py | 8 | 5822 | # Helper functions for the generation of SMT2 expressions
# The SMT2 expressions will be returned as a string.
# The expressions are divided as follows
#
# - generic SMT2 operations
# - definitions of SMT2 structures
# - bit vector operations
# - array operations
# generic SMT2 operations
def smt2_eq(a, b):
"""
... | gpl-2.0 |
edx/ansible | v2/ansible/plugins/lookup/random_choice.py | 16 | 1138 | # (c) 2013, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
maelnor/nova | nova/db/sqlalchemy/migrate_repo/versions/248_add_expire_reservations_index.py | 52 | 1913 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
agincel/AdamTestBot | unidecode/util.py | 51 | 1790 | # vim:ts=4 sw=4 expandtab softtabstop=4
from __future__ import print_function
import optparse
import locale
import os
import sys
import warnings
from unidecode import unidecode
PY3 = sys.version_info[0] >= 3
def fatal(msg):
sys.stderr.write(msg + "\n")
sys.exit(1)
def main():
default_encoding = locale.g... | mit |
yongshengwang/builthue | desktop/core/ext-py/Django-1.4.5/django/core/files/move.py | 403 | 2931 | """
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from django.core.files import locks
try:
from shutil import copystat
except ImportError:
import stat
def copystat(src, dst):
... | apache-2.0 |
peterfpeterson/mantid | scripts/Diffraction/isis_powder/hrpd_routines/hrpd_advanced_config.py | 3 | 2689 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... | gpl-3.0 |
blmousee/pyctp | example/pyctp2/trader/account.py | 7 | 3940 | # -*- coding:utf-8 -*-
import threading
import time
from ctp.futures import TraderApi, ApiStruct
from ..trader.trade_command_queue import TradeCommandQueue
from ..trader.trade_command import QueryAccountCommand
from ..trader.ctp_wrapper import TraderSpiDelegate
from ..common.base import INTERNAL_PATH
#数据定义中唯一一个enum... | mit |
group-policy/rally | tests/unit/task/test_context.py | 11 | 8917 | # Copyright 2014: Mirantis 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 b... | apache-2.0 |
cgore/pixie | pixie/vm/libs/env.py | 8 | 1483 | from pixie.vm.code import as_var
from pixie.vm.object import Object, Type, runtime_error
from pixie.vm.primitives import nil
from pixie.vm.string import String
import pixie.vm.stdlib as proto
from pixie.vm.code import extend, as_var
import pixie.vm.rt as rt
import os
class Environment(Object):
_type = Type(u"pixi... | lgpl-3.0 |
cfriedt/gnuradio | gr-pager/apps/usrp_rx_flex.py | 58 | 17097 | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: USRP FLEX Pager Receiver (Single Channel)
# Generated: Thu Oct 29 11:03:16 2009
##################################################
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio impor... | gpl-3.0 |
dpac-vlsi/SynchroTrace | configs/example/dragon_test_simpletest.py | 2 | 4825 | #
# Author: Ankit More
#
import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys
addToPath('../common')
addToPath('../ruby')
addToPath('../topologies')
import Options
import Ruby
# Get paths we might need. It's expected this file is ... | bsd-3-clause |
ccn-2m/django | tests/regressiontests/admin_changelist/admin.py | 47 | 2998 | from __future__ import absolute_import
from django.contrib import admin
from django.core.paginator import Paginator
from .models import (Event, Child, Parent, Genre, Band, Musician, Group,
Quartet, Membership, ChordsMusician, ChordsBand, Invitation, Swallow)
site = admin.AdminSite(name="admin")
class CustomPag... | bsd-3-clause |
google/eclipse2017 | scripts/get_user_ids.py | 1 | 1785 | #
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
autrilla/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/url.py | 125 | 23557 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# based on https://github.com/w3c/web-platform-tests/blob/275544eab54a0d0c7f74ccc2baae9711293d8908/url/urltestdata.txt
invalid = {
"scheme-trailing-tab": "a:\tfoo.com",
"scheme-trailing-newline": "a:\nfoo.com",... | mpl-2.0 |
cliu-aa/flask | tests/test_blueprints.py | 143 | 18147 | # -*- coding: utf-8 -*-
"""
tests.blueprints
~~~~~~~~~~~~~~~~
Blueprints (and currently modules)
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
from flask._compat import text_type
from werkzeug.http import parse_cache_control_... | bsd-3-clause |
jmhsi/justin_tinker | data_science/courses/learning_dl_packages/models/research/ptn/nets/ptn_im_decoder.py | 10 | 2902 | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
landryb/QGIS | python/user.py | 4 | 2363 | import os
import sys
import glob
import traceback
from PyQt4.QtCore import QCoreApplication
from qgis.core import QgsApplication, QgsMessageLog
def load_user_expressions(path):
"""
Load all user expressions from the given paths
"""
#Loop all py files and import them
modules = glob.glob(path + "/*... | gpl-2.0 |
goulu/pdfminer | tools/conv_cmap.py | 2 | 6043 | #!/usr/bin/env python3
import sys
import pickle as pickle
import codecs
class CMapConverter:
def __init__(self, enc2codec={}):
self.enc2codec = enc2codec
self.code2cid = {} # {'cmapname': ...}
self.is_vertical = {}
self.cid2unichr_h = {} # {cid: unichr}
self.cid2unichr_... | mit |
ehirt/odoo | addons/hr_holidays/wizard/__init__.py | 442 | 1122 | # -*- 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 |
sebinthomas/pyvarnam | pyvarnam/varnam_defs.py | 1 | 3346 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
""" Varnam library functions list
"""
# Varnam library functions list
from .utils import *
import ctypes as C
#REMINDER: Change this for every major release of varnam
LIBVARNAM_MAJOR_VERSION = 3
VARNAM_PATHS = ['','..','/usr/local/lib', '/usr/local/lib/i386-linux-gnu'... | mit |
sambler/oiio | testsuite/python-typedesc/test_typedesc.py | 4 | 5146 | #!/usr/bin/env python
import OpenImageIO as oiio
# Test that every expected enum value of BASETYPE exists
def basetype_enum_test():
try:
oiio.UNKNOWN
oiio.NONE
oiio.UCHAR
oiio.UINT8
oiio.CHAR
oiio.INT8
oiio.USHORT
oiio.UINT16
oiio.SHORT
... | bsd-3-clause |
ak2703/edx-platform | lms/djangoapps/mobile_api/social_facebook/courses/views.py | 85 | 2362 | """
Views for courses info API
"""
from rest_framework import generics, status
from rest_framework.response import Response
from courseware.access import is_mobile_available_for_user
from student.models import CourseEnrollment
from lms.djangoapps.mobile_api.social_facebook.courses import serializers
from ...users.... | agpl-3.0 |
rgayon/plaso | plaso/output/shared_dsv.py | 1 | 4484 | # -*- coding: utf-8 -*-
"""Shared functionality for delimiter separated values output modules."""
from __future__ import unicode_literals
from plaso.output import formatting_helper
from plaso.output import interface
class DSVEventFormattingHelper(formatting_helper.EventFormattingHelper):
"""Delimiter separated va... | apache-2.0 |
chrisseto/osf.io | scripts/approve_registrations.py | 3 | 2499 | """Run nightly, this script will approve any pending registrations that have
elapsed the pending approval time..
"""
import logging
import django
from django.utils import timezone
from django.db import transaction
from modularodm import Q
django.setup()
from framework.celery_tasks import app as celery_app
from osf ... | apache-2.0 |
ysasaki6023/NeuralNetworkStudy | cifar04/net.py | 1 | 3132 | #!/usr/bin/env python
import numpy as np
import chainer
import chainer.links as L
import chainer.functions as F
from chainer.utils import conv
class ImageProcessNetwork(chainer.Chain):
def __init__(self,
I_colors, I_Xunit, I_Yunit, F_unit,
N_PLayers = 4,
P0C_... | mit |
pombredanne/MOG | nova/tests/api/ec2/test_cloud.py | 5 | 129907 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the... | apache-2.0 |
kustodian/ansible | lib/ansible/modules/database/proxysql/proxysql_mysql_users.py | 5 | 16216 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = '''
---
module: proxysql_mysql_users
versi... | gpl-3.0 |
caltech-chimera/pychimera | scripts/multiphot.py | 1 | 9783 | #!/usr/bin/env python
"""
--------------------------------------------------------------------------
Routine to perform aperture photometry on CHIMERA science frames.
Usage: python fastphot.py [options] image coords
Authors:
Navtej Saini, Lee Rosenthal
Organization:
Caltech, Pas... | mit |
blaggacao/odoo | openerp/addons/test_limits/models.py | 435 | 1034 | # -*- coding: utf-8 -*-
import time
import openerp
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will consume between 'almost no
resource' and 'a lot of resource'.
"""
_name = 'test.limits.model'
def consume_nothing(self, cr, uid, context=None):
return True... | agpl-3.0 |
mallconnectionorg/openerp | rrhh/currency_rate_update/__init__.py | 26 | 1148 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 Camtocamp SA
# @author JB Aubort, Nicolas Bessi, Joel Grand-Guillaume
# European Central Bank and Polish National Bank invented by Grzegorz Grzelak
# Banxico implemented by Agustin C... | agpl-3.0 |
bountycoinoh/bountycoinoh | qa/rpc-tests/smartfees.py | 3 | 5363 | #!/usr/bin/env python
#
# Test fee estimation code
#
# Add python-bitcoinrpc to module search path:
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
import json
import random
import shutil
import subprocess
import tempfile
import traceback
from bitc... | mit |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/pip/_vendor/webencodings/mklabels.py | 512 | 1305 | """
webencodings.mklabels
~~~~~~~~~~~~~~~~~~~~~
Regenarate the webencodings.labels module.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
import json
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
def asser... | mit |
sunqm/pyscf | pyscf/scf/uhf_symm.py | 1 | 22155 | #!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... | apache-2.0 |
rjschof/gem5 | src/cpu/simple/probes/SimPoint.py | 53 | 2478 | # Copyright (c) 2012-2014 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | bsd-3-clause |
arve0/objectifiedetree | objectifiedetree/etree/ElementPath.py | 13 | 9924 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... | mit |
dimagol/trex-core | scripts/external_libs/pyzmq-14.5.0/python2/arm/ucs4/64bit/zmq/devices/monitoredqueuedevice.py | 44 | 1994 | """MonitoredQueue classes and functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq import ZMQError, PUB
from zmq.devices.proxydevice import ProxyBase, Proxy, ThreadProxy, ProcessProxy
from zmq.devices.monitoredqueue import monitored_queue
class Monitore... | apache-2.0 |
btabibian/scikit-learn | examples/cluster/plot_cluster_comparison.py | 46 | 6620 | """
=========================================================
Comparing different clustering algorithms on toy datasets
=========================================================
This example shows characteristics of different
clustering algorithms on datasets that are "interesting"
but still in 2D. With the exception ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.