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 |
|---|---|---|---|---|---|
robjordan/unesco_project | unesco/whsites/views.py | 1 | 3453 | from django.views.generic import ListView, DetailView, TemplateView
# from django.views.generic import TemplateView, RedirectView, CreateView
# from django.views.generic import UpdateView, DeleteView
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from django.shortcuts import get_list... | apache-2.0 |
abstract-open-solutions/hr | __unported__/hr_payroll_register/report/report_payroll_register.py | 27 | 17496 | # -*- coding:utf-8 -*-
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
# 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
# it under... | agpl-3.0 |
sdague/home-assistant | homeassistant/components/dexcom/config_flow.py | 9 | 2959 | """Config flow for Dexcom integration."""
from pydexcom import AccountError, Dexcom, SessionError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
from homeassistant.core import callback
from .const import ( # pyl... | apache-2.0 |
kidaa30/spacewalk | backend/server/handlers/config/test/test_template1.py | 9 | 2006 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
guojianli/code-for-blog | 2009/pygame_creeps_game/widgets.py | 12 | 4312 | """ Simplistic "GUI Widgets" for a Pygame screen.
Most widgets receive a 'surface' argument in the constructor.
This is the pygame surface to which the widget will draw
itself when it's draw() method is called.
Unless otherwise specified, all rectangles are pygame.Rect
instances, and all ... | unlicense |
apbard/scipy | scipy/signal/setup.py | 48 | 1302 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from scipy._build_utils import numpy_nodepr_api
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('signal', parent_package, top_path)
conf... | bsd-3-clause |
google/linear-book-scanner | viewer.py | 3 | 30296 | #!/usr/bin/python
#
# Copyright 2011 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 |
pombredanne/rekall | rekall-core/rekall/plugins/overlays/windows/heap.py | 4 | 7439 | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# 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 License, or (at
# your option) any later ver... | gpl-2.0 |
HyczZhu/dtcassandra | drivers/py/cql/cassandra/ttypes.py | 5 | 102163 | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class ConsistencyLev... | apache-2.0 |
driver-pete/driver-pete-python-sandbox | driver_pete_python_sandbox/find_enpoints.py | 1 | 2815 |
from driver_pete_python_sandbox.filter_gps import delta_float_time
from driver_pete_python_sandbox.utilities import distance
from driver_pete_python_sandbox.gmaps import trajectory_point_to_str
class FindEndpoints(object):
def __init__(self, stationary_threshold = (60*60)*5, endpoints_distance = 1000., endpoints... | apache-2.0 |
titienmiami/mmc.repository | plugin.video.SportsDevil/lib/downloader.py | 7 | 2298 | # -*- coding: latin-1 -*-
import common
import urllib
import os.path
import xbmc, xbmcgui
class Downloader(object):
def __init__(self):
self.pDialog = None
def downloadWithJDownloader(self, url, title):
common.runPlugin('plugin://plugin.program.jdownloader/?action=addlink&url=' + url)
... | gpl-2.0 |
rajanandakumar/DIRAC | Core/scripts/dirac-executor.py | 9 | 1643 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-executor
# Author : Adria Casajus
########################################################################
__RCSID__ = "$Id$"
""" This is a script to launch DIRAC executors
"""
import sys
impor... | gpl-3.0 |
erickt/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/admin/validation.py | 108 | 23236 | from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.forms.models import BaseModelForm, BaseModelFormSet, _get_foreign_key
from django.contrib.admin.util import get_fields_from_path, NotRelationField
"""
Does basic ModelA... | apache-2.0 |
pphaneuf/certificate-transparency | python/utilities/dnslookup/dnslookup.py | 11 | 3851 | #!/usr/bin/env python
# Implement DNS inclusion proof checking, see [TBD].
#
# Unfortunately, getting at the SCTs in general is hard in Python, so this
# does not start with an SSL connection, but instead fetches a log entry by
# index and then verifies the proof over DNS.
# You will need to install DNSPython (http:/... | apache-2.0 |
ashhher3/pattern | pattern/web/pdf/lzw.py | 55 | 2787 | #!/usr/bin/env python2
import sys
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
## LZWDecoder
##
class LZWDecoder(object):
debug = 0
def __init__(self, fp):
self.fp = fp
self.buff = 0
self.bpos = 8
self.nbits = 9
self.t... | bsd-3-clause |
jasonseminara/OpenSourceFinal | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## 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... | mit |
m4734/mysql_pio | boost_1_59_0/libs/python/pyste/src/Pyste/VarExporter.py | 54 | 1313 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from Exporter import Exporter
from settings import *
import utils
#====================... | gpl-2.0 |
chrisseto/Still | wdim/server/api/v1/base.py | 1 | 1199 | import json
import tornado.web
CORS_ACCEPT_HEADERS = [
'Range',
'Content-Type',
'Authorization',
'Cache-Control',
'X-Requested-With',
]
CORS_EXPOSE_HEADERS = [
'Range',
'Accept-Ranges',
'Content-Range',
'Content-Length',
'Content-Encoding',
]
class BaseAPIHandler(tornado.we... | mit |
windinthew/audacity | lib-src/lv2/lv2/plugins/eg-fifths.lv2/waflib/Utils.py | 181 | 9106 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,traceback,inspect,re,shutil,datetime,gc
import subprocess
try:
from collections import deque
except ImportError:
class deque(list):
def popleft(self):
... | gpl-2.0 |
XiaodunServerGroup/medicalmooc | lms/djangoapps/analytics/distributions.py | 54 | 5676 | """
Profile Distributions
Aggregate sums for values of fields in students profiles.
For example:
The distribution in a course for gender might look like:
'gender': {
'type': 'EASY_CHOICE',
'data': {
'no_data': 1234,
'm': 5678,
'o': 2134,
'f': 5678
},
'display_names': {
... | agpl-3.0 |
j-carl/ansible | lib/ansible/plugins/connection/paramiko_ssh.py | 9 | 23497 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 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
DOCUMENTATION = """
author: Ansible Core Team
con... | gpl-3.0 |
awkspace/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ssh_setting.py | 24 | 9453 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
piffey/ansible | lib/ansible/modules/network/eos/eos_l2_interface.py | 25 | 10611 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
simonwydooghe/ansible | lib/ansible/plugins/action/ironware.py | 9 | 3723 | #
# (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 |
gram526/VTK | ThirdParty/Twisted/twisted/test/test_formmethod.py | 39 | 3653 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for formmethod module.
"""
from twisted.trial import unittest
from twisted.python import formmethod
class ArgumentTestCase(unittest.TestCase):
def argTest(self, argKlass, testPairs, badValues, *args, **kwargs):
arg... | bsd-3-clause |
codesprinters/twillmanager | twillmanager/async.py | 1 | 3252 | # encoding: utf-8
""" This module contains a class for creating asynchronously responding workers"""
from __future__ import absolute_import
from Queue import Empty
from multiprocessing import Process, Queue
__all__ = ['Worker', 'WorkerProxy']
class WorkerProxy(object):
""" Proxy for controlling worker from ano... | bsd-3-clause |
crosswalk-project/web-testing-service | wts/tests/csp/csp_default-src_cross-origin_script.py | 30 | 3226 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "default-src " + url1 ... | bsd-3-clause |
raycarnes/odoomrp-wip | machine_manager/__openerp__.py | 14 | 1756 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... | agpl-3.0 |
RadioFreeAsia/RDacity | lib-src/lv2/sratom/waflib/Tools/d.py | 278 | 2076 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Utils,Task,Errors
from waflib.TaskGen import taskgen_method,feature,extension
from waflib.Tools import d_scan,d_config
from waflib.Tools.ccroot import link_... | gpl-2.0 |
alekseyev/wheatleycms | docutils/parsers/rst/languages/ja.py | 6 | 3775 | # -*- coding: utf-8 -*-
# $Id: ja.py 6460 2010-10-29 22:18:44Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two file... | bsd-3-clause |
aumayr/beancount-web | src/fava/ext/portfolio_list/__init__.py | 1 | 4353 | """Portfolio list extension for Fava.
This is a simple example of Fava's extension reports system.
"""
import re
from beancount.core.data import Open
from beancount.core.number import Decimal
from beancount.core.number import ZERO
from fava.ext import FavaExtensionBase
from fava.helpers import FavaAPIException
from ... | mit |
jpshort/odoo | addons/resource/faces/utils.py | 433 | 3231 | ############################################################################
# Copyright (C) 2005 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free software; you can redistribute it and/or modify
# ... | agpl-3.0 |
dharmabumstead/ansible | lib/ansible/modules/network/f5/bigip_policy_rule.py | 5 | 27376 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
StefanRijnhart/odoomrp-wip | crm_claim_links/models/crm_claim.py | 31 | 1208 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos (danielcampos@avanzosc.es) Date: 26/08/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | agpl-3.0 |
codeMarble/codeMarble_Web | codeMarble_Web/controller/admin.py | 1 | 5733 | # -*- coding: utf-8 -*-
import os
import sys
import shutil
import zipfile
from flask import request, redirect, session, url_for, render_template, flash
from codeMarble_Web.celeryFile import addProblem
from codeMarble_Web.database import dao
from codeMarble_Web.codeMarble_blueprint import *
from codeMarble_Web.util... | gpl-3.0 |
gfyoung/scipy | scipy/special/tests/test_precompute_utils.py | 25 | 1361 | from __future__ import division, print_function, absolute_import
import numpy as np
import pytest
from scipy.special._testutils import MissingModule, check_version
from scipy.special._mptestutils import mp_assert_allclose
from scipy.special._precompute.utils import lagrange_inversion
try:
import sympy
except Impo... | bsd-3-clause |
ogenstad/ansible-modules-extras | cloud/cloudstack/cs_portforward.py | 22 | 12586 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
Neil741/ryu-master | ryu/tests/unit/ofproto/test_ether.py | 63 | 1101 | # Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | apache-2.0 |
richard-willowit/odoo | addons/resource/tests/common.py | 16 | 2960 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.fields import Datetime
from odoo.tests.common import TransactionCase
class TestResourceCommon(TransactionCase):
def setUp(self):
super(TestResourceCommon, self).setUp()
self.env.user.tz =... | gpl-3.0 |
danlrobertson/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/python/integration.py | 30 | 13137 | import pytest
from _pytest import python
from _pytest import runner
class TestOEJSKITSpecials(object):
def test_funcarg_non_pycollectobj(self, testdir): # rough jstests usage
testdir.makeconftest(
"""
import pytest
def pytest_pycollect_makeitem(collector, name, obj):
... | mpl-2.0 |
hwmaier/esp-idf | components/idf_test/integration_test/TestCaseScript/WiFiStress/SoftAPNSTA.py | 15 | 6804 | import random
import time
import string
import threading
from TCAction import TCActionBase
from NativeLog import NativeLog
from TCAction import PerformanceTCBase
from Utility import Encoding
class STAJAPThread(threading.Thread):
def __init__(self, test_action, port_name, ssid, password, delay1, delay2, change_ma... | apache-2.0 |
rsnakamura/oldape | apetools/watchers/logwatcher.py | 1 | 4683 |
from apetools.baseclass import BaseThreadClass
from apetools.commons.errors import CommandError
from apetools.threads import threads
from apetools.commons.timestamp import TimestampFormat, TimestampFormatEnums
class LogWatcherError(CommandError):
"""
An error to raise if something is wrong with the LogWatche... | apache-2.0 |
mou4e/zirconium | tools/deep_memory_profiler/subcommands/addr.py | 30 | 3007 | # 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.
import logging
import sys
import re
from lib.subcommand import SubCommand
LOGGER = logging.getLogger('dmprof')
class AddrCommand(SubCommand):
def __in... | bsd-3-clause |
sayanchowdhury/fedmsg_meta_fedora_infrastructure | fedmsg_meta_fedora_infrastructure/tests/faf.py | 5 | 3623 | # This file is part of fedmsg.
# Copyright (C) 2015 Red Hat, Inc.
#
# fedmsg 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.1 of the License, or (at your option) any later version.
#... | lgpl-2.1 |
stylemistake/wswhud | wswhud_app.py | 1 | 1876 | #!/usr/bin/python
import sys, time, threading, getopt
import wswhud_proto_pixcode
import wswhud_server
## --------------------------------------------------------------------------
## Initialization
## --------------------------------------------------------------------------
## Default protocol
proto = wswhud_pro... | bsd-2-clause |
autosportlabs/kivy | kivy/uix/switch.py | 16 | 3296 | '''
Switch
======
.. versionadded:: 1.0.7
.. image:: images/switch-on.jpg
:align: right
.. image:: images/switch-off.jpg
:align: right
The :class:`Switch` widget is active or inactive, like a mechanical light
switch. The user can swipe to the left/right to activate/deactivate it::
switch = Switch(activ... | mit |
immerrr/numpy | runtests.py | 25 | 12374 | #!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
Run a debug... | bsd-3-clause |
untitaker/icalendar | src/icalendar/tests/test_unit_cal.py | 1 | 14613 | from datetime import datetime
from datetime import timedelta
from icalendar.tests import unittest
import icalendar
import pytz
class TestCalComponent(unittest.TestCase):
def test_cal_Component(self):
from icalendar.cal import Component, Calendar, Event
from icalendar import prop
# A com... | bsd-2-clause |
LaoZhongGu/kbengine | kbe/src/lib/python/Doc/includes/mp_benchmarks.py | 47 | 5622 | #
# Simple benchmarks for the multiprocessing package
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
import time
import sys
import multiprocessing
import threading
import queue
import gc
if sys.platform == 'win32':
_timer = time.clock
else:
_timer = time.time
delta = 1
#### TEST_QUEUESPEED... | lgpl-3.0 |
ehashman/oh-mainline | vendor/packages/requests/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## 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... | agpl-3.0 |
alfayez/gnuradio | gr-uhd/examples/python/usrp_nbfm_ptt.py | 2 | 17659 | #!/usr/bin/env python
#
# Copyright 2005,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
ocefpaf/python-oceans | oceans/sw_extras/waves.py | 2 | 5105 | import gsw
import numpy as np
class Waves:
r"""
Solves the wave dispersion relationship via Newton-Raphson.
.. math::
\omega^2 = gk\tanh kh
Parameters
----------
h : array_like, str
Water depth [m] or 'deep', 'shallow' as keywords
T : array_like
Wave period [s]
... | bsd-3-clause |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/site-packages/pypm/external/2/sqlalchemy/engine/default.py | 3 | 27128 | # engine/default.py
# Copyright (C) 2005-2011 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
"""Default implementations of per-dialect sqlalchemy.engine classes.
These are semi... | mit |
uberlinuxguy/mprov | mprov/Config.py | 1 | 7035 | """
config.py handles the commandline arguments that are "configurable"
within mprov
"""
import argparse
from utils import print_err
class Config(object):
"""
Parses the command line args for all 3 modes of operation.
and acts as a runtime repo for them.
"""
def print_config(self):
"""
... | gpl-2.0 |
erkanay/django | django/contrib/gis/tests/gis_migrations/test_operations.py | 3 | 3770 | from __future__ import unicode_literals
from django.db import connection, migrations, models
from django.db.migrations.migration import Migration
from django.db.migrations.state import ProjectState
from django.test import skipUnlessDBFeature, TransactionTestCase
if connection.features.gis_enabled:
from django.con... | bsd-3-clause |
armando-migliaccio/neutron | neutron/openstack/common/importutils.py | 128 | 2234 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | apache-2.0 |
tcyb/nextgen4b | nextgen4b/tools/demux.py | 1 | 3208 | import gzip
import logging
import sys
import time
import yaml
from Bio import SeqIO
from ..process.filter import get_coords, load_ngs_file
def demux_by_barcode(yfname, ffname, fsuffix='R1'):
logging.info('Started forward sequence demuxing of '+ffname)
# Load YAML
yf = open(yfname)
expt_yaml = yaml.lo... | mit |
holtgrewe/seqan | misc/seqan_instrumentation/py2exe/dist/classes/simplejson/encoder.py | 25 | 21740 | """Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | bsd-3-clause |
mwbond/utdf | src/utdf/utdf.py | 1 | 3370 | # Matthew Bond
# Comparing and analyzing UTDF sqlite dbs
from decimal import Decimal
# A wrapper for a db query
def query_db(cur, table_name, col_names=None, where=None):
col_names = col_names or ['*']
base_cmd = 'SELECT {} FROM {}'.format(', '.join(col_names), table_name)
if where is not None:
c... | isc |
cloudbau/keystone | keystone/contrib/ec2/routers.py | 8 | 1874 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
tacgomes/morph | morphlib/morphset.py | 3 | 8942 | # Copyright (C) 2013-2015 Codethink Limited
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 |
Southpaw-TACTIC/Team | src/python/Lib/site-packages/PySide/examples/opengl/overpainting.py | 1 | 12272 | #!/usr/bin/env python
############################################################################
##
## Copyright (C) 2006-2006 Trolltech ASA. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## This file may be used under the terms of the GNU General Public
## License version... | epl-1.0 |
fenglu-g/incubator-airflow | tests/hooks/test_oracle_hook.py | 1 | 9797 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
QianBIG/odoo | addons/sale_stock/__init__.py | 376 | 1045 | # -*- 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 |
xdevelsistemas/taiga-back-community | taiga/base/utils/diff.py | 2 | 1805 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | agpl-3.0 |
fna/sheer | sheer/query.py | 2 | 10502 | import os
import codecs
import logging
import json
import flask
import dateutil.parser
from time import mktime, strptime
import datetime
from werkzeug.urls import url_encode
from werkzeug.datastructures import MultiDict
from sheer.decorators import memoized
from sheer.utility import find_in_search_path
from sheer.... | cc0-1.0 |
patrickstocklin/chattR | lib/python2.7/site-packages/django/contrib/admin/models.py | 103 | 3002 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.admin.utils import quote
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.utils.encoding import python_2_unicode_c... | gpl-2.0 |
j-carpentier/nova | nova/tests/unit/compute/test_tracker.py | 6 | 63041 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
camradal/ansible | lib/ansible/modules/windows/win_user.py | 25 | 4530 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Martz <matt@sivel.net>, and others
#
# 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 t... | gpl-3.0 |
amyvmiwei/kbengine | kbe/src/lib/python/Tools/scripts/treesync.py | 52 | 5930 | #! /usr/bin/env python3
"""Script to synchronize two source trees.
Invoke with two arguments:
python treesync.py slave master
The assumption is that "master" contains CVS administration while
slave doesn't. All files in the slave tree that have a CVS/Entries
entry in the master tree are synchronized. This means:
... | lgpl-3.0 |
agoose77/hivesystem | manual/movingpanda/panda-14d.py | 1 | 11053 | import dragonfly
import dragonfly.pandahive
import bee
from bee import connect
import dragonfly.scene.unbound, dragonfly.scene.bound
import dragonfly.std
import dragonfly.io
import dragonfly.canvas
import dragonfly.convert.pull
import dragonfly.logic
import dragonfly.bind
import Spyder
# ## random matrix generator
f... | bsd-2-clause |
osom8979/tbag | external/freetype/src/tools/docmaker/utils.py | 42 | 3513 | #
# utils.py
#
# Auxiliary functions for the `docmaker' tool (library file).
#
# Copyright 2002-2018 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing to use, modify,... | mit |
aselle/tensorflow | tensorflow/python/keras/engine/input_layer.py | 14 | 8433 | # 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
#
# Unless required by applica... | apache-2.0 |
nck0405/MyOwn | models/00_db.py | 7 | 6310 | # -*- coding: utf-8 -*-
"""
Import Modules
Configure the Database
Instantiate Classes
"""
if settings.get_L10n_languages_readonly():
# Make the Language files read-only for improved performance
T.is_writable = False
get_vars = request.get_vars
# Are we running in debug mode?
settings.check_debug... | mit |
rvmoura96/projeto-almoxarifado | myvenv/Lib/site-packages/django/contrib/redirects/migrations/0001_initial.py | 308 | 1561 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
... | mit |
pafiedor/ruby_rhino | networkx/classes/tests/historical_tests.py | 62 | 17725 | #!/usr/bin/env python
"""Original NetworkX graph tests"""
from nose.tools import *
import networkx
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
from networkx.testing import *
class HistoricalTests(object):
def setUp(self):
self.null=nx.null_graph()
self.P1=cn... | gpl-3.0 |
lht142934/vnpy | vn.demo/ctpdemo/eventEngine.py | 140 | 6653 | # encoding: UTF-8
# 系统模块
from Queue import Queue, Empty
from threading import Thread
# 第三方模块
from PyQt4.QtCore import QTimer
# 自己开发的模块
from eventType import *
########################################################################
class EventEngine:
"""
事件驱动引擎
事件驱动引擎中所有的变量都设置为了私有,这是为了防止不小心
从外部修改了... | mit |
pforai/easybuild-framework | easybuild/scripts/generate_software_list.py | 6 | 7133 | #!/usr/bin/env python
##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of the University of Ghent (http://ugent.be/hpc).
#
# http://github.com/hpcugent/easybuild
#
# EasyBuild is free software: you can redistribute it and/or modify
# it under the terms o... | gpl-2.0 |
Batterfii/django | tests/backends/tests.py | 56 | 47386 | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import datetime
import re
import threading
import unittest
import warnings
from decimal import Decimal, Rounded
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color ... | bsd-3-clause |
FreescaleSemiconductor/quantum | quantum/tests/unit/cisco/test_network_plugin.py | 1 | 9182 | # Copyright (c) 2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
wanggang3333/scikit-learn | sklearn/neighbors/nearest_centroid.py | 199 | 7249 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
LockScreen/Backend | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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 |
fasaas/owne-coursera | documentation/Crafting-Quality-Code/Program_Planning/restaurants.py | 2 | 3841 | """
A restaurant recommendation system.
Here are some example dictionaries. These correspond to the information in
restaurants_small.txt.
Restaurant name to rating:
# dict of {str: int}
{'Georgie Porgie': 87,
'Queen St. Cafe': 82,
'Dumplings R Us': 71,
'Mexican Grill': 85,
'Deep Fried Everything': 52}
Price to ... | apache-2.0 |
brandsoulmates/incubator-airflow | airflow/contrib/sensors/emr_job_flow_sensor.py | 45 | 1749 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
gregdek/ansible | lib/ansible/parsing/utils/jsonify.py | 124 | 1233 | # (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 |
Evervolv/android_external_chromium_org | chrome/browser/policy/test/asn1der.py | 76 | 1303 | # Copyright (c) 2011 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.
"""Helper module for ASN.1/DER encoding."""
import binascii
import struct
# Tags as defined by ASN.1.
INTEGER = 2
BIT_STRING = 3
NULL = 5
OBJECT_IDENTI... | bsd-3-clause |
Nikea/scikit-xray-examples | demos/dpc/download.py | 6 | 1433 | import zipfile
import requests
import tempfile
from clint.textui import progress
import os
def download_zip(url, download_path=None):
if download_path is None:
download_path = tempfile.NamedTemporaryFile(suffix='.zip').name
r = requests.get(url, stream=True)
print('Downloading url --> %s\nto --> %s... | bsd-3-clause |
psa-lab/siteinterlock | scripts/proflex_hether.py | 1 | 2083 | # Sebastian Raschka 2016
#
# `siteinterlock` is a Python package for selecting near-native protein-ligand
# docking poses based upon the hypothesis that interfacial rigidification
# of both the protein and ligand prove to be important characteristics of
# the native binding mode and are sensitive to the spatial couplin... | gpl-3.0 |
lightningwolf/lightningwolf-smp | lightningwolf_smp/models/domain_query.py | 1 | 1091 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from lightningwolf_smp.models.domain_base import Domain
from lightningwolf_smp.models.domain_admin import DomainAdmin
filter_display = ['domain_name']
class DomainQuery(object):
def __init__(self, db):
self.db = db
def get_domain(self, domain_id):
... | mit |
dakcarto/QGIS | python/plugins/GdalTools/tools/optionsTable.py | 12 | 2961 | # -*- coding: utf-8 -*-
"""
***************************************************************************
optionsTable.py
---------------------
Date : June 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
***************... | gpl-2.0 |
rwl/PyCIM | CIM14/IEC61970/Wires/Ground.py | 1 | 1631 | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, modify, merge, publish... | mit |
foursquare/pants | src/python/pants/backend/codegen/wire/java/java_wire_library.py | 1 | 2676 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.backend.jvm.targets.jvm_target import JvmTarget
from pants.base.exceptions imp... | apache-2.0 |
dgellis90/nipype | nipype/interfaces/mrtrix/preprocess.py | 10 | 27273 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath,... | bsd-3-clause |
kogotko/carburetor | horizon/test/helpers.py | 1 | 11403 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
ProstoMaxim/incubator-airflow | tests/contrib/operators/test_fs_operator.py | 51 | 1908 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
rishikksh20/scikit-learn | sklearn/neighbors/__init__.py | 71 | 1025 | """
The :mod:`sklearn.neighbors` module implements the k-nearest neighbors
algorithm.
"""
from .ball_tree import BallTree
from .kd_tree import KDTree
from .dist_metrics import DistanceMetric
from .graph import kneighbors_graph, radius_neighbors_graph
from .unsupervised import NearestNeighbors
from .classification impo... | bsd-3-clause |
DARKPOP/external_chromium_org | tools/symsrc/source_index.py | 102 | 8693 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Usage: <win-path-to-pdb.pdb>
This tool will take a PDB on the command line, extract the source files that
were used in building ... | bsd-3-clause |
gundramleifert/exp_tf | models/lp/bdlstm_lp_v6.py | 1 | 13704 | '''
Author: Tobi and Gundram
'''
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import ctc_ops as ctc
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops.rnn import bidirectional_rnn
from util.LoaderUtil import read_image_list, get_list_vals
from random impo... | apache-2.0 |
gnumdk/lollypop | lollypop/pop_next.py | 1 | 5032 | # Copyright (c) 2014-2017 Cedric Bellegarde <cedric.bellegarde@adishatz.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, either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
ant9000/RIOT | dist/tools/suit/gen_key.py | 14 | 1084 | #!/usr/bin/env python3
#
# Copyright (C) 2020 Kaspar Schleiser <kaspar@schleiser.de>
# 2020 Inria
# 2020 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.