repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
CingHu/neutron-ustack | neutron/tests/unit/vmware/vshield/test_lbaas_plugin.py | 13 | 21755 | # Copyright 2013 VMware, 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... | apache-2.0 |
benoitc/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/qt.py | 61 | 13252 |
"""SCons.Tool.qt
Tool-specific initialization for Qt.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Pe... | apache-2.0 |
bfirsh/syndication-view | syndication/feeds.py | 1 | 1331 | from syndication import views
from django.core.exceptions import ObjectDoesNotExist
import warnings
# This is part of the deprecated API
from syndication.views import FeedDoesNotExist
class Feed(views.Feed):
"""Provided for backwards compatibility."""
def __init__(self, slug, request):
warnings.warn('... | bsd-3-clause |
nitsas/codejamsolutions | FreeCell Statistics/test_runme.py | 1 | 1586 | #!/usr/bin/env python3
"""
Unit Tests for the Freecell Statistics problem
for Google Code Jam 2011
Round 1A
Link to problem description:
http://code.google.com/codejam/contest/1145485/dashboard#s=p0
author:
Chris Nitsas
(nitsas)
language:
Python 3.2.1
date:
May, 2012
usage:
$ python3 test_runme.py
or
$ test_runm... | mit |
hidext/oemedical | oemedical_lab/models/oemedical_lab.py | 1 | 5877 | # coding=utf-8
#
# Copyright (C) 2012-2013 Federico Manuel Echeverri Choux
#
# 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... | agpl-3.0 |
MadCat34/Sick-Beard | cherrypy/_cptree.py | 45 | 10738 | """CherryPy Application and Tree objects."""
import os
import cherrypy
from cherrypy import _cpconfig, _cplogging, _cprequest, _cpwsgi, tools
from cherrypy.lib import httputil
class Application(object):
"""A CherryPy Application.
Servers and gateways should not instantiate Request objects directly.
... | gpl-3.0 |
songfj/scrapy | scrapy/settings/__init__.py | 124 | 6388 | import six
import json
import copy
import warnings
from collections import MutableMapping
from importlib import import_module
from scrapy.utils.deprecate import create_deprecated_class
from scrapy.exceptions import ScrapyDeprecationWarning
from . import default_settings
SETTINGS_PRIORITIES = {
'default': 0,
... | bsd-3-clause |
infobloxopen/heat-infoblox | heat_infoblox/resources/ospf.py | 1 | 7481 | # Copyright (c) 2016 Infoblox Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
Open-Transactions/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... | bsd-3-clause |
timoschwarzer/blendworks | BlendWorks Server/python/Lib/tkinter/test/test_ttk/test_extensions.py | 11 | 9626 | import sys
import unittest
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest
import tkinter.test.support as support
requires('gui')
class LabeledScaleTest(unittest.TestCase):
def setUp(self):
support.root_deiconify()
def tearDown(self):
support.root_with... | gpl-2.0 |
rajathkumarmp/robocomp | tools/rcmonitor/examples/pyramidRoi.py | 5 | 2069 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 by RoboLab - University of Extremadura
#
# This file is part of RoboComp
#
# RoboComp 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... | gpl-3.0 |
ghisvail/vispy | vispy/geometry/triangulation.py | 21 | 39587 | # -*- coding: utf8 -*-
from __future__ import division, print_function
import sys
from itertools import permutations
import numpy as np
from ..ext.ordereddict import OrderedDict
try:
# Try to use the C++ triangle library, faster than the
# pure Python version.
# The latest stable release only works with... | bsd-3-clause |
moniqx4/bite-project | deps/mrtaskman/server/mapreduce/lib/simplejson/decoder.py | 77 | 11123 | #!/usr/bin/env python
"""Implementation of JSONDecoder
"""
import re
import sys
import struct
from mapreduce.lib.simplejson.scanner import make_scanner
try:
from mapreduce.lib.simplejson._speedups import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.V... | apache-2.0 |
dgriffis/PyGithub | github/Permissions.py | 7 | 1922 | # -*- coding: utf-8 -*-
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub 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 Softwar... | gpl-3.0 |
lexus42/4022322442test | static/Brython3.1.1-20150328-091302/Lib/unittest/util.py | 794 | 4157 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
... | gpl-3.0 |
puiterwijk/product-definition-center | pdc/apps/repository/views.py | 1 | 12418 | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from rest_framework import mixins, viewsets, status
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from . import models
from . import serializers
from .... | mit |
KousikaGanesh/purchaseandInventory | openerp/addons/hr_payroll/__init__.py | 433 | 1137 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
leppa/home-assistant | tests/components/zha/common.py | 1 | 7221 | """Common test objects."""
import time
from unittest.mock import Mock, patch
from asynctest import CoroutineMock
import zigpy.profiles.zha
import zigpy.types
import zigpy.zcl
import zigpy.zcl.clusters.general
import zigpy.zcl.foundation as zcl_f
import zigpy.zdo.types
from homeassistant.components.zha.core.const impo... | apache-2.0 |
tarunkapadia93/gk_armani | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
reincubate/ricloud | ricloud/webhooks.py | 1 | 1619 | from __future__ import absolute_import, print_function
from flask import Flask, request, abort
from ricloud.signing import Signature
from ricloud.utils import encode_json
app = Flask(__name__)
@app.route("/webhooks/<uuid:event_id>", methods=["post"])
def webhooks(event_id):
if not request.is_json:
abo... | lgpl-3.0 |
salguarnieri/intellij-community | python/testData/MockSdk2.7/python_stubs/datetime.py | 27 | 20958 | # encoding: utf-8
# module datetime
# from /Users/vlan/.virtualenvs/obraz-py2.7/lib/python2.7/lib-dynload/datetime.so
# by generator 1.137
""" Fast implementation of the datetime type. """
# no imports
# Variables with simple values
MAXYEAR = 9999
MINYEAR = 1
# no functions
# classes
class date(object):
""" da... | apache-2.0 |
SickGear/SickGear | lib/apprise/plugins/NotifyWindows.py | 2 | 9234 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... | gpl-3.0 |
sivel/ansible | test/integration/targets/module_utils/library/test.py | 35 | 2970 | #!/usr/bin/python
# Most of these names are only available via PluginLoader so pylint doesn't
# know they exist
# pylint: disable=no-name-in-module
__metaclass__ = type
results = {}
# Test import with no from
import ansible.module_utils.foo0
results['foo0'] = ansible.module_utils.foo0.data
# Test depthful import wit... | gpl-3.0 |
JRock007/boxxy | dist/Boxxy server.app/Contents/Resources/lib/python2.7/pygame/tests/mixer_test.py | 5 | 25372 | #################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
... | mit |
Star2Billing/newfies-dialer | newfies/mod_sms/migrations/0001_initial.py | 5 | 8211 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
import mod_sms.models
class Migration(migrations.Migration):
dependencies = [
('sms', '0001_initial'),
('dialer_contact', '0001_i... | mpl-2.0 |
StackStorm/mistral | mistral/tests/unit/api/v2/test_executions.py | 1 | 30260 | # Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
# Copyright 2015 Huawei Technologies Co., Ltd.
# Copyright 2016 - Brocade Communications Systems, Inc.
# Copyright 2018 - Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exc... | apache-2.0 |
arrti/proxypool | listener.py | 1 | 1920 | #!/usr/bin/python2
# coding=utf-8
import sys
from datetime import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from smtplib import SMTP_SSL
from supervisor import childutils
from proxypool.config import SEND_MAIL
SMTP_SERVER = 'smtp server'
ACCOUNT = 'account'
PASSWORD... | apache-2.0 |
podemos-info/odoo | addons/edi/__init__.py | 9 | 1370 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
kirananto/RaZorLettuce | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
olavurmortensen/gensim | gensim/test/test_ldaseqmodel.py | 13 | 17398 | """
Tests to check DTM math functions and Topic-Word, Doc-Topic proportions.
"""
import numpy as np # for arrays, array broadcasting etc.
from gensim.models import ldaseqmodel, ldamodel
from gensim.corpora import Dictionary
import os.path
import unittest
import logging
module_path = os.path.dirname(__file__) # ne... | lgpl-2.1 |
vikkyrk/incubator-beam | sdks/python/apache_beam/io/filebasedsource_test.py | 1 | 26987 | #
# 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 |
MarekSuchanek/repocribro | repocribro/commands/repocheck.py | 1 | 4426 | import click
import flask
import flask.cli
import iso8601
import pytz
from werkzeug.exceptions import HTTPException
class RepocheckCommand:
event2webhook = {
'PushEvent': 'push',
'ReleaseEvent': 'release',
'RepositoryEvent': 'repository',
}
def run(self, full_name=None):
... | mit |
wuranbo/kafka | system_test/mirror_maker_testsuite/mirror_maker_test.py | 70 | 17661 | # 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 u... | apache-2.0 |
niasand/cool-config | pandas_learn/pivot_table.py | 1 | 8064 | # -*- coding:utf-8 -*-
# @Author: Zhiwei.Yang
# @Create At: 2019-02-23 19:22:08
# @Last Modified At: 2019-02-23 19:22:08
import pandas as pd
import numpy as np
lc = pd.read_csv("phone_data.csv")
df = pd.pivot_table(lc,index=["month"],values=["duration"],aggfunc=np.sum)
df3 = pd.pivot_table(lc,index=["month"],values... | mit |
bbozhev/flask-test | flask/lib/python2.7/site-packages/werkzeug/script.py | 147 | 11249 | # -*- coding: utf-8 -*-
r'''
werkzeug.script
~~~~~~~~~~~~~~~
.. admonition:: Deprecated Functionality
``werkzeug.script`` is deprecated without replacement functionality.
Python's command line support improved greatly with :mod:`argparse`
and a bunch of alternative modules.
Most ... | mit |
tqtran7/horizon | openstack_dashboard/dashboards/project/network_topology/routers/tables.py | 73 | 1051 | # Copyright 2013 NTT Innovation Institute 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 applic... | apache-2.0 |
1ukash/horizon | horizon/dashboards/project/access_and_security/keypairs/tables.py | 1 | 1878 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 |
lcm-proj/lcm | lcm-python/lcm/__init__.py | 1 | 4138 | import os
from lcm import _lcm
from lcm._lcm import LCM, LCMSubscription
class Event(object):
"""Data structure representing a single event in an LCM EventLog
"""
def __init__ (self, eventnum, timestamp, channel, data):
"""
Initializer
"""
self.eventnum = eventnum
... | lgpl-2.1 |
rabix/bunny | rabix-cli/examples/dna2protein/dna2protein.cwl-2018-03-22-135251.500/root/Transcribe/transcribe_argparse.py | 1 | 1226 | #!/usr/bin/env/python
import argparse
import re
import sys
def transcribe(args):
# create a transcription map and use regex to translate
map = {"A":"U", "T":"A", "C":"G", "G":"C"}
map = dict((re.escape(k), v) for k, v in map.iteritems())
pattern = re.compile("|".join(map.keys()))
DNA = args['dna'].read().strip()
... | apache-2.0 |
gkarlin/django-jenkins | build/Django/django/middleware/csrf.py | 20 | 8862 | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
from __future__ import unicode_literals
import hashlib
import logging
import re
import random
from django.conf import settings
from django.core.urlresolvers import g... | lgpl-3.0 |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Lib/encodings/iso8859_13.py | 593 | 13527 | """ Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.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 decode(self,input,errors... | gpl-3.0 |
XtremeTeam/Talisman-xmpp-bot | plugins/features_plugin.py | 1 | 7086 | #===istalismanplugin===
# -*- coding: utf-8 -*-
# Talisman plugin
# features_plugin.py
# Initial Copyright © 2007 Als <Als@exploit.in>
# 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; ei... | gpl-2.0 |
PanYuntao/node-gyp | gyp/test/subdirectory/gyptest-SYMROOT-default.py | 399 | 1260 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... | mit |
4eek/edx-platform | common/djangoapps/third_party_auth/api/tests/test_views.py | 8 | 5329 | """
Tests for the Third Party Auth REST API
"""
import json
import unittest
import ddt
from mock import patch
from django.test import Client
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from rest_framework import status
from django.conf import settings
from django.test.utils... | agpl-3.0 |
JenSte/libsigrokdecode | decoders/z80/tables.py | 24 | 44963 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Daniel Elstner <daniel.kitta@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... | gpl-3.0 |
sql-viewer/SQLGlimpse | sqlviewer/glimpse/management/commands/import.py | 1 | 2236 | from sqlviewer.glimpse.services import save_imported_model
from sqlviewer.integration.mysqlwb import import_model
__author__ = 'Stefan Martinov <stefan.martinov@gmail.com>'
import os
import time
from threading import Thread # This is the right package name
from django.core.management.base import BaseCommand, Comman... | gpl-2.0 |
stricklin/Gambot | PieceList.py | 1 | 1522 | class PieceList:
"""
holds pieces for board in dicts for easy access
orders pieces to produce better move ordering
"""
def __init__(self):
self.pieces_by_type = {
"K": [],
"P": [],
"B": [],
"R": [],
"Q": [],
"N": [],
... | gpl-3.0 |
yashu-seth/networkx | networkx/readwrite/p2g.py | 19 | 3277 | """
This module provides the following: read and write of p2g format
used in metabolic pathway studies.
See http://www.cs.purdue.edu/homes/koyuturk/pathway/ for a description.
The summary is included here:
A file that describes a uniquely labeled graph (with extension ".gr")
format looks like the following:
name
... | bsd-3-clause |
thonkify/thonkify | src/lib/google/protobuf/internal/wire_format.py | 255 | 8444 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | mit |
75651/kbengine_cloud | kbe/src/lib/python/Tools/scripts/diff.py | 40 | 2226 | #!/usr/bin/env python3
""" Command line interface to difflib.py providing diffs in four formats:
* ndiff: lists every line and highlights interline changes.
* context: highlights clusters of changes in a before/after format.
* unified: highlights clusters of changes in an inline format.
* html: generates side... | lgpl-3.0 |
FFMG/myoddweb.piger | myodd/boost/libs/numeric/odeint/performance/plot_result.py | 43 | 2225 | """
Copyright 2011-2014 Mario Mulansky
Copyright 2011-2014 Karsten Ahnert
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)
"""
import numpy as np
from matplotlib import pyplot as plt
plt.rc("font", size=16)
def g... | gpl-2.0 |
veridiam/Madcow-Waaltz | madcow/modules/summon.py | 5 | 1335 | """Summon people"""
import re
from learn import Main as Learn
from madcow.util import Module
from smtplib import SMTP
from madcow.conf import settings
from madcow.util.text import *
class Main(Module):
pattern = re.compile(r'^\s*summons?\s+(\S+)(?:\s+(.*?))?\s*$')
require_addressing = True
help = u'summo... | gpl-3.0 |
zhang625272514/peewee | playhouse/test_utils.py | 24 | 2675 | from functools import wraps
import logging
from peewee import create_model_tables
from peewee import drop_model_tables
logger = logging.getLogger('peewee')
class test_database(object):
def __init__(self, db, models, create_tables=True, drop_tables=True,
fail_silently=False):
self.db = d... | mit |
kernc/networkx | networkx/algorithms/community/kclique.py | 95 | 2720 | #-*- coding: utf-8 -*-
# Copyright (C) 2011 by
# Conrad Lee <conradlee@gmail.com>
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
from collections import defaultdict
import networkx as nx
__author__ = """\n""".join(['Conrad Lee <conradlee@gmail.com>',
... | bsd-3-clause |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/tools/solid_tools/maq_cs_wrapper.py | 1 | 12130 | #!/usr/bin/env python
#Guruprasad Ananda
#MAQ mapper for SOLiD colourspace-reads
import sys, os, zipfile, tempfile, subprocess
def stop_err( msg ):
sys.stderr.write( "%s\n" % msg )
sys.exit()
def __main__():
out_fname = sys.argv[1].strip()
out_f2 = open(sys.argv[2].strip(),'r+')
ref_fname = sys... | gpl-3.0 |
infoxchange/lettuce | tests/unit/test_step_runner.py | 18 | 17647 | # -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.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 Foundatio... | gpl-3.0 |
jhunufa/ArduWatchRaspSerial | virtualenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 714 | 5988 | from __future__ import absolute_import
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen... | mit |
alexmorozov/django | tests/gis_tests/gdal_tests/test_ds.py | 273 | 11450 | import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from ..test_data import TEST_DATA, TestDS, get_ds_file
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.... | bsd-3-clause |
gnu-sandhi/sandhi | modules/gr36/gnuradio-core/src/examples/volk_benchmark/volk_plot.py | 78 | 6117 | #!/usr/bin/env python
import sys, math
import argparse
from volk_test_funcs import *
try:
import matplotlib
import matplotlib.pyplot as plt
except ImportError:
sys.stderr.write("Could not import Matplotlib (http://matplotlib.sourceforge.net/)\n")
sys.exit(1)
def main():
desc='Plot Volk performanc... | gpl-3.0 |
krintoxi/NoobSec-Toolkit | NoobSecToolkit /tools/inject/thirdparty/beautifulsoup/beautifulsoup.py | 25 | 79455 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... | gpl-2.0 |
pdellaert/ansible | lib/ansible/modules/network/fortianalyzer/faz_device.py | 21 | 14413 | #!/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 distribut... | gpl-3.0 |
hujiajie/chromium-crosswalk | third_party/typ/typ/arg_parser.py | 33 | 13928 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | bsd-3-clause |
hkariti/ansible | lib/ansible/modules/database/proxysql/proxysql_mysql_users.py | 42 | 16189 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: proxysql_mysql_users
versi... | gpl-3.0 |
orestkreminskyi/taf | taf/plugins/pytest_onsenv.py | 2 | 11821 | # Copyright (c) 2011 - 2017, Intel Corporation.
#
# 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 agre... | apache-2.0 |
ofer43211/unisubs | apps/videos/types/brightcove.py | 3 | 2845 | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | agpl-3.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.3/django/db/backends/creation.py | 27 | 22597 | import sys
import time
from django.conf import settings
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific differences that pertain to
database *creation*, ... | bsd-3-clause |
boompieman/iim_project | project_python2/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_structures.py | 1152 | 1416 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity... | gpl-3.0 |
jdfekete/progressivis | progressivis/stats/min.py | 1 | 4919 | from ..core.utils import indices_len, fix_loc
from ..core.bitmap import bitmap
from ..table.module import TableModule
from ..table.table import Table
from ..core.slot import SlotDescriptor
from ..utils.psdict import PsDict
from ..core.decorators import process_slot, run_if_any
import numpy as np
import logging
logger ... | bsd-2-clause |
zcbenz/cefode-chromium | third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_table.py | 33 | 7098 | #!/usr/bin/python2
# (C) Copyright IBM Corporation 2004
# 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
# on the ri... | bsd-3-clause |
hzruandd/tornado | demos/twitter/twitterdemo.py | 98 | 3492 | #!/usr/bin/env python
"""A simplistic Twitter viewer to demonstrate the use of TwitterMixin.
To run this app, you must first register an application with Twitter:
1) Go to https://dev.twitter.com/apps and create an application.
Your application must have a callback URL registered with Twitter.
It doesn't m... | apache-2.0 |
xdlabs/crawling-tutorials | beautifulsoup/new_example.py | 1 | 3794 | import requests
from bs4 import BeautifulSoup
import re
url = "http://www.amazon.in/s/ref=lp_4149751031_st?rh=n%3A976389031%2Cn%3A%21976390031%2Cn%3A4149418031%2Cn%3A4149751031&qid=1450673890&sort=price-asc-rank"
data = requests.get(url)
html_data = data.content
soup = BeautifulSoup(html_data, "html.parser")
link ... | mit |
rschnapka/stock-logistics-workflow | picking_dispatch/wizard/check_assign_all.py | 1 | 1629 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/django/contrib/gis/geoip/prototypes.py | 535 | 3943 | from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at
from django.contrib.gis.geoip.libgeoip import free, lgeoip
# #### GeoIP C Structure definitions ####
class GeoIPRecord(Structure):
_fields_ = [('country_code', c_char_p),
('country_code3', c_char_p),
('cou... | gpl-3.0 |
yokose-ks/edx-platform | common/lib/xmodule/xmodule/modulestore/exceptions.py | 10 | 1496 | """
Exceptions thrown by KeyStore objects
"""
class ItemNotFoundError(Exception):
pass
class ItemWriteConflictError(Exception):
pass
class InsufficientSpecificationError(Exception):
pass
class OverSpecificationError(Exception):
pass
class InvalidLocationError(Exception):
pass
class NoPat... | agpl-3.0 |
evilpie/servo | tests/wpt/css-tests/tools/pywebsocket/src/example/origin_check_wsh.py | 516 | 1992 | # Copyright 2011, 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... | mpl-2.0 |
ted-gould/nova | nova/tests/unit/api/openstack/compute/test_tenant_networks.py | 18 | 12172 | # Copyright 2014 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 by applicable law or agreed t... | apache-2.0 |
TwolDE2/enigma2 | skin.py | 1 | 46104 | from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
import os
profile("LOAD:enigma_skin")
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop
from Components.config import ConfigSubsection,... | gpl-2.0 |
yahman72/robotframework | atest/testresources/testlibs/classes.py | 25 | 6026 | __version__ = 'N/A' # This should be ignored when version is parsed
class NameLibrary:
handler_count = 10
def simple1(self):
"""Simple 1"""
def simple2___(self):
"""Simple 2"""
def underscore_name(self):
"""Underscore Name"""
def underscore_name2_(self):
"""Undersc... | apache-2.0 |
ryanpetrello/draughtcraft | draughtcraft/tests/selenium/__init__.py | 1 | 1545 | from urlparse import urlparse
from wsgiref.simple_server import make_server
import multiprocessing
from selenium import webdriver
from selenium.webdriver.support import ui
from pecan.deploy import deploy
from draughtcraft.tests import TestApp
class TestSeleniumApp(TestApp):
HOST_BASE = "http://localhost:8521"
... | bsd-3-clause |
sean797/Flexget | flexget/plugins/filter/content_filter.py | 9 | 4744 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
import logging
from fnmatch import fnmatch
from flexget import plugin
from flexget.event import event
from flexget.config_schema impor... | mit |
mikica1986vee/godot | platform/x11/detect.py | 10 | 5058 |
import os
import sys
def is_active():
return True
def get_name():
return "X11"
def can_build():
if (os.name!="posix"):
return False
if sys.platform == "darwin":
return False # no x11 on mac for now
errorval=os.system("pkg-config --version > /dev/null")
if (errorval):
print("pkg-co... | mit |
nikste/tensorflow | tensorflow/python/kernel_tests/reader_ops_test.py | 37 | 28302 | # 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 |
joshua0pang/bazel | third_party/py/mock/tests/testhelpers.py | 109 | 27419 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from tests.support import unittest2, inPy3k
from mock import (
call, _Call, create_autospec, MagicMock,
Mock, ANY, _CallList, patch, PropertyMock
)
from datetime i... | apache-2.0 |
likithkailas/StreamingSystems | python/pyspark/heapq3.py | 77 | 37579 | # -*- encoding: utf-8 -*-
# back ported from CPython 3
# A. HISTORY OF THE SOFTWARE
# ==========================
#
# Python was created in the early 1990s by Guido van Rossum at Stichting
# Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
# as a successor of a language called ABC. Guido remains Py... | apache-2.0 |
moreati/numpy | numpy/core/tests/test_umath.py | 8 | 69660 | from __future__ import division, absolute_import, print_function
import sys
import platform
import warnings
from numpy.testing.utils import _gen_alignment_data
import numpy.core.umath as ncu
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
assert... | bsd-3-clause |
steedos/odoo7 | openerp/addons/marketing_campaign/__init__.py | 61 | 1106 | # -*- 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 |
mou4e/zirconium | third_party/closure_linter/closure_linter/checker.py | 109 | 3892 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | bsd-3-clause |
maoy/zknova | nova/tests/api/openstack/compute/contrib/test_quota_classes.py | 1 | 7299 | # Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
NSLS-II-HXN/PyXRF | pyxrf/core/tests/test_quant_analysis.py | 1 | 47397 | import os
import pytest
import jsonschema
import copy
import numpy as np
import numpy.testing as npt
import time as ttime
from pyxrf.core.utils import convert_time_from_nexus_string
from pyxrf.core.xrf_utils import validate_element_str, generate_eline_list, split_compound_mass
from pyxrf.core.quant_analysis import (
... | bsd-3-clause |
dsiroky/snakemq | tests/unittests/tests_messaging.py | 1 | 6151 | #! -*- coding: utf-8 -*-
"""
@author: David Siroky (siroky@dasir.cz)
@license: MIT License (see LICENSE.txt or
U{http://www.opensource.org/licenses/mit-license.php})
"""
import mock
import nose
import snakemq.message
import snakemq.messaging
import snakemq.exceptions
import utils
memview = snakemq.messagi... | mit |
maohongyuan/kbengine | kbe/src/lib/python/Lib/test/test_email/test_headerregistry.py | 72 | 56910 | import datetime
import textwrap
import unittest
from email import errors
from email import policy
from email.message import Message
from test.test_email import TestEmailBase, parameterize
from email import headerregistry
from email.headerregistry import Address, Group
DITTO = object()
class TestHeaderRegistry(TestE... | lgpl-3.0 |
robotic-ultrasound-image-system/ur5 | easy_handeye-master/easy_handeye/scripts/publish.py | 2 | 2055 | #!/usr/bin/env python2
import rospy
from tf import TransformBroadcaster, TransformerROS, transformations as tfs
from geometry_msgs.msg import Transform
from easy_handeye.handeye_calibration import HandeyeCalibration
rospy.init_node('handeye_calibration_publisher')
while rospy.get_time() == 0.0:
pass
inverse = ro... | apache-2.0 |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/django/core/management/commands/compilemessages.py | 99 | 4926 | from __future__ import unicode_literals
import codecs
import glob
import os
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import find_command, popen_wrapper
from django.utils._os import npath, upath
def has_bom(fn):
with open(fn, 'rb') as f:
sample =... | bsd-3-clause |
jay-lau/magnum | magnum/api/controllers/v1/bay.py | 1 | 13221 | # Copyright 2013 UnitedStack 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 |
imruahmed/microblog | flask/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py | 42 | 26953 | # postgresql/psycopg2.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+psycopg2
:name: psycopg2
:dbapi: psycopg2... | bsd-3-clause |
HelloLily/hellolily | lily/management/commands/tests/test_search_index.py | 1 | 14425 | from unittest import TestCase
from django.core.management import call_command
from django.core.management.base import CommandError
from django.db import models
from django.utils.six import StringIO
from django_elasticsearch_dsl.documents import DocType
from django_elasticsearch_dsl.registries import DocumentRegistry
f... | agpl-3.0 |
tux-00/ansible | lib/ansible/plugins/connection/lxd.py | 133 | 4283 | # (c) 2016 Matt Clay <matt@mystile.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
felixonmars/babel | babel/messages/plurals.py | 151 | 6696 | # -*- coding: utf-8 -*-
"""
babel.messages.plurals
~~~~~~~~~~~~~~~~~~~~~~
Plural form definitions.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from babel.core import default_locale, Locale
from operator import itemgetter
# XXX: remove this file, dupl... | bsd-3-clause |
ayepezv/GAD_ERP | addons/l10n_be_invoice_bba/models/res_partner.py | 38 | 1119 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
from odoo import api, fields, models
class ResPartner(models.Model):
""" add field to indicate default 'Communication Type' on customer invoi... | gpl-3.0 |
yongtang/tensorflow | tensorflow/lite/tools/pip_package/setup_with_binary.py | 9 | 2827 | # Copyright 2020 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.