repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
tsdmgz/ansible | test/runner/lib/changes.py | 66 | 5904 | """Detect changes in Ansible code."""
from __future__ import absolute_import, print_function
import re
import os
from lib.util import (
ApplicationError,
SubprocessError,
MissingEnvironmentVariable,
CommonConfig,
display,
)
from lib.http import (
HttpClient,
urlencode,
)
from lib.git im... | gpl-3.0 |
richrd/bx | irc.py | 1 | 29634 | # -*- coding: utf-8 -*-
"""irc.py: IRC Client Implementation
Handles all neccessary parts of the IRC protocol for client connections.
"""
import os
import sys
import time
import string
import select
import socket
# Symbian S60 specific compatibility
s60 = False
if sys.platform == "symbian_s60":
s60 = True
s... | apache-2.0 |
evonove/mkm-sdk | tests/tests_unit/test_exception.py | 1 | 1951 | from collections import namedtuple
from mkmsdk.exceptions import ConnectionError, MissingParam, MissingEnvVar, SerializationException
def test_connection_error_with_no_args():
"""
Test error string is formatted correctly
when exception is initialized without arguments
"""
error = ConnectionError(... | mit |
nirvn/QGIS | python/plugins/processing/script/AddScriptFromFileAction.py | 6 | 3506 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EditScriptAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... | gpl-2.0 |
wakatime/sublime-wakatime | packages/wakatime/packages/urllib3/util/request.py | 205 | 3705 | from __future__ import absolute_import
from base64 import b64encode
from ..packages.six import b, integer_types
from ..exceptions import UnrewindableBodyError
ACCEPT_ENCODING = 'gzip,deflate'
_FAILEDTELL = object()
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=... | bsd-3-clause |
darnould/integrations-core | varnish/test_varnish.py | 1 | 5266 | # stdlib
import os
import re
import subprocess
# 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest
# This is a small extract of metrics from varnish. This is meant to test that
# the check gather metrics. This the check return everything from varnish
# without any sele... | bsd-3-clause |
texastribune/scuole | scuole/regions/migrations/0004_auto_20151211_2336.py | 1 | 5133 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-11 23:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('regions', '0003_auto_20151211_1922'),
]
operations = [
migrations.RenameField(... | mit |
ryepdx/kit_sale | product.py | 1 | 1279 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
class product(osv.osv):
_inherit = "product.product"
def get_product_available(self, cr, uid, ids, context=None):
""" Finds ... | agpl-3.0 |
ice9js/servo | tests/wpt/web-platform-tests/mixed-content/generic/expect.py | 95 | 4179 | import json, os, urllib, urlparse
def redirect(url, response):
response.add_required_headers = False
response.writer.write_status(301)
response.writer.write_header("access-control-allow-origin", "*")
response.writer.write_header("location", url)
response.writer.end_headers()
response.writer.wri... | mpl-2.0 |
RossBrunton/django | tests/model_fields/test_uuid.py | 81 | 6096 | import json
import uuid
from django.core import exceptions, serializers
from django.db import models
from django.test import SimpleTestCase, TestCase
from .models import (
NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,
UUIDModel,
)
class TestSaveLoad(TestCase):
def test_uuid... | bsd-3-clause |
haad/ansible | lib/ansible/modules/source_control/gitlab_group.py | 47 | 7493 | #!/usr/bin/python
# (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
# 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',
... | gpl-3.0 |
kjw0106/boto | boto/pyami/bootstrap.py | 150 | 5748 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
voidbridge/electron | script/dump-symbols.py | 22 | 1970 | #!/usr/bin/env python
import os
import sys
from lib.config import PLATFORM
from lib.util import electron_gyp, execute, rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
CHROMIUM_DIR = os.path.j... | mit |
jmuhlich/django-conferenceabstract | setup.py | 1 | 1148 | # Based on Django "How to write reusable apps" tutorial.
import os
import setuptools
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setuptools.setup(
name='django-... | mit |
GameTheory-/android_kernel_lge_l1m | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
froch/kubernetes-py | tests/test_k8s_pet_set.py | 3 | 1866 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
import unittest
from tests import _utils
from tests.BaseTest import BaseTest
from kubernetes_py.K8sPetSet import K8sPetSet
def should_skip(... | apache-2.0 |
ConeyLiu/spark | examples/src/main/python/ml/standard_scaler_example.py | 128 | 1594 | #
# 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 |
yetsky/extra | packages/my-application/python-all/files/usr/lib/python2.7/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-2.0 |
mawentao007/reading_grab | example/spider.py | 1 | 1127 | # coding:utf-8
# crawl github project list
from grab import Grab
import logging
logging.basicConfig(level=logging.DEBUG)
g = Grab()
g.go('https://github.com/login')
print g.doc.form
g.doc.set_input('login', '1812@qq.com')
g.doc.set_input('password', '')
g.doc.submit()
g.doc.save('/tmp/x.html')
home_url = g.doc('//a... | mit |
StephenWeber/ansible | lib/ansible/modules/network/nxos/nxos_igmp.py | 6 | 7707 | #!/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 |
GageGaskins/osf.io | tests/factories.py | 1 | 20787 | # -*- coding: utf-8 -*-
"""Factories for the OSF models, including an abstract ModularOdmFactory.
Example usage: ::
>>> from tests.factories import UserFactory
>>> user1 = UserFactory()
>>> user1.username
fred0@example.com
>>> user2 = UserFactory()
fred1@example.com
Factory boy docs: http://f... | apache-2.0 |
ferhatelmas/sexmachine | sexmachine/detector.py | 1 | 4446 | import os.path
import codecs
from .mapping import map_name
class NoCountryError(Exception):
"""Raised when non-supported country is queried"""
pass
class Detector:
"""Get gender by first name"""
COUNTRIES = u"""great_britain ireland usa italy malta portugal spain france
belgium l... | gpl-3.0 |
zhangjunlei26/servo | tests/wpt/harness/test/test.py | 5 | 5079 | import ConfigParser
import argparse
import json
import os
import sys
import tempfile
import threading
import time
from StringIO import StringIO
from mozlog.structured import structuredlog, reader
from mozlog.structured.handlers import BaseHandler, StreamHandler, StatusHandler
from mozlog.structured.formatters import M... | mpl-2.0 |
mbakker7/ttim | tests/test_theis.py | 1 | 3437 | import numpy as np
from scipy.special import exp1
from ttim import *
def theis(r, t, T, S, Q):
u = r ** 2 * S / (4 * T * t)
h = -Q / (4 * np.pi * T) * exp1(u)
return h
def theisQr(r, t, T, S, Q):
u = r ** 2 * S / (4 * T * t)
Qr = -Q / (2 * np.pi) * np.exp(-u) / r
return Qr
T = 500
S = 1e-3... | mit |
Stevie-Bs/Stevie-Bs-Kodi | plugin.video.streamoase_ll/mechanize/_opener.py | 133 | 14763 | """URL opener.
Copyright 2004-2006 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import os, urllib2, bisect, httplib, types, tempfile
try:
import thread... | gpl-2.0 |
Jonekee/chromium.src | tools/cr/cr/actions/installer.py | 113 | 1642 | # 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.
"""A module for the Installer base class."""
import cr
class Installer(cr.Action, cr.Plugin.Type):
"""Base class for implementing installers.
Install... | bsd-3-clause |
maelnor/nova | nova/virt/vmwareapi/error_util.py | 3 | 1401 | # Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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... | apache-2.0 |
ymero/pulsar | pulsar/apps/wsgi/routers.py | 5 | 22135 | '''
Routing is the process of matching and parsing a URL to something we can use.
Pulsar provides a flexible integrated
routing system you can use for that. It works by creating a
:class:`Router` instance with its own ``rule`` and, optionally, additional
sub-routers for handling additional urls::
class Page(Router... | bsd-3-clause |
creative-quant/voltdb | tools/git-remove-branches-script.py | 10 | 6165 | #!/usr/bin/python
# Print out scripts for removing either
# - branches already merged to trunk
# - branches not merged, but with no current checkins
# This script DOES NOT do the removals - you need to run the
# console output.
#TODO: Make it handle incorrect password the 1st time, then abort
#from datetime import... | agpl-3.0 |
evro/CouchPotatoServer | libs/guessit/transfo/guess_date.py | 150 | 1217 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
tmenjo/cinder-2015.1.1 | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | 4 | 3060 | # Copyright (c) - 2014, Clinton Knight. 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 req... | apache-2.0 |
jbteixeir/Openflow-DC-Framework | pox/host_tracker/host_tracker.py | 1 | 12071 | # Copyright 2011 Dorgival Guedes
#
# This file is part of POX.
# Some of the arp/openflow-related code was borrowed from dumb_l3_switch.
#
# POX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | gpl-3.0 |
cfe-lab/MiCall | micall/utils/primer_tracker.py | 1 | 2264 | import typing
from pathlib import Path
from Bio import SeqIO
from micall.utils.alignment_wrapper import align_nucs
class PrimerTracker:
def __init__(self, conseq: str, seed_name: str):
self.conseq = conseq
self.seed_name = seed_name
self.ignored_positions: typing.Optional[typing.Set[int]... | agpl-3.0 |
jpirates1/Django-python-pro | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7.2/Lib/test/test_difflib.py | 86 | 10297 | import difflib
from test.test_support import run_unittest, findfile
import unittest
import doctest
import sys
class TestWithAscii(unittest.TestCase):
def test_one_insert(self):
sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
... | mit |
sergiohgz/incubator-airflow | tests/contrib/operators/test_discord_webhook_operator.py | 15 | 2403 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
Tesla-Redux-Devices/android_kernel_mediatek_sprout | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
rollenrolm/godot | doc/tools/doc_merge.py | 22 | 5046 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import xml.etree.ElementTree as ET
tree = ET.parse(sys.argv[1])
old_doc=tree.getroot()
tree = ET.parse(sys.argv[2])
new_doc=tree.getroot()
f = file(sys.argv[3],"wb")
tab=0
old_classes={}
def write_string(_f, text,newline=True):
for t in range(tab):
_f.write... | mit |
bobellis/ghost_blog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_openedgebuiltins.py | 370 | 40661 | # -*- coding: utf-8 -*-
"""
pygments.lexers._openedgebuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the OpenEdgeLexer.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
OPENEDGEKEYWORDS = [
'ABSOLUTE', 'ABS', 'ABSO', 'A... | mit |
AndreasWilliams/BotGravindo | src/scons-local-2.0.1/SCons/Variables/__init__.py | 61 | 11095 | """engine.SCons.Variables
This file defines the Variables class that is used to add user-friendly
customizable variables to an SCons build.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# ... | gpl-2.0 |
amenonsen/ansible | test/units/modules/network/f5/test_bigip_monitor_external.py | 22 | 3318 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
jplusui/jplusui.github.com | apps/node/node_modules/npm/node_modules/node-gyp/gyp/test/subdirectory/gyptest-SYMROOT-all.py | 399 | 1269 | #!/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... | bsd-3-clause |
CiviWiki/OpenCiviWiki | project/api/migrations/0005_auto_20170109_1813.py | 1 | 1092 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0004_auto_20161230_0412"),
]
operations = [
migrations.AddField(
model_name="civi",
name="rel... | agpl-3.0 |
jonghough/SimpleWebsocket | socket/websocket.py | 1 | 11128 | # -- coding: utf-8 --
import socket
import os
import base64
import hashlib
import struct
from array import array
from backports.ssl_match_hostname import match_hostname, CertificateError
'''
Simple python implementation of the Websocket protocol (RFC6455) for
websocket clients.
The goal is to keep the source as compa... | bsd-2-clause |
googleinterns/connectivity-test | src/derivation_declarations/generators/BGP_generators.py | 1 | 2030 | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
bunnyitvn/webptn | build/lib.linux-i686-2.7/django/contrib/gis/geos/point.py | 224 | 4351 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
from django.utils import six
from django.utils.six.moves import xrange
class Point(GEOSGeometry):
_minlength = 2
_ma... | bsd-3-clause |
Jimaklas/grd2poly | grd2poly.py | 1 | 1764 | import win32com.client
from input import GRD_FILE
# # Generate modules of necessary typelibs (AutoCAD Civil 3D 2008)
# comtypes.client.GetModule("C:\\Program Files\\Common Files\\Autodesk Shared\\acax17enu.tlb")
# comtypes.client.GetModule("C:\\Program Files\\AutoCAD Civil 3D 2008\\AecXBase.tlb")
# comtypes.client.Get... | gpl-3.0 |
Bakterija/mmplayer | mmplayer/media_player/providers/audio_gstplayer_modified.py | 1 | 1047 | from kivy.core.audio.audio_gstplayer import SoundGstplayer
from kivy.logger import Logger
from kivy.compat import PY2
from os.path import realpath
from kivy.lib.gstplayer import GstPlayer, get_gst_version
if PY2:
from urllib import pathname2url
else:
from urllib.request import pathname2url
def _on_gstplayer_m... | mit |
PaulWay/spacewalk | search-server/spacewalk-search/scripts/search.py | 19 | 2581 | #!/usr/bin/python
import xmlrpclib
from optparse import OptionParser
indexName = "package"
usage = "usage: %prog [options] search term"
desc = "%prog searches for package (default) or systems with the given \
search criteria"
parser = OptionParser(usage=usage, description=desc)
parser.add_option("--sessionid", dest=... | gpl-2.0 |
MITHyperloopTeam/software_core | software/simulation/sysid/brake_actuator_sysid.py | 1 | 2012 | import numpy as np
from scipy.optimize import minimize
input_file = "/home/gizatt/mit-hyperloop-es/logs/20161014/velocity_steps_extract.csv"
dataset_raw = np.loadtxt(input_file, skiprows=1, delimiter=",")
# indexes into that
j_recv_time = 0
j_utime = 1
j_dist = 2
j_vel = 3
j_pressure = 4
j_m = 5
j_po = 6
j_pv = 7
i... | lgpl-3.0 |
devendermishrajio/nova_test_latest | nova/cells/filters/__init__.py | 61 | 2105 | # Copyright (c) 2012-2013 Rackspace Hosting
# 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
#
# Unles... | apache-2.0 |
ph4r05/plyprotobuf | plyproto/parser.py | 1 | 14479 | __author__ = "Dusan (Ph4r05) Klinec"
__copyright__ = "Copyright (C) 2014 Dusan (ph4r05) Klinec"
__license__ = "Apache License, Version 2.0"
__version__ = "1.0"
import ply.lex as lex
import ply.yacc as yacc
from .model import *
class ProtobufLexer(object):
keywords = ('double', 'float', 'int32', 'int64', 'uint32',... | apache-2.0 |
jaduimstra/nilmtk | nilmtk/dataset_converters/redd/convert_redd.py | 6 | 5462 | from __future__ import print_function, division
import pandas as pd
import numpy as np
from copy import deepcopy
from os.path import join, isdir, isfile
from os import listdir
import re
from sys import stdout
from nilmtk.utils import get_datastore
from nilmtk.datastore import Key
from nilmtk.timeframe import TimeFrame
... | apache-2.0 |
dcroc16/skunk_works | google_appengine/lib/distutils/distutils/msvccompiler.py | 250 | 23637 | """distutils.msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""
# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
# finding DevStudio (through the registry)
__revision__ = "$Id$"
import sys
import os
im... | mit |
vdmann/cse-360-image-hosting-website | lib/python2.7/site-packages/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
chouseknecht/ansible | lib/ansible/modules/network/aci/mso_schema_template_anp.py | 26 | 5536 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
# 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_ve... | gpl-3.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/prompt_toolkit/key_binding/bindings/named_commands.py | 6 | 15922 | """
Key bindings which are also known by GNU readline by the given names.
See: http://www.delorie.com/gnu/docs/readline/rlman_13.html
"""
from __future__ import unicode_literals
from prompt_toolkit.enums import IncrementalSearchDirection, SEARCH_BUFFER
from prompt_toolkit.selection import PasteMode
from six.moves impo... | bsd-3-clause |
liyitest/rr | openstack_dashboard/test/integration_tests/regions/baseregion.py | 40 | 4462 | # 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 |
defance/edx-platform | common/test/acceptance/pages/lms/matlab_problem.py | 179 | 1024 | """
Matlab Problem Page.
"""
from bok_choy.page_object import PageObject
class MatlabProblemPage(PageObject):
"""
View of matlab problem page.
"""
url = None
def is_browser_on_page(self):
return self.q(css='.ungraded-matlab-result').present
@property
def problem_name(self):
... | agpl-3.0 |
zapstar/gae-facebook | main.py | 1 | 3589 | #Import WebApp2 framework on Google App Engine
import webapp2
#Import Sessions from WebApp2 Extras
from webapp2_extras import sessions
#Import Quote Function from URL Library
from urllib import quote
#Import Parse_QueryString from URL Parse
from urlparse import parse_qs
#Import URLFetch from Google App Engine API
f... | mit |
jamison904/T999_minimum_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... | gpl-2.0 |
erdanieee/imagePicker | node_modules/dmg-builder/vendor/dmgbuild/colors.py | 12 | 13054 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import math
class Color (object):
def to_rgb(self):
raise Exception('Must implement to_rgb() in subclasses')
class RGB (Color):
def __init__(self, r, g, b):
self.r = r
self.g = g
self.b = b
def to_r... | mit |
Gregory-Howard/spaCy | spacy/tests/en/test_punct.py | 4 | 4576 | # coding: utf-8
"""Test that open, closed and paired punctuation is split off correctly."""
from __future__ import unicode_literals
import pytest
from ...util import compile_prefix_regex
from ...language_data import TOKENIZER_PREFIXES
PUNCT_OPEN = ['(', '[', '{', '*']
PUNCT_CLOSE = [')', ']', '}', '*']
PUNCT_PAIR... | mit |
apache/airflow | airflow/hooks/subprocess.py | 2 | 3589 | # 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 |
mitchrule/Miscellaneous | Django_Project/django/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py | 469 | 4196 | import functools
from pip._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
from .filewrapper import CallbackFileWrapper
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = set(['PUT', 'DELETE'])
def __init__(self, cache=None,
... | mit |
jaharkes/home-assistant | homeassistant/components/switch/mfi.py | 25 | 3613 | """
Support for Ubiquiti mFi switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.mfi/
"""
import logging
import requests
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant... | mit |
fernandopinhati/oppia | core/platform/users/gae_current_user_services.py | 30 | 2532 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
tammoippen/nest-simulator | pynest/nest/tests/test_connect_pairwise_bernoulli.py | 11 | 3393 | # -*- coding: utf-8 -*-
#
# test_connect_pairwise_bernoulli.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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-2.0 |
trankmichael/scikit-learn | sklearn/datasets/svmlight_format.py | 114 | 15826 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
ubiar/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py | 386 | 1736 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
noinil/pinang | share/figures/energy_function/native.py | 1 | 1420 | #!/usr/bin/env python
from pylab import *
figure(figsize=(8,5), dpi=80)
subplot(111)
X = np.linspace(0.5, 2, 256,endpoint=False)
C = 5*pow((1/X),12) - 6*pow((1/X),10)
# C1 = 5*pow((0.5/X),12) - 6*pow((0.5/X),10)
A = 5*pow((1/X),12)
R = - 6*pow((1/X),10)
plot(X, C, color="green", linewidth=2.5, linestyle="-",
... | gpl-2.0 |
shivam1111/odoo | addons/hr_holidays/tests/common.py | 389 | 4347 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
2014c2g4/2015cda0623 | static/Brython3.1.0-20150301-090019/Lib/browser/markdown.py | 623 | 13060 | # -*- coding: utf-8 -*-
try:
import _jsre as re
except:
import re
import random
import time
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'0123456789'
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if ... | gpl-3.0 |
Fujin-Suzukaze/GT-I9505-Kernel-JB-4.3 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
gpkulkarni/linux-arm64 | scripts/checkkconfigsymbols.py | 88 | 15783 | #!/usr/bin/env python2
"""Find Kconfig symbols that are referenced but not defined."""
# (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com>
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
#
# Licensed under the terms of the GNU GPL License version 2
import difflib
import os
import re
import signal
i... | gpl-2.0 |
denisff/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/integration/TLSSocketServerMixIn.py | 320 | 2203 | """TLS Lite + SocketServer."""
from gdata.tlslite.TLSConnection import TLSConnection
class TLSSocketServerMixIn:
"""
This class can be mixed in with any L{SocketServer.TCPServer} to
add TLS support.
To use this class, define a new class that inherits from it and
some L{SocketServer.TCPServer} (wi... | apache-2.0 |
JohnGeorgiadis/invenio | invenio/modules/jsonalchemy/jsonext/readers/json_reader.py | 17 | 3532 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 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
# License, or (at your option) any later... | gpl-2.0 |
bollwyvl/nbviewer | tasks.py | 3 | 2576 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import shutil
import tempfile
import invoke
from notebook import DEFAULT_STATIC_FILES_PATH
APP_ROOT = os.path.dirname(__file__)
NPM_BIN = os.path.join(APP_ROOT, "node_modules", ".bin")
@invoke.task
def test():
invoke.run("nosetests -v")
@i... | bsd-3-clause |
scattering/ipeek | server/plot_dcs.py | 1 | 3478 | # -*- coding: utf-8 -*-
import h5py
import simplejson
import os
import numpy as np
#import matplotlib.pyplot as plt
from time import time
def Elam(lam):
"""
convert wavelength in angstroms to energy in meV
"""
return 81.81/lam**2
def Ek(k):
"""
convert wave-vector in inver angstroms to energy ... | unlicense |
autodrive/utils3 | utils3/tests_remote/tests_remote.py | 1 | 4137 | import os
import unittest
from .. import git_util
class TestGitUtilRemotes(unittest.TestCase):
def test_get_remote_branch_list(self):
# function under test
result_set = set(git_util.get_remote_branch_list())
# sample file in the test script folder
filename = os.path.join(os.path.s... | apache-2.0 |
ravindrasingh22/ansible | v1/ansible/runner/connection_plugins/local.py | 110 | 5581 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
rg3915/django-basic-apps | basic/music/urls.py | 10 | 1276 | from django.conf.urls.defaults import *
urlpatterns = patterns('basic.music.views',
url(r'^genres/(?P<slug>[-\w]+)/$',
view='genre_detail',
name='music_genre_detail',
),
url (r'^genres/$',
view='genre_list',
name='music_genre_list',
),
url(r'^labels/(?P<slug>[-\w]+)... | bsd-3-clause |
pycepa/pycepa | modules/Tor/cell/cell.py | 1 | 11202 | from cryptography import x509
from cryptography.hazmat.backends import default_backend
from time import time
from datetime import datetime
import struct
import os
import socket
import logging
log = logging.getLogger(__name__)
# default protocol version before negotiation
proto_version = 3
class CellError(Exception):
... | gpl-3.0 |
adsorensen/girder | plugins/oauth/server/providers/globus.py | 3 | 3567 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | apache-2.0 |
ebernhardson/l2r | code/bench_formats.py | 1 | 1186 | import pandas as pd
import feather
import os
import timeit
import config
from utils import table_utils
df = table_utils._read(config.ALL_DATA)
FILE_HDF = os.path.join(config.TMP_DIR, 'test.h5')
FILE_PICKLE = os.path.join(config.TMP_DIR, 'test.pkl')
FILE_FEATHER = os.path.join(config.TMP_DIR, 'test.feather')
def tes... | mit |
manishpatell/erpcustomizationssaiimpex123qwe | addons/gamification/models/__init__.py | 389 | 1038 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
mattesno1/Sick-Beard | lib/requests/packages/charade/jpcntx.py | 151 | 19323 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 Ri... | gpl-3.0 |
mdhaber/scipy | scipy/sparse/linalg/eigen/arpack/setup.py | 18 | 1845 | from os.path import join
def configuration(parent_package='',top_path=None):
from scipy._build_utils.system_info import get_info
from numpy.distutils.misc_util import Configuration
from scipy._build_utils import (get_g77_abi_wrappers,
gfortran_legacy_flag_hook,
... | bsd-3-clause |
dropbox/changes | tests/changes/jobs/test_sync_build.py | 1 | 3772 | from __future__ import absolute_import
from datetime import datetime
from mock import patch
from changes.constants import Status, Result
from changes.config import db
from changes.models.build import Build
from changes.models.itemstat import ItemStat
from changes.jobs.sync_build import sync_build
from changes.testuti... | apache-2.0 |
manishpatell/erpcustomizationssaiimpex123qwe | addons/purchase/__init__.py | 439 | 1185 | # -*- 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... | agpl-3.0 |
signed/intellij-community | python/lib/Lib/site-packages/django/template/smartif.py | 331 | 6261 | """
Parser and utilities for the smart 'if' tag
"""
import operator
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (left = lbp, right = rbp)
class TokenBase(object):
"""
Ba... | apache-2.0 |
sorki/rosdep | test/test_rosdep_osx.py | 6 | 7167 | # -*- coding: utf-8 -*-
# Copyright (c) 2011, Willow Garage, 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
# ... | bsd-3-clause |
lancezlin/pyjs | pygtkweb/library/browser.py | 6 | 4255 | from __pyjamas__ import JS, doc, wnd, get_main_frame
listeners = {}
def mash_attrib(name, joiner='-'):
return name
def get_listener(item):
pass
def set_listener(item, listener):
pass
def round_val(val, digits):
return JS('@{{val}}.toFixed(@{{digits}});')
class Element:
def __init__(self, tag=N... | apache-2.0 |
xen0l/ansible | lib/ansible/modules/cloud/google/gcp_compute_route_facts.py | 12 | 7916 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
gudcjfdldu/volatility | volatility/plugins/linux/dentry_cache.py | 57 | 2513 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | gpl-2.0 |
scripnichenko/nova | nova/tests/unit/compute/test_resources.py | 57 | 11446 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
PierreRust/beets | extra/release.py | 24 | 8554 | #!/usr/bin/env python3
"""A utility script for automating the beets release process.
"""
import click
import os
import re
import subprocess
from contextlib import contextmanager
import datetime
BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
CHANGELOG = os.path.join(BASE, 'docs', 'changelog.rst')
... | mit |
romankagan/DDBWorkbench | python/lib/Lib/site-packages/django/contrib/gis/geos/prototypes/predicates.py | 623 | 1777 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gis... | apache-2.0 |
RomainBrault/scikit-learn | sklearn/externals/joblib/numpy_pickle_compat.py | 78 | 8439 | """Numpy pickle compatibility functions."""
import pickle
import os
import zlib
from io import BytesIO
from ._compat import PY3_OR_LATER
from .numpy_pickle_utils import _ZFILE_PREFIX
from .numpy_pickle_utils import Unpickler
def hex_str(an_int):
"""Convert an int to an hexadecimal string."""
return '{:#x}'.... | bsd-3-clause |
patrickstocklin/chattR | lib/python2.7/site-packages/nltk/parse/nonprojectivedependencyparser.py | 8 | 29287 | # Natural Language Toolkit: Dependency Grammars
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Jason Narad <jason.narad@gmail.com>
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
from __future__ import print_function
import math
import logging
from nltk.compat import xrange
from nltk.par... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.