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 |
|---|---|---|---|---|---|
Theer108/invenio | invenio/legacy/bibcirculation/webinterface.py | 6 | 60839 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 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 th... | gpl-2.0 |
recourse/netwatch | python/telnetpot.py | 1 | 1316 | from twisted.conch.insults import insults
from twisted.conch.telnet import TelnetTransport, StatefulTelnetProtocol
from twisted.internet import protocol
from common import PotFactory
# I probably suck as I just could not get to use AuthenticatingTelnetProtocol
class TelnetPotProtocol(StatefulTelnetProtocol):
state... | gpl-3.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/twisted/names/test/test_rfc1982.py | 46 | 13992 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.names.rfc1982}.
"""
from __future__ import division, absolute_import
import calendar
from datetime import datetime
from functools import partial
from twisted.names._rfc1982 import SerialNumber
from twisted.trial imp... | mit |
chokribr/PIST | modules/bibdocfile/lib/bibdocfile_managedocfiles.py | 3 | 132674 | ## $Id: Revise_Files.py,v 1.37 2009/03/26 15:11:05 jerome Exp $
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2012, 2013, 2014 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 Foundat... | gpl-2.0 |
Klozz/Stratos-kernel-GB | scripts/rt-tester/rt-tester.py | 904 | 5366 | #!/usr/bin/env python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
impor... | gpl-2.0 |
Jovy23/N930TUVU1APGC_Kernel | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # 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 |
edisonlz/fruit | web_project/base/site-packages/gdata/tlslite/errors.py | 333 | 5795 | """Exception classes.
@sort: TLSError, TLSAbruptCloseError, TLSAlert, TLSLocalAlert, TLSRemoteAlert,
TLSAuthenticationError, TLSNoAuthenticationError, TLSAuthenticationTypeError,
TLSFingerprintError, TLSAuthorizationError, TLSValidationError, TLSFaultError
"""
from constants import AlertDescription, AlertLevel
class ... | apache-2.0 |
misdoro/python-ase | ase/calculators/jacapo/utils/wannier.py | 2 | 24405 | from __future__ import print_function
""" class Wannier provides the function get_wannier_localization_matrix and initial_wannier.
"""
import numpy as np
from Scientific.IO.NetCDF import NetCDFFile as netCDF
def dagger(matrix,copy=1):
# First change the axis: (Does not allocate a new array)
matrix_con... | gpl-2.0 |
DemocracyLab/CivicTechExchange | common/helpers/form_helpers.py | 1 | 5175 | import json
from common.helpers.collections import find_first
from common.models.tags import Tag
from common.helpers.date_helpers import parse_front_end_datetime
from distutils.util import strtobool
from django.contrib.gis.geos import Point
def read_form_field_string(model, form, field_name, transformation=None):
... | mit |
v17al/Flexget | flexget/plugins/filter/exists_series.py | 5 | 5430 | from __future__ import unicode_literals, division, absolute_import
import copy
import logging
from path import path
from flexget import plugin
from flexget.event import event
from flexget.config_schema import one_or_more
from flexget.utils.log import log_once
from flexget.utils.template import RenderError
from flexge... | mit |
ibelem/crosswalk-test-suite | cordova/cordova-sampleapp-android-tests/sampleapp/CIRC_uninstall.py | 18 | 1986 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
matthiasdiener/spack | var/spack/repos/builtin/packages/argtable/package.py | 5 | 1635 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
foobarbazblarg/stayclean | stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_internal/cli/progress_bars.py | 15 | 9121 | from __future__ import division
import itertools
import sys
from signal import SIGINT, default_int_handler, signal
from pip._vendor import six
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
from pip._vendor.progress.spinner import Spinner
from pip._internal.utils.compat import WINDOWS
fr... | mit |
RedHatQE/pulp-automation | tests/general_tests/test_02_repo_importer_distributor.py | 2 | 3626 | import json, unittest
from tests import pulp_test
from pulp_auto.repo import Repo, Importer, Distributor
from pulp_auto.task import Task, TaskFailure
from tests.conf.roles import ROLES
from tests.conf.facade.yum import YumRepo
from pulp_auto import path_join
def setUpModule():
pass
class ImporterDistributorTest... | gpl-2.0 |
jerith/hrmpy | hrmpy/main.py | 1 | 5275 | import os
try:
from rpython.rlib.jit import JitDriver
except ImportError:
class JitDriver(object):
"""
Fake JitDriver to avoid a hard dependency on RPython.
"""
def __init__(self, **kw):
pass
def jit_merge_point(self, **kw):
pass
def can... | mit |
juanyaw/python | cpython/Lib/test/test_asyncio/test_windows_utils.py | 34 | 6274 | """Tests for window_utils"""
import socket
import sys
import unittest
import warnings
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _winapi
from asyncio import _overlapped
from asyncio import windows_utils
try:
from test import support
except ImportErro... | bsd-3-clause |
vanhonit/xmario_center | softwarecenter/db/pkginfo_impl/packagekit.py | 3 | 12648 | # Copyright (C) 2011 Canonical
#
# Authors:
# Alex Eftimie
#
# 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; version 3.
#
# This program is distributed in the hope that it will be useful, but W... | gpl-3.0 |
gtirloni/ansible-mediawiki-idrc | inventory/digital_ocean.py | 1 | 19886 | #!/usr/bin/env python
'''
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
d... | apache-2.0 |
aresch/rencode | tests/timetest.py | 1 | 10592 | # -*- coding: utf-8 -*-
#
# timetest.py
#
# Copyright (C) 2010 Andrew Resch <andrewresch@gmail.com>
#
# rencode is free software.
#
# You may 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... | gpl-3.0 |
kordano/samba-ldb-mdb | source4/torture/libnet/python/samr-test.py | 67 | 1895 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
# Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009
#
# 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 Founda... | gpl-3.0 |
dbcollection/dbcollection | dbcollection/datasets/flic/keypoints.py | 2 | 5791 | """
FLIC Keypoints process functions.
"""
from __future__ import print_function, division
import os
import numpy as np
import progressbar
from dbcollection.datasets import BaseTask
from dbcollection.utils.string_ascii import convert_str_to_ascii as str2ascii
from dbcollection.utils.file_load import load_matlab
from ... | mit |
mdublin/Brightcove-Dynamic-Ingest-App | ENV/lib/python2.7/site-packages/requests/packages/urllib3/contrib/ntlmpool.py | 59 | 4740 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... | mit |
ksachs/invenio | modules/bibformat/lib/bibformat.py | 18 | 18958 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 t... | gpl-2.0 |
jc0n/scrapy | tests/test_crawl.py | 14 | 10928 | import json
import socket
import logging
from testfixtures import LogCapture
from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy.http import Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.python import to_unicode
from tests import mock
from tests.spiders impo... | bsd-3-clause |
dennis-sheil/commandergenius | project/jni/python/src/Lib/encodings/euc_kr.py | 816 | 1027 | #
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('euc_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | lgpl-2.1 |
philipok-1/raspberry-slack | plugins/plugin_status.py | 1 | 1134 | import re
import utils, psutil
import subprocess
import router
import json
logger=utils.loggerMaster("slack.plugin_status")
def plugin_main(message, host):
logger.debug("testing plugin")
if re.match(r'.*(status).*', message, re.IGNORECASE):
cpu_pct = psutil.cpu_percent(interval=1, percpu=False)
... | mit |
kawasaki2013/python-for-android-x86 | python3-alpha/python3-src/Doc/includes/dbpickle.py | 100 | 2863 | # Simple example presenting how persistent ID can be used to pickle
# external objects by reference.
import pickle
import sqlite3
from collections import namedtuple
# Simple class representing a record in our database.
MemoRecord = namedtuple("MemoRecord", "key, task")
class DBPickler(pickle.Pickler):
def persi... | apache-2.0 |
CiscoSystems/vespa | neutron/extensions/vpnaas.py | 3 | 18743 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License... | apache-2.0 |
JanNash/sms-tools | lectures/05-Sinusoidal-model/plots-code/spectral-peaks-interpolation.py | 22 | 1234 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
from scipy.fftpack import fft, ifft
import math
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DFT
impo... | agpl-3.0 |
dgellis90/nipype | nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py | 12 | 1882 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..visualization import ConvertScalarImageToRGB
def test_ConvertScalarImageToRGB_inputs():
input_map = dict(args=dict(argstr='%s',
),
colormap=dict(argstr='%s',
mandatory=True,
position=4,
usedefault... | bsd-3-clause |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/jedi/evaluate/param.py | 3 | 16448 | from collections import defaultdict
from jedi._compatibility import zip_longest
from jedi import debug
from jedi import common
from jedi.parser import tree
from jedi.evaluate import iterable
from jedi.evaluate import analysis
from jedi.evaluate import context
from jedi.evaluate import docstrings
from jedi.evaluate imp... | bsd-3-clause |
8l/Bcachefs | scripts/rt-tester/rt-tester.py | 904 | 5366 | #!/usr/bin/env python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
impor... | gpl-2.0 |
dlintott/gns3-ppa | src/GNS3/Ui/ConfigurationPages/Form_PreferencesQemu.py | 3 | 88330 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './ConfigurationPages/Form_PreferencesQemu.ui'
#
# Created: Mon Sep 9 21:29:24 2013
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCo... | gpl-2.0 |
mrquim/mrquimrepo | script.video.F4mProxy/lib/flvlib/scripts/debug_flv.py | 98 | 3580 | import sys
import logging
from optparse import OptionParser
from flvlib import __versionstr__
from flvlib import tags
from flvlib import helpers
from flvlib.astypes import MalformedFLV
log = logging.getLogger('flvlib.debug-flv')
log.setLevel(logging.ERROR)
def debug_file(filename, quiet=False, metadata=False):
... | gpl-2.0 |
Vatican-Cameos/Babi-DiscordBot | cogs/interaction.py | 1 | 3932 | import discord
from discord.ext import commands
from .utils.dataIO import dataIO
import random
babiRespondsList = ["What?", "What do you want?" ,"yes?" , "Who called me?", "What did you say?"]
#channel_id uncomment this.
channel = discord.Object(channel_id)
class BabiCog:
"""My custom cog that does stuff!"""
... | gpl-3.0 |
variac/bazel | tools/android/resource_extractor.py | 13 | 3054 | # Copyright 2016 The Bazel 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 applicable la... | apache-2.0 |
j00bar/ansible | lib/ansible/modules/cloud/cloudstack/cs_sshkeypair.py | 32 | 8887 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
tynn/numpy | tools/test-installed-numpy.py | 9 | 2365 | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
# A simple script to test the installed version of numpy by calling
# 'numpy.test()'. Key features:
# -- convenient command-line syntax
# -- sets exit status appropriately, useful for automated test environments
# It would be b... | bsd-3-clause |
tongpo/Holle-World | py/easyGUI/demoprograms/chapter7/radiobuttondemo.py | 1 | 2484 | """
File: radiobuttondemo.py
Author: Kenneth A. Lambert
"""
from breezypythongui import EasyFrame
class RadiobuttonDemo(EasyFrame):
"""Allows the user to place a restaurant order from a set
of options."""
def __init__(self):
"""Sets up the window and widgets."""
EasyFrame.__init__(sel... | gpl-2.0 |
pedrobaeza/account-closing | __unported__/account_multicurrency_revaluation/__init__.py | 1 | 1114 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
allen-fdes/python_demo | venv/Lib/site-packages/pip/vcs/mercurial.py | 280 | 4974 | from __future__ import absolute_import
import logging
import os
import tempfile
import re
from pip.utils import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
from pip._vendor.six.moves import configparser
logger = logging.getLogger(__name__)
class Mercurial(Vers... | mit |
Mitchkoens/sympy | sympy/vector/vector.py | 42 | 13170 | from sympy.core.assumptions import StdFactKB
from sympy.core import S, Pow
from sympy.core.expr import AtomicExpr
from sympy.core.compatibility import range
from sympy import diff as df, sqrt, ImmutableMatrix as Matrix
from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.basisdependent import Basis... | bsd-3-clause |
rtruxal/metagoofil | pdfminer/fontmetrics.py | 65 | 25237 | #!/usr/bin/env python2
""" Font metrics for the Adobe core 14 fonts.
Font metrics are used to compute the boundary of each character
written with a proportional font.
The following data were extracted from the AFM files:
http://www.ctan.org/tex-archive/fonts/adobe/afm/
"""
### BEGIN Verbatim copy of the lice... | gpl-2.0 |
taoger/titanium_mobile | support/common/css/cssyacc.py | 37 | 10497 | # -*- coding: utf-8 -*-
'''
A parser for CSS.
'''
import re
from ply import yacc as ply_yacc
from csslex import csslexer
import css
__all__ = ('cssparser', 'yacc', 'parsetab')
def normalize(x):
'''Normalizes escaped characters to their literal value.'''
p = ur'\\0{0,4}([0-9]{2})'
r = lambda m: chr(int(m.... | apache-2.0 |
myerpengine/odoo | addons/edi/models/res_currency.py | 437 | 2892 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
vadimtk/chrome4sdp | tools/telemetry/third_party/webpagereplay/script_injector_test.py | 25 | 3887 | #!/usr/bin/env python
# Copyright 2013 Google 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... | bsd-3-clause |
pankajp/pyface | examples/image_widget.py | 5 | 4567 | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | bsd-3-clause |
neumerance/deploy | .venv/lib/python2.7/site-packages/sphinx/ext/pngmath.py | 5 | 8593 | # -*- coding: utf-8 -*-
"""
sphinx.ext.pngmath
~~~~~~~~~~~~~~~~~~
Render math in HTML via dvipng.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import codecs
import shutil
import tempfile
import posixpath
from os import path... | apache-2.0 |
kaiweifan/horizon | openstack_dashboard/openstack/common/fileutils.py | 13 | 3019 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apac... | apache-2.0 |
pasqualguerrero/django | tests/postgres_tests/test_aggregates.py | 307 | 11910 | 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 |
robbymeals/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
meabsence/python-for-android | python-build/python-libs/gdata/src/gdata/Crypto/PublicKey/pubkey.py | 228 | 6269 | #
# pubkey.py : Internal functions for public key operations
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty... | apache-2.0 |
magenta/note-seq | note_seq/performance_lib_test.py | 1 | 14802 | # Copyright 2021 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/pystache/tests/test_defaults.py | 32 | 2152 | # coding: utf-8
"""
Unit tests for defaults.py.
"""
import unittest
import pystache
from pystache.tests.common import AssertStringMixin
# TODO: make sure each default has at least one test.
class DefaultsConfigurableTestCase(unittest.TestCase, AssertStringMixin):
"""Tests that the user can change the defaul... | mit |
pixelgremlins/ztruck | dj/lib/python2.7/site-packages/django/utils/deconstruct.py | 83 | 2136 | # Avoid importing `importlib` from this package.
from __future__ import absolute_import
from importlib import import_module
from django.utils.version import get_docs_version
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsys... | apache-2.0 |
true-datura/freakhouse | config/settings/base.py | 1 | 8489 | """
Django settings for Freakhouse project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (freakhouse/con... | mit |
navdeepniku/ast | contrib/scripts/sip_to_pjsip/sip_to_pjsip.py | 4 | 41721 | #!/usr/bin/python
import optparse
import astdicts
import astconfigparser
import socket
import re
PREFIX = 'pjsip_'
###############################################################################
### some utility functions
###############################################################################
def section_b... | gpl-2.0 |
balanced/PyXB | tests/trac/test-trac-0153.py | 3 | 6600 | # -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSch... | apache-2.0 |
Antiun/c2c-rd-addons | c2c_budget_chricar/__terp__.py | 4 | 2268 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) Camptocamp SA - http://www.camptocamp.com
# Author: Arnaud WÃŒst ported by nbessi
#
# This file is part of the c2c_budget module
#
# WARNING: This program as such is intended to be used by profes... | agpl-3.0 |
patillacode/twallery | src/python/webserver/server.py | 1 | 2157 | import argparse
import json
import logging
# import subprocess
import sys
import traceback
from flask import Flask
from flask import render_template
# from flask import request
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
app = Flask(__name__)
@app.route("/gallery")
def gallery():
... | gpl-3.0 |
lirui-apache/hive | testutils/ptest/Process.py | 18 | 1672 | # 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 use ... | apache-2.0 |
shriker/sublime | Packages/mdpopups/st3/mdpopups/__init__.py | 2 | 21291 | # -*- coding: utf-8 -*-
"""
Markdown popup.
Markdown tooltips and phantoms for SublimeText.
TextMate theme to CSS.
https://manual.macromates.com/en/language_grammars#naming_conventions
"""
import sublime
import markdown
import jinja2
import traceback
import time
from . import version as ver
from . import colorbox
fr... | mit |
asmacdo/yum | completion-helper.py | 9 | 3417 | #!/usr/bin/python -t
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Ville Skyttä
#
# 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 |
schumi2004/NOT_UPDATED_Sick-Beard-Dutch | lib/hachoir_metadata/riff.py | 90 | 7707 | """
Extract metadata from RIFF file format: AVI video and WAV sound.
"""
from lib.hachoir_metadata.metadata import Metadata, MultipleMetadata, registerExtractor
from lib.hachoir_metadata.safe import fault_tolerant, getValue
from lib.hachoir_parser.container.riff import RiffFile
from lib.hachoir_parser.video.fourcc imp... | gpl-3.0 |
melgor/autograd | examples/sinusoid.py | 3 | 1120 | from __future__ import absolute_import
from __future__ import print_function
import autograd.numpy as np
import matplotlib.pyplot as plt
from autograd import grad
from six.moves import map
from six.moves import range
def fun(x):
return np.sin(x)
d_fun = grad(fun) # First derivative
dd_fun = grad(d_fun) # Secon... | mit |
stratton-oakcoin/oakcoin | test/functional/rpcnamedargs.py | 1 | 1305 | #!/usr/bin/env python3
# Copyright (c) 2016 The Oakcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test using named arguments for RPCs."""
from test_framework.test_framework import OakcoinTestFramework
from... | mit |
kevin-intel/scikit-learn | examples/exercises/plot_cv_diabetes.py | 23 | 2755 | """
===============================================
Cross-validation on diabetes Dataset Exercise
===============================================
A tutorial exercise which uses cross-validation with linear models.
This exercise is used in the :ref:`cv_estimators_tut` part of the
:ref:`model_selection_tut` section of ... | bsd-3-clause |
scs/uclinux | user/python/python-2.4.4/Lib/test/test_mimetypes.py | 5 | 2602 | import mimetypes
import StringIO
import unittest
from sets import Set
from test import test_support
# Tell it we don't know about external files:
mimetypes.knownfiles = []
mimetypes.inited = False
mimetypes._default_mime_types()
class MimeTypesTestCase(unittest.TestCase):
def setUp(self):
self.db = mime... | gpl-2.0 |
suffolklibraries/sljekyll | vendor/bundle/ruby/2.4.0/gems/ffi-1.11.1/ext/ffi_c/libffi/generate-darwin-source-and-headers.py | 44 | 6626 | #!/usr/bin/env python
import subprocess
import os
import errno
import collections
import glob
import argparse
class Platform(object):
pass
class simulator_platform(Platform):
directory = 'darwin_ios'
sdk = 'iphonesimulator'
arch = 'i386'
triple = 'i386-apple-darwin11'
version_min = '-miphoneos... | mit |
newyork167/volatility | volatility/plugins/linux/psaux.py | 45 | 1333 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
jchevin/MissionPlanner-master | Lib/distutils/filelist.py | 75 | 12429 | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
__revision__ = "$Id$"
import os, re
import fnmatch
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
cl... | gpl-3.0 |
gyst/plone.app.learning | bootstrap.py | 95 | 6158 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | gpl-2.0 |
rajeshmajumdar/cpanelbf | cpanelbf.py | 1 | 2607 | #!usr/bin/env python
import argparse
import urllib,urllib2
import re, time
import cookielib
import sys, os
import threading
import socket
def cls():
if os.name == "nt":
os.system('cls')
else:
os.system('clear')
cls()
logo = """
**
**
** _________ ___ ___
** | ____ \ / ... | gpl-2.0 |
OmeGak/indico | indico/modules/events/blueprint.py | 2 | 3390 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.modules.events.controllers.admin import (RHCreateRefe... | mit |
boneyao/sentry | src/sentry/search/migrations/0002_auto__del_searchtoken__del_unique_searchtoken_document_field_token__de.py | 32 | 2742 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'SearchDocument', fields ['project', 'group']
... | bsd-3-clause |
kzlin129/YouCompleteMe | python/ycm/client/resolve_completion_request.py | 4 | 3282 | # Copyright (C) 2020 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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) ... | gpl-3.0 |
spyder-ide/spyder-notebook | spyder_notebook/widgets/serverinfo.py | 1 | 4344 | # -*- coding: utf-8 -*-
#
# Copyright (c) Spyder Project Contributors
# Licensed under the terms of the MIT License
"""ServerInfoDialog, a dialog window showing info about notebook servers."""
# Standard library imports
import sys
# Qt imports
from qtpy.QtWidgets import (
QApplication, QComboBox, QDialogButtonB... | mit |
brianbruggeman/lose-7drl | lose/game.py | 1 | 2661 | # -*- coding: utf-8 -*-
import os
import copy
from random import seed, choice
from docopt import docopt
from .utils.ui import main_menu
from .__metadata__ import __versionstr__ as version
from .utils.logger import get_logger
from .utils.data_loaders import load_maps, load_mobs, load_items, load_tiles
def initialize... | apache-2.0 |
south-coast-science/scs_dfe_eng | src/scs_dfe/gps/pam_7q.py | 1 | 4006 | """
Created on 30 Dec 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
https://www.u-blox.com/en/product/pam-7q-module
example sentence set:
$GPGLL,5049.38388,N,00007.37172,W,113111.00,A,A*7E
$GPRMC,113112.00,A,5049.38381,N,00007.37173,W,0.017,,201119,,,A*60
$GPVTG,,T,,M,0.017,N,0.032,K,A*24
$GPGGA,11... | mit |
xzturn/tensorflow | tensorflow/python/kernel_tests/partitioned_variables_test.py | 22 | 26657 | # 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 |
nrz/ylikuutio | external/bullet3/examples/pybullet/gym/pybullet_examples/manyspheres.py | 4 | 1185 | import pybullet as p
import time
import pybullet_data
conid = p.connect(p.SHARED_MEMORY)
if (conid < 0):
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.setInternalSimFlags(0)
p.resetSimulation()
p.loadURDF("plane.urdf", useMaximalCoordinates=True)
p.loadURDF("tray/traybox.urdf", useMaxi... | agpl-3.0 |
csc8630Spring2014/Graphifier | align2.py | 1 | 3566 | import numpy as np
import sys, time
MAXSIZE = 501
align = np.ndarray((MAXSIZE,MAXSIZE), dtype='int16')
Talign = np.ndarray((MAXSIZE,MAXSIZE), dtype='int16')
similarity = np.ndarray((MAXSIZE,MAXSIZE), dtype='int32')
align.fill(-9999)
Talign.fill(-9999)
for i in range(0,MAXSIZE):
align[i,0] = 0
Talign[0,i] = 0
... | mit |
MVoloshin/limbo-android | jni/qemu/roms/seabios/tools/acpi_extract.py | 44 | 10031 | #!/usr/bin/python
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
# Process mixed ASL/AML listing (.lst file) produced by iasl -l
# Locate and execute ACPI_EXTRACT directives, output offset info
#
# Documentation of ACP... | gpl-2.0 |
tmtowtdi/MontyLacuna | gui/ORIGships/lib/appthreads.py | 2 | 11833 |
import datetime, functools, time
from PySide.QtCore import *
class BuildShipsInYards(QThread):
sig_empty = Signal(object)
### CHECK
### I'm currently not using the unchecked shipyard slots at all. I'll
### eventually need to collect those unchecked shipyards and count their
### slots and a... | mit |
djhenderson/ctypesgen | ctypesgencore/printer_json/printer.py | 13 | 5092 | #!/usr/bin/env python
import os, sys, time, json
from ctypesgencore.descriptions import *
from ctypesgencore.ctypedescs import *
from ctypesgencore.messages import *
import ctypesgencore.libraryloader # So we can get the path to it
import test # So we can find the path to local files in the printer package
def path_... | bsd-3-clause |
dpshelio/scikit-image | skimage/filters/rank/generic.py | 18 | 31373 | """The local histogram is computed using a sliding window similar to the method
described in [1]_.
Input image can be 8-bit or 16-bit, for 16-bit input images, the number of
histogram bins is determined from the maximum value present in the image.
Result image is 8-/16-bit or double with respect to the input image an... | bsd-3-clause |
othersite/document | scala/awesome-scala/metadata.py | 3 | 6399 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# by Erik Osheim
#
# Reads README.md, and writes a README.md.new. If the format of
# README.md changes, this script may need modifications.
#
# Currently it rewrites each section, doing the following:
# 1. alphabetizing
# 2. querying GitHub for stars and days since acti... | apache-2.0 |
chokribr/PIST | modules/webaccess/lib/external_authentication_cern_wrapper.py | 35 | 7433 | # -*- 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
## Licens... | gpl-2.0 |
DPaaS-Raksha/horizon | openstack_dashboard/usage/views.py | 12 | 2029 | import logging
from horizon import tables
from .base import BaseUsage
LOG = logging.getLogger(__name__)
class UsageView(tables.DataTableView):
usage_class = None
show_terminated = True
def __init__(self, *args, **kwargs):
super(UsageView, self).__init__(*args, **kwargs)
if not issubcla... | apache-2.0 |
Samuc/Proyecto-IV | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | gpl-2.0 |
kvar/ansible | lib/ansible/modules/cloud/opennebula/one_image.py | 52 | 11657 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""
(c) 2018, Milan Ilic <milani@nordeus.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the ter... | gpl-3.0 |
milseman/swift | utils/generate_confusables.py | 22 | 3277 | #!/usr/bin/env python
# utils/update_confusables.py - Utility to update definitions of unicode
# confusables
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# S... | apache-2.0 |
adazey/Muzez | libs/nltk/tokenize/util.py | 1 | 3167 | # Natural Language Toolkit: Tokenizer Utilities
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
from re import finditer
def string_span_tokenize(s, sep):
r"""
Return the offsets of... | gpl-3.0 |
jooojub/SPC | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # 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 |
dasMalle/AScriptADay2016 | January/16-StateMachine/OnOff_FSM.py | 1 | 2110 | from random import randint
from time import clock
##===========================================================
State = type("State", (object,), {}) # baseclass
class LightOn(State):
def Execute(self):
print("Light is on")
class LightOff(State):
def Execute(self):
print("Light is off")
##... | gpl-2.0 |
RedHatQE/cfme_tests | cfme/markers/uses.py | 7 | 2530 | """uses_*: Provides a set of fixtures used to mark tests for filtering on the command-line.
Tests using these fixtures directly or indirectly can be filtered using py.test's
``-k`` filter argument. For example, run tests that use the ssh client::
py.test -k uses_ssh
Additionally, tests using one of the fixtures ... | gpl-2.0 |
mikaelboman/home-assistant | homeassistant/helpers/event_decorators.py | 12 | 2402 | """Event Decorators for custom components."""
import functools
from homeassistant.helpers import event
HASS = None
def track_state_change(entity_ids, from_state=None, to_state=None):
"""Decorator factory to track state changes for entity id."""
def track_state_change_decorator(action):
"""Decorator ... | mit |
Bideau/SmartForrest | PythonServer/lib/python2.7/site-packages/setuptools/__init__.py | 158 | 5195 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import sys
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
import setuptools.version
from setuptools.extension import ... | mit |
HiSPARC/topaz | 150416_station_offsets/determine_dt.py | 1 | 6068 | """Determine the change in station offsets over time
For various combinations of stations in compact clusters
- First determine dt for each station pair coincidence once
- Use detector offsets from API
"""
import multiprocessing
import os
from datetime import datetime
import tables
from numpy import isnan
from s... | gpl-3.0 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/ctypes/macholib/dyld.py | 57 | 5510 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
dyld emulation
"""
import os
from framework import framework_info
from dylib import dylib_inf... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.