repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
40223150/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/pprint.py | 634 | 12757 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... | agpl-3.0 |
stefangri/s_s_productions | PHY341/V356_Kettenschaltungen/Messdaten/auswertung.py | 1 | 12836 | import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
import math
import latex
from uncertainties.umath import *
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from pint import UnitRegistry
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisar... | mit |
KurtDeGreeff/infernal-twin | build/pillow/build/lib.linux-i686-2.7/PIL/ImageEnhance.py | 72 | 3185 | #
# The Python Imaging Library.
# $Id$
#
# image enhancement classes
#
# For a background, see "Image Processing By Interpolation and
# Extrapolation", Paul Haeberli and Douglas Voorhies. Available
# at http://www.graficaobscura.com/interp/index.html
#
# History:
# 1996-03-23 fl Created
# 2009-06-16 fl Fixed mean ca... | gpl-3.0 |
Sodki/ansible-modules-extras | source_control/bzr.py | 50 | 6478 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, André Paramés <git@andreparames.com>
# Based on the Git module by 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 a... | gpl-3.0 |
maniteja123/scipy | scipy/ndimage/morphology.py | 76 | 80032 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | bsd-3-clause |
akshaybabloo/Car-ND | Term_1/advanced_lane_finding_10/perspective_transform_10_3.py | 1 | 3752 | import pickle
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# Read in the saved camera matrix and distortion coefficients
# These are the arrays you calculated using cv2.calibrateCamera()
dist_pickle = pickle.load(open("wide_dist_pickle.p", "rb"))
mtx = dist_pickle["mtx... | mit |
PyCQA/pylint | pylint/checkers/typecheck.py | 1 | 76192 | # Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2009 James Lingard <jchl@aristanetworks.com>
# Copyright (c) 2012-2014 Google, Inc.
# Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 David Shea <dshea@redhat.com>
# Copyright (c) 2014 Steven My... | gpl-2.0 |
Johnzero/erp | openerp/addons/analytic_journal_billing_rate/__init__.py | 9 | 1092 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
vismartltd/edx-platform | common/test/acceptance/tests/lms/test_lms.py | 4 | 39843 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS.
"""
from flaky import flaky
from textwrap import dedent
from unittest import skip
from nose.plugins.attrib import attr
from bok_choy.promise import EmptyPromise
from bok_choy.web_app_test import WebAppTest
from ..helpers import (
UniqueCourseTest,
Even... | agpl-3.0 |
djmonta/iTerm2 | tools/ply/ply-3.4/example/BASIC/basparse.py | 166 | 8899 | # An implementation of Dartmouth BASIC (1964)
#
from ply import *
import basiclex
tokens = basiclex.tokens
precedence = (
('left', 'PLUS','MINUS'),
('left', 'TIMES','DIVIDE'),
('left', 'POWER'),
('right','UMINUS')
)
#### A BASIC program is a series of stat... | gpl-2.0 |
40223142/cda11 | static/Brython3.1.1-20150328-091302/Lib/posix.py | 603 | 20904 | """This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly
disguised Unix interface). Refer to the library manual and
corresponding Unix manual entries for more information on calls."""
import datetime
from browser import window
def _rand... | gpl-3.0 |
darmaa/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py | 384 | 11148 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
HyperBaton/ansible | test/units/modules/network/fortios/test_fortios_system_ntp.py | 21 | 7087 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
okin/nikola | nikola/data/themes/base/messages/messages_fi.py | 2 | 1931 | # -*- encoding:utf-8 -*-
"""Autogenerated file, do not edit. Submit translations on Transifex."""
MESSAGES = {
"%d min remaining to read": "%d minuuttia lukuaikaa",
"(active)": "(aktiivinen)",
"Also available in:": "Saatavilla myös:",
"Archive": "Arkisto",
"Atom feed": "Atom-syöte",
"Authors": ... | mit |
Naereen/notebooks | Benchmark_of_the_SHA256_hash_function__Python_Cython_Numba.py | 1 | 35399 |
# coding: utf-8
# # Table of Contents
# <p><div class="lev1 toc-item"><a href="#Benchmark-of-the-SHA256-hash-function,-with-Python,-Cython-and-Numba" data-toc-modified-id="Benchmark-of-the-SHA256-hash-function,-with-Python,-Cython-and-Numba-1"><span class="toc-item-num">1 </span>Benchmark of the SHA256 ha... | mit |
alexlo03/ansible | lib/ansible/modules/cloud/vmware/vmware_vswitch_facts.py | 41 | 5181 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# 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_... | gpl-3.0 |
pomegranited/edx-platform | lms/djangoapps/courseware/tests/test_video_handlers.py | 39 | 35867 | # -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
import os
import freezegun
import tempfile
import textwrap
import json
import ddt
from nose.plugins.attrib import attr
from datetime import timedelta, datetime
from webob import Request
from mock import MagicMock, Mock, patch
from xmodule.contentstore.conte... | agpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pyttsx/voice.py | 7 | 1186 | '''
Voice metadata definition.
Copyright (c) 2009, 2013 Peter Parente
Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE... | gpl-3.0 |
open-mmlab/mmdetection | configs/common/mstrain_3x_coco.py | 1 | 2428 | _base_ = '../_base_/default_runtime.py'
# dataset settings
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
# In mstrain 3x config, img_scale=[(1333, 640), (1333, 800)],
# multiscale_mode='range'
train_pipeline = [
... | apache-2.0 |
ocadotechnology/boto | tests/integration/support/test_layer1.py | 135 | 3029 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
asiersarasua/QGIS | python/plugins/processing/algs/grass7/ext/v_net_steiner.py | 12 | 1471 | # -*- coding: utf-8 -*-
"""
***************************************************************************
v_net_steiner.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Médéric Ribreux
Email : medspx at medspx dot fr
*********************... | gpl-2.0 |
sktjdgns1189/android_kernel_samsung_kccat6 | 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 |
ArcticCore/arcticcoin | qa/rpc-tests/proxy_test.py | 45 | 8192 | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
... | mit |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 2/instances/4_wikiflow_1sh_1s_noannot/sessioncompute_0/SessionCompute_0.py | 11 | 2942 | #!/usr/bin/env python
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import ConfigDB_SessionCompute_0
import pprint
# connector and config
client = DataStoreClient("mongodb", ConfigDB_SessionCompute_0)
config = ConfigDB_SessionCompute_0
# according to config
dataList = client.getData() # return an array... | gpl-3.0 |
socradev/django-fancypages | fancypages/renderers.py | 2 | 2610 | from copy import copy
from django import template
from django.template import loader
from django.core.exceptions import ImproperlyConfigured
from .models import ContentBlock, Container
class ContainerRenderer(object):
def __init__(self, container, context, extra_context=None):
if not container and not ... | bsd-3-clause |
miqui/python-hpOneView | examples/scripts/get-alerts.py | 1 | 5719 | #!/usr/bin/env python
###
# (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP
#
# 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 limita... | mit |
liikGit/MissionPlanner | Lib/encodings/cp1255.py | 93 | 13029 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def d... | gpl-3.0 |
etxc/namebench | nb_third_party/dns/rdtypes/ANY/NSEC.py | 235 | 5296 | # Copyright (C) 2004-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 ... | apache-2.0 |
ipa-pgt/rqt_frame_editor_plugin | frame_editor/src/frame_editor/interface_services.py | 1 | 9038 | #!/usr/bin/env python
import copy
import time
import rospy
import os
from frame_editor.objects import *
from frame_editor.commands import *
from frame_editor.interface import Interface
from frame_editor.constructors_geometry import *
from frame_editor.constructors_std import *
from frame_editor.srv import *
clas... | mit |
feliperfranca/FelipeRFranca_site | django/contrib/gis/utils/ogrinfo.py | 389 | 1973 | """
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import GEO_CLASSES
def ogrinfo(data_source, num_... | bsd-3-clause |
buffalocoin/p2pool | p2pool/util/skiplist.py | 278 | 2140 | from p2pool.util import math, memoize
class SkipList(object):
def __init__(self, p=0.5):
self.p = p
self.skips = {}
def forget_item(self, item):
self.skips.pop(item, None)
@memoize.memoize_with_backing(memoize.LRUDict(5))
def __call__(self, start, *args):
... | gpl-3.0 |
piquadrat/django | tests/get_or_create/models.py | 32 | 1580 | from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
birthday = models.DateField()
defaults = models.TextField()
def __str__(self):
return '%s %s' % (self.first_name, self.last_name)
class Def... | bsd-3-clause |
linostar/timeline-clone | dependencies/timelinelib/markdown-2.0.3/markdown/postprocessors.py | 141 | 2471 | """
POST-PROCESSORS
=============================================================================
Markdown also allows post-processors, which are similar to preprocessors in
that they need to implement a "run" method. However, they are run after core
processing.
"""
import markdown
class Processor:
def __init_... | gpl-3.0 |
meredith-digops/ansible | lib/ansible/modules/windows/win_find.py | 15 | 10254 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ansible, inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
pombredanne/django-moderation | moderation/managers.py | 2 | 4318 | from __future__ import unicode_literals
from django.db.models.manager import Manager
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from moderation.utils import django_17
class MetaClass(type(Manager)):
def __new__(cls, n... | bsd-3-clause |
numu5061/FOCUS | newUser.py | 5 | 8411 | #!/usr/bin/env python
from flask import Flask, request
import couchdb, json, datetime
app = Flask(__name__)
''' *** List of accessible api urls ***
***NOTE: until Akash finishes user authentication/security, <string:id> will be the name of the user
1. '/' is a get request that tests accessibility to the flask serv... | mit |
elky/django | tests/expressions/test_queryset_values.py | 103 | 2622 | from django.db.models.aggregates import Sum
from django.db.models.expressions import F
from django.test import TestCase
from .models import Company, Employee
class ValuesExpressionsTests(TestCase):
@classmethod
def setUpTestData(cls):
Company.objects.create(
name='Example Inc.', num_emplo... | bsd-3-clause |
fjorba/invenio | modules/bibclassify/lib/bibclassify_config.py | 8 | 9775 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or ... | gpl-2.0 |
mfenniak/heroku-buildpack-python-libffi | vendor/distribute-0.6.36/setuptools/extension.py | 72 | 1398 | import sys
import distutils.core
import distutils.extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(distutils.core.Extension)
def have_pyrex():
"""
Return True if Cython or Pyrex can be imported.
"""
pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext... | mit |
topix-hackademy/python-contact-tool-sdk | contactsdk/main.py | 1 | 1065 | from configparser import ConfigParser
import argparse
import os
from contactsdk.connector import Connector
def parse_input():
parser = argparse.ArgumentParser()
parser.add_argument("config_file", type=str, help="Configuration file")
args = parser.parse_args()
return args
def program():
print "*... | mit |
AdamantLife/alcustoms | alcustoms/math/evaluator.py | 1 | 8121 | """ alcustoms.math.evaluator
A parser for string-based math springs.
The primary function of this module is math_eval() which does the evaluating.
Parsing Rules:
Basic Python operators are evaluated as normal: + , - , * , / , **
A collection of colliquial operators are supported (translat... | gpl-3.0 |
nuagenetworks/tempest | tempest/api/volume/base.py | 1 | 8773 | # Copyright 2012 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
v3best/linux-v3best | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
chadversary/chromiumos.chromite | cbuildbot/cbuildbot_config.py | 1 | 76027 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Configuration options for various cbuildbot builders."""
# Disable relative import warning from pylint.
# pylint: disable=W0403... | bsd-3-clause |
mike-perdide/gitbuster | tests/tests_confirm_dialog.py | 1 | 3722 | from PyQt4.QtGui import QApplication
from PyQt4.QtCore import Qt
from subprocess import Popen, PIPE
import os
import sys
from gitbuster.main_window import MainWindow
from gitbuster.confirm_dialog import ConfirmDialog
from gitbuster.branch_view import ButtonLineEdit
from template_test import TemplateTest
class Tests... | gpl-3.0 |
Chilledheart/chromium | tools/telemetry/third_party/gsutilz/third_party/crcmod/setup.py | 33 | 1983 | from distutils.core import setup
from distutils.extension import Extension
import sys,os
if sys.version_info[0] == 2:
base_dir = 'python2'
elif sys.version_info[0] == 3:
base_dir = 'python3'
setup_dict = dict(
name='crcmod',
version='1.7',
description='CRC Generator',
author='Ray Buvel',
author_email='rlbuvel... | bsd-3-clause |
pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/pip/_vendor/webencodings/x_user_defined.py | 341 | 4306 | # coding: utf8
"""
webencodings.x_user_defined
~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the x-user-defined encoding.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
import codecs
### Codec APIs
class Codec... | mit |
birdsarah/appjs-browserhistory | node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/common.py | 39 | 14000 | # 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.
from __future__ import with_statement
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing decorator. It'll blo... | mit |
ayepezv/GAD_ERP | addons/mail/tests/test_mail_gateway.py | 2 | 38476 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import socket
from odoo.addons.mail.tests.common import TestMail
from odoo.tools import mute_logger
MAIL_TEMPLATE = """Return-Path: <whatever-2a840@postmaster.twitter.com>
To: {to}
cc: {cc}
Received: by mail1.openerp.... | gpl-3.0 |
pssncp142/pyakm | src/pyakm/alpminit.py | 1 | 8410 | #!/usr/bin/env python3
#
# pycman - A Python implementation of Pacman
# Copyright (C) 2011 Rémy Oudompheng <remy@archlinux.org>
#
# 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 v... | gpl-3.0 |
ManageIQ/integration_tests | cfme/exceptions.py | 2 | 7817 | """Provides custom exceptions for the ``cfme`` module. """
class CFMEException(Exception):
"""Base class for exceptions in the CFME tree
Used to easily catch errors of our own making, versus errors from external libraries.
"""
pass
class ApplianceVersionException(CFMEException):
"""Raised when... | gpl-2.0 |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py | 1786 | 2504 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | mit |
hellodata/hellodate | 2/site-packages/django/middleware/common.py | 52 | 7351 | import hashlib
import logging
import re
import warnings
from django.conf import settings
from django.core.mail import mail_managers
from django.core import urlresolvers
from django import http
from django.utils.deprecation import RemovedInDjango18Warning
from django.utils.encoding import force_text
from django.utils.h... | lgpl-3.0 |
alphageek-xyz/site | landing/templatetags/landing_utils.py | 1 | 6753 | import os, re, json
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django.utils.html import format_html
from django.contrib.staticfiles import finders
from bootstrap3.templatetags.bootstrap3 import bootstrap_form, bootstrap_field
from css_html_js_minify.html_minifier impor... | bsd-3-clause |
jeacaveo/planning_70 | tests/test_planning.py | 1 | 19305 | # -*- coding: utf-8 -*-
from openerp.tests import common
from openerp.osv.orm import except_orm
from datetime import datetime
from . import test_util
class TestPlanning(common.TransactionCase):
def setUp(self):
super(TestPlanning, self).setUp()
# Cursor and user initialization
cr, uid =... | agpl-3.0 |
mikehulluk/morphforge | src/morphforge/simulation/neuron/biophysics/__init__.py | 1 | 1828 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | bsd-2-clause |
kundajelab/idr | setup.py | 3 | 2839 | import os, sys
import numpy
from setuptools import setup, Extension, find_packages
try:
from Cython.Build import cythonize
extensions = cythonize([
Extension("idr.inv_cdf",
["idr/inv_cdf.pyx", ],
include_dirs=[numpy.get_include()]),
])
except ImportError:
ex... | gpl-2.0 |
wakashige/bazel | third_party/py/mock/__init__.py | 424 | 75527 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 1.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts m... | apache-2.0 |
svp-dev/slcore | slc/tools/slc/am/visitors.py | 1 | 15746 | import pprint
from ..visitors import *
from ..ast import *
def gen_loop_fun_name(orig_name): # takes a thread function name and generates a name that will be used as
# the name of the function that implements the corresponding loop
return Opaque("_fam_") + orig_name
class Crea... | gpl-3.0 |
ComputerNetworks-UFRGS/AuroraSDN | Aurora/urls.py | 1 | 1106 | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Social auth urls
url('', include('social.apps.django_app.urls', namespace='social')),
# Aurora urls
url(r'^$', 'sdn.views.basic.pages.... | gpl-2.0 |
vjmac15/Lyilis | lib/youtube_dl/extractor/streamcloud.py | 60 | 2482 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
urlencode_postdata,
)
class StreamcloudIE(InfoExtractor):
IE_NAME = 'streamcloud.eu'
_VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?P<fname>[... | gpl-3.0 |
hivesolutions/appier | src/appier/typesf.py | 1 | 35612 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2021 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... | apache-2.0 |
ArthurGarnier/SickRage | lib/future/backports/email/mime/multipart.py | 83 | 1699 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME multipart/* type messages."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all__ = ['MIMEMultipart']
from future.backp... | gpl-3.0 |
grevutiu-gabriel/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py | 119 | 71750 | # Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... | bsd-3-clause |
google-code-export/django-hotclub | libs/external_libs/gdata.py-1.0.13/src/gdata/geo/__init__.py | 8 | 5949 | # -*-*- encoding: utf-8 -*-*-
#
# This is gdata.photos.geo, implementing geological positioning in gdata structures
#
# $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | mit |
clarkperkins/django-socketio | django_socketio/clients.py | 10 | 1384 |
from django_socketio import events
# Maps open Socket.IO session IDs to request/socket pairs for
# running cleanup code and events when the server is shut down
# or reloaded.
CLIENTS = {}
def client_start(request, socket, context):
"""
Adds the client triple to CLIENTS.
"""
CLIENTS[socket.session.s... | bsd-2-clause |
iabdalkader/micropython | tests/basics/array1.py | 7 | 2397 | try:
import uarray as array
except ImportError:
try:
import array
except ImportError:
print("SKIP")
raise SystemExit
a = array.array('B', [1, 2, 3])
print(a, len(a))
i = array.array('I', [1, 2, 3])
print(i, len(i))
print(a[0])
print(i[-1])
a = array.array('l', [-1])
print(len(a), a[... | mit |
myarjunar/QGIS | python/plugins/processing/algs/qgis/SelectByAttribute.py | 1 | 5099 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SelectByAttribute.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*******************... | gpl-2.0 |
drawcode/yaml-cpp.new-api | test/gmock-1.7.0/gtest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/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... | mit |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/core/cache/backends/filebased.py | 428 | 5387 | "File-based cache backend"
import errno
import glob
import hashlib
import io
import os
import random
import tempfile
import time
import zlib
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.core.files.move import file_move_safe
from django.utils.encoding import force_bytes
try:
f... | mit |
tudorbarascu/QGIS | python/plugins/MetaSearch/dialogs/newconnectiondialog.py | 28 | 3791 | # -*- coding: utf-8 -*-
###############################################################################
#
# CSW Client
# ---------------------------------------------------------
# QGIS Catalog Service client.
#
# Copyright (C) 2010 NextGIS (http://nextgis.org),
# Alexander Bruy (alexander.bruy@gmail... | gpl-2.0 |
prabhu/invoicy | invoicy/settings.py | 1 | 2824 | import os
# Django settings for invoicy project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '/Users/prabhu/hacks/invoicy/... | bsd-3-clause |
bczmufrn/frequencia | frequencia/registro/models.py | 1 | 1162 | from django.db import models
from frequencia.core.basemodel import basemodel
from frequencia.accounts.models import User
from frequencia.vinculos.models import Vinculo
class Maquina(basemodel):
nome = models.CharField('Nome', max_length=30)
descricao = models.CharField('Descricao', max_length=100, blank=True)
ip... | mit |
epssy/hue | desktop/core/ext-py/kazoo-2.0/kazoo/client.py | 35 | 49594 | """Kazoo Zookeeper Client"""
import inspect
import logging
import os
import re
import warnings
from collections import defaultdict, deque
from functools import partial
from os.path import split
from kazoo.exceptions import (
AuthFailedError,
ConfigurationError,
ConnectionClosedError,
ConnectionLoss,
... | apache-2.0 |
grundgruen/powerline | tests/test_eex_algo.py | 2 | 4813 | from unittest import TestCase
import pandas as pd
from zipline.finance import trading
from zipline.utils.factory import create_simulation_parameters
from zipline.test_algorithms import TestAlgorithm
from zipline.finance.commission import PerShare
from zipline.finance.slippage import FixedSlippage
from powerline.utils... | apache-2.0 |
jcanizales/grpc | tools/distrib/check_include_guards.py | 25 | 7390 | #!/usr/bin/env python2.7
# Copyright 2016, 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 li... | bsd-3-clause |
EasyPost/shentry | tests/test_basic.py | 1 | 3476 | import os
import tempfile
import socket
import subprocess
import mock
import pytest
import shentry
class _Any(object):
def __eq__(self, other):
return True
def __ne__(self, other):
return False
ANY = _Any()
@pytest.mark.parametrize('argv,expected_full_command,expected_command_ws,expecte... | isc |
barzan/dbseer | middleware_old/dstat_for_server/plugins/dstat_top_cpu.py | 3 | 1969 | ### Authority: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
"""
Most expensive CPU process.
Displays the process that uses the CPU the most during the monitored
interval. The value displayed is the percentage of CPU time for the total
amount of CPU processing power. Based on per process ... | apache-2.0 |
quamilek/django | tests/auth_tests/test_validators.py | 229 | 7546 | from __future__ import unicode_literals
import os
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_val... | bsd-3-clause |
rahul-c1/scikit-learn | sklearn/decomposition/tests/test_fastica.py | 30 | 7560 | """
Test the fastica algorithm.
"""
import itertools
import numpy as np
from scipy import stats
from nose.tools import assert_raises
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testi... | bsd-3-clause |
luceatnobis/youtube-dl | youtube_dl/extractor/microsoftvirtualacademy.py | 68 | 7476 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_xpath,
)
from ..utils import (
int_or_none,
parse_duration,
smuggle_url,
unsmuggle_url,
xpath_text,
)
class MicrosoftVirtualAcademyBaseIE(InfoExtractor):
def _extract_base_ur... | unlicense |
cdegroc/scikit-learn | sklearn/base.py | 1 | 13651 | """Base class for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD Style
import copy
import inspect
import numpy as np
from scipy import sparse
import warnings
from .metrics import r2_score
from .utils import deprecated
######################################################... | bsd-3-clause |
nightstrike/blender_nif_plugin | todo/utilities/object_niftools_save_bone_pose.py | 3 | 4068 | #!BPY
"""
Name: 'Save Bone Pose'
Blender: 245
Group: 'Object'
Tooltip: 'Save pose of selected bones to a text buffer'
"""
# --------------------------------------------------------------------------
# Save Bone Pose 1.0 by Amorilia
# --------------------------------------------------------------------------
# *****... | bsd-3-clause |
cgstudiomap/cgstudiomap | main/eggs/passlib-1.6.5-py2.7.egg/passlib/_setup/docdist.py | 8 | 3109 | """custom command to build doc.zip file"""
#=============================================================================
# imports
#=============================================================================
# core
import os
from distutils import dir_util
from distutils.cmd import Command
from distutils.errors impor... | agpl-3.0 |
adoosii/edx-platform | common/lib/xmodule/xmodule/modulestore/mongo/draft.py | 12 | 42494 | """
A ModuleStore that knows about a special version DRAFT. Modules
marked as DRAFT are read in preference to modules without the DRAFT
version by this ModuleStore (so, access to i4x://org/course/cat/name
returns the i4x://org/course/cat/name@draft object if that exists,
and otherwise returns i4x://org/course/cat/name)... | agpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/rpm/Python-2.7.5/lib/python2.7/idlelib/GrepDialog.py | 81 | 4052 | import os
import fnmatch
import sys
from Tkinter import *
from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase
def grep(text, io=None, flist=None):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_grepdialog"):
engine._grepdialog = GrepD... | lgpl-3.0 |
AChep/AcDisplay | project/app/fetch_translations.py | 1 | 5847 | # Copyright (C) 2013 AChep@xda <artemchep@gmail.com>
#
# This script is published under the terms of the GNU GPL v2.0 license.
# See http://www.gnu.org/licenses/gpl-2.0.html
# Python 3 is required
from zipfile import ZipFile
from bs4 import BeautifulSoup
from colorama import init, Fore
import urllib.request
import sh... | gpl-2.0 |
jlegendary/opencog | scripts/make_benchmark_graphs.py | 56 | 3139 | #!/usr/bin/env python
# Requires matplotlib for graphing
# reads *_benchmark.csv files as output by atomspace_bm and turns them into
# graphs.
import csv
import numpy as np
import matplotlib.colors as colors
#import matplotlib.finance as finance
import matplotlib.dates as mdates
import matplotlib.ticker as mticker
i... | agpl-3.0 |
Yuriy-Leonov/python-novaclient | novaclient/tests/v1_1/test_floating_ips_bulk.py | 7 | 2753 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
# 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/licen... | apache-2.0 |
logangator2/Proj5-Leaflet | Leaflet/flask_leaflet.py | 1 | 1759 | """
Flask-led leaflet website
"""
import flask # The basic framework for http requests, storing cookies, etc
import logging # For monitoring and debugging
# Our own modules
import config # Configure from configuration files or command line
import leaflet_pre
###
# Globals
###
app = flask.Flask(__name__)
CON... | bsd-2-clause |
apache/libcloud | libcloud/utils/publickey.py | 6 | 2750 | # 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 |
zeroc0d3/docker-lab | vim/rootfs/usr/lib/python2.7/dist-packages/powerline/lint/markedjson/composer.py | 37 | 3589 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from powerline.lint.markedjson import nodes
from powerline.lint.markedjson import events
from powerline.lint.markedjson.error import MarkedError
__all__ = ['Composer', 'ComposerError']
class ComposerE... | mit |
iglpdc/nipype | nipype/interfaces/fsl/tests/test_auto_ProjThresh.py | 12 | 1075 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..dti import ProjThresh
def test_ProjThresh_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,... | bsd-3-clause |
tccworld/qualitybots | src/webdriver/client_logging.py | 26 | 2170 | #!/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 required... | apache-2.0 |
Sidney84/pa-chromium | tools/json_schema_compiler/json_schema_test.py | 8 | 1595 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json_schema
import json_schema_test
import unittest
class JsonSchemaUnittest(unittest.TestCase):
def testNocompile(self):... | bsd-3-clause |
yawnosnorous/python-for-android | python-build/python-libs/gdata/build/lib/gdata/books/service.py | 136 | 11339 | #!/usr/bin/python
"""
Extend gdata.service.GDataService to support authenticated CRUD ops on
Books API
http://code.google.com/apis/books/docs/getting-started.html
http://code.google.com/apis/books/docs/gdata/developers_guide_protocol.html
TODO: (here and __init__)
* search based on label... | apache-2.0 |
mendax-grip/cfdemUtilities | zaki/plotTotalZaki.py | 2 | 2387 | #This program makes the plot for the average velocity of the particles in a the Z direction for
# a single case
# Author : Bruno Blais
# Last modified : December 3rd
#Python imports
import os
import sys
import math
import numpy
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import LogLocato... | lgpl-3.0 |
frewsxcv/keyczar | cpp/src/tools/swtoolkit/site_scons/http_download.py | 20 | 2706 | #!/usr/bin/python2.4
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | apache-2.0 |
farazrehman/aws-resources | CloudFormation/nash/lib/python2.7/site-packages/pip/_vendor/requests/compat.py | 1039 | 1469 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
try:
import simplejson as json
except (ImportError, SyntaxError):
# si... | gpl-2.0 |
google-code-export/dojango | dojango/data/modelstore/treestore.py | 12 | 1656 | from stores import Store
from fields import StoreField
from methods import BaseMethod
class ChildrenMethod(BaseMethod):
""" A method proxy that will resolve the children
of a model that has a tree structure.
"django-treebeard" and "django-mptt" both attach a get_children method
to the model... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.