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 |
|---|---|---|---|---|---|
Arzaroth/python_rapidxml | tests/test_basic.py | 1 | 5638 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# File: simple.py
# by Arzaroth Lekva
# arzaroth@arzaroth.com
#
import os
import rapidxml
def test_unparse(init_rapidxml):
assert init_rapidxml.unparse() == ('<root><test attr1="one" attr2="two" attr3="three"/>'
'<test2><node i... | mit |
henrysher/duplicity | setup.py | 1 | 7472 | #!/usr/bin/env python2
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU... | gpl-2.0 |
wndias/bc.repository | script.module.youtube.dl/lib/youtube_dl/extractor/bigflix.py | 18 | 2676 | # coding: utf-8
from __future__ import unicode_literals
import base64
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class BigflixIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?bigflix\.com/.+/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://www.bigflix.... | gpl-2.0 |
OpenNetworkingFoundation/PIF-Open-Intermediate-Representation | pif_ir/bir/tests/test_common.py | 1 | 1166 | # single BIRStruct description
yaml_eth_struct_dict = {
'type' : 'struct',
'fields' : [
{'dst' : 48},
{'src' : 48},
{'type_' : 16}
]
}
yaml_udp_struct_dict = {
'type' : 'struct',
'fields' : [
{'sport' : 16},
{'dport' : 16},
{'len' : 16},
{'c... | apache-2.0 |
bratsche/Neutron-Drive | google_appengine/lib/django_1_3/django/db/models/query_utils.py | 240 | 5799 | """
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
import weakref
from django.utils.copycompat import deepcopy
from django.d... | bsd-3-clause |
modsy/incubator-airflow | airflow/www/blueprints.py | 5 | 1143 | # -*- coding: utf-8 -*-
#
# 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, software
... | apache-2.0 |
cloudbase/neutron-virtualbox | neutron/tests/post_mortem_debug.py | 72 | 4237 | # Copyright 2013 Red Hat, 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... | apache-2.0 |
specter119/custodian | custodian/feff/handlers.py | 1 | 4398 | # coding: utf-8
from __future__ import unicode_literals, division
from custodian.custodian import ErrorHandler
import re
from custodian.utils import backup
from pymatgen.io.feff.sets import FEFFDictSet
from custodian.feff.interpreter import FeffModder
import logging
""" This module implements specific error handler f... | mit |
ActiveState/code | recipes/Python/271607_fiber_scheduler/recipe-271607.py | 1 | 5269 | import sys, select, time, socket, traceback
class SEND:
def __init__( self, sock, timeout ):
self.fileno = sock.fileno()
self.expire = time.time() + timeout
def __str__( self ):
return 'SEND(%i,%s)' % ( self.fileno, time.strftime( '%H:%M:%S', time.localtime( self.expire ) ) )
class RECV:
def ... | mit |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_4/tests/regressiontests/servers/tests.py | 24 | 7504 | """
Tests for django.core.servers.
"""
import os
from urlparse import urljoin
import urllib2
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, LiveServerTestCase
from django.core.handlers.wsgi import WSGIHandler
from django.core.ser... | mit |
pombredanne/pyjs | examples/showcase/src/demos_panels/flexTable.py | 13 | 2925 | """
The ``ui.FlexTable`` class implements a table that can have different numbers
of cells in each row, and single cells can span multiple rows and columns.
Each FlexTable has a ``FlexCellFormatter`` which you can use to format the
cells in the table. The ``FlexCellFormatter`` has methods to set the row or
column spa... | apache-2.0 |
theflofly/tensorflow | tensorflow/compiler/xla/python_api/xla_shape.py | 36 | 5288 | # Copyright 2018 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 |
rodrigc/buildbot | master/buildbot/steps/shell.py | 3 | 22571 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
eunchong/build | third_party/cherrypy/lib/caching.py | 88 | 17413 | """
CherryPy implements a simple caching system as a pluggable Tool. This tool tries
to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but
it's probably good enough for most sites.
In general, GET responses are cached (along with selecting headers) and, if
another request arrives for the same r... | bsd-3-clause |
frederick-masterton/django | tests/max_lengths/tests.py | 27 | 1588 | from __future__ import unicode_literals
import unittest
from .models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
class MaxLengthArgumentsTests(unittest.TestCase):
def verify_max_length(self, model, field, length):
self.assertEqual(model._meta.get_field(field).max_length, length)
... | bsd-3-clause |
DeanThompson/pyelong | pyelong/request.py | 1 | 6017 | # -*- coding: utf-8 -*-
import hashlib
import json
import time
import urllib
import requests
from requests import RequestException, ConnectionError, Timeout
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from .api import ApiSpec
from .exceptions import ElongException, ElongAPIError, \
Ret... | mit |
catroot/rethinkdb | test/common/http_support/werkzeug/wsgi.py | 146 | 37745 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import sys
import posixpath
import mimetypes
from itert... | agpl-3.0 |
tuxinhang1989/mezzanine | mezzanine/utils/html.py | 9 | 3678 | from __future__ import absolute_import, unicode_literals
from future.builtins import chr, int, str
try:
from html.parser import HTMLParser, HTMLParseError
from html.entities import name2codepoint
except ImportError: # Python 2
from HTMLParser import HTMLParser, HTMLParseError
from htmlentitydefs impor... | bsd-2-clause |
daviwesley/Empire | lib/modules/situational_awareness/host/computerdetails.py | 19 | 4385 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-ComputerDetails',
'Author': ['@JosephBialek'],
'Description': ('Enumerates useful information on the system. By default, all checks are run.'),
... | bsd-3-clause |
mrkulk/text-world | evennia/server/portal/irc.py | 2 | 6997 | """
This connects to an IRC network/channel and launches an 'bot' onto it.
The bot then pipes what is being said between the IRC channel and one or
more Evennia channels.
"""
import re
from twisted.application import internet
from twisted.words.protocols import irc
from twisted.internet import protocol
from evennia.se... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/storage/netapp/na_ontap_license.py | 41 | 10704 | #!/usr/bin/python
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
lordmos/blink | Source/bindings/scripts/unstable/idl_compiler.py | 1 | 5668 | #!/usr/bin/python
# Copyright (C) 2013 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 c... | mit |
wyq200704/ardupilot | Tools/LogAnalyzer/LogAnalyzer.py | 55 | 12485 | #!/usr/bin/env python
#
# A module to analyze and identify any common problems which can be determined from log files
#
# Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014
#
# some logging oddities noticed while doing this, to be followed up on:
# - tradheli MOT labels Mot1,Mot2,Mot3,Mot4,GGain
# ... | gpl-3.0 |
zhlinh/leetcode | 0173.Binary Search Tree Iterator/test.py | 1 | 1230 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import TreeNode
from solution import BSTIterator
def constructOne(s):
s = s.strip()
if s == '#':
return None
else:
return TreeNode(int(s))
def createTree(tree):
q = []
tree = tree.split(",")
root = constructOne(tree[0... | apache-2.0 |
wavelets/silk | django_silky/silk/tests/test_code_gen_curl.py | 4 | 4039 | """
Test curl command generation by executing the generated command
against a HTTP server that echos various components in the request.
"""
import json
import unittest
import subprocess
from silk.tests.util import PORT, construct_echo_process
# noinspection PyUnresolvedReferences
from silk.code_generation.curl imp... | mit |
ClearCorp/odoo-clearcorp | report_xls_template_example/__openerp__.py | 3 | 1648 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
spl0k/supysonic | tests/base/test_cache.py | 1 | 8007 | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2018 Alban 'spl0k' Féron
# 2018-2019 Carey 'pR0Ps' Metcalfe
#
# Distributed under terms of the GNU AGPLv3 license.
import os
import unittest
import shutil
import time
import tempfile
fr... | agpl-3.0 |
lxml/lxml | src/lxml/tests/test_xslt.py | 1 | 69992 | # -*- coding: utf-8 -*-
"""
Test cases related to XSLT processing
"""
from __future__ import absolute_import
import io
import sys
import copy
import gzip
import os.path
import unittest
import contextlib
from textwrap import dedent
from tempfile import NamedTemporaryFile, mkdtemp
is_python3 = sys.version_info[0] >= ... | bsd-3-clause |
cpn18/track-chart | desktop/gps_smoothing.py | 1 | 1313 | import sys
import json
import math
THRESHOLD = 10
data = []
with open(sys.argv[1], "r") as f:
used = count = 0
for line in f:
if line[0] == "#":
continue
items = line.split()
if items[1] == "TPV":
obj = json.loads(" ".join(items[2:-1]))
obj['used'] =... | gpl-3.0 |
rjschwei/azure-sdk-for-python | unreleased/azure-mgmt-machinelearning/azure/mgmt/machinelearning/models/__init__.py | 5 | 2737 | # 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 |
ABaldwinHunter/django-clone-classic | tests/template_tests/test_context.py | 128 | 6990 | # -*- coding: utf-8 -*-
from django.http import HttpRequest
from django.template import (
Context, Engine, RequestContext, Template, Variable, VariableDoesNotExist,
)
from django.template.context import RenderContext
from django.test import RequestFactory, SimpleTestCase
class ContextTests(SimpleTestCase):
... | bsd-3-clause |
nopjmp/SickRage | lib/rebulk/processors.py | 20 | 3372 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
from logging import getLogger
from .utils import IdentitySet
from .rules import Rule, RemoveMatch
log = getLogger(__name__).log
DEFAULT = '__default__'
POST_PROCESS = -2048
PRE_PROCESS = 2048
def _default_conflict_solver(match, conflicting... | gpl-3.0 |
kgori/treeCl | treeCl/parutils.py | 1 | 9550 | from abc import ABCMeta, abstractmethod
from .constants import PARALLEL_PROFILE
from .utils import setup_progressbar, grouper, flatten_list
import logging
import multiprocessing
import sys
logger = logging.getLogger(__name__)
__author__ = 'kgori'
"""
Introduced this workaround for a bug in multiprocessing where
error... | mit |
anbangr/trusted-juju | juju/unit/tests/test_charm.py | 1 | 5922 | from functools import partial
import os
import shutil
from twisted.internet.defer import inlineCallbacks, returnValue, succeed, fail
from twisted.web.error import Error
from twisted.web.client import downloadPage
from juju.charm import get_charm_from_path
from juju.charm.bundle import CharmBundle
from juju.charm.publ... | agpl-3.0 |
zengenti/ansible | lib/ansible/modules/network/nxos/nxos_overlay_global.py | 6 | 8874 | #!/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 |
jakobworldpeace/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 55 | 9939 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
pbrazdil/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/reflection.py | 260 | 5864 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
larsmans/scikit-learn | sklearn/cluster/setup.py | 31 | 1248 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = ... | bsd-3-clause |
bcantoni/ccm | ccmlib/dse_node.py | 1 | 22234 | # ccm node
from __future__ import absolute_import, with_statement
import os
import re
import shutil
import signal
import stat
import subprocess
import time
import yaml
from six import iteritems, print_
from ccmlib import common, extension, repository
from ccmlib.node import (Node, NodeError, ToolError,
... | apache-2.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons_contrib/mesh_extra_tools/pkhg_faces.py | 1 | 32230 | bl_info = {
"name": "PKHG faces",
"author": " PKHG ",
"version": (0, 0, 5),
"blender": (2, 7, 1),
"location": "View3D > Tools > PKHG (tab)",
"description": "Faces selected will become added faces of different style",
"warning": "not yet finished",
"wiki_url": "",
"category": "Mesh",
... | gpl-3.0 |
hackersql/sq1map | plugins/dbms/mssqlserver/__init__.py | 3 | 1081 | #!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import DBMS
from lib.core.settings import MSSQL_SYSTEM_DBS
from lib.core.unescaper import unescaper
from plugins.dbms.mssqlserver.enumeration import Enumer... | gpl-3.0 |
enriclluelles/ansible-modules-extras | network/openvswitch_bridge.py | 8 | 3925 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
#
# This file is part of Ansible
#
# This module 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 |
ArcherSys/ArcherSys | Lib/test/test_socket.py | 1 | 585437 | <<<<<<< HEAD
<<<<<<< HEAD
import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import... | mit |
choderalab/openmoltools | examples/test_example.py | 7 | 1421 | import simtk.unit as u
from simtk.openmm import app
import simtk.openmm as mm
from openmoltools import gafftools, system_checker
ligand_name = "sustiva"
ligand_path = "./chemicals/%s/" % ligand_name
temperature = 300 * u.kelvin
friction = 0.3 / u.picosecond
timestep = 0.1 * u.femtosecond
prmtop = app.AmberPrmtopFile... | mit |
laissezfarrell/rl-bitcurator-scripts | python/accession-reporter.py | 1 | 3754 | #!/usr/bin/env python3
#Script (in progress) to report high-level folder information for offices transferring records to the University Archives.
#Dependencies: argparse, pathlib, python3.6 or above, csv, datetime
#Assumptions:
# 1.
import argparse, csv, datetime
from pathlib import Path, PurePath
from datetime imp... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_subnets_operations.py | 1 | 21762 | # 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 |
alirizakeles/zato | code/zato-server/src/zato/server/service/internal/security/openstack.py | 1 | 6547 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from contextlib import closing
from traceback import format_exc
from uui... | gpl-3.0 |
Juniper/contrail-dev-neutron | neutron/services/vpn/service_drivers/ipsec.py | 8 | 5879 | # vim: tabstop=10 shiftwidth=4 softtabstop=4
#
# Copyright 2013, Nachi Ueno, NTT I3, 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://ww... | apache-2.0 |
10239847509238470925387z/tmp123 | app.py | 1 | 2195 | #!/usr/bin/env python
import urllib
import json
import os
import constants
import accounts
from flask import Flask
from flask import request
from flask import make_response
# Flask app should start in global layout
app = Flask(__name__)
PERSON = constants.TEST_1
@app.route('/webhook', methods=['POST'])
def webhook... | apache-2.0 |
rezvorck/android_kernel_s450m_4g_mm | tools/perf/scripts/python/sched-migration.py | 1910 | 11965 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
cbrewster/servo | tests/wpt/web-platform-tests/tools/third_party/py/testing/process/test_forkedfunc.py | 55 | 4612 | import pytest
import py, sys, os
pytestmark = py.test.mark.skipif("not hasattr(os, 'fork')")
def test_waitfinish_removes_tempdir():
ff = py.process.ForkedFunc(boxf1)
assert ff.tempdir.check()
ff.waitfinish()
assert not ff.tempdir.check()
def test_tempdir_gets_gc_collected(monkeypatch):
monkeypat... | mpl-2.0 |
ckuethe/gnuradio | gr-atsc/python/atsc/qa_atsc.py | 55 | 7019 | #!/usr/bin/env python
#
# Copyright 2004,2006,2007,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... | gpl-3.0 |
the3dsean/cryboards | maintenance/language/zhtable/Makefile.py | 37 | 14682 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author Philip
import tarfile as tf
import zipfile as zf
import os, re, shutil, sys, platform
pyversion = platform.python_version()
islinux = platform.system().lower() == 'linux'
if pyversion[:3] in ['2.6', '2.7']:
import urllib as urllib_request
import codecs
... | gpl-2.0 |
Lind-Project/native_client | src/trusted/validator_arm/validation-report.py | 1 | 3575 | #!/usr/bin/python2
#
# Copyright (c) 2012 The Native Client 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 sys
import textwrap
from subprocess import Popen, PIPE
_OBJDUMP = 'arm-linux-gnueabi-objdump'
def _objdump(binary, ... | bsd-3-clause |
core-code/LibVT | Dependencies/Core3D/Preprocessing/generateOctreeFromObj.py | 1 | 10849 | #!/usr/bin/env python
#
# generateOctreeFromObj.py
# Core3D
#
# Created by Julian Mayer on 16.11.07.
# Copyright (c) 2010 A. Julian Mayer
#
# 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 wit... | mit |
nlhepler/pysam | save/pysam_bench.py | 9 | 1328 | '''benchmark pysam BAM/SAM access with the samtools commandline tools.
samtools functions are called via the pysam interface to avoid the over-head
of starting additional processes.
'''
import pysam
import timeit
iterations = 10
def runBenchmark( test,
pysam_way,
samtools_way =... | mit |
BhallaLab/moose-core | tests/core/test_function_example.py | 2 | 3483 | # Modified from function.py ---
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import moose
simtime = 1.0
def test_example():
moose.Neutral('/model')
function = moose.Function('/model/function')
function.c['c0'] = 1.0
function.c['c1'] = 2.0
#function.x... | gpl-3.0 |
AbhiAgarwal/blaze | blaze/compute/air/environment.py | 4 | 1108 | # -*- coding: utf-8 -*-
"""
AIR compilation environment.
"""
from __future__ import print_function, division, absolute_import
# Any state that should persist between passes end up in the environment, and
# should be documented here
air_env = {
# blaze expression graph
#'expr_graph': None,
# globa... | bsd-3-clause |
Effective-Quadratures/Effective-Quadratures | equadratures/scalers.py | 1 | 7167 | """
Classes to scale data.
Some of these classes are called internally by other modules, but they can also be used independently as a pre-processing stage.
Scalers can fit to one set of data, and used to transform other data sets with the same number of dimensions.
Examples
--------
Fitting scaler implicitly during... | lgpl-2.1 |
goodwinnk/intellij-community | python/helpers/py3only/docutils/parsers/rst/languages/zh_tw.py | 52 | 5165 | # -*- coding: utf-8 -*-
# $Id: zh_tw.py 7119 2011-09-02 13:00:23Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two f... | apache-2.0 |
igor-toga/local-snat | neutron/cmd/eventlet/server/__init__.py | 9 | 1058 | # 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, software
# d... | apache-2.0 |
maheshraju-Huawei/actn | tools/build/uploadToS3.py | 20 | 2690 | #!/usr/bin/env python
"""
Upload a file to S3
"""
from sys import argv, stdout
from time import time
from os.path import basename
from optparse import OptionParser
from boto.s3.key import Key
from boto.s3.connection import S3Connection
def uploadFile( filename, dest=None, bucket=None, overwrite=False ):
"Upload... | apache-2.0 |
cloudconductor/cloud_conductor_gui | gui_app/views/applicationDeployViews.py | 1 | 8093 | # -*- coding: utf-8 -*-
from django.shortcuts import render, redirect, render_to_response
import ast
from ..forms import selecttForm
from ..forms import applicationForm
from ..utils import ApplicationUtil
from ..utils import ApplicationHistoryUtil
from ..utils import EnvironmentUtil
from ..utils import StringUtil
from ... | apache-2.0 |
igorborojevic/incubator-zeppelin | dev/test_zeppelin_pr.py | 20 | 3840 | #!/usr/bin/python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License... | apache-2.0 |
robhudson/django | django/contrib/postgres/fields/ranges.py | 124 | 5609 | import json
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range
from django.contrib.postgres import forms, lookups
from django.db import models
from django.utils import six
from .utils import AttributeSetter
__all__ = [
'RangeField', 'IntegerRangeField', 'BigIntegerRangeField',
'Floa... | bsd-3-clause |
hackerkid/zulip | zerver/openapi/python_examples.py | 1 | 46543 | # Zulip's OpenAPI-based API documentation system is documented at
# https://zulip.readthedocs.io/en/latest/documentation/api.html
#
# This file defines the Python code examples that appears in Zulip's
# REST API documentation, and also contains a system for running the
# example code as part of the `tools/test-api` t... | apache-2.0 |
weimingtom/japanese-novel-analyser | src/freqbrowser.py | 2 | 1753 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This is the Frequency Browser.
It uses the database created by the Japanese Novel Analyser and
allows displaying the frequencies by selecting certain parts of speech
or conjugations. For these it has grouping and filter options.
Usage: freqbrowser.py [OPTION]...
Disp... | gpl-3.0 |
CloudI/CloudI | src/service_api/python/jsonrpclib/tests/test_server.py | 1 | 1597 | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Tests the pooled server
:license: Apache License 2.0
"""
# JSON-RPC library
from jsonrpclib import ServerProxy
from jsonrpclib.SimpleJSONRPCServer import PooledJSONRPCServer
from jsonrpclib.threadpool import ThreadPool
# Standard library
import random
import thre... | mit |
zedr/django | django/templatetags/static.py | 227 | 4084 | from django import template
from django.template.base import Node
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __in... | bsd-3-clause |
AversivePlusPlus/AversivePlusPlus | tools/conan/conans/client/importer.py | 2 | 3684 | import os
import fnmatch
from conans.model.ref import PackageReference
from conans.client.file_copier import FileCopier
class FileImporter(object):
""" manages the copy of files, resources, libs from the local store to the user
space. E.g.: shared libs, dlls, they will be in the package folder of your
con... | bsd-3-clause |
pgleeson/TestArea | pythonnC/Ex4_SaveNetworkML.py | 5 | 2358 | #
#
# A file which opens a neuroConstruct project, adds some cells and network connections
# and then saves a NetworkML file with the net structure
#
# Author: Padraig Gleeson
#
# This file has been developed as part of the neuroConstruct project
# This work has been funded by the Medical Research Cou... | gpl-2.0 |
dan-cristian/haiot | gpio/io_common/__init__.py | 1 | 3453 | from common import Constant
from storage.model import m
from main.logger_helper import L
import abc
from common import utils
# update in db (without propagatting the change by default)
def update_custom_relay(pin_code, pin_value, notify=False, ignore_missing=False):
relay = m.ZoneCustomRelay.find_one({m.ZoneCust... | gpl-2.0 |
nanolearningllc/edx-platform-cypress | common/djangoapps/student/tests/test_create_account.py | 39 | 20158 | """Tests for account creation"""
import json
import ddt
import unittest
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import AnonymousUser
from django.utils.importli... | agpl-3.0 |
worsht/antlr4 | runtime/Python2/src/antlr4/Parser.py | 8 | 22742 | # [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redistr... | bsd-3-clause |
pimoroni/unicorn-hat-hd | examples/show-png.py | 1 | 1382 | #!/usr/bin/env python
import time
from sys import exit
try:
from PIL import Image
except ImportError:
exit('This script requires the pillow module\nInstall with: sudo pip install pillow')
import unicornhathd
print("""Unicorn HAT HD: Show a PNG image!
This basic example shows use of the Python Pillow libra... | mit |
arifsetiawan/edx-platform | common/test/acceptance/pages/studio/settings_advanced.py | 42 | 6648 | """
Course Advanced Settings page
"""
from bok_choy.promise import EmptyPromise
from .course_page import CoursePage
from .utils import press_the_notification_button, type_in_codemirror, get_codemirror_value
KEY_CSS = '.key h3.title'
UNDO_BUTTON_SELECTOR = ".action-item .action-undo"
MANUAL_BUTTON_SELECTOR = ".action... | agpl-3.0 |
stuartlangridge/raspi-recorder | listener_daemon.py | 1 | 2508 | import threading, time, subprocess
from bluetooth import *
server_sock=BluetoothSocket( RFCOMM )
server_sock.bind(("",PORT_ANY))
server_sock.listen(1)
port = server_sock.getsockname()[1]
uuid = "c3091f5f-7e2f-4908-b628-18231dfb5034"
advertise_service( server_sock, "PiRecorder",
service_id = uuid,
... | mit |
dongjoon-hyun/docker | vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py | 1232 | 3478 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... | apache-2.0 |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.7.52-1/roles/lib_openshift/src/lib/base.py | 6 | 21246 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-lines
# noqa: E301,E302,E303,T001
class OpenShiftCLIError(Exception):
'''Exception class for openshiftcli'''
pass
ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')]
def locate_oc_binary():
''' Find and return oc binar... | apache-2.0 |
kingmotley/SickRage | lib/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... | gpl-3.0 |
mjirayu/sit_academy | common/lib/xmodule/xmodule/conditional_module.py | 97 | 10074 | """Conditional module is the xmodule, which you can use for disabling
some xmodules by conditions.
"""
import json
import logging
from lazy import lazy
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule, STUDENT_VIEW
from xmodule.seq_module import SequenceDescriptor
... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/communication/azure-communication-sms/azure/communication/sms/_models/_models.py | 1 | 2064 | # 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 |
groschovskiy/lerigos_music | Server/API/lib/gcloud/resource_manager/connection.py | 8 | 1637 | # Copyright 2015 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... | apache-2.0 |
rawwell/django | django/dispatch/dispatcher.py | 38 | 17163 | """Multiple-producer-multiple-consumer signal-dispatching
dispatcher is the core of the PyDispatcher system,
providing the primary API and the core logic for the
system.
Module attributes of note:
Any -- Singleton used to signal either "Any Sender" or
"Any Signal". See documentation of the _Any class.
... | bsd-3-clause |
foodszhang/kbengine | kbe/src/lib/python/Tools/pynche/TextViewer.py | 116 | 6869 | """TextViewer class.
The TextViewer allows you to see how the selected color would affect various
characteristics of a Tk text widget. This is an output viewer only.
In the top part of the window is a standard text widget with some sample text
in it. You are free to edit this text in any way you want (BAW: allow yo... | lgpl-3.0 |
Deepakpatle/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/http_lock_unittest.py | 124 | 5481 | # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# 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 co... | bsd-3-clause |
ruilin/RLMap | data/benchmarks/tk_results_viewer.py | 53 | 9617 | from Tkinter import *
import tkMessageBox
import math
import sys
import copy
import os
import shutil
import time
def less_start_time(t1, t2):
fmt = '%a_%b_%d_%H:%M:%S_%Y'
return time.strptime(t1[0].replace('__','_'), fmt) < time.strptime(t2[0].replace('__','_'), fmt)
class BenchmarkResultsFrame(Frame):
de... | apache-2.0 |
JoelEager/pyTanks.Server | start.py | 1 | 2083 | """
Startup script for the pyTanks server
Requirements:
Python 3.5 or newer
websockets 7.0 (pip install websockets==7.0)
Usage:
python start.py
The pyTanks server uses the settings found in config.py to control how the server works. Those values can be
changed directly or be overridden by appendi... | mit |
bgris/ODL_bgris | lib/python3.5/site-packages/docutils/utils/math/tex2mathml_extern.py | 4 | 5635 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# :Id: $Id: tex2mathml_extern.py 7861 2015-04-10 23:48:51Z milde $
# :Copyright: © 2015 Günter Milde.
# :License: Released under the terms of the `2-Clause BSD license`_, in short:
#
# Copying and distribution of this file, with or without modification,
# are permitt... | gpl-3.0 |
nullzero/wprobot | scripts/userfixes.py | 1 | 4673 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Fix misspelled words
"""
import init
import wp
import pywikibot
from wp import lre
def glob():
global subst
subst = lre.Subst()
subst.append(u"กฏหมาย", u"กฎหมาย")
subst.append(u"กรกฏาคม", u"กรกฎาคม")
subst.append(u"กษัตรย์", u"กษัตริย์")
subst.appe... | mit |
alriddoch/cyphesis | rulesets/mason/world/tasks/Heaping.py | 3 | 5118 | #This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2006 Al Riddoch (See the file COPYING for details).
from atlas import *
from physics import *
import math
import sys
import weakref
import server
class Heaping(server.Task):
""" A task for laying down built up terrain wi... | gpl-2.0 |
zstyblik/infernal-twin | build/pillow/Tests/test_image_crop.py | 12 | 1793 | from helper import unittest, PillowTestCase, hopper
from PIL import Image
class TestImageCrop(PillowTestCase):
def test_crop(self):
def crop(mode):
out = hopper(mode).crop((50, 50, 100, 100))
self.assertEqual(out.mode, mode)
self.assertEqual(out.size, (50, 50))
... | gpl-3.0 |
zstackio/zstack-woodpecker | integrationtest/vm/mn_ha/test_all_mn_hosts_force_stop_recover_create_vm.py | 2 | 4023 | '''
Integration Test for creating KVM VM in MN HA mode with all mn hosts force stop and recovery.
@author: Mirabel
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.node_operati... | apache-2.0 |
inscriptionweb/sslstrip | sslstrip/ServerConnectionFactory.py | 73 | 1648 | # Copyright (c) 2004-2009 Moxie Marlinspike
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distri... | gpl-3.0 |
fedya/ajenti | plugins/squid/main.py | 17 | 1237 | from ajenti.ui import *
from ajenti.com import implements
from ajenti.api import *
from ajenti import apis
from backend import *
class SquidPlugin(apis.services.ServiceControlPlugin):
text = 'Squid'
icon = '/dl/squid/icon.png'
folder = 'servers'
service_name = 'squid'
def get_config(self):
... | lgpl-3.0 |
LinusU/ansible-modules-extras | windows/win_nssm.py | 80 | 5380 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Heyo
#
# 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) a... | gpl-3.0 |
kmonsoor/python-for-android | python3-alpha/python3-src/Lib/idlelib/AutoComplete.py | 67 | 9061 | """AutoComplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names of file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import sys
import string
from idlelib.configHandler import idleConf
# This string inclu... | apache-2.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/Python-Markdown/markdown/extensions/attr_list.py | 72 | 6259 | """
Attribute List Extension for Python-Markdown
============================================
Adds attribute list syntax. Inspired by
[maruku](http://maruku.rubyforge.org/proposal.html#attribute_lists)'s
feature of the same name.
See <https://pythonhosted.org/Markdown/extensions/attr_list.html>
for documentation.
Or... | gpl-3.0 |
Orav/kbengine | kbe/tools/server/webconsole/six.py | 18 | 30966 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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, includin... | lgpl-3.0 |
twoolie/ProjectNarwhal | narwhal/core/profile/admin.py | 1 | 1124 | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from sorl.thumbnail.admin import AdminImageMixin
from treebeard.admin import TreeAdmin
from models import Profile
class ProfileAdmin(AdminImageMixin, admin.ModelAdmin):
search_fields = ('user__userna... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.