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 |
|---|---|---|---|---|---|
khancyr/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/convert_uart_order.py | 21 | 1096 | #!/usr/bin/env python
'''
convert UART_ORDER in a hwdef.dat into a SERIAL_ORDER
'''
import sys, shlex
def convert_file(fname):
lines = open(fname, 'r').readlines()
for i in range(len(lines)):
if lines[i].startswith('SERIAL_ORDER'):
print("Already has SERIAL_ORDER: %s" % fname)
... | gpl-3.0 |
sourcepole/qgis | python/plugins/osm/OsmPlugin.py | 2 | 13996 | """@package OsmPlugin
This is the main module of the OSM Plugin.
It shows/hides all tool buttons, widgets and dialogs.
After closing dialogs it does all actions related with their return codes.
/***************************************************************************
* ... | gpl-2.0 |
joonas-fi/sumatrapdf | ext/freetype2/src/tools/chktrcmp.py | 192 | 3823 | #!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009, 2013
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/inter... | gpl-3.0 |
haripradhan/MissionPlanner | Lib/xml/etree/SimpleXMLTreeBuilder.py | 42 | 4805 | #
# ElementTree
# $Id: SimpleXMLTreeBuilder.py 3225 2007-08-27 21:32:08Z fredrik $
#
# A simple XML tree builder, based on Python's xmllib
#
# Note that due to bugs in xmllib, this builder does not fully support
# namespaces (unqualified attributes are put in the default namespace,
# instead of being left as is... | gpl-3.0 |
wonder-sk/QGIS | python/ext-libs/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... | gpl-2.0 |
Metaswitch/horizon | openstack_dashboard/api/ceilometer.py | 18 | 49104 | # 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
# distributed under t... | apache-2.0 |
israelbenatar/boto | tests/integration/kinesis/test_kinesis.py | 99 | 4404 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... | mit |
blaggacao/OpenUpgrade | addons/hr_attendance/__init__.py | 434 | 1122 | # -*- 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 |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/ssl.py | 67 | 34420 | # Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O erro... | lgpl-3.0 |
gnarula/eden_deployment | modules/s3db/msg.py | 1 | 88933 | # -*- coding: utf-8 -*-
""" Sahana Eden Messaging Model
@copyright: 2009-2014 (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 the Software wit... | mit |
CodeDJ/qt5-hidpi | qt/qtwebkit/Tools/QueueStatusServer/handlers/statusbubble_unittest.py | 128 | 2482 | # Copyright (C) 2010 Google, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lgpl-2.1 |
LukeHoersten/ansible-modules-core | cloud/amazon/iam_cert.py | 102 | 11642 | #!/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 distributed... | gpl-3.0 |
jkyeung/XlsxWriter | xlsxwriter/test/comparison/test_chart_combined03.py | 1 | 1649 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
Qinusty/rethinkdb | test/common/unit.py | 7 | 2157 | #!/user/bin/env python
# Copyright 2014-2015 RethinkDB, all rights reserved.
import collections, os, subprocess, sys
import test_framework, utils
class AllUnitTests(test_framework.Test):
def __init__(self, filters=[]):
super(AllUnitTests, self).__init__()
self.filters = filters
self.confi... | agpl-3.0 |
coddingtonbear/d-rats | d_rats/mapdisplay.py | 3 | 52155 | #!/usr/bin/python
import os
import math
import urllib
import time
import random
import shutil
import tempfile
import threading
import copy
import gtk
import gobject
import mainapp
import platform
import miscwidgets
import inputdialog
import utils
import geocode_ui
import map_sources
import map_source_editor
import s... | gpl-3.0 |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Tumblr/Post/EditAudioPostWithURL.py | 5 | 7243 | # -*- coding: utf-8 -*-
###############################################################################
#
# EditAudioPostWithURL
# Updates a specified audio post on a Tumblr blog using a specified external URL.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Ver... | gpl-3.0 |
vmindru/ansible | lib/ansible/modules/cloud/amazon/_ec2_ami_find.py | 17 | 13419 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated']... | gpl-3.0 |
dnguyen0304/clare | clare/clare/common/messaging/consumer/interfaces.py | 1 | 1596 | # -*- coding: utf-8 -*-
import abc
class IConsumer(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def consume(self, interval, timeout):
"""
Parameters
----------
interval : float
Rate of work. The units are in seconds.
timeout : float
... | mit |
jrha/aquilon | tests/broker/test_manage_validate_branch.py | 2 | 6137 | #!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2012,2013 Contributor
#
# 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... | apache-2.0 |
fredmorcos/attic | projects/plantmaker/plantmaker-main/src/benchmark/benchmark.py | 1 | 2905 | from os import path
from extra.printer import pprint, GREEN, BLUE, RED
class Benchmark(object):
useCairoPlot = False
useGnuPlot = True
def __init__(self, plant, orderList, testNumber):
self.prefix = "generic"
self.testName = "generic"
self.testNumber = testNumber
self.cairoPlotTimes = []
self.gnuPlotTim... | isc |
olopez32/syncless | googlecode_upload.py | 5 | 9044 | #!/usr/local/bin/stackless2.6
#
# Downloaded from http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
# at Thu Apr 29 17:24:59 CEST 2010
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
#... | apache-2.0 |
netroby/WinObjC | deps/3rdparty/icu/icu/source/test/depstest/dependencies.py | 198 | 7330 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2014, International Business Machines
# Corporation and others. All Rights Reserved.
#
# file name: dependencies.py
#
# created on: 2011may26
"""Reader module for dependency data for the ICU dependency tester.
Reads dependencies.txt and makes the data ... | mit |
cdubz/babybuddy | reports/graphs/feeding_amounts.py | 1 | 1422 | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.utils.translation import gettext as _
import plotly.offline as plotly
import plotly.graph_objs as go
from reports import utils
def feeding_amounts(instances):
"""
Create a graph showing daily feeding amounts over time.
:param instance... | bsd-2-clause |
geraldinepascal/FROGS | tools/phyloseq_beta_diversity/phyloseq_beta_diversity.py | 1 | 7336 | #!/usr/bin/env python3
#
# Copyright (C) 2018 INRA
#
# 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... | gpl-3.0 |
edmorley/django | django/db/models/deletion.py | 38 | 13580 | from collections import Counter, OrderedDict
from operator import attrgetter
from django.db import IntegrityError, connections, transaction
from django.db.models import signals, sql
class ProtectedError(IntegrityError):
def __init__(self, msg, protected_objects):
self.protected_objects = protected_object... | bsd-3-clause |
Jamlum/pytomo | pytomo/dns/renderer.py | 2 | 12024 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-2.0 |
yanglr/book | a.py | 2 | 2054 | import os, pycurl, re, sys, shutil
md=":"
login=":"
def dxDown(url, fullpath):
c=pycurl.Curl() # 縮寫一下
c.setopt(c.FOLLOWLOCATION, True) # 允許重定向
c.setopt(pycurl.USERAGENT, b"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)") # 模擬瀏覽器
c.setopt(pycurl.URL, url) # 訪問指定網址
c.setopt(pycurl.COOKIE... | gpl-3.0 |
Detailscool/YHSpider | JiraStoryMaker/JiraStoryMaker2.py | 1 | 5993 | #!/usr/bin/python
# -*- coding:utf-8 -*-
# JiraStoryMaker.py
# Created by Henry on 2018/4/9
# Description :
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selen... | mit |
axbaretto/beam | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/pbr/extra_files.py | 145 | 1096 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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 |
sposh-science/pycode-browser | Code/Physics/spring2.py | 6 | 1784 | """
spring2.py
The rk4_two() routine in this program does a two step integration using
an array method. The current x and xprime values are kept in a global
list named 'val'.
val[0] = current position; val[1] = current velocity
The results are compared with analytically calculated values.
"""
from pylab import *
d... | gpl-3.0 |
ASCrookes/django | tests/gis_tests/distapp/tests.py | 154 | 33547 | from __future__ import unicode_literals
from django.contrib.gis.db.models.functions import (
Area, Distance, Length, Perimeter, Transform,
)
from django.contrib.gis.geos import GEOSGeometry, LineString, Point
from django.contrib.gis.measure import D # alias for Distance
from django.db import connection
from djang... | bsd-3-clause |
citrix-openstack-build/ceilometer | tests/storage/test_impl_hbase.py | 3 | 1963 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012, 2013 Dell Inc.
#
# Author: Stas Maksimov <Stanislav_M@dell.com>
# Author: Shengjie Min <Shengjie_Min@dell.com>
#
# 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 |
srluge/SickRage | lib/sqlalchemy/dialects/mysql/cymysql.py | 78 | 2352 | # mysql/cymysql.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+cymysql
:name: CyMySQL
:dbapi: cymysql
:connectst... | gpl-3.0 |
NCBI-Hackathons/Pharmacogenomics_Prediction_Pipeline_P3 | doc/source/conf.py | 4 | 9581 | # -*- coding: utf-8 -*-
#
# Pharmacogenomics Prediction Pipeline (P3) documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 13 09:37:04 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... | cc0-1.0 |
xu6148152/Binea_Python_Project | automate the boring stuff with python/automate_online-materials/phoneAndEmail.py | 4 | 1235 | #! python3
# phoneAndEmail.py - Finds phone numbers and email addresses on the clipboard.
import pyperclip, re
phoneRegex = re.compile(r'''(
(\d{3}|\(\d{3}\))? # area code
(\s|-|\.)? # separator
(\d{3}) # first 3 digits
(\s|-|\.) # separator
(\d{4}) ... | mit |
sdgathman/pymilter | testsample.py | 1 | 5060 | import unittest
import Milter
import sample
import template
import mime
import zipfile
from Milter.test import TestBase
from Milter.testctx import TestCtx
class TestMilter(TestBase,sample.sampleMilter):
def __init__(self):
TestBase.__init__(self)
sample.sampleMilter.__init__(self)
class BMSMilterTestCase(un... | gpl-2.0 |
Gagnavarslan/djangosaml2 | tests/testprofiles/tests.py | 9 | 2048 | # Copyright (C) 2012 Sam Bull (lsb@pocketuniverse.ca)
# Copyright (C) 2011-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2010 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | apache-2.0 |
bobobox/ansible | lib/ansible/plugins/action/vyos.py | 5 | 4465 | #
# (c) 2016 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 |
damonkohler/sl4a | python/src/Lib/lib-tk/Tkconstants.py | 375 | 1493 | # Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'
# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'
# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'
# -relief
RAISED='rai... | apache-2.0 |
UManPychron/pychron | pychron/hardware/arduino/arduino_valve_actuator.py | 2 | 1597 | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | apache-2.0 |
ryanahall/django | django/db/migrations/executor.py | 12 | 8846 | from __future__ import unicode_literals
from django.apps.registry import apps as global_apps
from django.db import migrations
from .loader import MigrationLoader
from .recorder import MigrationRecorder
from .state import ProjectState
class MigrationExecutor(object):
"""
End-to-end migration execution - load... | bsd-3-clause |
Inspq/ansible | lib/ansible/modules/storage/netapp/sf_volume_manager.py | 49 | 11480 | #!/usr/bin/python
# (c) 2017, NetApp, 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.... | gpl-3.0 |
gauribhoite/personfinder | env/site-packages/babel/support.py | 137 | 21812 | # -*- coding: utf-8 -*-
"""
babel.support
~~~~~~~~~~~~~
Several classes and functions that help with integrating and using Babel
in applications.
.. note: the code in this module is not used by Babel itself
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more detail... | apache-2.0 |
arvinquilao/android_kernel_cyanogen_msm8916 | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
fengzhyuan/scikit-learn | sklearn/tests/test_metaestimators.py | 226 | 4954 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
pombredanne/Rusthon | regtests/bench/fannkuch.py | 2 | 1085 | # The Computer Language Benchmarks Game
# http://shootout.alioth.debian.org/
#
# contributed by Sokolov Yura
# modified by Tupteq
# modified by hartsantler 2014
from time import clock
from runtime import *
DEFAULT_ARG = 9
def main():
times = []
for i in range(4):
t0 = clock()
res = fannkuch(DEFAULT_ARG)
tk =... | bsd-3-clause |
Mixser/django | tests/template_tests/filter_tests/test_wordwrap.py | 324 | 1666 | from django.template.defaultfilters import wordwrap
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class WordwrapTests(SimpleTestCase):
@setup({'wordwrap01':
'{% autoescape off %}{{ a|wordwrap:"3" }} {{ b|wordwrap:"3" }}{% endautoescape %}'... | bsd-3-clause |
StuartGordonReid/Comp-Finance | Optimizers/Solution.py | 1 | 1512 | __author__ = 'Stuart Gordon Reid'
__email__ = 'stuartgordonreid@gmail.com'
__website__ = 'http://www.stuartreid.co.za'
"""
File description
"""
class Solution(object):
solution = []
def __init__(self, solution, problem):
"""
Abstract initialization method for a solution to some optimization ... | lgpl-3.0 |
defaultnamehere/grr | lib/flows/general/endtoend_test.py | 3 | 8099 | #!/usr/bin/env python
"""Tests for grr.lib.flows.general.endtoend."""
# pylint: disable=unused-import, g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import, g-bad-import-order
from grr.endtoend_tests import base
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib imp... | apache-2.0 |
kytvi2p/tahoe-lafs | src/allmydata/scripts/tahoe_backup.py | 2 | 12614 |
import os.path
import time
import urllib
import simplejson
import datetime
from allmydata.scripts.common import get_alias, escape_path, DEFAULT_ALIAS, \
UnknownAliasError
from allmydata.scripts.common_http import do_http, HTTPError, format_http_error
from allmydata.util import time... | gpl-2.0 |
mozilla/lumbergh | careers/careers/feeds.py | 2 | 1413 | # -*- coding: utf-8 -*-
from datetime import date
from django.contrib.syndication.views import Feed
from django.urls import reverse
from django.utils import feedgenerator
from careers.careers.models import Position
class LatestPositionsFeed(Feed):
feed_type = feedgenerator.Rss201rev2Feed
title = 'Current Mo... | mpl-2.0 |
Fl0rianFischer/sme_odoo | addons/website_sale_digital/controllers/main.py | 20 | 4262 | # -*- coding: utf-8 -*-
import base64
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website_portal.controllers.main import website_account
from openerp.addons.website_sale.controllers.main import website_sale
from cStringIO import StringIO
from werkzeug.utils impor... | gpl-3.0 |
yesudeep/cmc | app/jinja2/docs/jinjaext.py | 9 | 6833 | # -*- coding: utf-8 -*-
"""
Jinja Documentation Extensions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for automatically documenting filters and tests.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""
import os
import re
import inspect
import jinja2
from itertools import islice
from typ... | mit |
fhaoquan/kbengine | kbe/src/lib/python/Lib/test/test_parser.py | 113 | 26114 | import parser
import unittest
import sys
import operator
import struct
from test import support
from test.script_helper import assert_python_failure
#
# First, we test that we can generate trees from valid source fragments,
# and that these valid trees are indeed allowed by the tree-loading side
# of the parser mod... | lgpl-3.0 |
manhong2112/CodeColle | Python/Pygame/pygame~/compat.py | 5 | 3445 | # coding: ascii
"""Python 2.x/3.x compatibility tools"""
import sys
__all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_',
'unicode_', 'raw_input_', 'as_bytes', 'as_unicode',
'bytes_', 'next_', 'imap_', 'PY_MAJOR_VERSION', 'PY_MINOR_VERSION']
PY_MAJOR_VERSION, PY_MINOR_VERSION = sys.vers... | mit |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/view_tests/tests/test_i18n.py | 13 | 11317 | # -*- coding:utf-8 -*-
import gettext
import json
import os
import unittest
from os import path
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import (
LiveServerTestCase, TestCase, modify_settings, override_settings,
)
from django.utils import six
from django.utils.... | mit |
ModoUnreal/PyWeather | setup.py | 1 | 99122 | '''
_______
| \ \ / @@@;
| \ \ / `#....@
| | \ / ,;@.....;,;
| | \ / @..@........@` PyWeather Setup
| | \ / .............@ version 0.6.3 beta
| / \ / .............@ ... | gpl-3.0 |
jkarnows/scikit-learn | sklearn/neighbors/tests/test_dist_metrics.py | 230 | 5234 | import itertools
import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy
from scipy.spatial.distance import cdist
from sklearn.neighbors.dist_metrics import DistanceMetric
from nose import SkipTest
def dist_func(x1, x2, p):
return np.sum((x1 - x2) ** p) ** (1. / p)
de... | bsd-3-clause |
hsharsha/depot_tools | third_party/boto/pyami/helloworld.py | 120 | 1247 | # 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... | bsd-3-clause |
Infusion-OS/android_external_skia | tools/skpdiff/skpdiff_server.py | 161 | 24230 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import BaseHTTPServer
import json
import os
import os.path
import re
import subprocess
import sys
import tempfile
import urllib2
# Grab the script path because that is where all the static assets are
SCRIPT_DIR = os.path.d... | bsd-3-clause |
vabs22/zulip | zerver/migrations/0070_userhotspot.py | 9 | 1032 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-28 00:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
... | apache-2.0 |
mehtapgundogan/Tellal | env/lib/python2.7/site-packages/pip/vcs/bazaar.py | 35 | 4455 | from __future__ import absolute_import
import logging
import os
import tempfile
import re
# TODO: Get this into six.moves.urllib.parse
try:
from urllib import parse as urllib_parse
except ImportError:
import urlparse as urllib_parse
from pip.utils import rmtree, display_path
from pip.vcs import vcs, VersionC... | gpl-2.0 |
lambdaq/pytr | core.py | 1 | 7912 | #!/usr/bin/env python
# coding: utf8
# from gevent import monkey
# monkey.patch_all()
import socket
import os, sys
import random, struct
import logging
from collections import deque, Counter, defaultdict
logger = logging.getLogger(__file__)
logger.addHandler(logging.StreamHandler(sys.stderr))
logger.setLevel(loggin... | bsd-2-clause |
SteveHNH/ansible | lib/ansible/modules/windows/win_group_membership.py | 47 | 3143 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Andrew Saraceni <andrew.saraceni@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 ... | gpl-3.0 |
nwalters512/the-blue-alliance | tests/test_validation_helper.py | 3 | 1494 | import unittest2
from helpers.validation_helper import ValidationHelper
class TestValidationHelper(unittest2.TestCase):
def testTeamValidation(self):
errors = ValidationHelper.validate([("team_id_validator", "frc01")])
self.assertEqual(errors, {"Errors": [{"team_id": "frc01 is not a valid team id... | mit |
gangadharkadam/office_erp | erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py | 16 | 2966 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint
from frappe import msgprint, _
def execute(filters=None):
if not filters: filters = {}
conditio... | agpl-3.0 |
lifeofguenter/google-appengine-wx-launcher | launcher/text_frame_unittest.py | 28 | 2392 | #!/usr/bin/env python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
iamjakob/oauth2lib | oauth2lib/provider.py | 8 | 21633 | import json
import logging
from requests import Response
from cStringIO import StringIO
try:
from werkzeug.exceptions import Unauthorized
except ImportError:
Unauthorized = Exception
from . import utils
class Provider(object):
"""Base provider class for different types of OAuth 2.0 providers."""
def ... | mit |
jagg81/translate-toolkit | translate/storage/statsdb.py | 2 | 27596 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007-2010 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... | gpl-2.0 |
agry/NGECore2 | scripts/mobiles/rori/shallow_torton.py | 2 | 1728 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | lgpl-3.0 |
brownharryb/erpnext | erpnext/patches/v5_1/fix_against_account.py | 107 | 1271 | from __future__ import unicode_literals
import frappe
from erpnext.accounts.doctype.gl_entry.gl_entry import update_against_account
def execute():
from_date = "2015-05-01"
for doc in frappe.get_all("Journal Entry",
filters={"creation": (">", from_date), "docstatus": "1"}):
# update in gl_en... | gpl-3.0 |
zaventh/android_kernel_lge_hammerhead | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
baylee/django | tests/forms_tests/widget_tests/test_selectdatewidget.py | 35 | 20646 | from datetime import date
from django.forms import DateField, Form, SelectDateWidget
from django.test import override_settings
from django.utils import translation
from django.utils.dates import MONTHS_AP
from .base import WidgetTest
class SelectDateWidgetTest(WidgetTest):
maxDiff = None
widget = SelectDate... | bsd-3-clause |
drexly/tonginBlobStore | lib/django/contrib/admin/helpers.py | 79 | 14890 | from __future__ import unicode_literals
import warnings
from django import forms
from django.conf import settings
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.utils import (
display_for_field, flatten_fieldsets, help_text_for_field, label_for_field,
lookup_field,... | bsd-3-clause |
adit-chandra/tensorflow | tensorflow/tools/docs/parser.py | 3 | 58781 | # Lint as: python2, python3
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | apache-2.0 |
franosincic/edx-platform | common/djangoapps/student/admin.py | 22 | 6073 | """ Django admin pages for student app """
from django import forms
from django.contrib.auth.models import User
from ratelimitbackend import admin
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from config_models.admin import Config... | agpl-3.0 |
waxkinetic/fabcloudkit | fabcloudkit/build_tools/python_build.py | 1 | 7221 | """
fabcloudkit
:copyright: (c) 2013 by Rick Bohrer.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
# pypi
from fabric.context_managers import cd, prefix, settings
from fabric.operations import run, sudo
from fabric.state import env
# package
from fabcloudkit impo... | bsd-3-clause |
huchoi/edx-platform | common/djangoapps/django_future/csrf.py | 104 | 2882 | # Taken from Django 1.4
import warnings
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import decorator_from_middleware, available_attrs
from functools import wraps
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_... | agpl-3.0 |
cloudera/hue | desktop/core/ext-py/ply-3.11/ply/ctokens.py | 17 | 3155 | # ----------------------------------------------------------------------
# ctokens.py
#
# Token specifications for symbols in ANSI C and C++. This file is
# meant to be used as a library in other tokenizers.
# ----------------------------------------------------------------------
# Reserved words
tokens = [
# Li... | apache-2.0 |
t0mm0/youtube-dl | youtube_dl/extractor/kaltura.py | 63 | 4867 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
ExtractorError,
int_or_none,
)
class KalturaIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:kaltura:|
https?://(:?(?:www|cdnapisec)\.)... | unlicense |
koniiiik/django | tests/string_lookup/models.py | 281 | 1533 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def... | bsd-3-clause |
autosub-team/autosub | src/plugins/vels_ob/swagger_client/models/task.py | 2 | 6371 | # coding: utf-8
"""
HDL Testing Platform
REST API for HDL TP # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Task(object):
"""NOTE: This class is auto generated by the swa... | gpl-2.0 |
ajstarna/RicochetRobots | Brobot/model.py | 1 | 9336 | import itertools
import random
# Directions
NORTH = 'N'
EAST = 'E'
SOUTH = 'S'
WEST = 'W'
DIRECTIONS = [NORTH, EAST, SOUTH, WEST]
REVERSE = {
NORTH: SOUTH,
EAST: WEST,
SOUTH: NORTH,
WEST: EAST,
}
OFFSET = {
NORTH: -16,
EAST: 1,
SOUTH: 16,
WEST: -1,
}
# Masks
M_NORTH = 0x01
M_EAST =... | bsd-2-clause |
tongxindao/Flask-micblog | PyFlk-Framework/pyflk/session/__init__.py | 2 | 5139 | import os
import json
import time
import base64
def create_session_id():
'''
create Session ID
'''
# first of all, get current time stamp and convert byte stream, in Base64 code, decode to string and put off Base64 code "=" symbol, get second to last bit, final reverse order array
return base64.en... | apache-2.0 |
dhanzhang/shadowsocks-1 | shadowsocks/crypto/util.py | 1032 | 4287 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
hkchenhongyi/django | tests/generic_views/test_detail.py | 284 | 8387 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
from django.views.generic.base import View
from django.views.gen... | bsd-3-clause |
jonashagstedt/django-jsx | demo/demo/settings.py | 2 | 3162 | """
Django settings for demo project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... | bsd-3-clause |
zzzeek/sqlalchemy | lib/sqlalchemy/event/api.py | 3 | 6794 | # event/api.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Public API functions for the event system.
"""
from __future__ import absolute_imp... | mit |
wolfgangmauerer/prosoda | prosoda/interactive.py | 1 | 1232 | # Commands that are useful after adist.yp has been
# run in ipython
# This file is part of prosoda. prosoda 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 h... | gpl-2.0 |
c-o-m-m-a-n-d-e-r/CouchPotatoServer | libs/pyasn1/type/constraint.py | 382 | 7279 | #
# ASN.1 subtype constraints classes.
#
# Constraints are relatively rare, but every ASN1 object
# is doing checks all the time for whether they have any
# constraints and whether they are applicable to the object.
#
# What we're going to do is define objects/functions that
# can be called unconditionally ... | gpl-3.0 |
kdebrab/pandas | pandas/core/indexes/category.py | 1 | 30548 | import operator
import numpy as np
from pandas._libs import index as libindex
from pandas import compat
from pandas.compat.numpy import function as nv
from pandas.core.dtypes.generic import ABCCategorical, ABCSeries
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas.core.dtypes.common import (
is_... | bsd-3-clause |
floresconlimon/qutebrowser | qutebrowser/mainwindow/statusbar/prompter.py | 5 | 14437 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
csgrad/ns-3-9-ngwmn | bindings/python/apidefs/gcc-ILP32/ns3_module_udp_echo.py | 10 | 7949 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## udp-echo-client.h: ns3::UdpEchoClient [class]
module.add_class('UdpEchoClient', parent=root_module['ns3::Application'])
## udp-echo-server.h: ns3::UdpEch... | gpl-2.0 |
jicruz/heroku-bot | lib/youtube_dl/extractor/movingimage.py | 64 | 1774 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
unescapeHTML,
parse_duration,
)
class MovingImageIE(InfoExtractor):
_VALID_URL = r'https?://movingimage\.nls\.uk/film/(?P<id>\d+)'
_TEST = {
'url': 'http://movingimage.nls.uk/film/3561',
'm... | gpl-3.0 |
joakim-hove/django | tests/fixtures/tests.py | 113 | 35712 | from __future__ import unicode_literals
import os
import sys
import tempfile
import unittest
import warnings
from django.apps import apps
from django.contrib.sites.models import Site
from django.core import management
from django.core.serializers.base import ProgressBar
from django.db import IntegrityError, connectio... | bsd-3-clause |
chop-dbhi/varify-data-warehouse | vdw/genes/models.py | 1 | 4984 | from django.db import models
from django.contrib.auth.models import User
from objectset.models import ObjectSet, SetObject
from vdw.literature.models import PubMed
from vdw.genome.models import Chromosome
from vdw.phenotypes.models import Phenotype, PhenotypeThrough
from .managers import GeneManager
class GeneFamily(... | bsd-2-clause |
mattjmorrison/ReportLab | src/reportlab/lib/colors.py | 10 | 35800 | #Copyright ReportLab Europe Ltd. 2000-2010
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/colors.py
__version__=''' $Id: colors.py 3780 2010-09-17 13:40:59Z rgbecker $ '''
__doc__='''Defines standard colour-handling classes and colour na... | bsd-3-clause |
adaur/SickRage | lib/guessit/transfo/guess_movie_title_from_position.py | 28 | 8579 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 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 |
numericube/twistranet | twistranet/twistapp/forms/fields.py | 1 | 7275 | """
The twistranet Fields
"""
import os
import urlparse
from django import forms
from django.core.validators import URL_VALIDATOR_USER_AGENT
from django.db import models
from django.core.validators import EMPTY_VALUES
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext as _
fro... | agpl-3.0 |
SravanthiSinha/edx-platform | pavelib/utils/test/suites/bokchoy_suite.py | 57 | 6408 | """
Class used for defining and running Bok Choy acceptance test suite
"""
from time import sleep
from paver.easy import sh
from pavelib.utils.test.suites.suite import TestSuite
from pavelib.utils.envs import Env
from pavelib.utils.test import bokchoy_utils
from pavelib.utils.test import utils as test_utils
try:
... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.