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 |
|---|---|---|---|---|---|
jeffbryner/MozDef | tests/mq/plugins/test_github_webhooks.py | 3 | 217979 | from mq.plugins.github_webhooks import message
class TestGithubWebhooksFixup(object):
def setup(self):
self.plugin = message()
self.metadata = {
'index': 'events'
}
def verify_metadata(self, metadata):
assert metadata['index'] == 'events'
def test_defaults(sel... | mpl-2.0 |
vipulkanade/EventbriteDjango | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 197 | 10094 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | mit |
sammyshj/stem | test/unit/descriptor/networkstatus/bridge_document.py | 10 | 4719 | """
Unit tests for the BridgeNetworkStatusDocument of stem.descriptor.networkstatus.
"""
import datetime
import unittest
import stem.descriptor
from stem.descriptor.networkstatus import BridgeNetworkStatusDocument
from test.unit.descriptor import get_resource
DOCUMENT = b"""\
published 2012-06-01 04:07:04
r Unname... | lgpl-3.0 |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/Pillow-2.3.0-py2.7-linux-x86_64.egg/PIL/ImagePath.py | 41 | 1231 | #
# The Python Imaging Library
# $Id$
#
# path interface
#
# History:
# 1996-11-04 fl Created
# 2002-04-14 fl Added documentation stub class
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on usage and redistribution.
#
from PIL import Image
# th... | apache-2.0 |
hatbot-team/hatbot_resources | preparation/resources/Resource.py | 1 | 3889 | from hb_res.storage import get_storage
from copy import copy
import time
__author__ = "mike"
_resource_blacklist = {'Resource'}
_resources_by_trunk = dict()
_built_trunks = set()
_building_trunks = set()
def build_deps(res_obj):
assert hasattr(res_obj, 'dependencies')
for dep in res_obj.dependencies:
... | mit |
ojii/sandlib | lib/lib-python/2.7/test/test_descr.py | 1 | 159616 | import __builtin__
import sys
import types
import unittest
import popen2 # trigger early the warning from popen2.py
from copy import deepcopy
from test import test_support
class OperatorsTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
... | bsd-3-clause |
ClaudiaSaxer/PlasoScaffolder | src/plasoscaffolder/model/sql_query_model.py | 1 | 1280 | # -*- coding: utf-8 -*-
"""The SQL query model class."""
from plasoscaffolder.model import sql_query_column_model_data
from plasoscaffolder.model import sql_query_column_model_timestamp
class SQLQueryModel(object):
"""A SQL query model."""
def __init__(
self, query: str, name: str,
columns: [sql_quer... | apache-2.0 |
ChanduERP/odoo | addons/l10n_cr/__openerp__.py | 82 | 3145 | # -*- encoding: utf-8 -*-
##############################################################################
#
# __openerp__.py
# l10n_cr_account
# First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv... | agpl-3.0 |
SoftwareDefinedBuildings/smap | python/smap/drivers/pge.py | 6 | 4629 | """
Copyright (c) 2011, 2012, Regents of the University of California
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 l... | bsd-2-clause |
Eldinnie/ptbtest | examples/test_echobot2.py | 1 | 3680 | from __future__ import absolute_import
import unittest
from telegram.ext import CommandHandler
from telegram.ext import Filters
from telegram.ext import MessageHandler
from telegram.ext import Updater
from ptbtest import ChatGenerator
from ptbtest import MessageGenerator
from ptbtest import Mockbot
from ptbtest impor... | gpl-3.0 |
Eaglemania/TOL | pyglet/font/__init__.py | 6 | 23520 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | gpl-2.0 |
profjrr/scrapy | tests/test_downloadermiddleware_httpproxy.py | 103 | 3439 | import os
import sys
from twisted.trial.unittest import TestCase, SkipTest
from scrapy.downloadermiddlewares.httpproxy import HttpProxyMiddleware
from scrapy.exceptions import NotConfigured
from scrapy.http import Response, Request
from scrapy.spiders import Spider
spider = Spider('foo')
class TestDefaultHeadersMidd... | bsd-3-clause |
whn09/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/relaxed_bernoulli_test.py | 110 | 6469 | # 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 |
vHanda/electron | script/build.py | 155 | 1166 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
from lib.util import atom_gyp
CONFIGURATIONS = ['Release', 'Debug']
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
ninja = os.path.join('vendor', 'depot_tools', 'ninja')
... | mit |
eckucukoglu/arm-linux-gnueabihf | arm-linux-gnueabihf/libc/usr/lib/python2.7/distutils/command/build_py.py | 176 | 16299 | """distutils.command.build_py
Implements the Distutils 'build_py' command."""
__revision__ = "$Id$"
import os
import sys
from glob import glob
from distutils.core import Command
from distutils.errors import DistutilsOptionError, DistutilsFileError
from distutils.util import convert_path
from distutils import log
c... | gpl-2.0 |
lijoantony/django-oscar | src/oscar/apps/wishlists/migrations/0001_initial.py | 51 | 2730 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0001_initial'),
migrations.swappable_dependency(settin... | bsd-3-clause |
GinnyN/towerofdimensions-django | django-openid-auth/django_openid_auth/teams.py | 25 | 14251 | # Launchpad OpenID Teams Extension support for python-openid
#
# Copyright (C) 2008-2010 Canonical Ltd.
#
# 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 copyri... | bsd-3-clause |
mscherer/ansible-modules-extras | database/mysql/mysql_replication.py | 8 | 13966 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql replication
(c) 2013, Balazs Pocze <banyek@gawker.com>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU... | gpl-3.0 |
dend/yulyeong | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_robotframeworklexer.py | 198 | 18591 | # -*- coding: utf-8 -*-
"""
pygments.lexers._robotframeworklexer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Robot Framework.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Copyright 2012 Nokia Siemens Networks Oyj
#
# License... | mit |
ThinkingBridge/platform_external_chromium_org | build/linux/unbundle/replace_gyp_files.py | 31 | 2798 | #!/usr/bin/env python
# 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.
"""
Replaces gyp files in tree with files from here that
make the build use system libraries.
"""
import optparse
import os.path
impo... | bsd-3-clause |
DavidPurcell/murano_temp | murano/dsl/principal_objects/__init__.py | 2 | 1068 | # Copyright (c) 2014 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... | apache-2.0 |
joausaga/ideascaly | tests/test_api.py | 1 | 10169 | import os
import unittest
from tests.config import IdeascalyTestCase
from ideascaly.models import Idea, Vote, Comment, Campaign, Author
"""Unit tests"""
class IdeascalyAPITests(IdeascalyTestCase):
# ---
# Testing variables
# ---
campaign_id = 28416
idea_id_votes = 137010
idea_id_comments = ... | mit |
byterom/android_external_skia | tools/jsondiff.py | 113 | 7526 | #!/usr/bin/python
'''
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
'''
Gathers diffs between 2 JSON expectations files, or between actual and
expected results within a single JSON actual-results file,
and generates an old-vs-new diff... | bsd-3-clause |
jastarex/DeepLearningCourseCodes | 01_TF_basics_and_linear_regression/tensorflow_basic.py | 1 | 8932 |
# coding: utf-8
# # TensorFlow基础
# In this tutorial, we are going to learn some basics in TensorFlow.
# ## Session
# Session is a class for running TensorFlow operations. A Session object encapsulates the environment in which Operation objects are executed, and Tensor objects are evaluated. In this tutorial, we will... | apache-2.0 |
0k/odoo | addons/product_visible_discount/product_visible_discount.py | 28 | 4505 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
ajnirp/servo | python/servo/post_build_commands.py | 5 | 9180 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
raphaelvalentin/Utils | functions/system.py | 1 | 3297 | import re, time, os, shutil, string
from subprocess import Popen, PIPE, STDOUT
from random import randint, seed
__all__ = ['find', 'removedirs', 'source', 'tempfile', 'copy', 'rm', 'template, template_dir']
def find(path='.', regex='*', ctime=0):
r = []
regex = str(regex).strip()
if regex == '*': regex = ... | gpl-2.0 |
Just-D/panda3d | direct/src/distributed/TimeManager.py | 11 | 6863 | from direct.showbase.DirectObject import *
from pandac.PandaModules import *
from direct.task import Task
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import globalClockDelta
class TimeManager(DistributedObject.Distribute... | bsd-3-clause |
myriadrf/pyLMS7002M | pyLMS7002M/LMS7002_RFE.py | 2 | 19263 | #***************************************************************
#* Name: LMS7002_RFE.py
#* Purpose: Class implementing LMS7002 RFE functions
#* Author: Lime Microsystems ()
#* Created: 2016-11-14
#* Copyright: Lime Microsystems (limemicro.com)
#* License:
#**************************************************... | apache-2.0 |
rlouf/patterns-of-segregation | bin/plot_gini.py | 1 | 2527 | """plot_gini.py
Plot the Gini of the income distribution as a function of the number of
households in cities.
"""
from __future__ import division
import csv
import numpy as np
import itertools
from matplotlib import pylab as plt
#
# Parameters and functions
#
income_bins = [1000,12500,17500,22500,27500,32500,37500,42... | bsd-3-clause |
phamelin/ardupilot | Tools/autotest/param_metadata/ednemit.py | 15 | 3501 | #!/usr/bin/env python
"""
Emits parameters as an EDN file, does some small remapping of names
"""
from emit import Emit
import edn_format
import datetime
import pytz
import subprocess
class EDNEmit(Emit):
def __init__(self, *args, **kwargs):
Emit.__init__(self, *args, **kwargs)
self.output = "{:... | gpl-3.0 |
Jajcus/pyxmpp | pyxmpp/jabber/muccore.py | 1 | 27807 | #
# (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
mozilla/zamboni | mkt/site/monitors.py | 1 | 8772 | import os
import socket
import StringIO
import tempfile
import time
import traceback
from django.conf import settings
import commonware.log
import elasticsearch
import requests
from cache_nuggets.lib import memoize
from PIL import Image
from lib.crypto import packaged, receipt
from lib.crypto.packaged import Signing... | bsd-3-clause |
sschiau/swift | utils/gyb_syntax_support/NodeSerializationCodes.py | 1 | 7368 | from Node import error
SYNTAX_NODE_SERIALIZATION_CODES = {
# 0 is 'Token'. Needs to be defined manually
# 1 is 'Unknown'. Needs to be defined manually
'UnknownDecl': 2,
'TypealiasDecl': 3,
'AssociatedtypeDecl': 4,
'IfConfigDecl': 5,
'PoundErrorDecl': 6,
'PoundWarningDecl': 7,
'Poun... | apache-2.0 |
amitjamadagni/sympy | sympy/external/tests/test_codegen.py | 3 | 11845 | # This tests the compilation and execution of the source code generated with
# utilities.codegen. The compilation takes place in a temporary directory that
# is removed after the test. By default the test directory is always removed,
# but this behavior can be changed by setting the environment variable
# SYMPY_TEST_CL... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py | 1 | 28513 | # 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 may ... | mit |
qwefi/nova | nova/console/rpcapi.py | 4 | 2739 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, 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
#
... | apache-2.0 |
Thielak/program-y | src/programy/__init__.py | 49 | 1066 | """
Copyright (c) 2016 Keith Sterling
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, modify, merge, publish, distribute,... | mit |
leshchevds/ganeti | lib/utils/text.py | 5 | 18938 | #
#
# Copyright (C) 2006, 2007, 2010, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | bsd-2-clause |
rizumu/django | tests/proxy_model_inheritance/tests.py | 278 | 1764 | from __future__ import absolute_import, unicode_literals
import os
from django.core.management import call_command
from django.test import TestCase, TransactionTestCase
from django.test.utils import extend_sys_path
from django.utils._os import upath
from .models import (
ConcreteModel, ConcreteModelSubclass, Con... | bsd-3-clause |
anandology/pyjamas | examples/misc/djangoweb/settings.py | 12 | 2950 | # Django settings for pyjsDemo project.
import os
STATIC = str(os.path.join(os.path.dirname(__file__), 'media/output').replace('\\','/'))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'pos... | apache-2.0 |
nicememory/pie | pyglet/pyglet/extlibs/future/py2_3/future/builtins/iterators.py | 70 | 1401 | """
This module is designed to be used as follows::
from future.builtins.iterators import *
And then, for example::
for i in range(10**15):
pass
for (a, b) in zip(range(10**15), range(-10**15, 0)):
pass
Note that this is standard Python 3 code, plus some imports that do
nothing on P... | apache-2.0 |
jusdng/odoo | addons/sale_crm/__openerp__.py | 260 | 2036 | # -*- 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 |
ramezquitao/pyoptools | pyoptools/raytrace/_comp_lib/cylindrical_lens.py | 2 | 2878 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Copyright (c) 2007, Ricardo Amézquita Orozco
# All rights reserved.
#
# This software is provided without warranty under the terms of the GPLv3
# license included in LICENSE.txt and may be re... | gpl-3.0 |
adamcik/mopidy | tests/core/test_playlists.py | 4 | 15093 | import unittest
from unittest import mock
from mopidy import backend, core
from mopidy.models import Playlist, Ref, Track
class BasePlaylistsTest(unittest.TestCase):
def setUp(self): # noqa: N802
self.plr1a = Ref.playlist(name="A", uri="dummy1:pl:a")
self.plr1b = Ref.playlist(name="B", uri="dumm... | apache-2.0 |
lizardsystem/lizard-esf | doc/source/conf.py | 1 | 7078 | # -*- coding: utf-8 -*-
# Note that not all possible configuration values are present in this
# autogenerated file.
# All configuration values have a default; values that are commented out
# serve to show the default.
import datetime
import os
import sys
from pkg_resources import parse_version
import pkginfo
def _e... | gpl-3.0 |
richarddzh/markdown-latex-tools | md2tex/md2tex.py | 1 | 6180 | '''
md2tex.py
- author: Richard Dong
- description: Convert markdown to latex
'''
from __future__ import print_function
import re
import io
import sys
import argparse
import markdown
class State:
NORMAL = 0
RAW = 1
class Handler:
def __init__(self):
self.vars = dict()
self.state = State.NORMAL
sel... | gpl-2.0 |
drawks/ansible | lib/ansible/plugins/netconf/ce.py | 10 | 7483 | #
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
nck0405/MyOwn | modules/tests/volunteer/export_volunteers.py | 25 | 1890 | # -*- coding: utf-8 -*-
""" Sahana Eden Volunteer Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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... | mit |
yongshengwang/hue | build/env/lib/python2.7/site-packages/Paste-2.0.1-py2.7.egg/paste/util/quoting.py | 50 | 2219 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import cgi
import six
import re
from six.moves import html_entities
from six.moves.urllib.parse import quote, unquote
__all__ = ['html_quote', 'html... | apache-2.0 |
tecknicaltom/xhtml2pdf | demo/tgpisa/setup.py | 168 | 2452 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from turbogears.finddata import find_package_data
import os
execfile(os.path.join("tgpisa", "release.py"))
packages=find_packages()
package_data = find_package_data(where='tgpisa',
package='tgpisa')
if os.path.isdir('locales'):
packages.appe... | apache-2.0 |
Benocs/core | src/daemon/core/misc/ipaddr.py | 1 | 15121 | #
# CORE
#
# Copyright (c)2010-2012 the Boeing Company.
# See the LICENSE.BOEING file included in this distribution.
#
# author: Tom Goff <thomas.goff@boeing.com>
#
# Copyright (c) 2014 Benocs GmbH
#
# author: Robert Wuttke <robert@benocs.com>
#
# See the LICENSE file included in this distribution.
#
'''
ipaddr.py: he... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/262_test_largefile.py | 58 | 6626 | """Test largefile support on system where this makes sense.
"""
import os
import stat
import sys
import unittest
from test.test_support import run_unittest, TESTFN, verbose, requires, \
TestSkipped, unlink
try:
import signal
# The default handler for SIGXFSZ is to abort the proce... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/nbconvert/filters/tests/test_latex.py | 21 | 1550 | """
Module with tests for Latex
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------... | gpl-3.0 |
twestbrookunh/paladin-plugins | core/main.py | 1 | 13912 | #! /usr/bin/env python3
"""
The MIT License
Copyright (c) 2017 by Anthony Westbrook, University of New Hampshire <anthony.westbrook@unh.edu>
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 witho... | mit |
sahiljain/catapult | third_party/google-endpoints/endpoints/message_parser.py | 7 | 7890 | # Copyright 2016 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 a... | bsd-3-clause |
jmartinm/invenio-master | modules/webjournal/lib/widgets/bfe_webjournal_widget_weather.py | 25 | 8191 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Licens... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_outbound_rules_operations.py | 1 | 8796 | # 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 may ... | mit |
dgladkov/django | django/contrib/gis/gdal/prototypes/errcheck.py | 586 | 4229 | """
This module houses the error-checking routines used by the GDAL
ctypes prototypes.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.gdal.error import (
GDALException, SRSException, check_err,
)
from django.contrib.gis.gdal.libgdal import lgdal
from django.utils import six
# Helper routine... | bsd-3-clause |
dhhagan/ACT | ACT/thermo/visualize.py | 1 | 13306 | """
Classes and functions used to visualize data for thermo scientific analyzers
"""
from pandas import Series, DataFrame
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import dates as d
import os
import math
import glob
import matplotlib
import warnings
i... | mit |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/setuptools/package_index.py | 10 | 39958 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
import itertools
from functools import wraps
try:
from urllib.parse import splituser
except ImportError:
from urllib2 import splituser
from setuptools.extern import six
from setupt... | mit |
BeATz-UnKNoWN/python-for-android | python3-alpha/extra_modules/pyxmpp2/streambase.py | 46 | 24972 | #
# (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
brummer-simon/RIOT | tests/cond_order/tests/01-run.py | 7 | 1506 | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# Copyright (C) 2016 Oliver Hahm <oliver.hahm@inria.fr>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sy... | lgpl-2.1 |
punktniklas/NiKom | Extras/Botcheck/striptelnetcmds.py | 2 | 1118 | #!/usr/bin/env python
# This script strips telnet command data from stdin.
import sys
state = "Normal"
for line in sys.stdin:
chars = []
for c in line:
if "Normal" == state:
if "\xff" == c:
state = "Command"
else:
chars.append(c)
elif "... | mit |
TheNite/namebench | nb_third_party/jinja2/ext.py | 199 | 21800 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from collections impor... | apache-2.0 |
isaac-s/cloudify-plugins-common | cloudify/constants.py | 2 | 1540 | ########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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... | apache-2.0 |
timm/timmnix | pypy3-v5.5.0-linux64/lib-python/3/ctypes/util.py | 1 | 8948 | import sys, os
import contextlib
import subprocess
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
def _get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.versi... | mit |
ForeverWintr/ImageClassipy | clouds/tests/util/util.py | 1 | 1283 | """
Test utils
"""
import tempfile
import PIL
import numpy as np
from clouds.util.constants import HealthStatus
def createXors(tgt):
#create test xor images
xorIn = [
((255, 255, 255, 255), HealthStatus.GOOD),
((255, 255, 0, 0), HealthStatus.CLOUDY),
((0, 0, 0, 0), HealthStatus.GOOD),... | mit |
jmehnle/ansible | lib/ansible/modules/cloud/google/gcdns_record.py | 49 | 28445 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 CallFire Inc.
#
# This file is part of Ansible.
#
# 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... | gpl-3.0 |
frishberg/django | tests/admin_changelist/models.py | 276 | 2890 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(mo... | bsd-3-clause |
vitorio/bite-project | deps/gdata-python-client/src/gdata/health/__init__.py | 263 | 7090 | #!/usr/bin/python
#
# Copyright 2009 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 b... | apache-2.0 |
klahnakoski/jx-sqlite | vendor/mo_logs/__init__.py | 1 | 15837 | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | mpl-2.0 |
inside-track/pemi | pemi/fields.py | 1 | 7300 | import decimal
import datetime
import json
from functools import wraps
import dateutil
import pemi.transforms
__all__ = [
'StringField',
'IntegerField',
'FloatField',
'DateField',
'DateTimeField',
'BooleanField',
'DecimalField',
'JsonField'
]
BLANK_DATE_VALUES = ['null', 'none', 'na... | mit |
leeon/annotated-django | django/contrib/formtools/tests/tests.py | 32 | 7417 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import unittest
import warnings
from django import http
from django.contrib.formtools import preview, utils
from django.test import TestCase, override_settings
from django.utils._os import upath
from django.contrib.formtools.te... | bsd-3-clause |
Robpol86/FlashAirMusic | tests/test_convert_transcode.py | 1 | 13863 | """Test functions in module."""
import asyncio
import itertools
import re
import signal
from textwrap import dedent
import pytest
from flash_air_music.configuration import FFMPEG_DEFAULT_BINARY
from flash_air_music.convert import transcode
from flash_air_music.convert.discover import get_songs, Song
from tests impor... | mit |
joonro/PyTables | tables/tests/test_earray.py | 6 | 102218 | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import numpy
import tables
from tables import Int16Atom, Int32Atom, Float64Atom, StringAtom
from tables.utils import byteorders
from tables.tests import common
from tables.tests.common import allequal
from tables.tests.common import u... | bsd-3-clause |
crowning-/dash | qa/rpc-tests/blockchain.py | 2 | 3904 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test RPC calls related to blockchain state. Tests correspond to code in
# rpc/blockchain.cpp.
#
from... | mit |
peiyuwang/pants | tests/python/pants_test/backend/jvm/subsystems/test_custom_scala.py | 8 | 4374 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | apache-2.0 |
richardfergie/googleads-python-lib | examples/adxbuyer/v201502/error_handling/handle_partial_failures.py | 4 | 3576 | #!/usr/bin/python
#
# Copyright 2013 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 b... | apache-2.0 |
Peddle/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/email_notifications.py | 37 | 5300 | import sys
import traceback
from optparse import make_option
from django.conf import settings
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
class EmailNotificationCommand(BaseCommand):
"""A BaseCommand subclass which adds sending email fuctionality.
Subclasses wi... | apache-2.0 |
gonuke/cyclus | getdecay.py | 6 | 2050 | #! /usr/bin/env python
from __future__ import print_function, unicode_literals
import os
import sys
import io
import shutil
import tarfile
import argparse
if sys.version_info[0] < 3:
from urllib import urlopen
else:
from urllib.request import urlopen
DECAY_H = os.path.join('src', 'pyne_decay.h')
DECAY_CPP = os... | bsd-3-clause |
ijat/Hotspot-PUTRA-Auto-login | PyInstaller-3.2/PyInstaller/hooks/hook-PyQt5.QtWebEngineWidgets.py | 1 | 2207 | #-----------------------------------------------------------------------------
# Copyright (c) 2014-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | gpl-3.0 |
AlexanderFabisch/scikit-learn | sklearn/manifold/t_sne.py | 13 | 34618 | # Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de>
# Author: Christopher Moody <chrisemoody@gmail.com>
# Author: Nick Travers <nickt@squareup.com>
# License: BSD 3 clause (C) 2014
# This is the exact and Barnes-Hut t-SNE implementation. There are other
# modifications of the algorithm:
# * Fast Optimi... | bsd-3-clause |
arbrandes/edx-configuration | util/docker_images.py | 13 | 1144 | import yaml
import os
import pathlib2
import itertools
import sys
TRAVIS_BUILD_DIR = os.environ.get("TRAVIS_BUILD_DIR", "")
CONFIG_FILE_PATH = pathlib2.Path(TRAVIS_BUILD_DIR, "util", "parsefiles_config.yml")
def get_used_images(images):
"""
Returns the images and their ranks that are scheduled to be built and... | agpl-3.0 |
yatinkumbhare/openstack-nova | nova/api/openstack/compute/plugins/v3/extended_server_attributes.py | 36 | 3357 | # Copyright 2012 OpenStack Foundation
#
# 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 |
tsaitsai/jasper-client | client/modules/Birthday.py | 35 | 2013 | # -*- coding: utf-8-*-
import datetime
import re
import facebook
from client.app_utils import getTimezone
WORDS = ["BIRTHDAY"]
def handle(text, mic, profile):
"""
Responds to user-input, typically speech text, by listing the user's
Facebook friends with birthdays today.
Arguments:
... | mit |
fengbeihong/tempest_automate_ironic | tempest/services/volume/json/extensions_client.py | 12 | 1107 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
Tesi-Luca-Davide/ryu | ryu/services/protocols/bgp/operator/views/fields.py | 38 | 1875 | import importlib
import inspect
class Field(object):
def __init__(self, field_name):
self.field_name = field_name
def get(self, obj):
return getattr(obj, self.field_name)
class RelatedViewField(Field):
def __init__(self, field_name, operator_view_class):
super(RelatedViewField, ... | apache-2.0 |
zero-os/0-orchestrator | tests/0_orchestrator/test_suite/testcases/basic_tests/test04_storageclusters_apis.py | 2 | 7791 | from random import randint
from testcases.testcases_base import TestcasesBase
from nose.tools import with_setup
import time
class TestStorageclustersAPI(TestcasesBase):
def setUp(self):
super().setUp()
if self._testID != 'test003_deploy_new_storagecluster':
nodes = [self.nodeid]
... | apache-2.0 |
marqueedev/django | tests/middleware_exceptions/tests.py | 25 | 43526 | import sys
from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template import engines
from django.template.response import TemplateResponse
from django.test import RequestFactory, T... | bsd-3-clause |
heenbo/mosquitto-heenbo | test/broker/08-ssl-connect-no-identity.py | 7 | 1376 | #!/usr/bin/env python
# Client connects without a certificate to a server that has use_identity_as_username=true. Should be rejected.
import subprocess
import socket
import ssl
import sys
import time
if sys.version < '2.7':
print("WARNING: SSL not supported on Python 2.6")
exit(0)
import inspect, os, sys
# F... | gpl-3.0 |
cloudpbl-senrigan/combinator | tools/gyp/pylib/gyp/msvs_emulation.py | 3 | 46622 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
phenoxim/nova | nova/api/openstack/compute/quota_classes.py | 3 | 5453 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
jamesblunt/edx-platform | scripts/hotfix.py | 154 | 1898 | #!/usr/bin/env python
"""
Script to generate alton and git commands for executing hotfixes
Commands for:
- cutting amis
- creating hotfix tag
The script should be run with the hotfix's git hash as a command-line argument.
i.e. `python scripts/hotfix.py <hotfix hash>`
"""
from __future__ import print_function
from ... | agpl-3.0 |
shaftoe/home-assistant | tests/components/automation/test_template.py | 8 | 13520 | """The tests for the Template automation."""
import unittest
from homeassistant.core import callback
from homeassistant.setup import setup_component
import homeassistant.components.automation as automation
from tests.common import (
get_test_home_assistant, assert_setup_component, mock_component)
# pylint: disa... | apache-2.0 |
libre-informatique/SymfonyLibrinfoCRMBundle | src/Resources/doc/conf.py | 18 | 1918 | import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
import sphinx_rtd_theme
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig'
]
templates_path = ['_templates']
source_suffix = ... | lgpl-3.0 |
gudcjfdldu/volatility | volatility/plugins/overlays/windows/win7_sp0_x86_vtypes.py | 58 | 471672 | ntkrnlmp_types = {
'_u' : [ 0x50, {
'KeyNode' : [ 0x0, ['_CM_KEY_NODE']],
'KeyValue' : [ 0x0, ['_CM_KEY_VALUE']],
'KeySecurity' : [ 0x0, ['_CM_KEY_SECURITY']],
'KeyIndex' : [ 0x0, ['_CM_KEY_INDEX']],
'ValueData' : [ 0x0, ['_CM_BIG_DATA']],
'KeyList' : [ 0x0, ['array', 1, ['unsigned long']]],
... | gpl-2.0 |
brijeshkesariya/odoo | openerp/report/common.py | 457 | 3337 | # -*- 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... | agpl-3.0 |
albertliangcode/Pi_MonteCarloSim | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escsm.py | 2930 | 7839 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
s3ql/main | tests/t6_upgrade.py | 2 | 9214 | #!/usr/bin/env python3
'''
t6_upgrade.py - this file is part of S3QL.
Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This work can be distributed under the terms of the GNU GPLv3.
'''
if __name__ == '__main__':
import pytest
import sys
sys.exit(pytest.main([__file__] + sys.argv[1:]))
from common imp... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.