repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ocminer/QuitDough-Release | refs/heads/master | contrib/testgen/base58.py | 2139 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... |
sahmed95/sympy | refs/heads/master | sympy/functions/special/__init__.py | 47 | from . import gamma_functions
from . import error_functions
from . import zeta_functions
from . import tensor_functions
from . import delta_functions
from . import elliptic_integrals
from . import beta_functions
from . import mathieu_functions
from . import polynomials
|
bnaul/scikit-learn | refs/heads/master | sklearn/impute/tests/test_impute.py | 3 | from __future__ import division
import pytest
import numpy as np
from scipy import sparse
from scipy.stats import kstest
import io
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing import assert_allclose_dense_sparse
from sklearn.utils._testing import assert_array_equal
from sklearn.uti... |
ruddra/django-oscar | refs/heads/master | tests/unit/checkout/calculator_tests.py | 6 | from decimal import Decimal as D
from django.test import TestCase
import mock
from oscar.apps.checkout import calculators
from oscar.apps.shipping import methods
from oscar.core import prices
class TestOrderTotalCalculator(TestCase):
def setUp(self):
self.calculator = calculators.OrderTotalCalculator()... |
crs4/biodoop-core | refs/heads/develop | bl/core/messages/details/__init__.py | 1 | # BEGIN_COPYRIGHT
#
# Copyright (C) 2009-2013 CRS4.
#
# This file is part of biodoop-core.
#
# biodoop-core 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 optio... |
ubiar/odoo | refs/heads/8.0 | addons/sale_order_dates/__openerp__.py | 260 | # -*- 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... |
drexly/tonginBlobStore | refs/heads/master | lib/django/contrib/gis/geos/prototypes/geom.py | 288 | from ctypes import POINTER, c_char_p, c_int, c_size_t, c_ubyte
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero,
)
# This is the return type used by bina... |
resmo/ansible | refs/heads/devel | lib/ansible/modules/network/icx/icx_l3_interface.py | 19 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
Work4Labs/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/gis/gdal/tests/test_ds.py | 233 | import os, os.path, unittest
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS
# List of acceptable data sources.... |
wrobstory/bearcart | refs/heads/master | examples/random_data.py | 5 | # -*- coding: utf-8 -*-
'''
An example for Bearcart
'''
import random
import bearcart
import pandas as pd
html_path = r'index.html'
data_path = r'data.json'
js_path = 'rickshaw.min.js'
css_path = 'rickshaw.min.css'
tabular_data_1 = [random.randint(10, 100) for x in range(0, 25, 1)]
tabular_data_2 = [random.randint(1... |
Jakob37/RASP | refs/heads/master | Scripts/OTUclustering/filter_low_count_otus.py | 1 | #!/usr/bin/env python3
"""
RASP: Rapid Amplicon Sequence Pipeline
Copyright (C) 2016, Jakob Willforss and Björn Canbäck
All rights reserved.
This file is part of RASP.
RASP 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 ... |
powlo/script.module.pydevd | refs/heads/master | lib/_pydev_imps/_pydev_sys_patch.py | 52 |
import sys
def patch_sys_module():
def patched_exc_info(fun):
def pydev_debugger_exc_info():
type, value, traceback = fun()
if type == ImportError:
#we should not show frame added by plugin_import call
if traceback and hasattr(traceback, "tb_next"):... |
zepto/musio-python2 | refs/heads/master | musio/conversion_util.py | 2 | #!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# Audio conversion utilities.
# Copyright (C) 2012 Josiah Gordon <josiahg@gmail.com>
#
# 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
# t... |
opesci/devito | refs/heads/master | devito/passes/clusters/asynchrony.py | 1 | from collections import defaultdict
from sympy import Mod, Mul
from devito.exceptions import InvalidOperator
from devito.ir.clusters import Queue
from devito.ir.support import Forward, SEQUENTIAL
from devito.tools import (DefaultOrderedDict, frozendict, is_integer,
indices_to_sections, timed... |
romain-dartigues/ansible | refs/heads/devel | lib/ansible/executor/playbook_executor.py | 7 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
hn8841182/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/re.py | 626 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... |
ygol/odoo | refs/heads/8.0 | addons/account_budget/__openerp__.py | 261 | # -*- 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... |
pepetreshere/odoo | refs/heads/patch-2 | addons/mass_mailing_event/__init__.py | 2787 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
|
qboticslabs/pyoverflow | refs/heads/master | examples/division_zero.py | 1 | #!/usr/bin/env python
import pyoverflow
a = input("Enter first number")
b = input("Enter second number")
try:
div = a/b
print div
except Exception as e:
#Error message and number of solutions
pyoverflow.submit_err(str(e),2)
#Wait for the magic :)
|
sbalant/swftools | refs/heads/master | wx/gui/fields.py | 10 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# gpdf2swf.py
# graphical user interface for pdf2swf
#
# Part of the swftools package.
#
# Copyright (c) 2008,2009 Matthias Kramm <kramm@quiss.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... |
anand1712/cloudpulse | refs/heads/master | cloudpulse/openstack/common/service.py | 1 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
FFMG/myoddweb.piger | refs/heads/master | monitor/api/python/Python-3.7.2/Lib/test/test_locale.py | 3 | from test.support import verbose, is_android, check_warnings
import unittest
import locale
import sys
import codecs
import warnings
class BaseLocalizedTest(unittest.TestCase):
#
# Base class for tests using a real locale
#
@classmethod
def setUpClass(cls):
if sys.platform == 'darwin':
... |
dpmatthews/rose | refs/heads/master | t/rosie.db/00-query.py | 4 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2012-2019 British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and... |
mambocab/rumble | refs/heads/master | tests/test_utils.py | 1 | from __future__ import division
import re
import pytest
from rumble import utils
def test_empty():
assert list(utils.ordered_uniques([])) == []
def test_already_unique():
expected = [1, 5, 3, 7]
assert list(utils.ordered_uniques(expected)) == expected
def test_remove_non_unique():
arg = [1, 5, ... |
carnotweat/cpupimp | refs/heads/master | couchpotato/core/media/movie/providers/userscript/sharethe.py | 45 | from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
autoload = 'ShareThe'
class ShareThe(UserscriptBase):
includes = ['http://*.sharethe.tv/movies/*', 'http://sharethe.tv/movies/*']
|
diogo149/autocause | refs/heads/master | autocause/core.py | 1 | import copy
from collections import defaultdict
from imp import load_source
import numpy as np
from sklearn.preprocessing import LabelBinarizer
from boomlet.utils.array import to_2d, column_combinations
from boomlet.utils.estimators import binarizer_from_classifier
from boomlet.transform.preprocessing import InfinityR... |
catapult-project/catapult | refs/heads/master | third_party/gsutil/third_party/pyasn1/pyasn1/codec/native/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
jeroenj/CouchPotatoServer | refs/heads/master | couchpotato/core/notifications/boxcar2.py | 68 | from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
log = CPLog(__name__)
autoload = 'Boxcar2'
class Boxcar2(Notification):
url = 'https://new.boxcar.io/api/notifications'
def notify(self, message = ... |
nlphacker/qemu-study | refs/heads/master | tests/qemu-iotests/qed.py | 248 | #!/usr/bin/env python
#
# Tool to manipulate QED image files
#
# Copyright (C) 2010 IBM, Corp.
#
# Authors:
# Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
import sys
import struct
import r... |
potherca-contrib/phpDocumentor2 | refs/heads/develop | docs/.exts/__init__.py | 308 | # -*- coding: utf-8 -*-
"""
sphinxcontrib
~~~~~~~~~~~~~
This package is a namespace package that contains all extensions
distributed in the ``sphinx-contrib`` distribution.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
__import__(... |
google-research/language | refs/heads/master | language/nqg/model/qcfg/compute_recall.py | 1 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
autarkist/enhanced_post | refs/heads/master | src/account/models.py | 10644 | from django.db import models
# Create your models here.
|
ntt-sic/glance | refs/heads/master | glance/api/cached_images.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... |
tuxskar/ord-en-ley | refs/heads/develop | ordenley/tests/views_test.py | 1 | # -*- coding: utf-8 -*-
'''
Created on Dec 8, 2012
@author: tuxskar
'''
import unittest
import gtk
import views.main
import views.client
import controllers.controller
import ordenley.tests
import ldtp
import models.Models
class main_test(unittest.TestCase):
def setUp(self):
"""Setup for main_view window ... |
jhancock93/autorest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/__init__.py | 53 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
chrism333/xpcc | refs/heads/develop | scons/site_tools/xpcc.py | 1 | #!/usr/bin/env python
#
# Copyright (c) 2009, Roboterclub Aachen e.V.
# 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
# ... |
gnowxilef/pycloudflare | refs/heads/master | tests/test_pagination.py | 1 | from unittest import TestCase
from pycloudflare.pagination import PaginatedAPIIterator
class PagitationTestsMixin(object):
def test_iterate_one_undersized_page(self):
self.responses = list(range(5))
r = list(self.psc)
self.assertEqual(r, self.responses)
def test_iterate_multiple_full... |
atheed/servo | refs/heads/master | tests/wpt/web-platform-tests/mathml/tools/utils/mathfont.py | 101 | from __future__ import print_function
import fontforge
from misc import MathMLAssociationCopyright
em = 1000
def create(aName):
print("Generating %s.woff..." % aName, end="")
mathFont = fontforge.font()
mathFont.fontname = aName
mathFont.familyname = aName
mathFont.fullname = aName
mathFont.co... |
libracore/erpnext | refs/heads/v12 | erpnext/selling/doctype/sales_partner_type/test_sales_partner_type.py | 17 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
class TestSalesPartnerType(unittest.TestCase):
pass
|
srfarias/Ultra-Kernel | refs/heads/master | scripts/gcc-wrapper.py | 501 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... |
crosswalk-project/chromium-crosswalk-efl | refs/heads/efl/crosswalk-10/39.0.2171.19 | tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py | 27 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import StringIO
import unittest
from telemetry import benchmark
from telemetry.results import chart_json_output_formatter
from telemet... |
cerebrumaize/leetcode | refs/heads/master | maxmal rectangle/1.py | 1 |
#!/usr/bin/env python
'''code description'''
# pylint: disable = I0011, E0401, C0103
class Solution(object):
'''Solution description'''
def func(self, matrix):
'''List[List[str]]
Solution function description
'''
if not matrix: return 0
n = len(matrix[0])
height... |
ycaihua/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/lib2to3/fixes/fix_next.py | 203 | """Fixer for it.next() -> next(it), per PEP 3114."""
# Author: Collin Winter
# Things that currently aren't covered:
# - listcomp "next" names aren't warned
# - "with" statement targets aren't checked
# Local imports
from ..pgen2 import token
from ..pygram import python_symbols as syms
from .. import fixer_base
f... |
adrienbrault/home-assistant | refs/heads/dev | homeassistant/components/ness_alarm/__init__.py | 14 | """Support for Ness D8X/D16X devices."""
from collections import namedtuple
import datetime
from nessclient import ArmingState, Client
import voluptuous as vol
from homeassistant.components.binary_sensor import DEVICE_CLASSES
from homeassistant.const import (
ATTR_CODE,
ATTR_STATE,
CONF_HOST,
CONF_SCA... |
titusfortner/selenium | refs/heads/master | py/test/selenium/webdriver/common/executing_javascript_tests.py | 23 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
jonyroda97/redbot-amigosprovaveis | refs/heads/develop | lib/websockets/py35/__init__.py | 21 | # This package contains code using async / await syntax added in Python 3.5.
# It cannot be imported on Python < 3.5 because it triggers syntax errors.
|
clarammdantas/Online-Jugde-Problems | refs/heads/master | AA_fera_15_1/string_task.py | 4 | # coding: utf-8
# Maria Clara Dantas, UFCG
# string_task
palavra = raw_input()
nova_palavra = ''
for i in range(len(palavra)):
if palavra[i] not in 'AEIOUYaeiouy':
nova_palavra += '.' + palavra[i].lower()
print nova_palavra
|
zhjunlang/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_buffer.py | 80 | #
# The ndarray object from _testbuffer.c is a complete implementation of
# a PEP-3118 buffer provider. It is independent from NumPy's ndarray
# and the tests don't require NumPy.
#
# If NumPy is present, some tests check both ndarray implementations
# against each other.
#
# Most ndarray tests also check that memoryvi... |
unseenlaser/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_zip.py | 170 | """
Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
unless there exists a 'from future_builtins import zip' statement in the
top-level namespace.
We avoid the transformation if the zip() call is directly contained in
iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
"""
#... |
fulmicoton/pylearn2 | refs/heads/master | pylearn2/expr/activations.py | 48 | """
.. todo::
WRITEME
"""
import theano
T = theano.tensor
def identity(x):
"""
.. todo::
WRITEME properly
Importable identity function. Created for the purposes of pickling.
"""
return x
def relu(x):
"""
.. todo::
WRITEME properly
Rectified linear activation
... |
ibethune/lammps | refs/heads/master | tools/i-pi/ipi/engine/barostats.py | 33 | """Contains the classes that deal with constant pressure dynamics.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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 Licens... |
aidanlister/django | refs/heads/master | tests/mail/test_sendtestemail.py | 327 | from __future__ import unicode_literals
from django.core import mail
from django.core.management import call_command
from django.test import SimpleTestCase, override_settings
@override_settings(
ADMINS=(('Admin', 'admin@example.com'), ('Admin and Manager', 'admin_and_manager@example.com')),
MANAGERS=(('Manag... |
geminy/aidear | refs/heads/master | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/testing/test_env.py | 12 | #!/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.
"""Sets environment variables needed to run a chromium unit test."""
import os
import stat
import subprocess
import sys
# This is... |
Mightyjo/yaml-cpp | refs/heads/master | test/gmock-1.7.0/gtest/test/gtest_catch_exceptions_test.py | 2139 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... |
pombredanne/invenio-old | refs/heads/master | modules/bibformat/lib/elements/bfe_record_stats.py | 4 | ## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS 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 (... |
weety/rt-thread | refs/heads/master | bsp/stm32/stm32mp157a-st-ev1/rtconfig.py | 6 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... |
GustavoHennig/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_scaling_policy.py | 6 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
evernym/plenum | refs/heads/master | plenum/bls/bls_store.py | 2 | from common.exceptions import ValueUndefinedError
from common.serializers.serialization import multi_sig_store_serializer
from storage.helper import initKeyValueStorage
from crypto.bls.bls_multi_signature import MultiSignature
from typing import Optional
class BlsStore:
def __init__(self,
key_va... |
ntrrgc/snorky | refs/heads/master | snorky/demos/snorky_todo_react/snorky_todo/views.py | 2 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.contrib.staticfiles.views import serve
def home_view(request):
return serve(request, "/index.html")
|
Stanford-Online/edx-platform | refs/heads/master | openedx/core/djangoapps/schedules/content_highlights.py | 12 | """
Contains methods for accessing weekly course highlights. Weekly highlights is a
schedule experience built on the Schedules app.
"""
import logging
from courseware.module_render import get_module_for_descriptor
from courseware.model_data import FieldDataCache
from openedx.core.djangoapps.schedules.config import COU... |
aioue/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_pool.py | 19 | #!/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... |
supersven/intellij-community | refs/heads/master | python/testData/formatter/blankLineBetweenMethods_after.py | 79 | class C:
def foo(self):
pass
def bar(self):
pass
|
kudos/passwords | refs/heads/master | passwords/pbkdf2.py | 1 | # -*- coding: utf-8 -*-
"""
pbkdf2
~~~~~~
This module implements pbkdf2 for Python. It also has some basic
tests that ensure that it works. The implementation is straightforward
and uses stdlib only stuff and can be easily be copy/pasted into
your favourite application.
Use this as repla... |
ahmednuaman/gdrive-cms-py-gae | refs/heads/master | oauth2client/keyring_storage.py | 274 | # Copyright (C) 2012 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 writ... |
sserrot/champion_relationships | refs/heads/master | venv/share/doc/networkx-2.4/examples/drawing/plot_four_grids.py | 1 | #!/usr/bin/env python
"""
==========
Four Grids
==========
Draw a graph with matplotlib.
You must have matplotlib for this to work.
"""
# Author: Aric Hagberg (hagberg@lanl.gov)
# Copyright (C) 2004-2019
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
#... |
PeterPetrik/QGIS | refs/heads/master | tests/src/python/test_qgsfiledownloader.py | 16 | # -*- coding: utf-8 -*-
"""
Test the QgsFileDownloader class
Run test with:
LC_ALL=en_US.UTF-8 ctest -V -R PyQgsFileDownloader
.. 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
the Free Software Foundation; either versio... |
XiaonuoGantan/python-algorithms | refs/heads/master | tree.py | 1 | class BinarySearchTree:
def __init__(self):
self.root = None
self.size = 0
def length(self):
return self.size
def __len__(self):
return self.size
def __iter__(self):
return self.root.__iter__()
def put(self, key, val):
if self.root is not None:
... |
Tehsmash/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/contrib/test_security_group_default_rules.py | 18 | # Copyright 2013 Metacloud, 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 agr... |
homerquan/mongo-connector | refs/heads/master | ez_setup.py | 87 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... |
peercoin/peercoin | refs/heads/master | test/functional/wallet_create_tx.py | 16 | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
asse... |
waveform80/lars | refs/heads/master | tests/test_cache.py | 1 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2013 Mime Consulting Ltd. <info@mimeconsulting.co.uk>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated docum... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/views/decorators/http.py | 94 | """
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from email.Utils import formatdate
from django.utils.decorators import decorato... |
dbckz/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_template.py | 44 | #!/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... |
kubeflow/pipelines | refs/heads/master | sdk/python/tests/dsl/component_tests.py | 1 | # Copyright 2018 The Kubeflow 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... |
phektus/Django-Google-AppEngine-OpenId-Auth | refs/heads/master | django/contrib/gis/db/models/aggregates.py | 512 | from django.db.models import Aggregate
from django.contrib.gis.db.models.sql import GeomField
class Collect(Aggregate):
name = 'Collect'
class Extent(Aggregate):
name = 'Extent'
class Extent3D(Aggregate):
name = 'Extent3D'
class MakeLine(Aggregate):
name = 'MakeLine'
class Union(Aggregate):
nam... |
ehiggs/hanythingondemand | refs/heads/master | hod/local.py | 1 | #!/usr/bin/env python
# ##
# Copyright 2009-2015 Ghent University
#
# This file is part of hanythingondemand
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),... |
valorekhov/AvrBee | refs/heads/master | src/AvrBee/ArduinoXbeeApiModeProgrammer.py | 1 | import select
from AvrIspFlow import *
from HexFileFormat import HexFileFormat
class ArduinoXbeeApiModeProgrammer(object):
def __init__(self, xbee, targetName, resetPin = 'D3'):
self.targetName = targetName
self.resetPin = resetPin
self.xbee = xbee
def resolve_target(self):
... |
etalab/udata | refs/heads/master | udata/core/storages/utils.py | 2 | import hashlib
import mimetypes
import os
import zlib
from slugify import Slugify
CHUNK_SIZE = 2 ** 16
slugify = Slugify(separator='-', to_lower=True, safe_chars='.')
def hash(file, hasher):
blk_size_to_read = hasher.block_size * CHUNK_SIZE
while (True):
read_data = file.read(blk_size_to_read)
... |
farseerfc/pacman-fc | refs/heads/master | test/pacman/tests/sync102.py | 27 | self.description = "Sysupgrade with a newer local package"
sp = pmpkg("dummy", "0.9-1")
sp.files = ["bin/foo", "bin/bar"]
lp = pmpkg("dummy")
lp.files = ["bin/foo", "bin/baz"]
self.addpkg2db("sync", sp)
self.addpkg2db("local", lp)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.... |
nhejazi/scikit-learn | refs/heads/master | sklearn/metrics/tests/test_classification.py | 3 | from __future__ import division, print_function
import numpy as np
from scipy import linalg
from functools import partial
from itertools import product
import warnings
from sklearn import datasets
from sklearn import svm
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import la... |
BrainDamage/Flexget | refs/heads/develop | flexget/ui/plugins/plugins/plugins.py | 16 | from __future__ import unicode_literals, division, absolute_import
from flask import Blueprint, jsonify
from flexget.ui.webui import register_plugin
from flexget.plugin import plugins, get_plugins, task_phases, plugin_contexts
plugins_module = Blueprint('plugins', __name__)
def plugin_infos(plugins):
def plugin_... |
ohio813/pyflag | refs/heads/master | src/plugins/Themes/XML.py | 7 | """ A basic XML Theme support files """
import pyflag.Reports as Reports
import pyflag.Registry as Registry
class Schema(Reports.report):
name = "List"
family = "Introspection"
hidden = True
parameters = {'object':'any'}
def display(self, query, result):
obj = query['object']
if ... |
liavkoren/djangoDev | refs/heads/master | django/contrib/gis/utils/layermapping.py | 3 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/air_quality/group.py | 27 | """Describe group states."""
from homeassistant.components.group import GroupIntegrationRegistry
from homeassistant.core import callback
from homeassistant.helpers.typing import HomeAssistantType
@callback
def async_describe_on_off_states(
hass: HomeAssistantType, registry: GroupIntegrationRegistry
) -> None:
... |
wuhengzhi/chromium-crosswalk | refs/heads/master | chrome/test/chromedriver/test/test_environment.py | 20 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""TestEnvironment classes.
These classes abstract away the various setups needed to run the WebDriver java
tests in various environments.
"""
import loggi... |
TSCLKS/linux | refs/heads/rpi-3.18.mai | scripts/analyze_suspend.py | 1540 | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... |
sauloal/pycluster | refs/heads/master | pypy-1.9_64/lib-python/2.7/plat-mac/lib-scriptpackages/Finder/Enumerations.py | 81 | """Suite Enumerations: Enumerations for the Finder
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'tpnm'
from StdSuites.Type_Names_Suite import *
class Enumerations_Events(Type_Names_Suite_Event... |
liumeixia/xiaworkspace | refs/heads/master | pythonProject/automate/busOnline/VidioContent.py | 1 | #-*- coding: utf-8 -*-
import os
import logging
import time
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from Common.CreatScreenshot import CreatScreenshot
from Common.CommonFunction import CommonFunc... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/ship/attachment/weapon/decimator_turret_base.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/loot/creature_loot/collections/contraband_style1_03.py | 85615 | import sys
def setup(core, object):
return |
hoarf/gamin | refs/heads/master | plot.py | 1 |
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
fig = plt.figure()
ax = fig.gca(projection='3d')
X = np.arange(-2, 2.5, 0.5)
Y = np.arange(-2,... |
ovnicraft/odoo | refs/heads/8.0 | addons/account/wizard/account_change_currency.py | 385 | # -*- encoding: 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 G... |
korealerts1/sentry | refs/heads/master | src/sentry/api/serializers/rest_framework/group_notes.py | 16 | from __future__ import absolute_import
from rest_framework import serializers
class NoteSerializer(serializers.Serializer):
text = serializers.CharField()
|
jpshort/odoo | refs/heads/8.0 | marcos_addons/marcos_ncf/wizard/__init__.py | 3 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2015 Marcos Organizador de Negocios SRL http://marcos.do
# Write by Eneldo Serrata (eneldo@marcos.do)
#
# This program is free software: you can redistribute it and/or modify
# it un... |
decimalbell/devnull | refs/heads/master | python/dabeaz/coroutines/countdown.py | 1 | #!/usr/bin/env python
def countdown(n):
while n > 0:
yield n
n -= 1
def main():
for i in countdown(23):
print(i)
if __name__ == '__main__':
main()
|
mancoast/CPythonPyc_test | refs/heads/master | cpython/254_test_syntax.py | 6 | """This module tests SyntaxErrors.
Here's an example of the sort of thing that is tested.
>>> def f(x):
... global x
Traceback (most recent call last):
SyntaxError: name 'x' is local and global
The tests are all raise SyntaxErrors. They were created by checking
each C call that raises SyntaxError. There are se... |
zhlinh/leetcode | refs/heads/master | 0282.Expression Add Operators/test.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Solution
# num = "232"
# target = 8
num = "105"
target = 5
# num = "00"
# target = 0
sol = Solution()
res = sol.addOperators(num, target)
print(res)
|
KarelJakubec/pip | refs/heads/develop | pip/exceptions.py | 280 | """Exceptions used throughout package"""
from __future__ import absolute_import
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class ... |
yeming233/horizon | refs/heads/master | openstack_dashboard/test/api_tests/rest_util_tests.py | 7 | # Copyright 2014, Rackspace, US, 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 w... |
PRJosh/kernel_msm | refs/heads/caf_LA.BF.1.1.1_rb1.26 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.