repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
ChinaQuants/zipline | tests/test_munge.py | 34 | 1794 | #
# Copyright 2015 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
asalkeld/kubernetes | examples/selenium/selenium-test.py | 497 | 1089 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
mesonbuild/meson | tools/dircondenser.py | 1 | 2741 | #!/usr/bin/env python3
# Copyright 2018 The Meson development team
# 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 app... | apache-2.0 |
sirkubax/ansible | lib/ansible/executor/playbook_executor.py | 24 | 11332 | # (c) 2012-2014, 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) an... | gpl-3.0 |
elijah513/django | tests/one_to_one/models.py | 48 | 3309 | """
One-to-one relationships
To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compat... | bsd-3-clause |
adaxi/sickbeard | sickbeard/webapi.py | 6 | 106274 | # Author: Dennis Lutter <lad1337@gmail.com>
# Author: Jonathon Saine <thezoggy@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | gpl-3.0 |
dongjoon-hyun/tensorflow | tensorflow/python/autograph/pyct/static_analysis/liveness.py | 4 | 7575 | # 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 |
jokey2k/sentry | src/sentry/api/endpoints/event_details.py | 3 | 1545 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection, Endpoint
from sentry.api.bases.group import GroupPermission
from sentry.api.serializers import serialize
from sentry.models import Event
class EventDetailsEndpoint(Endpoint):
doc_section =... | bsd-3-clause |
boundarydevices/android_external_chromium_org | tools/perf/measurements/startup.py | 10 | 2636 | # 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.
from metrics import startup_metric
from telemetry.page import page_measurement
class Startup(page_measurement.PageMeasurement):
"""Performs a measurement... | bsd-3-clause |
mjtamlyn/django | tests/template_tests/templatetags/custom.py | 9 | 4979 | import operator
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.html import escape, format_html
register = template.Library()
@register.filter
@stringfilter
def trim(value, num):
return value[:num]
@register.filter
def noop(value, param=None):
"""A noo... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/xml/dom/minidom.py | 76 | 66275 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | gpl-2.0 |
Eseoghene/bite-project | deps/gdata-python-client/src/gdata/apps/data.py | 104 | 1863 | #!/usr/bin/python
#
# Copyright 2010 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 ... | apache-2.0 |
ddzialak/boto | tests/integration/emr/test_cert_verification.py | 126 | 1542 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 withou... | mit |
gamingrobot/second-sunrise | game/plugins/core/profile/profile.py | 1 | 1617 | # Copyright Tom SF Haines
#
# 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, soft... | apache-2.0 |
arvinsingla/CouchPotatoServer | libs/chardet/latin1prober.py | 1778 | 5232 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
skodapetr/lbvs-environment | scripts/export_results.py | 1 | 4819 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Print results as a CSV file.
Usage example:
python export_results.py
python export_results.py --columns
"""
import os
import json
import gzip
import csv
import sys
import argparse
__license__ = "X11"
def main():
args = parse_args()
writer = csv.writ... | mit |
cugbmao/PropertyEnchanter | Demo/static/assets/global/plugins/jquery-file-upload/server/gae-python/main.py | 242 | 5844 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.1.1
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appe... | mit |
Sinap/kodiswift | kodiswift/module.py | 3 | 4781 | # -*- coding: utf-8 -*-
"""
kodiswift.module
-----------------
This module contains the Module Class.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
"""
from __future__ import absolute_import
from kodiswift import setup_log
from kodiswift.xbmcmixin import XBMCMixin
__all__ = ... | gpl-3.0 |
JNU-Include/CNN | lib/dropout_mnist_cnn.py | 1 | 3213 | import tensorflow as tf
from lib.mnist_cnn import MnistCNN
class DropoutMnistCNN(MnistCNN):
DO = None
def my_log(self, i, xdata, ydata):
err = self.sess.run(self.cost_function, feed_dict={self.X: xdata, self.Y: ydata, self.DO: 0.7})
msg = "Step:{}, Error:{:.6f}".format(i, err)
self.l... | mit |
dursk/django | tests/db_functions/models.py | 245 | 1332 | """
Tests for built in Function expressions.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=50)
alias = models.CharField(max_leng... | bsd-3-clause |
kapilt/ansible | lib/ansible/plugins/inventory/directory.py | 54 | 2034 | # (c) 2012-2014, 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) an... | gpl-3.0 |
ajoaoff/django | django/contrib/gis/db/backends/postgis/schema.py | 333 | 3091 | from django.db.backends.postgresql.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
rast_index_wrapper = 'ST_ConvexHull(%s)'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(inde... | bsd-3-clause |
alexzoo/python | selenium_tests/env/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py | 17 | 30788 | """
PluginManager, basic initialization and tracing.
pluggy is the cristallized core of plugin management as used
by some 150 plugins for pytest.
Pluggy uses semantic versioning. Breaking changes are only foreseen for
Major releases (incremented X in "X.Y.Z"). If you want to use pluggy in
your project you should thu... | apache-2.0 |
strummerTFIU/TFG-IsometricMaps | LAStools/ArcGIS_toolbox/scripts_production/blast2demPro.py | 1 | 7737 | #
# blast2demPro.py
#
# (c) 2013, martin isenburg - http://rapidlasso.com
# rapidlasso GmbH - fast tools to catch reality
#
# uses blast2dem.exe to raster a folder of LiDAR files
#
# LiDAR input: LAS/LAZ/BIN/TXT/SHP/BIL/ASC/DTM
# raster output: BIL/ASC/IMG/TIF/DTM/PNG/JPG
#
# for licensing see http://l... | mit |
nashve/mythbox | resources/lib/IMDbPY/imdb/parser/local/characterParser.py | 5 | 4949 | """
parser.local.characterParser module (imdb package).
This module provides the functions used to parse the
information about characters in a local installation of the
IMDb database.
Copyright 2007-2008 Davide Alberani <da@erlug.linux.it>
This program is free software; you can redistribute it and/or modify
it under... | gpl-2.0 |
redhat-openstack/ceilometer | tools/send_test_data.py | 2 | 4749 | # 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 the Li... | apache-2.0 |
grapesmoker/regeditor-tk | src/regulations/notice.py | 1 | 3115 | from dateutil import parser as date_parser
from lxml import etree, objectify
from operator import itemgetter
from terms import Term
class Notice:
def __init__(self, filename=None, notice_type='regulation'):
self.filename = filename
self.terms = []
self.modified = False
self.effe... | mit |
vvv1559/intellij-community | python/lib/Lib/site-packages/django/conf/locale/nb/formats.py | 685 | 1657 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FOR... | apache-2.0 |
timsnyder/bokeh | bokeh/core/property/tests/test_regex.py | 2 | 2961 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
nycbjr/android_kernel_asus_tf700_3_1 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
tsmrachel/remo | remo/events/tests/test_forms.py | 5 | 6428 | from django.forms.models import inlineformset_factory, model_to_dict
from nose.tools import eq_, ok_
from remo.base.tests import RemoTestCase
from remo.events.forms import (BaseEventMetricsFormset, EventForm,
EventMetricsForm, PostEventForm)
from remo.events.models import Event
from rem... | bsd-3-clause |
sunqb/oa_qian | flask/Lib/site-packages/unidecode/x1d5.py | 248 | 3839 | data = (
'w', # 0x00
'x', # 0x01
'y', # 0x02
'z', # 0x03
'A', # 0x04
'B', # 0x05
'', # 0x06
'D', # 0x07
'E', # 0x08
'F', # 0x09
'G', # 0x0a
'', # 0x0b
'', # 0x0c
'J', # 0x0d
'K', # 0x0e
'L', # 0x0f
'M', # 0x10
'N', # 0x11
'O', # 0x12
'P', # 0x13
'Q', # 0x14... | apache-2.0 |
brev/nupic | tests/unit/nupic/data/dictutils_test.py | 32 | 2735 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
rahuldhote/odoo | addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
crs4/hadoop-galaxy | hadoop_galaxy/utils.py | 1 | 4680 | # BEGIN_COPYRIGHT
#
# Copyright (C) 2014 CRS4.
#
# This file is part of hadoop-galaxy, released under the terms of the BSD
# 3-Clause License <http://opensource.org/licenses/BSD-3-Clause>.
#
# END_COPYRIGHT
import logging
import os
import subprocess
import sys
import urlparse
import pydoop
import pydoop.hdfs as phdfs... | bsd-3-clause |
csirtgadgets/py-whitefacesdk | csirtgsdk/_version.py | 3 | 15769 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | lgpl-3.0 |
EmuxEvans/Wox | PythonHome/Lib/site-packages/chardet/charsetprober.py | 3127 | 1902 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
gganis/root | interpreter/llvm/src/utils/lit/tests/discovery.py | 51 | 4093 | # Check the basic discovery process, including a sub-suite.
#
# RUN: %{lit} %{inputs}/discovery \
# RUN: -j 1 --debug --show-tests --show-suites \
# RUN: -v > %t.out 2> %t.err
# RUN: FileCheck --check-prefix=CHECK-BASIC-OUT < %t.out %s
# RUN: FileCheck --check-prefix=CHECK-BASIC-ERR < %t.err %s
#
# CHECK-BASIC-ERR:... | lgpl-2.1 |
gonboy/sl4a | python/src/Lib/test/test_multibytecodec.py | 56 | 9764 | #!/usr/bin/env python
#
# test_multibytecodec.py
# Unit test for multibytecodec itself
#
from test import test_support
from test import test_multibytecodec_support
from test.test_support import TESTFN
import unittest, StringIO, codecs, sys, os
import _multibytecodec
ALL_CJKENCODINGS = [
# _codecs_cn
'gb2312', '... | apache-2.0 |
oloendithas/GT-P6800_JB_Kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
konsulko/libsigrokdecode | decoders/tlc5620/pd.py | 10 | 4650 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 2 of the Li... | gpl-3.0 |
tedder/ansible | test/units/modules/network/netvisor/test_pn_port_cos_rate_setting.py | 11 | 2346 | # Copyright: (c) 2018, Pluribus Networks
# 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 json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn... | gpl-3.0 |
ramaganapathy1/AMuDA-Ir-back-end | vEnv/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.py | 450 | 9668 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
def ... | mit |
steventimberman/masterDebater | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py | 713 | 2320 | from __future__ import absolute_import
import codecs
from uuid import uuid4
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_b... | mit |
Diaoul/Dobby | dobby/triggers/julius.py | 1 | 2411 | # Copyright 2011 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of Dobby.
#
# Dobby 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 ... | lgpl-3.0 |
qiyunzhu/horizomer | horizomer/benchmark/parse_output.py | 1 | 11849 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2015--, The Horizomer Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------... | bsd-3-clause |
rhndg/openedx | common/djangoapps/util/memcache.py | 251 | 1344 | """
This module provides a KEY_FUNCTION suitable for use with a memcache backend
so that we can cache any keys, not just ones that memcache would ordinarily accept
"""
from django.utils.encoding import smart_str
import hashlib
import urllib
def fasthash(string):
"""
Hashes `string` into a string representatio... | agpl-3.0 |
pombredanne/tornado | tornado/test/concurrent_test.py | 122 | 13390 | #!/usr/bin/env python
#
# Copyright 2012 Facebook
#
# 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 |
asoneofus/v350 | FADG_4.39A/system/core/libacc/tests/test.py | 1 | 13852 | #
# Test the acc compiler
import unittest
import subprocess
import os
import sys
gArmInitialized = False
gUseArm = True
gUseX86 = True
gRunOTCCOutput = True
gCompileOTCCANSI = True
def parseArgv():
global gUseArm
global gUseX86
global gRunOTCCOutput
for arg in sys.argv[1:]:
if arg == "--noar... | gpl-2.0 |
SYNchroACK/TekDefense-Automater | utilities.py | 7 | 15683 | """
The utilities.py module handles all utility functions that Automater
requires.
Class(es):
Parser -- Class to handle standard argparse functions with
a class-based structure.
IPWrapper -- Class to provide IP Address formatting and parsing.
Function(s):
No global exportable functions are defined.
Exception(s):
No ... | mit |
VisTrails/VisTrails | vistrails/gui/collection/explorer.py | 2 | 34359 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
spritzle/spritzle | spritzle/daemon/common.py | 1 | 2941 | #
# spritzle/common.py
#
# Copyright (C) 2016 Andrew Resch <andrewresch@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
... | gpl-3.0 |
danlwo/Hadoop-Spark-Python-Log-Parser | def_400_visualizations/def_400_pickle2CSV_distCount/def_400_pickle2CSV_distCount.py | 1 | 4777 | # Christina CJ Chen & Dan Lwo from Logitech
# python 2.7.10 $ spark-2.1.1-bin-hadoop2.7
# --- CAUTION! SAFETY RISK! ---
import credencialInfo
# --- Make sure env. variables set! ---
import findspark
findspark.init()
print '--- [INfO] FINDSPARK session successfully FINISHED. ---'
# --- Improt necessary modules ---
impo... | mit |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/django/utils/html.py | 67 | 12669 | """HTML utilities suitable for global use."""
from __future__ import unicode_literals
import re
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_text, force_str
from django.utils.functional import allow_lazy
from django.utils import six
from django.utils.six.moves.urlli... | bsd-3-clause |
Fruit-Snacks/aima-python | tests/test_csp.py | 26 | 1067 | import pytest
from csp import * #noqa
def test_backtracking_search():
assert (backtracking_search(australia) is not None) == True
assert (backtracking_search(australia, select_unassigned_variable=mrv) is not None) == True
assert (backtracking_search(australia, order_domain_values=lcv) is not None) == Tr... | mit |
Thraxis/SickRage | lib/mako/util.py | 39 | 10927 | # mako/util.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re
import collections
import codecs
import os
from mako import compat
import operator
def up... | gpl-3.0 |
windyuuy/opera | chromium/src/third_party/python_26/Lib/CGIHTTPServer.py | 59 | 12687 | """CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Py... | bsd-3-clause |
vnc-biz/openerp-web | setup.py | 9 | 1853 |
import os
import re
import sys
from setuptools import setup, find_packages
execfile('addons/web/common/release.py')
version_dash_incompatible = False
if 'bdist_rpm' in sys.argv:
version_dash_incompatible = True
try:
import py2exe
from py2exe_utils import opts
version_dash_incompatible = True
except I... | agpl-3.0 |
gylian/sickrage | lib/hachoir_parser/program/elf.py | 90 | 7120 | """
ELF (Unix/BSD executable file format) parser.
Author: Victor Stinner
Creation date: 08 may 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt16, UInt32, Enum,
String, Bytes)
from lib.hachoir_core.text_handler import textHandler, hexadecima... | gpl-3.0 |
matthewfranglen/spark | examples/src/main/python/mllib/gaussian_mixture_model.py | 128 | 2783 | #
# 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... | mit |
Senseg/Py4A | python3-alpha/python3-src/Tools/freeze/parsesetup.py | 100 | 3008 | # Parse Makefiles and Python Setup(.in) files.
import re
# Extract variable definitions from a Makefile.
# Return a dictionary mapping names to values.
# May raise IOError.
makevardef = re.compile('^([a-zA-Z0-9_]+)[ \t]*=(.*)')
def getmakevars(filename):
variables = {}
fp = open(filename)
pendingline =... | apache-2.0 |
p12tic/awn-extras | applets/maintained/slickswitcher/prefs.py | 2 | 15669 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010 sharkbaitbobby <sharkbaitbobby+awn@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of ... | gpl-2.0 |
ytjiang/django | tests/forms_tests/tests/test_fields.py | 18 | 84817 | # -*- coding: utf-8 -*-
"""
##########
# Fields #
##########
Each Field class does some sort of validation. Each Field has a clean() method,
which either raises django.forms.ValidationError or returns the "clean"
data -- usually a Unicode object, but, in some rare cases, a list.
Each Field's __init__() takes at least... | bsd-3-clause |
dfalt974/SickRage | lib/js2py/translators/translating_nodes.py | 27 | 22167 | from __future__ import unicode_literals
from .pyjsparserdata import *
from .friendly_nodes import *
import random
import six
if six.PY3:
from functools import reduce
xrange = range
unicode = str
# number of characters above which expression will be split to multiple lines in order to avoid python parser st... | gpl-3.0 |
scollis/iris | lib/iris/tests/unit/util/test_broadcast_to_shape.py | 3 | 2671 | # (C) British Crown Copyright 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
littlstar/chromium.src | chrome/common/extensions/docs/server2/branch_utility_test.py | 7 | 7666 | #!/usr/bin/env python
# Copyright (c) 2012 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.
import os
import sys
import unittest
from branch_utility import BranchUtility, ChannelInfo
from fake_url_fetcher import FakeUrlFet... | bsd-3-clause |
zbqf109/goodo | openerp/addons/crm/crm_stage.py | 20 | 2789 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import osv, fields
AVAILABLE_PRIORITIES = [
('0', 'Normal'),
('1', 'Low'),
('2', 'High'),
('3', 'Very High'),
]
class crm_stage(osv.Model):
""" Model for case stages. This models t... | gpl-3.0 |
GeyerA/android_external_chromium_org | media/tools/layout_tests/layouttest_analyzer.py | 48 | 22372 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Main functions for the Layout Test Analyzer module."""
from datetime import datetime
import optparse
import os
import sys
impor... | bsd-3-clause |
10clouds/edx-platform | openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py | 14 | 3022 | """
Tests for helpers.py
"""
import datetime
import hashlib
from mock import patch
from nose.plugins.attrib import attr
from pytz import UTC
from unittest import skipUnless
from django.conf import settings
from django.test import TestCase
from ..image_helpers import get_profile_image_urls_for_user
from student.tests.... | agpl-3.0 |
opennode/nodeconductor-openstack | src/waldur_openstack/openstack_tenant/tests/factories.py | 1 | 13202 | from random import randint
import uuid
from django.urls import reverse
from django.utils import timezone
from factory import fuzzy
import factory
import pytz
from waldur_core.structure import models as structure_models
from waldur_core.structure.tests import factories as structure_factories
from waldur_openstack.ope... | mit |
slisson/intellij-community | python/helpers/pydev/pydevd_comm.py | 23 | 55456 | ''' pydevd - a debugging daemon
This is the daemon you launch for python remote debugging.
Protocol:
each command has a format:
id\tsequence-num\ttext
id: protocol command number
sequence-num: each request has a sequence number. Sequence numbers
originating at the debugger are odd, sequence numbers ori... | apache-2.0 |
swjtuacmer/Ranker | Ranker/venv/lib/python2.7/site-packages/pip/_vendor/webencodings/tests.py | 340 | 6562 | # coding: utf8
"""
webencodings.tests
~~~~~~~~~~~~~~~~~~
A basic test suite for Encoding.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode,
... | mit |
Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/modeling/plotting/photometry.py | 1 | 3589 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | mit |
ROMFactory/android_external_chromium_org | chrome/test/webdriver/test/run_chromedriver_tests.py | 38 | 2156 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Runs all of the ChromeDriver tests.
For ChromeDriver documentation, refer to http://code.google.com/p/chromedriver.
"""
import... | bsd-3-clause |
jburel/openmicroscopy | components/tools/OmeroCpp/ext/gtest-1.7.0/test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-2.0 |
matlo/beagleboard-usbsniffer-kernel | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/sympy/integrals/tests/test_trigonometry.py | 109 | 3657 | from sympy.core import Eq, Rational, Symbol
from sympy.functions import sin, cos, tan, csc, sec, cot, log, Piecewise
from sympy.integrals.trigonometry import trigintegrate
x = Symbol('x')
def test_trigintegrate_odd():
assert trigintegrate(Rational(1), x) == x
assert trigintegrate(x, x) is None
assert tri... | mit |
gaddman/ansible | lib/ansible/inventory/data.py | 9 | 10288 | # (c) 2012-2014, 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) an... | gpl-3.0 |
htadg/icon-downloader | main.py | 1 | 4767 | #!usr/bin/python
from __future__ import print_function
import os
import re
import six
from random import randint
import argparse
import requests
from clint.textui import progress
from lxml import html
if six.PY2:
import urlparse
else:
import urllib.parse as urlparse
def get_download_url(url, size=512, fla... | mit |
mezz64/home-assistant | homeassistant/components/lutron/__init__.py | 15 | 5882 | """Component for interacting with a Lutron RadioRA 2 system."""
import logging
from pylutron import Button, Lutron
import voluptuous as vol
from homeassistant.const import ATTR_ID, CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
... | apache-2.0 |
WickedShell/ardupilot | Tools/autotest/autotest.py | 3 | 17704 | #!/usr/bin/env python
"""
APM automatic test suite
Andrew Tridgell, October 2011
"""
import atexit
import fnmatch
import glob
import optparse
import os
import shutil
import signal
import sys
import time
import traceback
import apmrover2
import arducopter
import arduplane
import quadplane
from pysim import util
os.... | gpl-3.0 |
wangxin39/xstat | ManageSystem/WebContent/fckeditor/editor/filemanager/connectors/py/fckconnector.py | 55 | 2596 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | bsd-3-clause |
gscalzo/gscalzo.github.io | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
duducosmos/pgs4a | python-install/lib/python2.7/xml/sax/handler.py | 230 | 13921 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id$
"""
version ... | lgpl-2.1 |
sebastien-forestier/explaupoppydiva | scripts/arm/test_vrep_xp.py | 2 | 2164 | from experiment import VrepDivaExperiment
from config import Config
if __name__ == '__main__':
iterations = 10000
#MS2
# config = Config("MS2", iterations)
# config.modules.pop('mod2')
# config.mids = ['mod1']
# config.modules['mod1'] = dict(m = config.motor_dims,
# ... | gpl-3.0 |
JianyuWang/nova | nova/tests/unit/objects/test_virtual_interface.py | 36 | 4640 | # Copyright (C) 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
liikGit/MissionPlanner | Lib/json/scanner.py | 64 | 2364 | """JSON token scanner
"""
import re
try:
from _json import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scann... | gpl-3.0 |
piotroxp/scibibscan | scib/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## 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 |
MER-GROUP/intellij-community | python/lib/Lib/locale.py | 116 | 73200 | """ Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for pass... | apache-2.0 |
credativUK/OCB | addons/l10n_be_hr_payroll_account/__init__.py | 430 | 1046 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
zaccoz/odoo | addons/product_expiry/__openerp__.py | 260 | 1788 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
biolab/orange | Orange/OrangeWidgets/Prototypes/OWExampleDistance.py | 6 | 5901 | """
<name>Example Distance</name>
<description>Computes a distance matrix from a set of data examples.</description>
<icon>icons/Distance.svg</icon>
<contact>Blaz Zupan (blaz.zupan(@at@)fri.uni-lj.si)</contact>
<priority>1300</priority>
"""
import OWGUI
from OWWidget import *
import Orange
from Orange import distanc... | gpl-3.0 |
JohnnySun/RaspberryPi_Lnux_Kernel_JohnnySun_Multiboot | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/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 |
gregswift/ansible-modules-extras | database/misc/mongodb_user.py | 42 | 10029 | #!/usr/bin/python
# (c) 2012, Elliott Foster <elliott@fourkitchens.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
# (c) 2014, Epic Games, 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 publi... | gpl-3.0 |
rsnakamura/theape | theape/parts/watchers/thewatcher.py | 1 | 5140 |
# The MIT License (MIT)
#
# Copyright (c) 2013 Russell Nakamura
#
# 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, cop... | mit |
Plexxi/st2 | st2actions/st2actions/cmd/actionrunner.py | 3 | 2855 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | apache-2.0 |
pedrobaeza/stock-logistics-workflow | stock_route_transit/model/stock_picking_type.py | 8 | 1458 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Alexandre Fayolle
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
emolch/guts | test/test.py | 1 | 18319 | import unittest
import calendar
import math
import re
import sys
sys.path[0:0] = [ '../src' ]
from guts import *
class SamplePat(StringPattern):
pattern = r'[a-z]{3}'
class SampleChoice(StringChoice):
choices = [ 'a', 'bcd', 'efg' ]
basic_types = (Bool, Int, Float, String, Unicode, Complex, Timestamp,
... | mit |
dataxu/ansible | lib/ansible/modules/database/postgresql/postgresql_schema.py | 20 | 8239 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
... | gpl-3.0 |
shaded-enmity/ansible-modules-extras | web_infrastructure/ejabberd_user.py | 108 | 7253 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.