code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
"""Support for Reddit."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, CONF_MAXIMUM)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.enti... | MartinHjelmare/home-assistant | homeassistant/components/reddit/sensor.py | Python | apache-2.0 | 4,105 |
from sympy.core.basic import Basic
from sympy.vector.scalar import BaseScalar
from sympy import eye, trigsimp, ImmutableMatrix as Matrix, Symbol
from sympy.core.compatibility import string_types, range
from sympy.core.cache import cacheit
from sympy.vector.orienters import (Orienter, AxisOrienter, BodyOrienter,
... | Curious72/sympy | sympy/vector/coordsysrect.py | Python | bsd-3-clause | 24,903 |
# 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.
"""This module contains the Module class and other classes for resources.
The Module class represents a module in the trace viewer system. A module has
a na... | modulexcite/catapult | tracing/third_party/tvcm/tvcm/module.py | Python | bsd-3-clause | 8,567 |
#!/usr/bin/env python
# -*- coding: ansi_x3.4-1968 -*-
# generated by wxGlade 0.6.3 on Sat Feb 09 13:36:33 2008
import wx
# begin wxGlade: extracode
# end wxGlade
class resampleImageViewFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: resampleImageViewFrame.__init__
kwds["st... | nagyistoce/devide | modules/filters/resources/python/resampleImageViewFrame.py | Python | bsd-3-clause | 2,908 |
"""
Author: Chase Coleman
Filename: test_lqcontrol
Tests for lqcontrol.py file
"""
import sys
import os
import unittest
import numpy as np
from scipy.linalg import LinAlgError
from numpy.testing import assert_allclose
from quantecon.lqcontrol import LQ
class TestLQControl(unittest.TestCase):
def setUp(self):
... | gxxjjj/QuantEcon.py | quantecon/tests/test_lqcontrol.py | Python | bsd-3-clause | 2,299 |
# Author: Travis Oliphant
# 1999 -- 2002
from __future__ import division, print_function, absolute_import
import warnings
import threading
import sys
import timeit
from . import sigtools, dlti
from ._upfirdn import upfirdn, _UpFIRDn, _output_len
from scipy._lib.six import callable
from scipy._lib._version import Num... | bkendzior/scipy | scipy/signal/signaltools.py | Python | bsd-3-clause | 116,017 |
# Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
import os
#Functions for manipulating datetime objects
#CCYY-MM-DDThh:mm:ssZ
def parseDateClass(s):
year, month, day = s.split("-")
day, tail = day[:2], day[2:]
hour, minute, second = tail[1:].split(... | rebolinho/liveit.repository | script.video.F4mProxy/lib/f4mUtils/datefuncs.py | Python | gpl-2.0 | 2,355 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | lonerr/ansible | lib/ansible/runner/action_plugins/script.py | Python | gpl-3.0 | 5,759 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Partner Assignation & Geolocation',
'version': '1.0',
'category': 'Customer Relationship Management',
'description': """
This is the module used by Odoo SA to redirect customers to its partner... | ilexius/odoo | addons/crm_partner_assign/__openerp__.py | Python | gpl-3.0 | 1,392 |
# Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import ... | shsingh/ansible | lib/ansible/cli/__init__.py | Python | gpl-3.0 | 20,952 |
#!/usr/bin/env python
#
# flashpolicyd.py
# Simple socket policy file server for Flash
#
# Usage: flashpolicyd.py [--port=N] --file=FILE
#
# Logs to stderr
# Requires Python 2.5 or later
from __future__ import with_statement
import sys
import optparse
import socket
import thread
import exceptions
import contextlib
V... | clagiordano/weblibs | utility/hMUD-master/flashpolicyd_v0.6/Standalone/flashpolicyd.py | Python | gpl-3.0 | 3,628 |
#!/usr/bin/python
# encoding: utf-8
# (c) 2016, James Hogarth <james.hogarth@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 Li... | mensler/ansible | lib/ansible/modules/web_infrastructure/jenkins_script.py | Python | gpl-3.0 | 6,284 |
#
# (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... | mheap/ansible | lib/ansible/plugins/action/eos.py | Python | gpl-3.0 | 5,886 |
#!/usr/bin/env python3
import time
import signal
import os
import sys
signal.signal(signal.SIGTERM, signal.SIG_IGN)
signal.signal(signal.SIGHUP, signal.SIG_IGN)
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGPIPE, signal.SIG_IGN)
with open(sys.argv[1], "w") as f:
f.write(str(os.getpid()) + ... | 50wu/gpdb | gpMgmt/test/behave/mgmt_utils/steps/data/pid_background_script.py | Python | apache-2.0 | 395 |
import copy
import time
import warnings
from collections import deque
from contextlib import contextmanager
import _thread
import pytz
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import utils
from django.db.bac... | uranusjr/django | django/db/backends/base/base.py | Python | bsd-3-clause | 24,419 |
#! /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
from waflib.Tools import ccroot,ar,gcc
from waflib.Configure import conf
@conf
def find_icc(conf):
if sys.platform=='cygwin':
conf.fatal('The Intel ... | bit-trade-one/SoundModuleAP | lib-src/lv2/sratom/waflib/Tools/icc.py | Python | gpl-2.0 | 890 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.tv
# Git: https://github.com/SiCKRAGETV/SickRage.git
#
# This file is part of SickRage.
#
# SickRage 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... | SerialShadow/SickRage | sickbeard/db.py | Python | gpl-3.0 | 15,583 |
{
'name': 'Website Versioning',
'category': 'Website',
'summary': 'Allow to save all the versions of your website and allow to perform AB testing.',
'version': '1.0',
'description': """
OpenERP Website CMS
===================
""",
'author': 'OpenERP SA',
'depends': ['website','marke... | odoousers2014/odoo | addons/website_version/__openerp__.py | Python | agpl-3.0 | 724 |
# Copyright (c) 2013 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | HybridF5/nova | nova/tests/unit/scheduler/test_scheduler_utils.py | Python | apache-2.0 | 16,922 |
# encoding: utf-8
# Copyright 2015-present The Scikit Flow 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
... | ivano666/tensorflow | tensorflow/examples/skflow/neural_translation.py | Python | apache-2.0 | 4,070 |
import time
import http.server
import os
HOST_NAME = '0.0.0.0' # Host name of the http server
# Gets the port number from $PORT0 environment variable
PORT_NUMBER = int(os.environ['PORT0'])
class MyHandler(http.server.BaseHTTPRequestHandler):
def do_GET(s):
"""Respond to a GET request."""
s.send_... | pradeeppanga/dcos-universe | docs/tutorial/helloworld.py | Python | apache-2.0 | 1,033 |
#!/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.
"""Top level script for running all python unittests in the NaCl SDK.
"""
from __future__ import print_function
import argparse
i... | M4sse/chromium.src | native_client_sdk/src/test_all.py | Python | bsd-3-clause | 3,095 |
# Copyright 2014 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 imp
import os.path
import sys
import unittest
try:
imp.find_module("devtoolslib")
except ImportError:
sys.path.append(os.path.dirname(os.path.dir... | takaaptech/sky_engine | mojo/devtools/common/devtoolslib/apptest_gtest_unittest.py | Python | bsd-3-clause | 2,417 |
#!/usr/bin/env python
#
# Copyright 2004,2005,2007,2010,2012,2013 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 ... | trondeau/gnuradio-old | gr-blocks/python/blocks/qa_stream_mux.py | Python | gpl-3.0 | 6,241 |
# 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 applicable law or agreed to in... | hanlind/nova | nova/conf/configdrive.py | Python | apache-2.0 | 4,097 |
# 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... | paninetworks/neutron | neutron/tests/unit/plugins/ml2/test_extension_driver_api.py | Python | apache-2.0 | 10,552 |
# Copyright 2014 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 memory
from metrics import Metric
class SystemMemoryMetric(Metric):
"""SystemMemoryMetric gathers system memory statistic.
This met... | TeamEOS/external_chromium_org | tools/perf/metrics/system_memory.py | Python | bsd-3-clause | 4,647 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: test_maximal_independent_set.py 577 2011-03-01 06:07:53Z lleeoo $
"""
Tests for maximal (not maximum) independent sets.
"""
# Copyright (C) 2004-2016 by
# Leo Lopes <leo.lopes@monash.edu>
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.ed... | JamesClough/networkx | networkx/algorithms/tests/test_mis.py | Python | bsd-3-clause | 3,517 |
# for localized messages
from . import _
from enigma import *
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.List import List
from Tools.Directories import resolveFilename, SCOPE_CURRENT_PLUGIN
from Tools.LoadPixmap import LoadPixmap
from Components.Button import B... | sklnet/opendroid-enigma2 | lib/python/Plugins/SystemPlugins/DeviceManager/HddSetup.py | Python | gpl-2.0 | 8,530 |
#!/usr/bin/env python
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in ... | JulienMcJay/eclock | windows/Python27/Lib/Cookie.py | Python | gpl-2.0 | 25,844 |
# 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 applicable law or agreed to in... | vishnu-kumar/PeformanceFramework | rally_os/plugins/openstack/scenarios/fuel/environments.py | Python | apache-2.0 | 3,333 |
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
# GDB pretty printers for Boost.Smart Ptr.
#
# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
#
# This file is part of boost-gdb-printers.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms... | jvanz/core | solenv/gdb/boost/smart_ptr.py | Python | gpl-3.0 | 2,423 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class MailRenderMixin(models.AbstractModel):
_inherit = "mail.render.mixin"
@api.model
def _render_template_postprocess(self, rendered):
# super will transform relative... | jeremiahyan/odoo | addons/mass_mailing/models/mail_render_mixin.py | Python | gpl-3.0 | 812 |
"""
This page is in the table of contents.
Winding is a script to set the winding profile for the skeinforge chain.
The displayed craft sequence is the sequence in which the tools craft the model and export the output.
On the winding dialog, clicking the 'Add Profile' button will duplicate the selected profile and gi... | AlexeyKruglov/Skeinforge-fabmetheus | skeinforge_application/skeinforge_plugins/profile_plugins/winding.py | Python | agpl-3.0 | 2,079 |
#!/usr/bin/env python
#
# Copyright 2010 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... | ankit318/appengine-mapreduce | python/test/mapreduce/model_test.py | Python | apache-2.0 | 13,422 |
"""Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/tempfile.py | Python | gpl-2.0 | 14,377 |
#!/usr/bin/env python
"""
Synopsis:
Generate Python classes from XML Schema definition.
Input is read from in_xsd_file or, if "-" (dash) arg, from stdin.
Output is written to files named in "-o" and "-s" options.
Usage:
python generateDS.py [ options ] <xsd_file>
python generateDS.py [ options ] -
O... | JoeHsiao/bioformats | components/xsd-fu/python/generateDS/generateDS.py | Python | gpl-2.0 | 169,830 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <dag@wieers.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 Lice... | sonaht/ansible | lib/ansible/modules/utilities/logic/set_fact.py | Python | gpl-3.0 | 2,883 |
#!/usr/bin/env python
#
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Test xsrf protection.
"""
__author__ = 'mike@emailscrubbed.com (Mike Purtell)'
import json
import re
from viewfinder.backend.base import message
from viewfinder.backend.www.test import service_base_test
class XsrfTestCase(service_base... | 0359xiaodong/viewfinder | backend/www/test/xsrf_test.py | Python | apache-2.0 | 5,189 |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.compat import unicode
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Alias,
Typed,
Set,
NoneSet,
Sequence,
String,
Bool,
MinMax,
Integer
)
from ope... | saukrIppl/seahub | thirdpart/openpyxl-2.3.0-py2.7.egg/openpyxl/drawing/text.py | Python | apache-2.0 | 22,428 |
# -*- test-case-name: twisted -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted: The Framework Of Your Internet.
"""
# Ensure the user is running the version of python we require.
import sys
if not hasattr(sys, "version_info") or sys.version_info < (2,3):
raise Ru... | sorenh/cc | vendor/Twisted-10.0.0/twisted/__init__.py | Python | apache-2.0 | 541 |
import logging
from airflow.configuration import conf
from airflow.executors.base_executor import BaseExecutor
from airflow.executors.local_executor import LocalExecutor
from airflow.executors.celery_executor import CeleryExecutor
from airflow.executors.sequential_executor import SequentialExecutor
from airflow.utils ... | smarden1/airflow | airflow/executors/__init__.py | Python | apache-2.0 | 1,008 |
from wagtail.api.v2.filters import FieldsFilter, OrderingFilter, SearchFilter
from wagtail.api.v2.views import BaseAPIViewSet
from ... import get_image_model
from .serializers import ImageSerializer
class ImagesAPIViewSet(BaseAPIViewSet):
base_serializer_class = ImageSerializer
filter_backends = [FieldsFilte... | nimasmi/wagtail | wagtail/images/api/v2/views.py | Python | bsd-3-clause | 747 |
from __future__ import absolute_import
import itertools
import json
import os
import zipfile
from collections import defaultdict
from six import StringIO
from datetime import datetime
from slyd.projecttemplates import templates
import six
REQUIRED_FILES = {'setup.py', 'scrapy.cfg', 'extractors.json', 'items.json',
... | SouthStar/portia | slyd/slyd/utils/download.py | Python | bsd-3-clause | 10,593 |
# 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... | kobejean/tensorflow | tensorflow/contrib/eager/python/examples/revnet/main.py | Python | apache-2.0 | 9,700 |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | kaffeel/oppia | core/storage/email/gae_models_test.py | Python | apache-2.0 | 1,370 |
#!/usr/bin/env python
# File created on 29 May 2011
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso", "Jose Antonio Navas Molina"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "g... | josenavas/qiime | scripts/count_seqs.py | Python | gpl-2.0 | 3,211 |
#!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
module... | hkariti/ansible | lib/ansible/modules/cloud/amazon/aws_direct_connect_connection.py | Python | gpl-3.0 | 11,836 |
# GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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.1
# of the License, or (at you... | coandco/pywinauto | pywinauto/unittests/test_common_controls.py | Python | lgpl-2.1 | 34,027 |
# -*- 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
... | gilt/incubator-airflow | airflow/operators/check_operator.py | Python | apache-2.0 | 9,424 |
"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited
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... | fahhem/mbed-os | tools/export/kds/__init__.py | Python | apache-2.0 | 1,603 |
import numpy as np
from bokeh.plotting import figure, show, output_file
from bokeh.models import TapTool
xx, yy = np.meshgrid(range(0,101,4), range(0,101,4))
x = xx.flatten()
y = yy.flatten()
N = len(x)
inds = [str(i) for i in np.arange(N)]
radii = np.random.random(size=N)*0.4 + 1.7
colors = [
"#%02x%02x%02x" % (... | percyfal/bokeh | examples/plotting/file/tap.py | Python | bsd-3-clause | 898 |
# Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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... | djrscally/eve-wspace | evewspace/core/management/commands/buildsystemdata.py | Python | gpl-3.0 | 3,314 |
"""General client side utilities.
This module contains utility functions, used primarily by advanced COM
programmers, or other COM modules.
"""
import pythoncom
from win32com.client import Dispatch, _get_good_object_
PyIDispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
def WrapEnum(ob, resultCLSID = None):
... | JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/win32com/client/util.py | Python | gpl-2.0 | 2,965 |
from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_length=50)
... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/gis/tests/relatedapp/models.py | Python | bsd-3-clause | 1,686 |
#!/usr/bin/env python
import datetime
from heapq import nlargest
from operator import itemgetter
import math
import six
from csvkit import CSVKitReader, table
from csvkit.cli import CSVKitUtility
NoneType = type(None)
MAX_UNIQUE = 5
MAX_FREQ = 5
OPERATIONS =('min', 'max', 'sum', 'mean', 'median', 'stdev', 'nulls',... | unpingco/csvkit | csvkit/utilities/csvstat.py | Python | mit | 8,673 |
# sql/expression.py
# Copyright (C) 2005-2016 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
"""Defines the public namespace for SQL expression constructs.
Prior to version 0... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/sqlalchemy/sql/expression.py | Python | mit | 6,301 |
"""
TestCmd.py: a testing framework for commands and scripts.
The TestCmd module provides a framework for portable automated testing of
executable commands and scripts (in any language, not just Python), especially
commands and scripts that require file system interaction.
In addition to running tests and evaluating... | mxrrow/zaicoin | src/deps/boost/tools/build/v2/test/TestCmd.py | Python | mit | 23,923 |
import unittest, sys
from lxml.tests.common_imports import make_doctest, doctest
import lxml.html
from lxml.html import html_parser, XHTML_NAMESPACE
class FrameTest(unittest.TestCase):
def test_parse_fragments_fromstring(self):
parser = lxml.html.HTMLParser(encoding='utf-8', remove_comments=True)
... | lxml/lxml | src/lxml/html/tests/test_frames.py | Python | bsd-3-clause | 1,557 |
"""
Copyright (C) 2010 David Fong and Michael Saunders
LSMR uses an iterative method.
07 Jun 2010: Documentation updated
03 Jun 2010: First release version in Python
David Chin-lung Fong clfong@stanford.edu
Institute for Computational and Mathematical Engineering
Stanford University
Michael Saunders ... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/sparse/linalg/isolve/lsmr.py | Python | mit | 15,126 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | anryko/ansible | lib/ansible/modules/network/vyos/_vyos_lldp_interface.py | Python | gpl-3.0 | 6,588 |
from cookies.resources.helpers import makeDropCookie, setNoCacheAndCORSHeaders
def main(request, response):
"""Respond to `/cookie/drop/secure` by dropping the two cookie set by
`setSecureTestCookies()`"""
headers = setNoCacheAndCORSHeaders(request, response)
# Expire the cookies, and return a JSON-en... | scheib/chromium | third_party/blink/web_tests/external/wpt/cookies/resources/dropSecure.py | Python | bsd-3-clause | 501 |
#!/usr/bin/python
# (c) 2017, 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',
'status': ['preview'],
... | KohlsTechnology/ansible | lib/ansible/modules/monitoring/sensu_handler.py | Python | gpl-3.0 | 9,200 |
import datetime
import time
from django.db.utils import DatabaseError
try:
from django.utils.six.moves import _thread as thread
except ImportError:
from django.utils.six.moves import _dummy_thread as thread
from collections import namedtuple
from contextlib import contextmanager
from django.conf import setti... | mariosky/evo-drawings | venv/lib/python2.7/site-packages/django/db/backends/__init__.py | Python | agpl-3.0 | 47,905 |
from django.contrib import admin
from kitsune.groups.models import GroupProfile
class GroupProfileAdmin(admin.ModelAdmin):
raw_id_fields = ['leaders']
admin.site.register(GroupProfile, GroupProfileAdmin)
| mythmon/kitsune | kitsune/groups/admin.py | Python | bsd-3-clause | 212 |
#!/usr/bin/env python
#
#
# 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
#... | hastef88/andes | modules/andes-core/systests/etc/bin/fail.py | Python | apache-2.0 | 3,242 |
import hashlib
from django.conf import settings
from django.utils import importlib
from django.utils.datastructures import SortedDict
from django.utils.encoding import smart_str
from django.core.exceptions import ImproperlyConfigured
from django.utils.crypto import (
pbkdf2, constant_time_compare, get_random_strin... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/contrib/auth/hashers.py | Python | bsd-3-clause | 14,277 |
# Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 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 requ... | Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/third_party/webdriver/pylib/selenium/webdriver/remote/remote_connection.py | Python | mit | 17,659 |
# Copyright 2017 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... | nburn42/tensorflow | tensorflow/contrib/boosted_trees/examples/boston.py | Python | apache-2.0 | 6,159 |
"""
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... | edmorley/django | django/core/files/locks.py | Python | bsd-3-clause | 3,512 |
# -*- coding: utf-8 -*-
"""tests decoration handling functions that are used by checks"""
from translate.filters import decoration
def test_spacestart():
"""test operation of spacestart()"""
assert decoration.spacestart(" Start") == " "
assert decoration.spacestart(u"\u0020\u00a0Start") == u"\u0020\u0... | bluemini/kuma | vendor/packages/translate/filters/test_decoration.py | Python | mpl-2.0 | 3,921 |
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: GPL-2.0
# -- Additinal options for LaTeX output ----------------------------------
# font config for ascii-art alignment
latex_elements['preamble'] += '''
\\IfFontExistsTF{Noto Sans CJK SC}{
% For CJK ascii-art alignment
\\setmonofont{Noto Sans Mono CJK SC}[Au... | rperier/linux | Documentation/translations/conf.py | Python | gpl-2.0 | 345 |
# Copyright 2014 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 applicable law or ag... | KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/calliope/__init__.py | Python | apache-2.0 | 623 |
import warnings
from django.contrib.localflavor.id.forms import (IDPhoneNumberField,
IDPostCodeField, IDNationalIdentityNumberField, IDLicensePlateField,
IDProvinceSelect, IDLicensePlatePrefixSelect)
from django.test import SimpleTestCase
class IDLocalFlavorTests(SimpleTestCase):
def setUp(self):
... | LethusTI/supportcenter | vendor/django/tests/regressiontests/localflavor/id/tests.py | Python | gpl-3.0 | 7,211 |
"""Tests for the array padding functions.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (assert_array_equal, assert_raises, assert_allclose,
TestCase)
from numpy.lib import pad
class TestConditionalShortcuts(TestCase):
... | jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/numpy/lib/tests/test_arraypad.py | Python | mit | 43,332 |
import cherrypy
from cherrypy.lib import httpauth
def check_auth(users, encrypt=None, realm=None):
"""If an authorization header contains credentials, return True, else False."""
request = cherrypy.serving.request
if 'authorization' in request.headers:
# make sure the provided credentials ... | TRex22/Sick-Beard | cherrypy/lib/auth.py | Python | gpl-3.0 | 3,288 |
# -*- coding: utf-8 -*-
"""
hyper/common/headers
~~~~~~~~~~~~~~~~~~~~~
Contains hyper's structures for storing and working with HTTP headers.
"""
import collections
from hyper.common.util import to_bytestring, to_bytestring_tuple
class HTTPHeaderMap(collections.MutableMapping):
"""
A structure that contains... | paulrouget/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/common/headers.py | Python | mpl-2.0 | 8,888 |
from builtins import str
from builtins import zip
from collections import OrderedDict
import json
import logging
from airflow.utils import AirflowException
from airflow.hooks import PrestoHook, HiveMetastoreHook, MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class HiveSta... | saadatqadri/airflow | airflow/operators/hive_stats_operator.py | Python | apache-2.0 | 6,082 |
"Base Cache class."
from __future__ import unicode_literals
import time
import warnings
from django.core.exceptions import DjangoRuntimeWarning, ImproperlyConfigured
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRun... | Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/cache/backends/base.py | Python | artistic-2.0 | 9,677 |
"""
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import warnings
import numpy as np
from itertools import product
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import coo_matrix
from sklearn import datasets
from sklearn.base import clo... | zaxtax/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting.py | Python | bsd-3-clause | 39,945 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import fields, models
class HrDepartment(models.Model):
_inherit = 'hr.department'
def _compute_expense_to_approve(self):
expense_data = self.env['hr.expense'].read_group([('department_id'... | vileopratama/vitech | src/addons/hr_expense/models/hr_department.py | Python | mit | 735 |
# -*- 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... | diogocs1/comps | web/addons/mrp/wizard/mrp_product_produce.py | Python | apache-2.0 | 6,090 |
#! /usr/bin/env python3
# Module ndiff version 1.7.0
# Released to the public domain 08-Dec-2000,
# by Tim Peters (tim.one@home.com).
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
# ndiff.py is now simply a front-end to the difflib.ndiff() function.
# Originally, it contained the difflib.S... | dya2/python-for-android | python3-alpha/python3-src/Tools/scripts/ndiff.py | Python | apache-2.0 | 3,825 |
# -*- test-case-name: twisted.test.test_ftp -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An FTP protocol implementation
@author: Itamar Shtull-Trauring
@author: Jp Calderone
@author: Andrew Bennetts
"""
# System Imports
import os
import time
import re
import operator
impo... | eunchong/build | third_party/twisted_10_2/twisted/protocols/ftp.py | Python | bsd-3-clause | 93,283 |
# formatting.py
# Sphinx extension providing formatting for Gallium-specific data
# (c) Corbin Simpson 2010
# Public domain to the extent permitted; contact author for special licensing
import docutils.nodes
import sphinx.addnodes
def parse_envvar(env, sig, signode):
envvar, t, default = sig.split(" ", 2)
env... | execunix/vinos | xsrc/external/mit/MesaLib/dist/src/gallium/docs/source/exts/formatting.py | Python | apache-2.0 | 1,120 |
'''
Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com>
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,
merg... | albert-chin/yowsup | yowsup/common/http/httpproxy.py | Python | gpl-3.0 | 3,283 |
# Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | samueldotj/TeeRISC-Simulator | tests/configs/simple-atomic-dummychecker.py | Python | bsd-3-clause | 2,321 |
"""Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
from collections import deque
# No... | Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86 | usr/pkg/lib/python2.7/threading.py | Python | mit | 32,720 |
import pass_pipeline as ppipe
import passes as p
def simplifycfg_silcombine_passlist():
return ppipe.PassList([
p.SimplifyCFG,
p.SILCombine,
p.SimplifyCFG,
])
def highlevel_loopopt_passlist():
return ppipe.PassList([
p.LowerAggregateInstrs,
p.SILCombine,
... | apple/swift | utils/pass-pipeline/src/pass_pipeline_library.py | Python | apache-2.0 | 2,942 |
"""
View endpoints for Survey
"""
import logging
import json
from django.contrib.auth.decorators import login_required
from django.http import (
HttpResponse, HttpResponseRedirect, HttpResponseNotFound
)
from django.core.urlresolvers import reverse
from django.views.decorators.http import require_POST
from django... | xingyepei/edx-platform | lms/djangoapps/survey/views.py | Python | agpl-3.0 | 4,127 |
#
# genxmlif, Release 0.9.0
# file: __init__.py
#
# genxmlif package file
#
# history:
# 2005-04-25 rl created
#
# Copyright (c) 2005-2008 by Roland Leuthe. All rights reserved.
#
# --------------------------------------------------------------------
# The generic XML interface is
#
# Copyright (c) 200... | Gussy/mavlink | pymavlink/generator/lib/genxmlif/__init__.py | Python | lgpl-3.0 | 3,040 |
from __future__ import unicode_literals
from django.db.models.query_utils import DeferredAttribute, InvalidQuery
from django.test import TestCase
from .models import (
BigChild, Child, ChildProxy, Primary, RefreshPrimaryProxy, Secondary,
)
class AssertionMixin(object):
def assert_delayed(self, obj, num):
... | DONIKAN/django | tests/defer/tests.py | Python | bsd-3-clause | 11,262 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('migrations', '0002_second'),
]
operations = [
migrations.CreateModel(
name='ModelWithCustomBase',
fi... | kisna72/django | tests/migrations/test_migrations_no_changes/0003_third.py | Python | bsd-3-clause | 960 |
#!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | dstockwell/catapult | tracing/third_party/closure_linter/closure_linter/fixjsstyle_test.py | Python | bsd-3-clause | 7,371 |
"""
Public exercise API.
"""
from twisted.protocols import amp
from txampext.errors import Error
class UnknownExercise(Error):
"""The exercise was not recognized.
"""
class GetExercises(amp.Command):
"""
Gets the identifiers and titles of some exercises.
"""
arguments = [
(b"solved... | crypto101/clarent | clarent/exercise.py | Python | isc | 1,105 |
from flask import Flask
from flask_cqlalchemy import CQLAlchemy
app = Flask(__name__)
app.config['CASSANDRA_HOSTS'] = ['127.0.0.1']
app.config['CASSANDRA_KEYSPACE'] = "cqlengine"
app.config['CASSANDRA_SETUP_KWARGS'] = {'protocol_version': 3}
db = CQLAlchemy(app)
class Address(db.UserType):
street = db.columns.T... | thegeorgeous/flask-cqlalchemy | examples/example_app_udt.py | Python | isc | 509 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ignorance documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... | snark/ignorance | docs/conf.py | Python | isc | 8,405 |
# Copyright (C) 2013-2020 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ... | isc-projects/forge | tests/softwaresupport/bind9_server/bind_configs.py | Python | isc | 54,716 |
INSTALL_PATH = '/home/fred/workspace/grafeo/'
| fredmorcos/attic | projects/grafeo/attic/grafeo_20100227_python/grafeo/config/Config.py | Python | isc | 46 |
drunkenDoodling = {
'ghost': "Salt and iron, and don't forget to burn the corpse",
'wendigo': 'Burn it to death',
'phoenix': 'Use the colt',
'angel': 'Use the angelic blade',
'werewolf': 'Silver knife or bullet to the heart',
'shapeshifter': 'Silver knife or bullet to the heart',
'rugaru': '... | the-zebulan/CodeWars | katas/kyu_7/supernatural.py | Python | mit | 1,003 |