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 |
|---|---|---|---|---|---|
williamfeng323/py-web | flask/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/__init__.py | 1778 | 1295 | ######################## BEGIN LICENSE BLOCK ########################
# 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 of the License, or (at your option) any later ve... | mit |
fatcloud/PyCV-time | experiments/stop_motion_tool/stop_motion_tool.py | 1 | 1533 | from cam import OpenCV_Cam
import cv2
import os.path
import time
cam = OpenCV_Cam(0)
cam.size = (1920, 1080)
KEY_ESC = 27
KEY_SPACE = ord(' ')
PAGE_DOWN = 2228224 # This make the stop motion to be controllable by presenter.
prevFrame = None
i = 0
#Make a directory on current working directory with date and time a... | mit |
WatanabeYasumasa/edx-platform | common/lib/calc/calc/functions.py | 279 | 1521 | """
Provide the mathematical functions that numpy doesn't.
Specifically, the secant/cosecant/cotangents and their inverses and
hyperbolic counterparts
"""
import numpy
# Normal Trig
def sec(arg):
"""
Secant
"""
return 1 / numpy.cos(arg)
def csc(arg):
"""
Cosecant
"""
return 1 / nump... | agpl-3.0 |
rderradi/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/write/DataWriter.py | 41 | 8289 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
jkenn99/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_list_tests_unittest.py | 1068 | 5415 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
googleapis/googleapis-gen | google/cloud/translate/v3beta1/translation-v3beta1-py/google/cloud/translate_v3beta1/types/__init__.py | 1 | 2684 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
SAM-IT-SA/odoo | addons/l10n_ca/__openerp__.py | 260 | 3087 | # -*- encoding: 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 G... | agpl-3.0 |
chen0510566/MissionPlanner | Lib/os.py | 52 | 27059 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the curr... | gpl-3.0 |
ojengwa/oh-mainline | vendor/packages/html5lib/setup.py | 18 | 1301 | from setuptools import setup, find_packages
import os
long_description="""HTML parser designed to follow the HTML5
specification. The parser is designed to handle all flavours of HTML and
parses invalid documents using well-defined error handling rules compatible
with the behaviour of major desktop web browsers.
Ou... | agpl-3.0 |
Precis/Diamond | src/collectors/snmpraw/snmpraw.py | 56 | 6074 | # coding=utf-8
"""
The SNMPRawCollector is designed for collecting data from SNMP-enables devices,
using a set of specified OIDs
#### Configuration
Below is an example configuration for the SNMPRawCollector. The collector
can collect data any number of devices by adding configuration sections
under the *devices* hea... | mit |
Ziqi-Li/bknqgis | numpy/numpy/ma/tests/test_deprecations.py | 8 | 2410 | """Test deprecation and future warnings.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import run_module_suite, assert_warns
from numpy.ma.testutils import assert_equal
from numpy.ma.core import MaskedArrayFutureWarning
class TestArgsort(object):
""" g... | gpl-2.0 |
plietar/certificate-transparency | python/ct/crypto/asn1/print_util.py | 35 | 3205 | # Utilities for printing ASN.1 values
def bits_to_hex(bit_array, delimiter=":"):
"""Convert a bit array to a prettily formated hex string. If the array
length is not a multiple of 8, it is padded with 0-bits from the left.
For example, [1,0,0,1,1,0,1,0,0,1,0] becomes 04:d2.
Args:
bit_array: the... | apache-2.0 |
jtpereyda/boofuzz | boofuzz/primitives/bit_field.py | 1 | 6982 | import struct
from builtins import range
import six
from past.builtins import map
from .. import helpers
from ..constants import LITTLE_ENDIAN
from ..fuzzable import Fuzzable
def binary_string_to_int(binary):
"""
Convert a binary string to a decimal number.
@type binary: str
@param binary: Binary ... | gpl-2.0 |
ubyssey/dispatch | dispatch/tests/test_core.py | 1 | 1743 | from django.test import TestCase
from dispatch.modules.integrations import BaseIntegration
class IntegrationTestCase(TestCase):
class TestIntegration(BaseIntegration):
ID = 'test-integration'
HIDDEN_FIELDS = [
'setting_d'
]
def test_integration_returns_empty_settings(sel... | gpl-2.0 |
g-weatherill/oq-hazardlib | openquake/hazardlib/gsim/fukushima_tanaka_1990.py | 4 | 6500 | # The Hazard Library
# Copyright (C) 2014 GEM 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 option) any later version.
#
# Th... | agpl-3.0 |
ilpianista/ansible | lib/ansible/plugins/lookup/first_found.py | 14 | 6019 | # (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, inc
# (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 = """
lookup: first_found
... | gpl-3.0 |
sexroute/commandergenius | project/jni/python/src/Tools/unicode/gencjkcodecs.py | 44 | 1988 | import os, string
codecs = {
'cn': ('gb2312', 'gbk', 'gb18030', 'hz'),
'tw': ('big5', 'cp950'),
'hk': ('big5hkscs',),
'jp': ('cp932', 'shift_jis', 'euc_jp', 'euc_jisx0213', 'shift_jisx0213',
'euc_jis_2004', 'shift_jis_2004'),
'kr': ('cp949', 'euc_kr', 'johab'),
'iso2022': ('iso2022_j... | lgpl-2.1 |
matmutant/sl4a | python/src/Lib/bsddb/test/test_associate.py | 34 | 14480 | """
TestCases for DB.associate.
"""
import sys, os, string
import time
from pprint import pprint
import unittest
from test_all import db, dbshelve, test_support, verbose, have_threads, \
get_new_environment_path
#----------------------------------------------------------------------
musicdata = {
1 : ("Ba... | apache-2.0 |
40223137/w17w17 | static/Brython3.1.0-20150301-090019/Lib/xml/dom/minicompat.py | 781 | 3228 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | gpl-3.0 |
RenderBroken/android_kernel_samsung_smdk4412 | 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 |
oklink-dev/bitcoin | contrib/devtools/test-security-check.py | 38 | 2651 | #!/usr/bin/python2
# Copyright (c) 2015-2016 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 script for security-check.py
'''
from __future__ import division,print_function
import subprocess
imp... | mit |
Eseoghene/bite-project | deps/gdata-python-client/tests/gdata_tests/apps/groups/data_test.py | 22 | 4638 | #!/usr/bin/python2.4
#
# Copyright 2011 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 require... | apache-2.0 |
akintoey/django | tests/utils_tests/test_functional.py | 273 | 3746 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.utils import six
from django.utils.functional import cached_property, lazy, lazy_property
class FunctionalTestCase(unittest.TestCase):
def test_lazy(self):
t = lazy(lambda: tuple(range(3)), list, tuple)
... | bsd-3-clause |
mtils/ems | ems/qt/richtext/char_format_actions.py | 1 | 6238 |
from ems.qt import QtWidgets, QtCore, QtGui
from ems.qt.richtext.char_format_proxy import CharFormatProxy
Qt = QtCore.Qt
QObject = QtCore.QObject
QColor = QtGui.QColor
QAction = QtWidgets.QAction
QKeySequence = QtGui.QKeySequence
QFont = QtGui.QFont
QIcon = QtGui.QIcon
QPixmap = QtGui.QPixmap
ThemeIcon = QIcon.fromTh... | mit |
hargup/sympy | sympy/matrices/dense.py | 12 | 44527 | from __future__ import print_function, division
import random
from sympy import Derivative
from sympy.core.basic import Basic
from sympy.core.compatibility import is_sequence, as_int, range
from sympy.core.function import count_ops
from sympy.core.decorators import call_highest_priority
from sympy.core.singleton impo... | bsd-3-clause |
JacquesLucke/still-lambda | pyglet/gl/lib_agl.py | 46 | 2804 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
basepi/hubble | tests/unittests/test_process_status.py | 2 | 8611 | from __future__ import absolute_import
import mock
import os
import sys
myPath = os.path.abspath(os.getcwd())
sys.path.insert(0, myPath)
import hubblestack.extmods.fdg.process_status
class TestProcessStatus():
'''
Class used to test the functions in ``process_status.py``
'''
@mock.patch('hubblestac... | apache-2.0 |
dgarros/ansible | lib/ansible/module_utils/iosxr.py | 14 | 5298 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Senseg/Py4A | python-modules/twisted/twisted/conch/test/test_userauth.py | 59 | 39075 | # -*- test-case-name: twisted.conch.test.test_userauth -*-
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the implementation of the ssh-userauth service.
Maintainer: Paul Swartz
"""
from zope.interface import implements
from twisted.cred.checkers import ICredentialsC... | apache-2.0 |
darkleons/lama | addons/sale_order_dates/sale_order_dates.py | 44 | 5170 | # -*- 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 |
candy7393/VTK | ThirdParty/Twisted/twisted/python/test/test_dist3.py | 26 | 1285 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.dist3}.
"""
from __future__ import division
import os
from twisted.trial.unittest import TestCase
from twisted.python.dist3 import modulesToInstall
class ModulesToInstallTests(TestCase):
"""
Tests for L{... | bsd-3-clause |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/tests/regressiontests/utils/baseconv.py | 44 | 1735 | from unittest import TestCase
from django.utils.baseconv import base2, base16, base36, base56, base62, base64, BaseConverter
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + range(-100, 100)
for converter in [base2, base16, base36, base56, base62, base64]:
... | mit |
Murano/microqa | app/forms.py | 1 | 1790 | # -*- coding: utf-8 -*-
from flask import flash
from flask_wtf import Form
from wtforms import StringField, TextAreaField, PasswordField, TextField
from model import User
from wtforms.validators import DataRequired, ValidationError
class QuestionForm(Form):
title = StringField(u"Заголовок вопроса", validators=[Da... | mit |
itoed/anaconda | pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py | 8 | 6641 | #
# Copyright (C) 2011-2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it wi... | gpl-2.0 |
xcat2/confluent | confluent_server/confluent/discovery/core.py | 2 | 56058 | # Copyright 2016-2021 Lenovo
#
# 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 |
yongshengwang/hue | desktop/core/ext-py/Pygments-1.3.1/build/lib/pygments/lexers/parsers.py | 72 | 23197 | # -*- coding: utf-8 -*-
"""
pygments.lexers.parsers
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for parser generators.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, \
include... | apache-2.0 |
jmehnle/ansible | test/units/plugins/lookup/test_ini.py | 119 | 2642 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@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
# (a... | gpl-3.0 |
moble/sympy | sympy/assumptions/tests/test_matrices.py | 71 | 8294 | from sympy import Q, ask, Symbol
from sympy.matrices.expressions import (MatrixSymbol, Identity, ZeroMatrix,
Trace, MatrixSlice, Determinant)
from sympy.matrices.expressions.factorizations import LofLU
from sympy.utilities.pytest import XFAIL
X = MatrixSymbol('X', 2, 2)
Y = MatrixSymbol('Y', 2, 3)
Z = MatrixSy... | bsd-3-clause |
OSVR/UIforETWbins | bin/StripChromeSymbols.py | 1 | 13713 | # Copyright 2015 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 by applicable... | apache-2.0 |
lmprice/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_hostmacro.py | 36 | 8385 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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 |
cloudbase/nova-virtualbox | nova/cmd/api_os_compute.py | 27 | 1497 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
ChawalitK/odoo | addons/sale_stock/tests/test_sale_stock.py | 1 | 14079 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.addons.sale.tests.test_sale_common import TestSale
class TestSaleStock(TestSale):
def test_00_sale_stock_invoice(self):
"""
Test SO's changes when playing around with stock moves, quants... | gpl-3.0 |
Liamraystanley/dropbin | lib/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## 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 |
bbc/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Internet/TCPClient.py | 3 | 15361 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FIXME: Uses the selector service, but has no way of indicating to the
# selector service that its services are no longer required.
# This needs resolving.
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Con... | apache-2.0 |
chengdh/openerp-ktv | openerp/addons/base_module_quality/wizard/quality_save_report.py | 9 | 2069 | # -*- 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 |
schieb/angr | angr/procedures/glibc/__libc_init.py | 3 | 1490 | import angr
######################################
# __libc_init
#
# Refer to http://androidxref.com/5.1.1_r6/xref/bionic/libc/bionic/libc_init_dynamic.cpp
# and http://androidxref.com/5.1.1_r6/xref/bionic/libc/private/KernelArgumentBlock.h
# raw_args points to argc, *argv, and *envp located on the stack
# unused is a... | bsd-2-clause |
yeahwhat-mc/CloudBotLegacy | plugins/namegen.py | 6 | 1784 | import json
import os
from util import hook, text, textgen
GEN_DIR = "./plugins/data/name_files/"
def get_generator(_json):
data = json.loads(_json)
return textgen.TextGenerator(data["templates"],
data["parts"], default_templates=data["default_templates"])
@hook.command(a... | gpl-3.0 |
souravsingh/sympy | sympy/matrices/immutable.py | 15 | 5158 | from __future__ import print_function, division
from sympy.core import Basic, Integer, Tuple, Dict, S, sympify
from sympy.core.sympify import converter as sympify_converter
from sympy.matrices.matrices import MatrixBase
from sympy.matrices.dense import DenseMatrix
from sympy.matrices.sparse import SparseMatrix, Mutab... | bsd-3-clause |
Imaginashion/cloud-vision | .fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
cchristelis/inasafe | safe/impact_functions/earthquake/itb_earthquake_fatality_model/metadata_definitions.py | 4 | 6561 | # coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Metadata for ITB Earthquake
Impact Function on Population.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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
... | gpl-3.0 |
mlaitinen/odoo | addons/sale_order_dates/sale_order_dates.py | 223 | 5308 | # -*- 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 |
wd5/jangr | _django/contrib/sitemaps/tests/urls.py | 233 | 1275 | from datetime import datetime
from django.conf.urls.defaults import *
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap
from django.contrib.auth.models import User
class SimpleSitemap(Sitemap):
changefreq = "never"
priority = 0.5
location = '/location/'
lastmod = datetime.now... | bsd-3-clause |
dbremner/bite-project | deps/mrtaskman/server/mapreduce/mapper_pipeline.py | 25 | 3513 | #!/usr/bin/env python
#
# Copyright 2011 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 o... | apache-2.0 |
Ichag/openerp-server | openerp/tests/test_mail_examples.py | 2 | 46300 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
MISC_HTML_SOURCE = """
<font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font>
<div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo... | agpl-3.0 |
Loreton/MP3Catalog | Source/Project/ExcelDB/ExcelCatalog.py | 1 | 1400 | #!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#
# Scope: Programma per ...........
# by Loreto Notarantonio 2013, February
# ######################################################################################
import os, sys
import ast
############################... | unlicense |
aps-sids/zulip | analytics/management/commands/active_user_stats.py | 115 | 2848 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import UserPresence, UserActivity
from zerver.lib.utils import statsd, statsd_key
from datetime import datetime, timedelta
from collections import defaultdict
class Command(BaseCommand):
help = """Sends... | apache-2.0 |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/mhlib.py | 290 | 33434 | """MH interface -- purely object-oriented (well, almost)
Executive summary:
import mhlib
mh = mhlib.MH() # use default mailbox directory and profile
mh = mhlib.MH(mailbox) # override mailbox location (default from profile)
mh = mhlib.MH(mailbox, profile) # override mailbox and profile
mh.error(format, ...)... | apache-2.0 |
darklordIN/android_kernel_sony_nicki-1 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
crowdhackathon-transport/optimizers | crowdstance-api/venv/lib/python2.7/site-packages/flask/testsuite/__init__.py | 564 | 7022 | # -*- coding: utf-8 -*-
"""
flask.testsuite
~~~~~~~~~~~~~~~
Tests Flask itself. The majority of Flask is already tested
as part of Werkzeug.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import os
import sys
im... | mit |
lrq3000/neuro_experiments_tools | utils/asciirename/unidecode/x0c1.py | 253 | 4765 | data = (
'syae', # 0x00
'syaeg', # 0x01
'syaegg', # 0x02
'syaegs', # 0x03
'syaen', # 0x04
'syaenj', # 0x05
'syaenh', # 0x06
'syaed', # 0x07
'syael', # 0x08
'syaelg', # 0x09
'syaelm', # 0x0a
'syaelb', # 0x0b
'syaels', # 0x0c
'syaelt', # 0x0d
'syaelp', # 0x0e
'syaelh', # 0x... | mit |
t0mk/ansible | test/units/cli/test_console.py | 194 | 1803 | # (c) 2016, Thilo Uttendorfer <tlo@sengaya.de>
#
# 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 |
kursitet/edx-platform | openedx/core/djangoapps/programs/utils.py | 21 | 3790 | """Helper functions for working with Programs."""
import logging
from django.core.cache import cache
from edx_rest_api_client.client import EdxRestApiClient
from openedx.core.djangoapps.programs.models import ProgramsApiConfig
from openedx.core.lib.token_utils import get_id_token
log = logging.getLogger(__name__)
... | agpl-3.0 |
mydongistiny/external_chromium_org | third_party/markdown/treeprocessors.py | 104 | 14665 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
itbabu/django-filer | filer/utils/filer_easy_thumbnails.py | 10 | 3208 | #-*- coding: utf-8 -*-
from easy_thumbnails.files import Thumbnailer
import os
import re
from filer import settings as filer_settings
# match the source filename using `__` as the seperator. ``opts_and_ext`` is non
# greedy so it should match the last occurence of `__`.
# in ``ThumbnailerNameMixin.get_thumbnail_name``... | mit |
Phuehvk/gyp | test/actions-multiple/gyptest-all.py | 345 | 2115 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies two actions can be attached to the same input files.
"""
import sys
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('a... | bsd-3-clause |
zhanqxun/cv_fish | numpy/polynomial/tests/test_polyutils.py | 202 | 3094 | """Tests for polyutils module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.polyutils as pu
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_module_suite)
class TestMisc(TestCase):
def... | apache-2.0 |
psi4/mongo_qcdb | qcfractal/storage_sockets/db_queries.py | 1 | 14717 | from typing import List, Optional, Set, Union
from sqlalchemy import Integer, inspect
from sqlalchemy.sql import bindparam, text
from qcfractal.interface.models import Molecule, ResultRecord
from qcfractal.storage_sockets.models import MoleculeORM, ResultORM
QUERY_CLASSES = set()
class QueryBase:
# The name/a... | bsd-3-clause |
rabimba/ns-3.18 | src/wifi/bindings/modulegen__gcc_ILP32.py | 10 | 877775 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
40223231/w16b_test | static/Brython3.1.1-20150328-091302/Lib/io.py | 623 | 9405 | import builtins
open = builtins.open
# for seek()
SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2
r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly rel... | agpl-3.0 |
scipy/scipy | scipy/fft/__init__.py | 7 | 3532 | """
==============================================
Discrete Fourier transforms (:mod:`scipy.fft`)
==============================================
.. currentmodule:: scipy.fft
Fast Fourier Transforms (FFTs)
==============================
.. autosummary::
:toctree: generated/
fft - Fast (discrete) Fourier Transf... | bsd-3-clause |
zaffra/Inquire | GAE/django/db/backends/sqlite3/introspection.py | 88 | 5864 | import re
from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict(object):
# Maps SQL types t... | bsd-3-clause |
wojtex/cantionale | title_index.py | 1 | 1914 |
class TitleIndex:
def __init__(self, songbook, params):
self.title = ''
self.filter = lambda x : True
if 'title' in params: self.title = params['title']
if 'filter' in params: self.filter = params['filter']
def draw(self, canvas, songbook):
sb = songbook
st = sb.style
c = canvas
wdt = sb.width
pos... | mit |
mheap/ansible | test/units/modules/network/f5/test_bigip_virtual_server.py | 22 | 31737 | # -*- 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
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | gpl-3.0 |
YOTOV-LIMITED/kuma | kuma/users/models.py | 9 | 5970 | import datetime
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.core import validators
from django.db import models
from django.utils.functional import cached_property
from constance import config
from sundial.zones import COMMON_GROUPED_CHOICES
from tower import ugett... | mpl-2.0 |
ddd332/presto | presto-docs/target/sphinx/pygments/styles/native.py | 26 | 1938 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... | apache-2.0 |
wuga214/Django-Wuga | env/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.py | 450 | 9668 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
def ... | apache-2.0 |
eickenberg/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | 19 | 2844 | """
Testing for mean shift clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.cluster import MeanShift
from sklearn.clu... | bsd-3-clause |
tempbottle/h-store | third_party/python/boto/cloudfront/exception.py | 221 | 1205 | # Copyright (c) 2006,2007 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... | gpl-3.0 |
estiko/lenovo_a706_xoplax | 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 |
krsjoseph/youtube-dl | devscripts/buildserver.py | 124 | 13186 | #!/usr/bin/python3
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import argparse
import ctypes
import functools
import sys
import threading
import traceback
import os.path
class BuildHTTPServer(ThreadingMixIn, HTTPServer):
allow_reuse_address = True
advapi32... | unlicense |
MarcosCommunity/odoo | addons/point_of_sale/report/pos_users_product.py | 380 | 3336 | # -*- 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 |
mrtexaznl/p2pool | p2pool/util/math.py | 130 | 6565 | from __future__ import absolute_import, division
import __builtin__
import math
import random
import time
def median(x, use_float=True):
# there exist better algorithms...
y = sorted(x)
if not y:
raise ValueError('empty sequence!')
left = (len(y) - 1)//2
right = len(y)//2
sum = y[left]... | gpl-3.0 |
espadrine/opera | chromium/src/third_party/webpagereplay/third_party/dns/node.py | 215 | 5914 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | bsd-3-clause |
sander76/home-assistant | homeassistant/components/onvif/camera.py | 7 | 6436 | """Support for ONVIF Cameras with FFmpeg as decoder."""
import asyncio
from haffmpeg.camera import CameraMjpeg
from haffmpeg.tools import IMAGE_JPEG, ImageFrame
from onvif.exceptions import ONVIFError
import voluptuous as vol
from homeassistant.components.camera import SUPPORT_STREAM, Camera
from homeassistant.compon... | apache-2.0 |
desirable-objects/hotwire-shell | hotwire/builtins/write.py | 3 | 2786 | # This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.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, includin... | gpl-2.0 |
171121130/SWI | venv/Lib/site-packages/openpyxl/drawing/effect.py | 2 | 9395 | from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
String,
Set,
Bool,
Integer,
NoneSet,
Float,)
from .colors import ColorChoice
class TintEffect(Serialisable):
... | mit |
aev3/trading-with-python | historicDataDownloader/historicDataDownloader.py | 77 | 4526 | '''
Created on 4 aug. 2012
Copyright: Jev Kuznetsov
License: BSD
a module for downloading historic data from IB
'''
import ib
import pandas
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
from time import sleep
import tradingWithPython.lib.logger as logger
from pandas impor... | bsd-3-clause |
IIoTeP9HuY/brotli | python/tests/roundtrip_test.py | 98 | 1504 | #!/usr/bin/env python
from __future__ import print_function
import sys
import os
from subprocess import check_call, Popen, PIPE
from test_utils import PYTHON, BRO, TEST_ENV, diff_q
INPUTS = """\
testdata/alice29.txt
testdata/asyoulik.txt
testdata/lcet10.txt
testdata/plrabn12.txt
../enc/encode.cc
../enc/dictionary.h
... | apache-2.0 |
mvaled/sentry | src/debug_toolbar/panels/sql/forms.py | 1 | 2785 | from __future__ import absolute_import, unicode_literals
import json
import hashlib
from django import forms
from django.conf import settings
from django.db import connections
from django.utils.encoding import force_text
from django.utils.functional import cached_property
from django.core.exceptions import Validation... | bsd-3-clause |
bkbilly/AlarmPI | alarmcode/notifier.py | 1 | 21921 | #!/usr/bin/env python
import threading
from alarmcode.colors import bcolors
import paho.mqtt.client as mqtt
import random
import json
import os
import smtplib
from email.mime.text import MIMEText
from collections import OrderedDict
import subprocess
import sys
import re
import requests
import logging
logging = loggin... | mit |
KapecK/or-tools | examples/data/strimko/strimko2_002.py | 74 | 1041 | streams = [
[1,1,2,2,2,2,2],
[1,1,2,3,3,3,2],
[1,4,1,3,3,5,5],
[4,4,3,1,3,5,5],
[4,6,6,6,7,7,5],
[6,4,6,4,5,5,7],
[6,6,4,7,7,7,7]
]
placed = [
[2,1,1],
[2,3,7],
[2,5,6],
[2,7,4],
[3,2,7],
[3,6,1],
[4,1,4],
[4,7,5],
[5,2,... | apache-2.0 |
manusev/plugin.video.kuchitv | resources/regex/freebroadcast.py | 1 | 5105 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# MonsterTV - XBMC Add-on by Juarrox (juarrox@gmail.com)
# Version 0.2.9 (18.07.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plug... | gpl-2.0 |
jude90/bottle | brick/structure.py | 3 | 1993 | '''
Created on 2013-4-21
@author: Xsank
'''
from collections import MutableMapping as DictMixin
class MultiDict(DictMixin):
def __init__(self, *a, **k):
self.dict = dict()
for k, v in dict(*a, **k).iteritems():
self[k] = v
def __len__(self): return len(self.dict)
def __iter... | mit |
michaelyin/code-for-blog | 2008/wx_mpl_bars.py | 12 | 7994 | """
This demo demonstrates how to embed a matplotlib (mpl) plot
into a wxPython GUI application, including:
* Using the navigation toolbar
* Adding data to the plot
* Dynamically modifying the plot's properties
* Processing mpl events
* Saving the plot to a file from a menu
The main goal is to serve as a basis for d... | unlicense |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/python/kernel_tests/bitcast_op_test.py | 56 | 2479 | # 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 |
crowdresearch/daemo | crowdsourcing/migrations/0000_get_worker_ratings_fn.py | 2 | 4499 | # -*- coding: utf-8 -*-
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0000_get_requester_ratings_fn'),
]
operations = [
migrations.RunSQL('''
CREATE OR REPLACE FUNCTION get_worker_ratings(IN worker_profile_id INTEGE... | mit |
soybean217/lora-python | UServer/admin_server/admin_data_update/model/gateway_locaton_data.py | 1 | 1618 | # _*_ coding:utf-8 _*_
from database.db4 import db4, Channel4, ConstDB4
from utils.log import Logger, Action
class Location:
channel_name = Channel4.gis_gateway_location + '*'
def __init__(self):
self.ps = db4.pubsub()
def psubscribe_gis(self):
self.ps.psubscribe(self.channel_name)
... | mit |
flwh/KK_mt6589_iq451 | prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/share/gdb/python/gdb/function/strfns.py | 137 | 2684 | # Useful gdb string convenience functions.
# Copyright (C) 2012-2013 Free Software Foundation, 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 you... | gpl-2.0 |
mvdbeek/tools-iuc | deprecated/tools/differential_count_models/rgToolFactory.py | 23 | 28139 | # rgToolFactory.py
# see https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
#
# copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012
#
# all rights reserved
# Licensed under the LGPL
# suggestions for improvement and bug fixes welcome at https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
#
# ... | mit |
Akasurde/ansible | lib/ansible/utils/collection_loader/_collection_config.py | 18 | 2945 | # (c) 2019 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
from ansible.module_utils.common.text.converters import to_text
from ansible.module_utils.six import with_meta... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.