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 |
|---|---|---|---|---|---|
QijunPan/ansible | lib/ansible/modules/cloud/rackspace/rax_cbs.py | 25 | 7272 | #!/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... | gpl-3.0 |
boundarydevices/android_external_chromium_org | build/landmine_utils.py | 59 | 2787 | # 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.
import functools
import logging
import os
import shlex
import sys
def memoize(default=None):
"""This decorator caches the return value of a parameterles... | bsd-3-clause |
eleonrk/SickRage | lib/github/tests/Github_.py | 9 | 17814 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
jeremygibbs/microhh | cases/lasso/lasso_init.py | 5 | 6596 | import netCDF4 as nc
import numpy as np
import f90nml
import shutil
import os
from datetime import datetime
#import os.path
#import os
#import sys
#import glob
float_type = "f8"
largescale = True
# Define some constants
cp = 1004.
rd = 287.04
grav = 9.8
rho = 1.225
p0 = 1e5
Lv = 2.5e6
tau = 21600.
# Get number of ver... | gpl-3.0 |
melvon22/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0be.py | 253 | 4849 | data = (
'byum', # 0x00
'byub', # 0x01
'byubs', # 0x02
'byus', # 0x03
'byuss', # 0x04
'byung', # 0x05
'byuj', # 0x06
'byuc', # 0x07
'byuk', # 0x08
'byut', # 0x09
'byup', # 0x0a
'byuh', # 0x0b
'beu', # 0x0c
'beug', # 0x0d
'beugg', # 0x0e
'beugs', # 0x0f
'beun', # 0x10
'... | gpl-2.0 |
TeachAtTUM/edx-platform | common/djangoapps/terrain/browser.py | 15 | 10334 | """
Browser set up for acceptance tests.
"""
# pylint: disable=no-member
# pylint: disable=unused-argument
from base64 import encodestring
from json import dumps
from logging import getLogger
import requests
from django.conf import settings
from django.core.management import call_command
from lettuce import after, b... | agpl-3.0 |
sebgoa/client-python | kubernetes/client/models/v1_node_system_info.py | 2 | 12434 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | apache-2.0 |
touchpro/android_kernel_lge_msm8226 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
PhyloStar/PyBayes | params_moves.py | 1 | 1027 | import numpy as np
from scipy.stats import dirichlet
import random, math
dir_alpha = 100.0
scaler_alpha = 1.25
epsilon = 1e-10
def mvDirichlet(pi):
pi_new = dirichlet.rvs(dir_alpha*pi)[0]
#print(pi, pi_new)
hastings_ratio = dirichlet.logpdf(pi, pi_new) - dirichlet.logpdf(pi_new, pi)
return pi_new, has... | gpl-2.0 |
gangadhar-kadam/verve_test_erp | erpnext/patches/v4_0/apply_user_permissions.py | 87 | 1999 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.hr.doctype.employee.employee import EmployeeUserDisabledError
def execute():
update_hr_permissions()
update_permissions()
... | agpl-3.0 |
tino1b2be/LARMAS | suit/widgets.py | 10 | 4988 | from django.contrib.admin.widgets import AdminTimeWidget, AdminDateWidget
from django.forms import TextInput, Select, Textarea
from django.utils.safestring import mark_safe
from django import forms
from django.utils.translation import ugettext as _
from django.contrib.admin.templatetags.admin_static import static
cla... | agpl-3.0 |
offbye/paparazzi | sw/tools/calibration/calibrate_gyro.py | 87 | 4686 | #! /usr/bin/env python
# Copyright (C) 2010 Antoine Drouin
#
# This file is part of Paparazzi.
#
# Paparazzi 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, or (at your option)
# any later ... | gpl-2.0 |
spektom/incubator-airflow | tests/dags/subdir2/test_dont_ignore_this.py | 5 | 1147 | #
# 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... | apache-2.0 |
hakuna-m/wubiuefi | src/pypack/altgraph/Dot.py | 9 | 8425 | '''
Interface to the dot language
=============================
The B{Dot} module provides a simple interface to the
file format used in the U{graphviz<http://www.research.att.com/sw/tools/graphviz/>}
program. The module is intended to offload the most tedious part of the process
(the B{dot} file generation) while tra... | gpl-2.0 |
propublica/Capitol-Words | capitolweb/scraper/management/commands/run_crec_scraper.py | 2 | 1705 | import logging
from datetime import datetime
from datetime import timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from scraper.models import CRECScraperResult
from scraper.crec_scraper import CRECScraper
class Command(BaseCommand):
help = 'Scrapes CREC from gpo.gov... | bsd-3-clause |
Vixionar/django | django/contrib/gis/db/backends/oracle/introspection.py | 539 | 1977 | import sys
import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
from django.utils import six
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDS... | bsd-3-clause |
The-WebOps-Club/odia-forum | pybbm_tag/views.py | 1 | 2818 | from django.shortcuts import render
from pybb.models import *
from pybbm_tag.models import Tag
from pybb.views import ForumView,AddPostView,EditPostView,TopicView
def add_tag(request,**kwargs):
# check permissions before calling this function
# in kwargs we expect the LABEL of the tag to add(not object) and the TO... | gpl-2.0 |
Gaia3D/QGIS | python/ext-libs/owslib/wms.py | 28 | 23814 | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com>
#
# Authors : Sean Gillies <sgillies@frii.com>
# Julien Anguenot <ja@nuxeo.com>
#
# Contact email: sgillie... | gpl-2.0 |
mammadori/pyglet | tools/wraptypes/wrap.py | 29 | 9533 | #!/usr/bin/env python
'''Generate a Python ctypes wrapper file for a header file.
Usage example::
wrap.py -lGL -oGL.py /usr/include/GL/gl.h
>>> from GL import *
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from ctypesparser import *
import textwrap
import sys
class CtypesWrapper(CtypesPars... | bsd-3-clause |
rlkelly/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | sandbox/Chapter10_/github_datapull.py | 108 | 2852 |
try:
import numpy as np
from requests import get
from bs4 import BeautifulSoup
stars_to_explore = ( 2**np.arange( -1, 16 ) ).astype("int")
forks_to_explore = ( 2**np.arange( -1, 16 ) ).astype("int")
repo_with_stars = np.ones_like( stars_to_explore )
repo_with_forks = np.ones_like( forks... | mit |
Titan-C/sympy | sympy/crypto/crypto.py | 17 | 56885 | # -*- coding: utf-8 -*-
"""
This file contains some classical ciphers and routines
implementing a linear-feedback shift register (LFSR)
and the Diffie-Hellman key exchange.
"""
from __future__ import print_function
from string import whitespace, ascii_uppercase as uppercase, printable
from sympy import nextprime
fr... | bsd-3-clause |
jkorell/PTVS | Python/Product/Analyzer/BuiltinScraper.py | 18 | 21219 | # ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution.... | apache-2.0 |
orwell-int/agent-server-game-python | setup.py | 1 | 1239 | #!/usr/bin/env python
import setuptools
# Hack to prevent stupid TypeError: 'NoneType' object is not callable error on
# exit of python setup.py test # in multiprocessing/util.py _exit_function when
# running python setup.py test (see
# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
try:
i... | bsd-3-clause |
Turpial/Turpial | turpial/ui/gtk/tray.py | 3 | 2115 | # -*- coding: utf-8 -*-
# GTK3 tray icon for Turpial
from gi.repository import Gtk
from turpial import DESC
from turpial.ui.lang import i18n
class TrayIcon(Gtk.StatusIcon):
def __init__(self, base):
Gtk.StatusIcon.__init__(self)
self.base = base
self.set_from_pixbuf(self.base.load_image... | gpl-3.0 |
sidmitra/django_nonrel_testapp | django/forms/util.py | 311 | 1983 | from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.safestring import mark_safe
# Import ValidationError so that it can be imported from this
# module to maintain backwards compatibility.
from django.core.exceptions import ValidationError
d... | bsd-3-clause |
robclark/chromium | third_party/tlslite/tlslite/TLSConnection.py | 6 | 71226 | """
MAIN CLASS FOR TLS LITE (START HERE!).
"""
from __future__ import generators
import socket
from utils.compat import formatExceptionTrace
from TLSRecordLayer import TLSRecordLayer
from Session import Session
from constants import *
from utils.cryptomath import getRandomBytes
from errors import *
from messages impor... | bsd-3-clause |
tensorflow/examples | tensorflow_examples/lite/model_maker/demo/image_classification_demo_test.py | 1 | 2699 | # Copyright 2019 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 |
takis/odoo | openerp/report/report_sxw.py | 217 | 27364 | # -*- coding: 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 GNU... | agpl-3.0 |
MrLucasCardoso/pycards | tests/test_amex.py | 1 | 2451 | import json
import pytest
from pycards import CreditCard
from datetime import datetime
from pycards.settings import FIXTURES_PATH
@pytest.fixture(scope="session")
def data():
with open(FIXTURES_PATH) as data_file:
return json.load(data_file)['AMEX']
def test_init(data):
assert len(data) > 0
card... | mit |
steveklabnik/servo | components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py | 149 | 2846 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
[NoInterfaceObject]
interface TestExtendedAttr {
[Unforgeable] readonly attribute byte b;
};
""")
results = parser.finish()
parser = parser.reset()
parser.parse("""
[Pref="foo.bar",Pref=flop]... | mpl-2.0 |
lichengshuang/createvhost | others/webvirtmgr/delServer.py | 1 | 1305 | #!/usr/bin/python
#-*-encoding:utf-8-*-
#author: asher
#date: 20160429 on train D909
# this scripts useed for add server ip to webvirtmgr
# if not , each server must add by website,it's too slow, and very not interesting.
# use this , it's make you feel very happy
import sqlite3
try:
conn = sqlite3.connect('../... | apache-2.0 |
esikachev/sahara-backup | sahara/tests/unit/swift/test_utils.py | 7 | 1447 | # Copyright (c) 2013 Mirantis 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... | apache-2.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.5/django/core/files/base.py | 147 | 4653 | from __future__ import unicode_literals
import os
from io import BytesIO, StringIO, UnsupportedOperation
from django.utils.encoding import smart_text
from django.core.files.utils import FileProxyMixin
from django.utils import six
from django.utils.encoding import force_bytes, python_2_unicode_compatible
@python_2_un... | mit |
goofwear/raspberry_pwn | src/pentest/fasttrack/setup.py | 16 | 11757 | #!/usr/bin/env python
import os
import sys
import time
import subprocess
import re
def get_basepath():
basepath = os.getcwd()
return basepath
definepath=get_basepath()
try:
if sys.argv[1]=='install':
print """
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ *** Fast-Track Setup *** ... | gpl-3.0 |
StephanieMak/hadoop | hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/job_history_summary.py | 323 | 3444 | #!/usr/bin/env python
#
# 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
# "... | apache-2.0 |
fengbaicanhe/intellij-community | python/lib/Lib/xml/FtCore.py | 132 | 1806 | """
Contains various definitions common to modules acquired from 4Suite
"""
__all__ = ["FtException", "get_translator"]
class FtException(Exception):
def __init__(self, errorCode, messages, args):
# By defining __str__, args will be available. Otherwise
# the __init__ of Exception sets it to the... | apache-2.0 |
louisq/staticguru | utility/artifact_archiver.py | 1 | 4495 | """
The MIT License (MIT)
Copyright (c) 2016 Louis-Philippe Querel l_querel@encs.concordia.ca
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... | mit |
digetx/picasso_upstream_support | Documentation/target/tcm_mod_builder.py | 215 | 36866 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
s0enke/boto | boto/logs/layer1.py | 146 | 22588 | # Copyright (c) 2014 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 |
MCFlowMace/Wordom | src/setup.py | 1 | 1423 | #! /usr/bin/env python
# System imports
from distutils.core import *
from distutils import sysconfig
# Third-party modules - we depend on numpy
import numpy
# in order to check whether lapack are present ...
import numpy.distutils.system_info as sysinfo
# Obtain the numpy include directory. This works across nu... | gpl-3.0 |
flask-admin/flask-admin | flask_admin/model/ajax.py | 53 | 1076 | DEFAULT_PAGE_SIZE = 10
class AjaxModelLoader(object):
"""
Ajax related model loader. Override this to implement custom loading behavior.
"""
def __init__(self, name, options):
"""
Constructor.
:param name:
Field name
"""
self.name = ... | bsd-3-clause |
psdh/servo | components/script/dom/bindings/codegen/parser/tests/test_builtins.py | 276 | 1798 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestBuiltins {
attribute boolean b;
attribute byte s8;
attribute octet u8;
attribute short s16;
attribute unsigned short u16;
attribute long s32;
attribute unsigne... | mpl-2.0 |
benob/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/classify/__init__.py | 9 | 3871 | # Natural Language Toolkit: Classifiers
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for labeling tokens with category labels (or
X{class labels}). Typica... | gpl-3.0 |
LoHChina/nova | nova/tests/functional/v3/test_migrate_server.py | 27 | 3462 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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 |
montefra/dodocs | dodocs/__init__.py | 1 | 1068 | """Main function
Copyright (c) 2015 Francesco Montesano
MIT Licence
"""
import os
import sys
from dodocs.cmdline import parse
import dodocs.logger as dlog
__version__ = "0.0.1"
def main(argv=None):
"""
Main code
Parameters
----------
argv : list of strings, optional
command line argum... | mit |
mozilla/kitsune | kitsune/wiki/permissions.py | 1 | 4844 | import logging
from django.conf import settings
log = logging.getLogger("k.wiki")
# Why is this a mixin if it can only be used for the Document model?
# Good question! My only good reason is to keep the permission related
# code organized and contained in one place.
class DocumentPermissionMixin(object):
"""Ad... | bsd-3-clause |
dwaynebailey/translate | translate/lang/zh_tw.py | 3 | 1116 | # -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at y... | gpl-2.0 |
shermanng10/superathletebuilder | env/lib/python2.7/site-packages/wheel/install.py | 472 | 18070 | """
Operations on existing wheel files, including basic installation.
"""
# XXX see patched pip to install
import sys
import warnings
import os.path
import re
import zipfile
import hashlib
import csv
import shutil
try:
_big_number = sys.maxsize
except NameError:
_big_number = sys.maxint
from wheel.decorato... | mit |
aussendorf/bareos-fd-python-plugins | plugin/BareosFdPluginBaseclass.py | 1 | 5778 | #This file is now part of the main Bareos repo. Do not use this version, use the package bareos-filedaemon-python-plugin instead
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Baseclass for Bareos python plugins
# Functions taken and adapted from bareos-fd.py
# (c) Bareos GmbH & Co. KG, Maik Aussendorf
# AGPL v.3
... | agpl-3.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/nbformat/v4/nbjson.py | 11 | 1921 | """Read and write notebooks in JSON format."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import copy
import json
from ipython_genutils import py3compat
from .nbbase import from_dict
from .rwbase import (
NotebookReader, NotebookWriter, rejoin_lines, spl... | mit |
bcornwellmott/frappe | frappe/commands/docs.py | 7 | 2238 | from __future__ import unicode_literals, absolute_import
import click
import os
import frappe
from frappe.commands import pass_context
@click.command('write-docs')
@pass_context
@click.argument('app')
@click.option('--target', default=None)
@click.option('--local', default=False, is_flag=True, help='Run app locally')... | mit |
uclouvain/osis_louvain | manage.py | 1 | 1269 | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
if 'test' in sys.argv:
os.environ.setdefault('TESTING', 'True')
dotenv.read_dotenv()
SETTINGS_FILE = os.environ.get('DJANGO_SETTINGS_MODULE', 'backoffice.settings.local')
os.environ.setdefault("DJANGO_SETTINGS_... | agpl-3.0 |
pforret/python-for-android | python-modules/twisted/twisted/web/rewrite.py | 57 | 1862 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
from twisted.web import resource
class RewriterResource(resource.Resource):
def __init__(self, orig, *rewriteRules):
resource.Resource.__init__(self)
self.resource = orig
self.rewriteRules = list(rewriteRu... | apache-2.0 |
vgrachev8/youtube-dl | youtube_dl/extractor/radiofrance.py | 2 | 2024 | # coding: utf-8
import re
from .common import InfoExtractor
class RadioFranceIE(InfoExtractor):
_VALID_URL = r'^https?://maison\.radiofrance\.fr/radiovisions/(?P<id>[^?#]+)'
IE_NAME = u'radiofrance'
_TEST = {
u'url': u'http://maison.radiofrance.fr/radiovisions/one-one',
u'file': u'one-on... | unlicense |
walksun/robotframework-selenium2library | test/unit/locators/test_elementfinder.py | 35 | 14209 | import unittest
import os
from Selenium2Library.locators import ElementFinder
from mockito import *
class ElementFinderTests(unittest.TestCase):
def test_find_with_invalid_prefix(self):
finder = ElementFinder()
browser = mock()
try:
self.assertRaises(ValueError, finder.find, br... | apache-2.0 |
yuyichao/pyscical | pyscical/utils.py | 1 | 1930 | # Copyright (C) 2012~2014 by Yichao Yu
# yyc1992@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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | gpl-3.0 |
potzenheimer/meetshaus | src/meetshaus.sitetheme/meetshaus/sitetheme/tests.py | 1 | 1419 | import unittest
#from zope.testing import doctestunit
#from zope.component import testing
from Testing import ZopeTestCase as ztc
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
ptc.setupPloneSite()
import meetshaus.si... | mit |
yglazner/jy-dev | jy_dev/docopt.py | 11 | 19946 | """Pythonic command-line interface parser that will make you smile.
* http://docopt.org
* Repository and issue-tracker: https://github.com/docopt/docopt
* Licensed under terms of MIT license (see LICENSE-MIT)
* Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com
"""
import sys
import re
__all__ = ['doco... | mit |
mikedh/trimesh | examples/voxel.py | 2 | 4350 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import inspect
import trimesh
from trimesh.exchange.binvox import voxelize_mesh
from trimesh import voxel as v
dir_current = os.path.dirname(
os.path.abspath(
inspect... | mit |
zyga/ubuntu-make | tests/large/test_ide.py | 6 | 18449 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
# Tin Tvrtković
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 3.
#
# This program is distributed... | gpl-3.0 |
cloudnautique/cloud-cattle | code/agent/src/agents/pyagent/cattle/plugins/core/event_handlers.py | 11 | 2000 | import os
import subprocess
from cattle import utils
from cattle import Config
from cattle.type_manager import types
from cattle.progress import Progress
def _should_handle(handler, event):
name = event.name.split(';', 1)[0]
if name not in handler.events() or event.replyTo is None:
return False
r... | apache-2.0 |
capchu/TextRPGOnline | rpgonline/env/lib/python2.7/site-packages/pip/vendor/html5lib/treebuilders/dom.py | 249 | 11328 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import minidom, Node, XML_NAMESPACE, XMLNS_NAMESPACE
import weakref
from . import _base
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom ... | gpl-3.0 |
mwstobo/marshmallow | tests/test_exceptions.py | 7 | 2753 | # -*- coding: utf-8 -*-
import pytest
from marshmallow.exceptions import ValidationError, MarshallingError, UnmarshallingError
from marshmallow import fields, Schema
class TestValidationError:
def test_stores_message_in_list(self):
err = ValidationError('foo')
assert err.messages == ['foo']
... | mit |
juanka1331/VAN-applied-to-Nifti-images | final_scripts/tests_over_3dmask_generator.py | 1 | 1589 | import sys
import os
from lib.data_loader import utils_mask3d
sys.path.append(os.path.dirname(os.getcwd()))
from lib.utils import output_utils
from lib.data_loader import mri_atlas
from lib.data_loader import pet_atlas
from lib.data_loader import PET_stack_NORAD
from lib.data_loader import MRI_stack_NORAD
from lib.uti... | gpl-2.0 |
boberfly/gaffer | python/GafferUI/Button.py | 7 | 6312 | ##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | bsd-3-clause |
xxd3vin/spp-sdk | opt/Python27/Lib/site-packages/numpy/ma/core.py | 22 | 226541 | """
numpy.ma : a package to handle missing or invalid values.
This package was initially written for numarray by Paul F. Dubois
at Lawrence Livermore National Laboratory.
In 2006, the package was completely rewritten by Pierre Gerard-Marchant
(University of Georgia) to make the MaskedArray class a subclass of ndarray,... | mit |
hkawasaki/kawasaki-aio8-2 | cms/djangoapps/contentstore/management/commands/check_course.py | 22 | 2740 | from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.xml_importer import check_module_metadata_editability
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore import Location
class Command(BaseCommand):
... | agpl-3.0 |
bbcf/bbcflib | bein/tests/test_bein.py | 1 | 13588 | import socket
import re
import sys
import random
from unittest2 import TestCase, TestSuite, main, TestLoader, skipIf
from bein import *
from bein.util import touch
M = MiniLIMS("testing_lims")
def hostname_contains(pattern):
hostname = socket.gethostbyaddr(socket.gethostname())[0]
if re.search(pattern, host... | gpl-3.0 |
dawnpower/nova | nova/openstack/common/imageutils.py | 64 | 6349 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | apache-2.0 |
Turkingwang/dpkt | dpkt/snoop.py | 22 | 2963 | # $Id$
"""Snoop file format."""
import sys, time
import dpkt
# RFC 1761
SNOOP_MAGIC = 0x736E6F6F70000000L
SNOOP_VERSION = 2
SDL_8023 = 0
SDL_8024 = 1
SDL_8025 = 2
SDL_8026 = 3
SDL_ETHER = 4
SDL_HDLC = 5
SDL_CHSYNC = 6
SDL_IBMCC = 7
SDL_FDDI = 8
SDL_OTHER = 9
dltoff = { SDL_ETHER:14 }
class PktHd... | bsd-3-clause |
amanikamail/flexx | docs/scripts/genuiclasses.py | 20 | 3063 | """ Generate docs for ui classes.
"""
import os
from types import ModuleType
from flexx import ui, app
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
DOC_DIR = os.path.abspath(os.path.join(THIS_DIR, '..'))
OUTPUT_DIR = os.path.join(DOC_DIR, 'ui')
created_files = []
def main():
pages = {}
class_... | bsd-2-clause |
eeshangarg/oh-mainline | vendor/packages/django-extensions/django_extensions/management/commands/sqldiff.py | 17 | 30783 | """
sqldiff.py - Prints the (approximated) difference between models and database
TODO:
- better support for relations
- better support for constraints (mainly postgresql?)
- support for table spaces with postgresql
- when a table is not managed (meta.managed==False) then only do a one-way
sqldiff ? show differ... | agpl-3.0 |
jjs0sbw/CSPLN | apps/scaffolding/linux/web2py/gluon/contrib/fpdf/php.py | 13 | 1256 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
# fpdf php helpers:
def substr(s, start, length=-1):
if length < 0:
length=len(s)-start
return s[start:start+length]
def sprintf(fmt, *args): return fmt % args
def print_r(array):
if not isinstance(array, dict):
array = dict([(... | gpl-3.0 |
rismalrv/edx-platform | common/djangoapps/course_modes/views.py | 62 | 10994 | """
Views for the course_mode module
"""
import decimal
from ipware.ip import get_ip
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import redirect
from django.views.generic.base import View
from django.utils.translation import ugettext ... | agpl-3.0 |
stevenwudi/Kernelized_Correlation_Filter | CNN_training.py | 1 | 3640 | import numpy as np
from keras.optimizers import SGD
from models.CNN_CIFAR import cnn_cifar_batchnormalisation, cnn_cifar_small, cnn_cifar_nodropout, \
cnn_cifar_small_batchnormalisation
from models.DataLoader import DataLoader
from scripts.progress_bar import printProgress
from time import time, localtime
# this is... | gpl-3.0 |
wakatime/wakatime | wakatime/packages/py27/pygments/lexers/sas.py | 4 | 9449 | # -*- coding: utf-8 -*-
"""
pygments.lexers.sas
~~~~~~~~~~~~~~~~~~~
Lexer for SAS.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words
from pygments.token import Comment, Key... | bsd-3-clause |
Cubitect/ASMModSuit | ASMVillageMarker.py | 1 | 5318 | import SRenderLib
from asmutils import *
def create_mod(util):
print '\nSearching for mappings for ASMVillageMarker...'
SRenderLib.setup_lib(util)
lines = util.readj('World')
pos = findOps(lines,0,[['.field','protected',';'],['.field','protected','Z'],['.field','protected',';'],['.field','protected',... | gpl-3.0 |
dyn888/youtube-dl | youtube_dl/extractor/behindkink.py | 145 | 1645 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import url_basename
class BehindKinkIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?behindkink\.com/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<id>[^/#?_]+)'
_TEST = {
... | unlicense |
shadowmint/nwidget | lib/cocos2d-0.5.5/test/test_menu_items.py | 1 | 2268 | # This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, q"
tags = "menu items, ToggleMenuItem, MultipleMenuItem, MenuItem, EntryMenuItem, ImageMenuItem, ColorMenuItem"
from pyglet import i... | apache-2.0 |
tangfeng1/flask | tests/test_blueprints.py | 143 | 18147 | # -*- coding: utf-8 -*-
"""
tests.blueprints
~~~~~~~~~~~~~~~~
Blueprints (and currently modules)
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
from flask._compat import text_type
from werkzeug.http import parse_cache_control_... | bsd-3-clause |
iparanza/earthenterprise | earth_enterprise/src/server/wsgi/serve/snippets/util/dbroot_v2_pb2.py | 4 | 184394 | #!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
ianyh/heroku-buildpack-python-opencv | vendor/.heroku/lib/python2.7/test/test_socket.py | 9 | 60282 | #!/usr/bin/env python
import unittest
from test import test_support
import errno
import socket
import select
import _testcapi
import time
import traceback
import Queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
def try_address(host, port=0, family=socket.A... | mit |
tunneln/CarnotKE | jyhton/Lib/test/test_StringIO_jy.py | 9 | 1994 | import unittest
import cStringIO
from test import test_support
class TestUnicodeInput(unittest.TestCase):
def test_differences_handling_unicode(self):
# Test for the "feature" described on #1089.
#
# Basically, StringIO returns unicode objects if you feed it unicode,
# but cStringIO... | apache-2.0 |
jpwhite3/python-whirlwind-tour | examples/lab4.py | 1 | 1539 | from __future__ import print_function
import sys
import re
import glob
import argparse
def eprint(*args, **kwargs):
# Print to STDERR instead of STDOUT
print(*args, file=sys.stderr, **kwargs)
def grep(expression, filepath, ignorecase=False, invert=False):
raw_expression = re.escape(expression)
... | cc0-1.0 |
Nexenta/cinder | cinder/tests/unit/volume/drivers/emc/vnx/test_taskflows.py | 5 | 6841 | # Copyright (c) 2016 EMC Corporation, 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 ap... | apache-2.0 |
lifeinoppo/littlefishlet-scode | RES/REF/python_sourcecode/ipython-master/IPython/utils/process.py | 17 | 2937 | # encoding: utf-8
"""
Utilities for working with external processes.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import sys
if sys.platform == 'win32':
from ._process_win32 import system, getoutput, arg_... | gpl-2.0 |
galfaroi/trading-with-python | lib/extra.py | 77 | 2540 | '''
Created on Apr 28, 2013
Copyright: Jev Kuznetsov
License: BSD
'''
from __future__ import print_function
import sys
import urllib
import os
import xlrd # module for excel file reading
import pandas as pd
class ProgressBar:
def __init__(self, iterations):
self.iterations = iterations
... | bsd-3-clause |
ayoubg/gem5-graphics | gem5-gpu/tests/quick/se_gpu/10.backprop/test.py | 1 | 1654 | # Copyright (c) 2006 The Regents of The University of Michigan
# 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 |
bcarr092/pyCovertAudio | src/pyCovertAudio/BFSKModulator.py | 1 | 2146 | from pyCovertAudio_lib import *
from BaseModulator import BaseModulator
from SignalFunctions import SignalFunctions
class BFSKModulator(BaseModulator):
def __init__(
self, bitsPerSymbol, sampleRate, samplesPerSymbol,
symbolExpansionFactor, separationIntervals, configuration
):
... | apache-2.0 |
Khan/git-bigfile | vendor/boto/datapipeline/exceptions.py | 235 | 1471 | # Copyright (c) 2012 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 |
40123112/w17exam | static/Brython3.1.3-20150514-095342/Lib/unittest/loader.py | 739 | 13883 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import functools
from fnmatch import fnmatch
from . import case, suite, util
__unittest = True
# what about .pyc or .pyo (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', '.pyc' *and* '.pyo'
VALID... | agpl-3.0 |
sebrandon1/nova | nova/virt/libvirt/designer.py | 5 | 5322 | # Copyright (C) 2013 Red Hat, 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 ... | apache-2.0 |
nirmeshk/oh-mainline | vendor/packages/html5lib/html5lib/tests/test_serializer.py | 72 | 7831 | import os
import unittest
from support import html5lib_test_files
try:
import json
except ImportError:
import simplejson as json
import html5lib
from html5lib import html5parser, serializer, constants
from html5lib.treewalkers._base import TreeWalker
optionals_loaded = []
try:
from lxml import etree
... | agpl-3.0 |
davidwaroquiers/pymatgen | pymatgen/io/wannier90.py | 5 | 6189 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Modules for working with wannier90 input and output.
"""
from typing import Sequence
import numpy as np
from scipy.io import FortranEOFError, FortranFile
__author__ = "Mark Turiansky"
__copyright__ = "Co... | mit |
bkj/ernest | enrich/modules/enrich_terminal_nodes.py | 2 | 6773 | #!/usr/bin/env python
'''
Add single neighbor tag for owners and issuers to ownership index;
tag enables hiding terminal nodes in front end
** Note **
This runs prospectively using the --most-recent argument
'''
import argparse
import json
import logging
from elasticsearch import Elasticsearch
from ... | apache-2.0 |
midgetspy/Sick-Beard | lib/hachoir_core/error.py | 90 | 1350 | """
Functions to display an error (error, warning or information) message.
"""
from lib.hachoir_core.log import log
from lib.hachoir_core.tools import makePrintable
import sys, traceback
def getBacktrace(empty="Empty backtrace."):
"""
Try to get backtrace as string.
Returns "Error while trying to get back... | gpl-3.0 |
lberruti/ansible-modules-extras | notification/irc.py | 41 | 6075 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jan-Piet Mens <jpmens () 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 L... | gpl-3.0 |
bev-a-tron/pledgeservice | testlib/waitress/trigger.py | 31 | 7964 | ##############################################################################
#
# Copyright (c) 2001-2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... | agpl-3.0 |
epssy/hue | desktop/core/ext-py/lxml/benchmark/bench_etree.py | 30 | 10920 | import sys, copy
from itertools import *
from StringIO import StringIO
import benchbase
from benchbase import (with_attributes, with_text, onlylib,
serialized, children, nochange)
TEXT = "some ASCII text"
UTEXT = u"some klingon: \F8D2"
#########################################################... | apache-2.0 |
modera/mcloud | mcloud/plugins/monitor.py | 1 | 1101 | import inject
from mcloud.application import ApplicationController
from mcloud.events import EventBus
from mcloud.plugin import IMcloudPlugin
from mcloud.plugins import Plugin
from mcloud.txdocker import IDockerClient
from twisted.internet import reactor
from twisted.python import log
from zope.interface import impleme... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.