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 |
|---|---|---|---|---|---|
moniqx4/bite-project | deps/gdata-python-client/tests/gdata_tests/auth_test.py | 126 | 26859 | #!/usr/bin/env python
#
# Copyright (C) 2007, 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 require... | apache-2.0 |
vagonbar/GNUnetwork | gwn/blocks/utilblocks/timer/timer.py | 2 | 4544 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of GNUWiNetwork,
# Copyright (C) 2014 by
# Pablo Belzarena, Gabriel Gomez Sena, Victor Gonzalez Barbone,
# Facultad de Ingenieria, Universidad de la Republica, Uruguay.
#
# GNUWiNetwork is free software: you can redistribute it ... | gpl-3.0 |
sarantapichos/faircoop-market | addons/website_product_brand/__init__.py | 2 | 1068 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd. (<http://www.serpentcs.com>)
#
# This program is free software: you can redistribute it and/or mod... | agpl-3.0 |
toobaz/pandas | pandas/tests/indexes/datetimes/test_ops.py | 2 | 18288 | from datetime import datetime
import warnings
import numpy as np
import pytest
from pandas.core.dtypes.generic import ABCDateOffset
import pandas as pd
from pandas import (
DatetimeIndex,
Index,
PeriodIndex,
Series,
Timestamp,
bdate_range,
date_range,
)
from pandas.tests.test_base import ... | bsd-3-clause |
xxd3vin/spp-sdk | opt/Python27/Lib/test/test_cmd_line_script.py | 35 | 8868 | # Tests command line execution of scripts
import unittest
import os
import os.path
import test.test_support
from test.script_helper import (run_python,
temp_dir, make_script, compile_script,
make_pkg, make_zip_script, make_zip_pkg)
verbose = test.test_su... | mit |
pbrazdil/phantomjs | src/qt/qtwebkit/Tools/gdb/webkit.py | 115 | 11357 | # 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... | bsd-3-clause |
zhaosichao/nw.js | tests/automation/buff_from_string/internal/test.py | 169 | 1430 | #!/usr/bin/env python
from selenium import webdriver
import os
import traceback
import time
from selenium import webdriver
from platform import platform
import socket
from sys import argv
port = 13013
if len(argv) >= 2:
port = int(argv[1])
path = os.path
dirname = path.abspath(path.dirname(__file__))
chromedriv... | mit |
jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/tensorflow/contrib/distributions/python/ops/poisson.py | 29 | 5151 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/pylint/test/regrtest_data/import_package_subpackage_module.py | 15 | 2238 | # pylint: disable=I0011,C0301,W0611
"""I found some of my scripts trigger off an AttributeError in pylint
0.8.1 (with common 0.12.0 and astroid 0.13.1).
Traceback (most recent call last):
File "/usr/bin/pylint", line 4, in ?
lint.Run(sys.argv[1:])
File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 72... | gpl-3.0 |
Mirantis/mos-horizon | openstack_dashboard/dashboards/admin/networks/ports/tables.py | 58 | 2826 | # Copyright 2012 NEC Corporation
#
# 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 ag... | apache-2.0 |
piyueh/PetIBM | examples/api_examples/oscillatingcylinder2dRe100_GPU/scripts/plotDragCoefficient.py | 2 | 2057 | """
Plot the drag coefficient over 4 oscillation cycles.
"""
import pathlib
import numpy
from matplotlib import pyplot
from scipy import signal
# Read the drag force from file.
simu_dir = pathlib.Path(__file__).parents[1]
data_dir = simu_dir / 'output'
filepath = data_dir / 'forces-0.txt'
with open(filepath, 'r') as... | bsd-3-clause |
FreeScienceCommunity/pyctp | example/pyctp2/testbed/metaclazz.py | 7 | 4323 | # -*- coding:utf-8 -*-
import inspect
from ..common.utils import with_metaclass
def singleton(cls):
instances = {}
def _singleton(*args, **kw):
if cls not in instances:
print("not find in singleton")
instances[cls] = cls(*args, **kw)
return instances[cls]
return _si... | mit |
katsikas/gnuradio | grc/gui/Messages.py | 17 | 3440 | """
Copyright 2007 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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-3.0 |
cytec/SickRage | lib/chardet/mbcharsetprober.py | 53 | 3302 | ######################## 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 |
wetneb/django | tests/nested_foreign_keys/tests.py | 207 | 9426 | from __future__ import unicode_literals
from django.test import TestCase
from .models import (
Event, Movie, Package, PackageNullFK, Person, Screening, ScreeningNullFK,
)
# These are tests for #16715. The basic scheme is always the same: 3 models with
# 2 relations. The first relation may be null, while the sec... | bsd-3-clause |
jzoldak/edx-platform | lms/djangoapps/certificates/migrations/0003_data__default_modes.py | 54 | 1388 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Converted from the original South migration 0002_default_rate_limit_config.py
from django.db import migrations, models
from django.conf import settings
from django.core.files import File
def forwards(apps, schema_editor):
"""Add default modes"""
... | agpl-3.0 |
atplanet/ansible-modules-core | cloud/rackspace/rax_keypair.py | 157 | 4957 | #!/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 |
raycarnes/project | project_task_materials/models/project.py | 17 | 1618 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 - 2013 Daniel Reis
# Copyright (C) 2015 - Antiun Ingeniería S.L. - Sergio Teruel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
kirillzhuravlev/numpy | tools/win32build/misc/x86analysis.py | 75 | 6150 | #! /usr/bin/env python
# Last Change: Sat Mar 28 02:00 AM 2009 J
# Try to identify instruction set used in binary (x86 only). This works by
# checking the assembly for instructions specific to sse, etc... Obviously,
# this won't work all the times (for example, if some instructions are used
# only after proper detecti... | bsd-3-clause |
kyvinh/home-assistant | homeassistant/components/light/wink.py | 6 | 3833 | """
Support for Wink lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.wink/
"""
import colorsys
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR_TEMP, SU... | apache-2.0 |
tardyp/buildbot | master/buildbot/test/unit/db_migrate/test_versions_056_add_test_result_tables.py | 5 | 3897 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
somsak/youtube-dl | youtube_dl/extractor/youtube.py | 9 | 92023 | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import os.path
import re
import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from ..jsinterp import JSInterpreter
from ..swfinterp import SWFInterpreter
from ..compat import (
compat_chr,
com... | unlicense |
Jaumo/cassandra | pylib/cqlshlib/formatting.py | 4 | 23522 | # 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 |
NicovincX2/Python-3.5 | Génie logiciel/Architecture logicielle/Patron de conception/Patron de structure/flyweight.py | 1 | 2973 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""http://codesnipers.com/?q=python-flyweights"""
import weakref
class FlyweightMeta(type):
def __new__(mcs, name, parents, dct):
"""
:param name: class name
:param parents: class parents
:param dct: dict: includes class attributes,... | gpl-3.0 |
geggo/pyface | pyface/tests/test_window.py | 2 | 6658 | from __future__ import absolute_import
from traits.testing.unittest_tools import unittest, UnittestTools
from ..constant import CANCEL, NO, OK, YES
from ..gui import GUI
from ..toolkit import toolkit_object
from ..window import Window
ModalDialogTester = toolkit_object('util.modal_dialog_tester:ModalDialogTester')
n... | bsd-3-clause |
dch312/scipy | scipy/linalg/_interpolative_backend.py | 143 | 44935 | #******************************************************************************
# Copyright (C) 2013 Kenneth L. Ho
#
# 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 t... | bsd-3-clause |
paulmand3l/Arduino | arduino-core/src/processing/app/i18n/python/requests/models.py | 151 | 21105 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import logging
import datetime
from io import BytesIO
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
from .c... | lgpl-2.1 |
drivefast/pycipherwallet | example/http_router.py | 1 | 3024 | import time
import bottle
import bcrypt
import sqlalchemy
from sqlalchemy.sql import text as sql_statement
import cipherwallet.api_router
ROOT = '/path/to/pycipherwallet/example'
@bottle.route('/<folder:re:css>/<filename:re:.*\.css>')
@bottle.route('/<folder:re:js>/<filename:re:.*\.js>')
@bottle.route('/<folder:re:i... | mit |
jmesteve/medical | openerp/oemedical/oemedical/oemedical_diagnostic_hypothesis/__init__.py | 5 | 1165 | # -*- coding: utf-8 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.techreceptives.com>)
# Special Credit and Thanks to Thymbra Latinoamericana S.A.
#
# This program is free sof... | agpl-3.0 |
Eaglemania/ASS | pyglet/input/x11_xinput.py | 42 | 11404 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes
import pyglet
from pyglet.input.base import \
Device, DeviceException, DeviceOpenException, \
Control, Button, RelativeAxis, AbsoluteAxis
from pyglet.libs.x11 import xlib
from pyglet.compat import asstr
try... | gpl-2.0 |
40023247/W17test | static/Brython3.1.3-20150514-095342/Lib/posix.py | 603 | 20904 | """This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly
disguised Unix interface). Refer to the library manual and
corresponding Unix manual entries for more information on calls."""
import datetime
from browser import window
def _rand... | agpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/gunicorn/six.py | 320 | 27344 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including with... | mit |
mitya57/debian-buildbot | buildbot/test/util/config.py | 2 | 1657 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
philsch/ansible | lib/ansible/modules/cloud/google/gce_snapshot.py | 37 | 7223 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 |
moutai/scikit-learn | sklearn/manifold/mds.py | 257 | 15138 | """
Multi-dimensional Scaling (MDS)
"""
# author: Nelle Varoquaux <nelle.varoquaux@gmail.com>
# Licence: BSD
import numpy as np
import warnings
from ..base import BaseEstimator
from ..metrics import euclidean_distances
from ..utils import check_random_state, check_array, check_symmetric
from ..externals.joblib impo... | bsd-3-clause |
mameneses/python-deployment | venv/lib/python2.7/site-packages/werkzeug/wrappers.py | 146 | 76379 | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... | mit |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/test/test_time.py | 81 | 30688 | from test import support
import time
import unittest
import locale
import sysconfig
import sys
import platform
try:
import threading
except ImportError:
threading = None
# Max year is only limited by the size of C int.
SIZEOF_INT = sysconfig.get_config_var('SIZEOF_INT') or 4
TIME_MAXYEAR = (1 << 8 * SIZEOF_INT... | gpl-2.0 |
DefyVentures/edx-platform | cms/djangoapps/contentstore/views/assets.py | 25 | 14681 | import logging
from functools import partial
import math
import json
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http... | agpl-3.0 |
zhlinh/leetcode | 0038.Count and Say/solution.py | 1 | 1175 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: zhlinhng@gmail.com
Version: 0.0.1
Created Time: 2016-02-17
Last_modify: 2016-02-17
******************************************
'''
'''
The count-and-say sequence is the sequence... | apache-2.0 |
2ndQuadrant/ansible | test/units/modules/network/ironware/test_ironware_command.py | 38 | 4058 | # (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 dis... | gpl-3.0 |
vitorio/ocropodium | ocradmin/nodelib/nodes/cuneiform.py | 1 | 1938 | """
Cuneiform Recogniser
"""
from __future__ import absolute_import
import os
import codecs
import shutil
import tempfile
import subprocess as sp
import numpy
from nodetree import node
from . import base
from .. import stages, types, utils
class CuneiformRecognizer(base.CommandLineRecognizerNode):
"""
Re... | apache-2.0 |
tchernomax/ansible | lib/ansible/modules/packaging/os/homebrew_cask.py | 23 | 23464 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.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_... | gpl-3.0 |
mtbc/openmicroscopy | components/tools/OmeroPy/src/omero_ext/which.py | 20 | 12152 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2002-2005 ActiveState Corp.
# See LICENSE.txt for license details.
# Author:
# Trent Mick (TrentM@ActiveState.com)
# Home:
# http://trentm.com/projects/which/
r"""Find the full path to commands.
which(command, path=None, verbose=0, exts=None)
Retur... | gpl-2.0 |
kennethlove/django | django/contrib/gis/db/backends/oracle/introspection.py | 119 | 1779 | import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY,
# but it is the only o... | bsd-3-clause |
Demolisty24/AlexaFood-Backend | venv/Lib/site-packages/werkzeug/testapp.py | 364 | 9396 | # -*- coding: utf-8 -*-
"""
werkzeug.testapp
~~~~~~~~~~~~~~~~
Provide a small test application that can be used to test a WSGI server
and check it for WSGI compliance.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
impo... | mit |
AVOXI/b2bua | sippy/SipTransactionManager.py | 1 | 30074 | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistrib... | bsd-2-clause |
lammy/artisan | setup-mac3.py | 9 | 8968 | """
This is a setup.py script generated by py2applet
Usage:
python3 setup-mac3.py py2app
"""
# manually remove sample-data mpl subdirectory from Python installation:
# sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/mpl-data/sample_data
from distutils import s... | gpl-3.0 |
dferens/django-angularmagic | angularmagic/base.py | 1 | 1190 | class Serializer(object):
"""
Converts complex objects such as querysets or model instances to
native Python datatypes that can be converted to xml/json/anything later.
Is a light wrapper of ``rest_framework.serializers.Serializer``.
:param model: class if serializer is class-specific.
:type m... | mit |
eg-zhang/h2o-2 | py/testdir_0xdata_only/test_parse_airline_multi_hdfs_many.py | 9 | 3190 | import unittest, sys, random, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_jobs as h2j
RANDOM_UDP_DROP = False
if RANDOM_UDP_DROP:
print "random_udp_drop!!"
# NAME_NODE = 'mr-0x6'
# VERSION = 'cdh4'
NAME_NODE = 'mr-0xd6'
VERSION = 'hdp2.1'
TRIAL_MAX =... | apache-2.0 |
arjoly/scikit-learn | sklearn/ensemble/tests/test_base.py | 284 | 1328 | """
Testing for the base module (sklearn.ensemble.base).
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
from numpy.testing import assert_equal
from nose.tools import assert_true
from sklearn.utils.testing import assert_raise_message
from sklearn.datasets import load_iris
from sklearn.ensemble import BaggingCla... | bsd-3-clause |
matthew-tucker/mne-python | examples/time_frequency/plot_source_power_spectrum.py | 19 | 1929 | """
=========================================================
Compute power spectrum densities of the sources with dSPM
=========================================================
Returns an STC file containing the PSD (in dB) of each of the sources.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-pariste... | bsd-3-clause |
dnlm92/chokoretto | main/lib/unidecode/x0c4.py | 253 | 5024 | data = (
'sswals', # 0x00
'sswalt', # 0x01
'sswalp', # 0x02
'sswalh', # 0x03
'sswam', # 0x04
'sswab', # 0x05
'sswabs', # 0x06
'sswas', # 0x07
'sswass', # 0x08
'sswang', # 0x09
'sswaj', # 0x0a
'sswac', # 0x0b
'sswak', # 0x0c
'sswat', # 0x0d
'sswap', # 0x0e
'sswah', # 0x0f
... | mit |
eusi/MissionPlanerHM | Lib/robotparser.py | 169 | 7202 | """ robotparser.py
Copyright (C) 2000 Bastian Kleineidam
You can choose between two licenses when using this package:
1) GNU GPLv2
2) PSF license for Python 2.2
The robots.txt Exclusion Protocol is implemented as specified in
http://info.webcrawler.com/mak/projects/robots/norobots-rfc.html
"... | gpl-3.0 |
JVenberg/PokemonGo-Bot-Desktop | pywin/Lib/UserList.py | 327 | 3644 | """A more or less complete user-defined wrapper around list objects."""
import collections
class UserList(collections.MutableSequence):
def __init__(self, initlist=None):
self.data = []
if initlist is not None:
# XXX should this accept an arbitrary sequence?
if type(initlis... | mit |
luoyetx/mxnet | example/nce-loss/wordvec_net.py | 27 | 3396 | # 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 |
minhtuancn/odoo | addons/account/report/account_analytic_entries_report.py | 306 | 3879 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
m1ck/bookadoptions | djangoappengine/tests/decimals.py | 52 | 1373 | from .testmodels import DecimalModel
from django.test import TestCase
from decimal import Decimal, InvalidOperation
D = Decimal
class DecimalTest(TestCase):
DECIMALS = D("12345.6789"), D("5"), D("345.67"), D("45.6"), D("2345.678")
def setUp(self):
for d in self.DECIMALS:
DecimalModel(deci... | bsd-3-clause |
jamesblunt/psutil | psutil/_pslinux.py | 1 | 45271 | # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux platform implementation."""
from __future__ import division
import base64
import errno
import functools
import os
import re
import socket
import... | bsd-3-clause |
sclabs/sccms-nonrel | django/contrib/gis/db/backends/postgis/adapter.py | 311 | 1165 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom):
"Initializes on the geometry."
# Getting the WKB (in string form, to allow easy pickling ... | bsd-3-clause |
rackerlabs/arborlabs_client | solumclient/v1/client.py | 2 | 1494 | # Copyright 2013 - Noorul Islam K M
#
# 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 w... | apache-2.0 |
undoware/neutron-drive | google_appengine/lib/django_1_2/django/db/models/fields/files.py | 44 | 15724 | import datetime
import os
import django.utils.copycompat as copy
from django.conf import settings
from django.db.models.fields import Field
from django.core.files.base import File, ContentFile
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile, get_image_dimensions
fr... | bsd-3-clause |
FNCS/ns-3.24 | src/bridge/bindings/modulegen__gcc_ILP32.py | 30 | 182442 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
mrrrgn/AutobahnPython | autobahn/autobahn/wamp/router.py | 6 | 4865 | ###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... | apache-2.0 |
thepiper/standoff | venv/lib/python2.7/site-packages/setuptools/archive_util.py | 520 | 6609 | """Utilities for extracting common archive formats"""
__all__ = [
"unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter",
"UnrecognizedFormat", "extraction_drivers", "unpack_directory",
]
import zipfile
import tarfile
import os
import shutil
import posixpath
import contextlib
from pkg_resourc... | gpl-3.0 |
adamgilman/tourbillon | tourbillon/streams.py | 1 | 1427 | from datetime import datetime
from threading import Timer
class TourbillonStream(object):
def __init__(self, tb, stream_name):
self.tb = tb
self.r = self.tb.r
self.stream_name = stream_name
self.channel = None
# self.message_queue
self.halt_next = False
self.seconds_delay = 1
def add(self, tick_tuple):... | mit |
saurabh6790/omni-apps | projects/report/daily_time_log_summary/daily_time_log_summary.py | 30 | 2561 | # 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 webnotes
from webnotes.utils import flt
def execute(filters=None):
if not filters:
filters = {}
elif filters.get("to_date"):
filters["t... | agpl-3.0 |
mazaclub/encompass | lib/old_mnemonic.py | 46 | 17317 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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
# (a... | gpl-3.0 |
XertroV/bitcoin-nulldata | src/test/bitcoin-util-test.py | 51 | 1534 | #!/usr/bin/env python
# Copyright 2014 BitPay Inc.
# Copyright 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import os
import bctest... | mit |
cmos3511/cmos_linux | python/op/nop/core/report/report.py | 1 | 5302 | """
Generate report module of OnePiece Platform
Usage:
a) dic :
1. instantiation
2. call method: read_dic
b) json :
1. instantiation
2. call method: read_json
API:
Input: gen_rpt_path
gen_rpt_path: generate report path
Ouput:
1) stdout: show the report o... | gpl-3.0 |
saturday-shi/spark | examples/src/main/python/ml/quantile_discretizer_example.py | 123 | 1707 | #
# 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 |
syaiful6/django | django/contrib/messages/api.py | 512 | 3202 | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
'MessageFailure',
)
class MessageFailure(E... | bsd-3-clause |
pgandhi999/spark | python/pyspark/tests/test_rdd.py | 5 | 31808 | #
# 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 |
fsb4000/electrum-server | backends/libbitcoin/composed.py | 6 | 6977 | import threading
import time
import bitcoin
class ExpiryQueue(threading.Thread):
def __init__(self):
self.lock = threading.Lock()
self.items = []
threading.Thread.__init__(self)
self.daemon = True
def run(self):
# Garbage collection
while True:
wi... | agpl-3.0 |
wilebeast/FireFox-OS | B2G/external/protobuf/python/stubout.py | 671 | 4940 | #!/usr/bin/python2.4
#
# 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 |
jacquerie/inspire-next | tests/unit/hal/test_hal_core_tei.py | 5 | 2080 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | gpl-3.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/idlelib/PyParse.py | 16 | 20461 | import re
import sys
from collections import Mapping
# Reason last stmt is continued (or C_NONE if it's not).
(C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE,
C_STRING_NEXT_LINES, C_BRACKET) = range(5)
if 0: # for throwaway debugging output
def dump(*stuff):
sys.__stdout__.write(" ".join(map(str, stuff)) + "... | gpl-3.0 |
smart-cities/reading_aginova_sensors | scripts/parse_log.py | 1 | 2425 | #!/usr/bin/env python
"""Parse a log file and submit last values
Parse a specified log file looking the most recent data being inserted to the
'NOVA_LASTDATA_T' table and submit this over http. MAX_BYTES is used to
limit the volume of data that is read from the log file into memory.
"""
# beware this is horrible ha... | gpl-2.0 |
kopach/git-cola | extras/build_mo.py | 2 | 3977 | """build_mo command for setup.py"""
from __future__ import absolute_import, division, unicode_literals
import os
import re
from distutils.command.build import build
from distutils.core import Command
from distutils.dep_util import newer
from distutils.spawn import find_executable
from distutils import log
from . imp... | gpl-2.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/google/appengine/ext/mapreduce/output_writers.py | 3 | 53255 | #!/usr/bin/env python
#
# Copyright 2007 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... | mit |
alu042/edx-platform | common/test/acceptance/tests/studio/test_studio_bad_data.py | 173 | 3970 | from base_studio_test import ContainerBase
from ...fixtures.course import XBlockFixtureDesc
from ...pages.studio.utils import verify_ordering
class BadComponentTest(ContainerBase):
"""
Tests that components with bad content do not break the Unit page.
"""
__test__ = False
def get_bad_html_content... | agpl-3.0 |
plotly/plotly.py | packages/python/plotly/plotly/validators/layout/slider/_currentvalue.py | 2 | 1237 | import _plotly_utils.basevalidators
class CurrentvalueValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="currentvalue", parent_name="layout.slider", **kwargs
):
super(CurrentvalueValidator, self).__init__(
plotly_name=plotly_name,
... | mit |
mablae/weblate | weblate/trans/south_migrations/0018_auto__add_field_change_translation.py | 1 | 14751 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
slank/ansible | lib/ansible/utils/module_docs_fragments/return_common.py | 30 | 1590 | # Copyright (c) 2016 Ansible, 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.
#
# Ansi... | gpl-3.0 |
SomethingExplosive/android_external_chromium_org | chrome/test/functional/ap_lab/dlink_ap_configurator.py | 76 | 12111 | # 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 logging
import os
import ap_configurator
import selenium.common.exceptions
class DLinkAPConfigurator(ap_configurator.APConfigurator):
"""Deri... | bsd-3-clause |
Ditmar/plugin.video.pelisalacarta | pelisalacarta/channels/tupornotv.py | 8 | 11296 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para tupornotv
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
import sys
from s... | gpl-3.0 |
RomainBrault/scikit-learn | sklearn/utils/deprecation.py | 36 | 2418 | import warnings
__all__ = ["deprecated", ]
class deprecated(object):
"""Decorator to mark a function or class as deprecated.
Issue a warning when the function is called/the class is instantiated and
adds a warning to the docstring.
The optional extra argument will be appended to the deprecation mes... | bsd-3-clause |
dex2000/openrouteservice | build/tools/exampleparser.py | 111 | 8324 | #!/usr/bin/env python
import sys
import os
import re
import urllib2
import time
from xml.dom.minidom import Document
try:
import xml.etree.ElementTree as ElementTree
except ImportError:
try:
import cElementTree as ElementTree
except ImportError:
try:
import elementtree.Element... | mit |
areski/django | tests/model_inheritance_regress/models.py | 243 | 5863 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
... | bsd-3-clause |
tboyce021/home-assistant | homeassistant/components/qwikswitch/sensor.py | 16 | 2050 | """Support for Qwikswitch Sensors."""
import logging
from pyqwikswitch.qwikswitch import SENSORS
from homeassistant.core import callback
from . import DOMAIN as QWIKSWITCH, QSEntity
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, _, add_entities, discovery_info=None):
"""Add sensor ... | apache-2.0 |
bak1an/django | tests/template_tests/filter_tests/test_length_is.py | 161 | 3192 | from django.template.defaultfilters import length_is
from django.test import SimpleTestCase
from ..utils import setup
class LengthIsTests(SimpleTestCase):
@setup({'length_is01': '{% if some_list|length_is:"4" %}Four{% endif %}'})
def test_length_is01(self):
output = self.engine.render_to_string('len... | bsd-3-clause |
DavidLP/home-assistant | tests/helpers/test_sun.py | 4 | 7758 | """The tests for the Sun helpers."""
# pylint: disable=protected-access
from unittest.mock import patch
from datetime import timedelta, datetime
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
import homeassistant.util.dt as dt_util
import homeassistant.helpers.sun as sun
def test_next_events(has... | apache-2.0 |
alfa-addon/addon | mediaserver/platformcode/html_recaptcha.py | 3 | 3365 | # -*- coding: utf-8 -*-
from core import httptools
from core import scrapertools
from platformcode import platformtools, logger
class recaptcha(object):
def start(self, handler, key, referer):
self.handler = handler
self.referer = referer
self.key = key
self.headers = {'Referer': ... | gpl-3.0 |
googleapis/api-client-staging | generated/python/googleapis-common-protos/google/api/source_info_pb2.py | 1 | 2577 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/api/source_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goog... | bsd-3-clause |
fkolacek/FIT-VUT | bp-revok/python/lib/python2.7/test/test_fpformat.py | 61 | 2316 | '''
Tests for fpformat module
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
import unittest
fpformat = import_module('fpformat', deprecated=True)
fix, sci, NotANumber = fpformat.fix, fpformat.sci, fpformat.NotANumber
StringType = type('')
# Test the old and obsolescent fpformat mo... | apache-2.0 |
INNUENDOWEB/INNUca | src/SPAdes-3.9.0-Linux/share/spades/pyyaml3/serializer.py | 293 | 4165 |
__all__ = ['Serializer', 'SerializerError']
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
class Serializer:
ANCHOR_TEMPLATE = 'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=None, version=None, ta... | gpl-3.0 |
isabellaleehs/isabellaleehs.github.io | projects/webapp1/flask/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | 140 | 17178 | """setuptools.command.bdist_egg
Build .egg distributions"""
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import textwrap
import marshal
from setuptools.extern import six
from pkg_resource... | mit |
GiovanniConserva/TestDeploy | venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## 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... | bsd-3-clause |
watspidererik/testenv | flask/lib/python2.7/site-packages/setuptools/__init__.py | 242 | 5033 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
import setuptools.version
from setuptools.extension import Extension
f... | mit |
Vudentz/zephyr | scripts/west_commands/tests/test_blackmagicprobe.py | 7 | 2564 | # Copyright (c) 2018 Foundries.io
# Copyright (c) 2019 Nordic Semiconductor ASA.
#
# SPDX-License-Identifier: Apache-2.0
import argparse
from unittest.mock import patch, call
import pytest
from runners.blackmagicprobe import BlackMagicProbeRunner
from conftest import RC_KERNEL_ELF, RC_GDB
TEST_GDB_SERIAL = 'test-gd... | apache-2.0 |
geekboxzone/lollipop_external_chromium_org_tools_gyp | test/win/gyptest-link-ordering.py | 225 | 3058 | #!/usr/bin/env python
# Copyright (c) 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.
"""
Make sure the link order of object files is the same between msvs and ninja.
"""
import TestGyp
import sys
if sys.platform == 'win32'... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.