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 |
|---|---|---|---|---|---|
sharkykh/SickRage | lib/ndg/httpsclient/test/test_https.py | 57 | 4359 | """unit tests module for ndg.httpsclient.https.HTTPSconnection class
PyOpenSSL utility to make a httplib-like interface suitable for use with
urllib2
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "06/01/12"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file i... | gpl-3.0 |
DirkdeDraak/easybuild-framework | easybuild/toolchains/__init__.py | 9 | 1310 | ##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# 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),
# the Hercules foundation (htt... | gpl-2.0 |
22rostislav/xhtml2pdf | ez_setup.py | 164 | 12155 | #!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... | apache-2.0 |
wxkdesky/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py | 124 | 2423 | # Copyright (C) 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 of conditions and the f... | bsd-3-clause |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/idlelib/HyperParser.py | 36 | 10496 | """Provide advanced parsing abilities for ParenMatch and other extensions.
HyperParser uses PyParser. PyParser mostly gives information on the
proper indentation of code. HyperParser gives additional information on
the structure of code.
"""
import string
import keyword
from idlelib import PyParse
class HyperParse... | mit |
aaronorosen/horizon-congress | openstack_dashboard/dashboards/admin/instances/panel.py | 46 | 1091 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
matthiasplappert/motion_classification | src/toolkit/util.py | 1 | 2470 | import numpy as np
from sklearn.utils.validation import check_array
class NotFittedError(ValueError, AttributeError):
pass
def check_feature_array(array, n_features=None):
array = check_array(array, ensure_2d=True, allow_nd=False)
if n_features is not None and array.shape[1] != n_features:
raise... | mit |
Makeystreet/makeystreet | woot/apps/catalog/migrations/0035_fix_sequence_problem.py | 1 | 26017 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
def increase_sequence(dbName):
highest_number = db.execute('select id from '+dbName+' order by id desc limit 1;')[0][0]
db.execute('alter sequence... | apache-2.0 |
Zhaoyanzhang/-myflasky | venv/lib/python2.7/site-packages/pip/utils/__init__.py | 323 | 27187 | from __future__ import absolute_import
from collections import deque
import contextlib
import errno
import io
import locale
# we have a submodule named 'logging' which would shadow this if we used the
# regular name:
import logging as std_logging
import re
import os
import posixpath
import shutil
import stat
import su... | mit |
zephg/parallel-ssh | psshlib/task.py | 63 | 10081 | # Copyright (c) 2009-2012, Andrew McNabb
from errno import EINTR
from subprocess import Popen, PIPE
import os
import signal
import sys
import time
import traceback
from psshlib import askpass_client
from psshlib import color
BUFFER_SIZE = 1 << 16
try:
bytes
except NameError:
bytes = str
class Task(object)... | bsd-3-clause |
Chedi/airflow | airflow/operators/sqlite_operator.py | 9 | 1088 | import logging
from airflow.hooks import SqliteHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class SqliteOperator(BaseOperator):
"""
Executes sql code in a specific Sqlite database
:param sqlite_conn_id: reference to a specific sqlite database
:type sqlite_con... | apache-2.0 |
scieloorg/processing | publication/documents_dates.py | 1 | 9255 | # coding: utf-8
"""
Este processamento gera uma tabulação de datas do artigo (publicação, submissão,
aceite, entrada no scieloe atualização no scielo)
"""
import argparse
import logging
import codecs
import datetime
import xylose.scielodocument
import utils
import choices
logger = logging.getLogger(__name__)
d... | bsd-2-clause |
bparafina/shadowsocks | tests/test.py | 1016 | 5029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
offtools/linux-show-player | lisp/ui/settings/settings_page.py | 3 | 1283 | # -*- coding: utf-8 -*-
#
# This file is part of Linux Show Player
#
# Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com>
#
# Linux Show Player 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 ... | gpl-3.0 |
JVillella/tensorflow | tensorflow/contrib/keras/python/keras/preprocessing/text_test.py | 17 | 2522 | # Copyright 2016 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 |
piotrek-golda/CivilHubIndependantCopy | projects/views/forum.py | 3 | 7098 | # -*- coding: utf-8 -*-
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.views.generic import ListView
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from places_core.mixins import Login... | gpl-3.0 |
40223136/w17test1 | static/Brython3.1.0-20150301-090019/Lib/fnmatch.py | 894 | 3163 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | gpl-3.0 |
raildo/nova | nova/api/openstack/compute/networks.py | 33 | 7369 | # Copyright 2011 Grid Dynamics
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | apache-2.0 |
Maximilian-Reuter/SickRage-1 | lib/stevedore/driver.py | 21 | 5496 | from .exception import NoMatches, MultipleMatches
from .named import NamedExtensionManager
class DriverManager(NamedExtensionManager):
"""Load a single plugin with a given name from the namespace.
:param namespace: The namespace for the entry points.
:type namespace: str
:param name: The name of the ... | gpl-3.0 |
davidjb/sqlalchemy | test/ext/test_baked.py | 17 | 23722 | from sqlalchemy.orm import Session, subqueryload, \
mapper, relationship, lazyload, clear_mappers
from sqlalchemy.testing import eq_, is_, is_not_, assert_raises
from sqlalchemy import testing
from test.orm import _fixtures
from sqlalchemy.ext.baked import BakedQuery, baked_lazyload, BakedLazyLoader
from sqlalchemy... | mit |
Fusion-Rom/android_external_chromium_org | tools/telemetry/telemetry/value/histogram.py | 35 | 4090 | # 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 json
from telemetry import value as value_module
from telemetry import perf_tests_helper
from telemetry.value import histogram_util
class HistogramVa... | bsd-3-clause |
jbaiter/beets | test/test_art.py | 5 | 11519 | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | mit |
Phdntom/NLCpyro | cluster.py | 1 | 13290 |
from constants import *
from class_lib import *
import numpy as np
#from collections import deque
class Cluster:
def __init__(self,unit,num,links,file_ext):
self.nodes = []
self.edges = []
self.sites = []
self.bonds = []
if unit == "site":
self.nodes.append( Site(links) )
self.site... | mit |
defance/edx-platform | common/lib/capa/capa/util.py | 47 | 7335 | """
Utility functions for capa.
"""
import bleach
from decimal import Decimal
from calc import evaluator
from cmath import isinf, isnan
import re
from lxml import etree
#-----------------------------------------------------------------------------
#
# Utility functions used in CAPA responsetypes
default_tolerance = '0... | agpl-3.0 |
ikassi/menpo | menpo/rasterize/opengl.py | 2 | 10884 | import numpy as np
from menpo.rasterize.copengl import COpenGLRasterizer
from menpo.image import MaskedImage
# noinspection PyProtectedMember
from menpo.rasterize.base import TextureRasterInfo
class GLRasterizer(object):
def __init__(self, width=1024, height=768, model_matrix=None,
view_matrix... | bsd-3-clause |
RAtechntukan/CouchPotatoServer | libs/chardet/mbcsgroupprober.py | 236 | 1889 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
generic-library/cxx-lutin | lutin_cxx.py | 1 | 2452 | #!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
import os
def get_type():
return "LIBRARY"
def get_desc():
return "clang generic lib c++"
def get_licence():
return "bsd-like"
def get_compagny_type():
return "com"
def get_compagny_name():
return "Univers... | mit |
azureplus/swftools | wx/viewers/technoargia.py | 6 | 21233 | #!/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... | gpl-2.0 |
peerster/CouchPotatoServer | libs/xmpp/protocol.py | 199 | 51362 | ## protocol.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later versio... | gpl-3.0 |
ewandor/home-assistant | homeassistant/components/cover/lutron_caseta.py | 8 | 2336 | """
Support for Lutron Caseta shades.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.lutron_caseta/
"""
import asyncio
import logging
from homeassistant.components.cover import (
CoverDevice, SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_SET_POSITION,
... | apache-2.0 |
40223205/w16b_test- | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/locals.py | 603 | 1141 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License... | agpl-3.0 |
kismatic/kubernetes | build/json-extractor.py | 62 | 2091 | #!/usr/bin/env python
# Copyright 2014 The Kubernetes 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 appli... | apache-2.0 |
pangwong11/jumpball | bd_analyze/nba_season_stats_analyzer.py | 1 | 5069 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as pyplot
from datetime import datetime
import os
import glob
import sys
import re
import argparse
import cv2
import random
import ast
# Argument parsing
#parser = argparse.ArgumentParser(description='Jumpball analyze')
#parser.add_argument('-s', '--seas... | apache-2.0 |
evamwangi/bc-7-Todo_List | venv/Lib/site-packages/sqlalchemy/processors.py | 36 | 5220 | # sqlalchemy/processors.py
# Copyright (C) 2010-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
# Copyright (C) 2010 Gaetan de Menten gdementen@gmail.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""defines generi... | mit |
DavidLP/home-assistant | homeassistant/components/mold_indicator/sensor.py | 7 | 11783 | """Calculates mold growth indication from temperature and humidity."""
import logging
import math
import voluptuous as vol
from homeassistant import util
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.core import callback
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT, ... | apache-2.0 |
emedinaa/contentbox | third_party/yawdadmin/admin.py | 6 | 9802 | import json
from django.conf.urls import patterns, url
from django.contrib import admin
from django.contrib.admin.options import InlineModelAdmin
from django.contrib.admin.util import unquote, get_deleted_objects
from django.core.exceptions import PermissionDenied
from django.db import router
from django.http import H... | apache-2.0 |
devigned/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/models/resource.py | 32 | 1506 | # 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 ... | mit |
mrcslws/nupic.research | nupic/research/frameworks/dynamic_sparse/networks/__init__.py | 3 | 1101 | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
sebasbaumh/three.js | utils/converters/ctm/join_ctm.py | 399 | 2521 | """Join multiple binary files into single file and generate JSON snippet with offsets
-------------------------------------
How to use
-------------------------------------
python join_ctm.py -i "part_*.ctm" -o joined.ctm [-j offsets.js]
Will read multiple files following wildcard pattern (ordered lexicographically)... | mit |
BaladiDogGames/baladidoggames.github.io | mingw/bin/lib/xml/sax/expatreader.py | 72 | 14565 | """
SAX driver for the pyexpat C module. This driver works with
pyexpat.__version__ == '2.22'.
"""
version = "0.20"
from xml.sax._exceptions import *
from xml.sax.handler import feature_validation, feature_namespaces
from xml.sax.handler import feature_namespace_prefixes
from xml.sax.handler import feature_external_... | mit |
RohitDas/cubeproject | lib/django/contrib/gis/db/models/proxy.py | 164 | 2605 | """
The GeometryProxy object, allows for lazy-geometries. The proxy uses
Python descriptors for instantiating and setting Geometry objects
corresponding to geographic model fields.
Thanks to Robert Coup for providing this functionality (see #4322).
"""
from django.utils import six
class GeometryProxy(object):
d... | bsd-3-clause |
sstjohn/pox | pox/messenger/__init__.py | 25 | 19645 | # Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is d... | gpl-3.0 |
devGregA/code | build/lib.linux-x86_64-2.7/scrapy/commands/check.py | 3 | 3900 | from __future__ import print_function
import time
import sys
from collections import defaultdict
from unittest import TextTestRunner, TextTestResult as _TextTestResult
from scrapy.command import ScrapyCommand
from scrapy.contracts import ContractsManager
from scrapy.utils.misc import load_object
from scrapy.utils.conf... | bsd-3-clause |
arhangel6/RecipeWizard | Server/views.py | 1 | 4673 | #Apache2 Python server
from __future__ import print_function
from django.shortcuts import render
import time
from django.http import HttpResponse
import smtplib
import MySQLdb
import sys
import os
import xmpp
def mytest(request):
if request.GET:
value = request.GET
form=value['form']
for... | mit |
RichDijk/eXe | twisted/pb/call.py | 14 | 19649 |
try:
import cStringIO as StringIO
except ImportError:
import StringIO
from twisted.python import failure, log
from twisted.python.components import registerAdapter
from twisted.internet import defer
from twisted.pb import remoteinterface, copyable, slicer, schema, tokens
from tokens import BananaError, Viola... | gpl-2.0 |
scs/uclinux | user/samba/samba-3.0.25a/source/stf/strings.py | 55 | 5889 | #! /usr/bin/python
# Comfychair test cases for Samba string functions.
# Copyright (C) 2003 by Martin Pool <mbp@samba.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 versio... | gpl-2.0 |
hanlind/nova | nova/tests/unit/virt/fakelibosinfo.py | 21 | 2989 | # Copyright 2016 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 agreed to in writing, s... | apache-2.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/eventlet-0.9.14/tests/timer_test.py | 8 | 1261 | from unittest import TestCase, main
import eventlet
from eventlet import hubs
from eventlet.hubs import timer
class TestTimer(TestCase):
def test_copy(self):
t = timer.Timer(0, lambda: None)
t2 = t.copy()
assert t.seconds == t2.seconds
assert t.tpl == t2.tpl
assert t.called... | apache-2.0 |
danielpalomino/gem5 | tests/configs/memtest-ruby.py | 8 | 4121 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2010 Advanced Micro Devices, 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 co... | bsd-3-clause |
dhruve/spark | examples/src/main/python/mllib/ranking_metrics_example.py | 100 | 2197 | #
# 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 us... | apache-2.0 |
levibostian/myBlanky | googleAppEngine/google/appengine/api/capabilities/__init__.py | 15 | 5930 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
andymckay/olympia | src/olympia/editors/sql_table.py | 24 | 1966 | from django_tables.base import BaseTable, Rows, TableOptions
__all__ = ('SQLTable',)
class SQLTableOptions(TableOptions):
def __init__(self, options=None):
super(SQLTableOptions, self).__init__(options)
self.columns = getattr(options, 'columns', None)
# Exclude is not currently supported... | bsd-3-clause |
ryanafolk/ambitus | ambitus_bayestraitscontroller.py | 1 | 3039 | #!/usr/bin/env python3
import subprocess # To call on bash
import sys # To process arguments
from ambitus_main import shell_call as shell_call
def bayesproc(commandargs):
processID = commandargs[0]
bootnum = commandargs[1]
runID = commandargs[2]
bootlabel = "_boot{0}".format(bootnum)
print("Variable {0}, PNO sam... | gpl-3.0 |
sunil07t/e-mission-server | emission/analysis/plotting/leaflet_osm/ipython_helper.py | 1 | 2375 | """
Helper functions that can display leaflet maps inline in an ipython notebook
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins i... | bsd-3-clause |
flashycud/timestack | djangoappengine/management/commands/runserver.py | 14 | 3475 | #!/usr/bin/python2.4
#
# Copyright 2008 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... | mit |
jcpowermac/ansible | lib/ansible/utils/module_docs_fragments/aireos.py | 131 | 2742 | #
# (c) 2017, James Mighion <@jmighion>
#
# 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.
#
... | gpl-3.0 |
samatt/OpenWPM | automation/DataAggregator/LevelDBAggregator.py | 1 | 3112 | from ..SocketInterface import serversocket
from ..MPLogger import loggingclient
import plyvel
import pyhash
import zlib
import time
import os
def LevelDBAggregator(manager_params, status_queue, batch_size=100):
"""
Receives <key, value> pairs from other processes and writes them to the central database.
... | gpl-3.0 |
philippjfr/bokeh | bokeh/models/graphs.py | 4 | 3109 | from ..core.has_props import abstract
from ..core.properties import Any, Dict, Either, Int, Seq, String
from ..model import Model
from ..models.sources import ColumnDataSource
@abstract
class LayoutProvider(Model):
'''
'''
pass
class StaticLayoutProvider(LayoutProvider):
'''
'''
graph_la... | bsd-3-clause |
petteyg/intellij-community | python/helpers/pydev/third_party/wrapped_for_pydev/ctypes/macholib/framework.py | 320 | 2201 | """
Generic framework path manipulation
"""
import re
__all__ = ['framework_info']
STRICT_FRAMEWORK_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
(?P<shortname>\w+).framework/
(?:Versions/(?P<version>[^/]+)/)?
(?P=shortname)
(?:_(?P<suffix>[^_]+))?
)$
""")
def framework_info(filename):... | apache-2.0 |
bradsk88/WinkHouse | lib/jinja2/filters.py | 329 | 30115 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import groupby
from jinja2.utils... | apache-2.0 |
zhufangxing/ndnCDN | src/fd-net-device/bindings/modulegen_customizations.py | 128 | 1118 | import os
def post_register_types(root_module):
enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',')
if 'EmuFdNetDevice' not in enabled_features:
if 'ns3::EmuFdNetDeviceHelper'in root_module:
root_module.classes.remove(root_module['ns3::EmuFdNetDeviceHelper'])
if 'TapFdNet... | gpl-2.0 |
mariosky/evo-drawings | venv/lib/python2.7/site-packages/pip/vendor/html5lib/trie/py.py | 80 | 1774 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError(... | agpl-3.0 |
rlkelly/Lasagne | lasagne/layers/base.py | 1 | 10847 | from collections import OrderedDict
from .. import utils
__all__ = [
"Layer",
"MergeLayer",
]
# Layer base class
class Layer(object):
"""
The :class:`Layer` class represents a single layer of a neural network. It
should be subclassed when implementing new types of layers.
Because each lay... | mit |
adamjerickson/namerizer | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
evankroske/broken_link_reporter | third_party/gtest-1.7.0/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
brainwane/zulip | zerver/lib/remote_server.py | 4 | 7302 | import logging
import urllib
from typing import Any, Dict, List, Mapping, Tuple, Union
import orjson
import requests
from django.conf import settings
from django.forms.models import model_to_dict
from django.utils.translation import ugettext as _
from analytics.models import InstallationCount, RealmCount
from version... | apache-2.0 |
anomaly/prestans | tests/rest/test_error_response.py | 1 | 1721 | import unittest
from prestans import exception
from prestans.http import STATUS
from prestans.rest import ErrorResponse
from prestans.serializer import JSON
class ErrorResponseTest(unittest.TestCase):
def test_init(self):
raised_exception = exception.NoEndpointError()
json_serializer = JSON()
... | bsd-3-clause |
stuarteberg/numpy | numpy/f2py/f90mod_rules.py | 122 | 9850 | #!/usr/bin/env python
"""
Build F90 module support for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 200... | bsd-3-clause |
sjpadgett/lepan-griffin-kernel | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
biospi/seamass-windeps | src/boost_1_57_0/libs/python/test/extract.py | 46 | 2497 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from extract_ext import *
Just about anything has a truth value in Python
>>> assert check_bool(None)
>>> extract_... | apache-2.0 |
rcharp/toyota-flask | numpy/numpy/polynomial/tests/test_classes.py | 122 | 17714 | """Test inter-conversion of different polynomial classes.
This tests the convert and cast methods of all the polynomial classes.
"""
from __future__ import division, absolute_import, print_function
import operator as op
from numbers import Number
import numpy as np
from numpy.polynomial import (
Polynomial, Leg... | apache-2.0 |
Dhivyap/ansible | lib/ansible/modules/network/avi/avi_networksecuritypolicy.py | 28 | 4329 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
aam-at/tensorflow | tensorflow/python/keras/layers/noise.py | 9 | 7052 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
unicri/edx-platform | cms/djangoapps/contentstore/views/assets.py | 25 | 14681 | import logging
from functools import partial
import math
import json
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http... | agpl-3.0 |
hoatle/odoo | addons/account_followup/account_followup.py | 94 | 29520 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
thomashaw/SecGen | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/lib2to3/pgen2/pgen.py | 321 | 13786 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Pgen imports
from . import grammar, token, tokenize
class PgenGrammar(grammar.Grammar):
pass
class ParserGenerator(object):
def __init__(self, filename, stream=None):
close_stream =... | gpl-3.0 |
appsembler/mayan_appsembler | apps/common/migrations/0003_auto__del_field_autoadminsingleton_original_auto_admin_password__del_f.py | 6 | 6099 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'AutoAdminSingleton.original_auto_admin_password'
db.delete_column('common_autoadminsinglet... | gpl-3.0 |
sustainingtechnologies/django-guardian | guardian/testapp/models.py | 13 | 1400 | from __future__ import unicode_literals
from datetime import datetime
from django.db import models
from django.contrib.admin.models import LogEntry
from guardian.models import UserObjectPermissionBase, GroupObjectPermissionBase
class DynamicAccessor(object):
def __init__(self):
pass
def __getattr__(s... | bsd-2-clause |
prop/titanium_mobile | node_modules/ioslib/node_modules/node-ios-device/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 426 | 56534 | # 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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | apache-2.0 |
switchkiller/ProjDjanko | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py | 2924 | 3268 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-2.0 |
tboyce021/home-assistant | tests/components/google_assistant/test_http.py | 13 | 6469 | """Test Google http services."""
from datetime import datetime, timedelta, timezone
from homeassistant.components.google_assistant import GOOGLE_ASSISTANT_SCHEMA
from homeassistant.components.google_assistant.const import (
HOMEGRAPH_TOKEN_URL,
REPORT_STATE_BASE_URL,
)
from homeassistant.components.google_assi... | apache-2.0 |
metasmile/scripts | gitler/gitler.py | 2 | 4412 | """
Line endings resolver for git
Copyright (c) 2015 metasmile cyrano905@gmail.com (github.com/metasmile)
"""
import time, os, sys, re, textwrap, argparse, pprint, subprocess
from os.path import expanduser
parser = argparse.ArgumentParser(description='Line endings resolver for git.')
parser.add_argument('-c','--conf... | mit |
marqh/iris | lib/iris/tests/unit/lazy_data/test_co_realise_cubes.py | 4 | 2957 | # (C) British Crown Copyright 2018, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | lgpl-3.0 |
Jorge-Rodriguez/ansible | test/units/modules/messaging/rabbitmq/test_rabbimq_user.py | 55 | 6653 | # -*- coding: utf-8 -*-
from ansible.modules.messaging.rabbitmq import rabbitmq_user
from units.compat.mock import patch
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
class TestRabbitMQUserModule(ModuleTestCase):
def setUp(self):
super(TestRabbitMQUserM... | gpl-3.0 |
pcm17/tensorflow | tensorflow/contrib/training/python/training/failure_tolerator_test.py | 54 | 4445 | # Copyright 2016 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 |
seanwestfall/django | tests/check_framework/test_model_field_deprecation.py | 322 | 2584 | from django.core import checks
from django.db import models
from django.test import SimpleTestCase
from .tests import IsolateModelsMixin
class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase):
def test_default_details(self):
class MyField(models.Field):
system_check_deprecated_details ... | bsd-3-clause |
kirichoi/tellurium | tellurium/plotting/engine_plotly.py | 1 | 8252 | """
Plotly implementation of the plotting engine.
"""
from __future__ import print_function, absolute_import
from .engine import PlottingEngine, PlottingFigure, PlottingLayout, filterWithSelections, TiledFigure, LowerTriFigure
import numpy as np
import plotly
from plotly.graph_objs import Scatter, Scatter3d, Layout, D... | apache-2.0 |
ademuk/django-oscar | tests/functional/customer/order_status_tests.py | 53 | 1274 | from django.utils.six.moves import http_client
from django.core.urlresolvers import reverse
from oscar.test.factories import create_order
from oscar.test.testcases import WebTestCase
class TestAnAnonymousUser(WebTestCase):
def test_gets_a_404_when_requesting_an_unknown_order(self):
path = reverse('cust... | bsd-3-clause |
mqeizi/WinObjC | deps/3rdparty/icu/icu/source/tools/icu-svnprops-check.py | 388 | 9251 | #! /usr/bin/python
# Copyright (C) 2009-2011, International Business Machines Corporation, Google and Others.
# All rights reserved.
#
# Script to check and fix svn property settings for ICU source files.
# Also check for the correct line endings on files with svn:eol-style = native
#
# THIS SCRIPT DOES NOT WORK O... | mit |
Simran-B/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/sortperf.py | 232 | 4746 | """Sort performance test.
See main() for command line syntax.
See tabulate() for output format.
"""
import sys
import time
import random
import marshal
import tempfile
import os
td = tempfile.gettempdir()
def randfloats(n):
"""Return a list of n random floats in [0, 1)."""
# Generating floats is expensive,... | apache-2.0 |
rui-castro/Sick-Beard | lib/html5lib/sanitizer.py | 100 | 14472 | import re
from xml.sax.saxutils import escape, unescape
from tokenizer import HTMLTokenizer
from constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area',
'art... | gpl-3.0 |
tailorian/Sick-Beard | lib/unidecode/x0d6.py | 253 | 4765 | data = (
'hyeo', # 0x00
'hyeog', # 0x01
'hyeogg', # 0x02
'hyeogs', # 0x03
'hyeon', # 0x04
'hyeonj', # 0x05
'hyeonh', # 0x06
'hyeod', # 0x07
'hyeol', # 0x08
'hyeolg', # 0x09
'hyeolm', # 0x0a
'hyeolb', # 0x0b
'hyeols', # 0x0c
'hyeolt', # 0x0d
'hyeolp', # 0x0e
'hyeolh', # 0x... | gpl-3.0 |
GaZ3ll3/scikit-image | skimage/feature/tests/test_canny.py | 15 | 2877 | import unittest
import numpy as np
from scipy.ndimage import binary_dilation, binary_erosion
import skimage.feature as F
class TestCanny(unittest.TestCase):
def test_00_00_zeros(self):
'''Test that the Canny filter finds no points for a blank field'''
result = F.canny(np.zeros((20, 20)), 4, 0, 0, ... | bsd-3-clause |
Jonekee/chromium.src | tools/findit/svn_repository_parser.py | 74 | 9178 | # Copyright (c) 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 xml.dom.minidom as minidom
from xml.parsers.expat import ExpatError
import crash_utils
from repository_parser_interface import ParserInterface
... | bsd-3-clause |
megaumi/django | tests/model_regress/tests.py | 326 | 8962 | from __future__ import unicode_literals
import datetime
from operator import attrgetter
from django.core.exceptions import ValidationError
from django.db import router
from django.db.models.sql import InsertQuery
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.time... | bsd-3-clause |
calebfoss/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/graph_io_test.py | 17 | 26385 | # Copyright 2016 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 |
andreadean5/python-hpOneView | examples/scripts/get-volume-template.py | 2 | 4915 | #!/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 |
MatthewWilkes/django-oscar | src/oscar/apps/dashboard/orders/app.py | 49 | 2013 | from django.conf.urls import url
from oscar.core.application import Application
from oscar.core.loading import get_class
class OrdersDashboardApplication(Application):
name = None
default_permissions = ['is_staff', ]
permissions_map = {
'order-list': (['is_staff'], ['partner.dashboard_access']),
... | bsd-3-clause |
windelbouwman/ppci-mirror | tools/compile_libmad.py | 1 | 2909 | """ Helper script to build libmad
Version: libmad-0.15.1b
Usage:
- Download the libmad sourcecode.
- Unzip the sourcecode
- Set the environment variable LIBMAD_FOLDER to the unzipped dir
- Run this script
"""
import sys
import os
import logging
import time
try:
from powertb import print_exc
except ImportError... | bsd-2-clause |
aaryani/CoreTardis | tardis/apps/hpctardis/metadata.py | 3 | 42999 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2011-2012, RMIT e-Research Office
# (RMIT University, Australia)
# Copyright (c) 2010-2011, Monash e-Research Centre
# (Monash University, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pr... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.