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 |
|---|---|---|---|---|---|
ArneBab/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/plat-mac/lib-scriptpackages/CodeWarrior/Required.py | 81 | 1664 | """Suite Required: Terms that every application should support
Level 1, version 1
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'reqd'
from StdSu... | mit |
mixedpuppy/offlineimap | setup.py | 16 | 1493 | #!/usr/bin/env python
# $Id: setup.py,v 1.1 2002/06/21 18:10:49 jgoerzen Exp $
# IMAP synchronization
# Module: installer
# COPYRIGHT #
# Copyright (C) 2002 - 2006 John Goerzen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-2.0 |
izapolsk/integration_tests | cfme/tests/infrastructure/test_host_drift_analysis.py | 1 | 4959 | import pytest
from cfme import test_requirements
from cfme.common.host_views import HostDriftAnalysis
from cfme.infrastructure.host import Host
from cfme.infrastructure.provider import InfraProvider
from cfme.utils import testgen
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.blockers ... | gpl-2.0 |
Semanticle/Semanticle | sm-mt-devel/src/metabulate/tests/test26case-004d.py | 1 | 18359 | '''
Copyright 2009, 2010 Anthony John Machin. All rights reserved.
Supplied subject to The GNU General Public License v3.0
Created on 28 Jan 2009
Last Updated on 10 July 2010
As test20 with tests of:
rules instantiation and query inference
Related:
single dict TS recursion rule plus generic rule + minimal da... | gpl-2.0 |
40223119/2015cda | static/Brython3.1.1-20150328-091302/Lib/codecs.py | 739 | 35436 | """ codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import builtins, sys
### Registry and builtin stateless codec functions
try:
from _codecs import *
except ImportError as why:
raise SystemErro... | gpl-3.0 |
boada/vpCluster | data/boada/may_2012/analysis/c260p61+32p13/stack_dithers.py | 6 | 2253 | import pyfits as pyf
from glob import glob
import os
from astLib.astStats import clippedMedianStdev
from numpy import average, delete
import numpy as np
def skySubtract(data):
sums = [sum(data[i, :]) for i in range(data.shape[0])]
med = clippedMedianStdev(sums)
med = med['clippedMedian']
skyfibers = ... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/win32com/makegw/makegw.py | 18 | 16995 | """Utility functions for writing out gateway C++ files
This module will generate a C++/Python binding for a specific COM
interface.
At this stage, no command line interface exists. You must start Python,
import this module, change to the directory where the generated code should
be written, and run the... | gpl-3.0 |
Microsoft/PTVS | Python/Templates/Django/ProjectTemplates/Python/Web/DjangoProject/settings.py | 4 | 3444 | """
Django settings for $safeprojectname$ project.
Based on by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
imp... | apache-2.0 |
cypod/arsenalsuite | cpp/lib/PyQt4/examples/dialogs/findfiles.py | 20 | 7982 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | gpl-2.0 |
gadybadger/mixpanel-celery | mixpanel/conf/settings.py | 1 | 2592 | """Default configuration values and documentation"""
from django.conf import settings
"""
.. data:: MIXPANEL_API_TOKEN
API token for your Mixpanel account. This configures the Mixpanel account
where all of the action will be.
You can find this on the ``API Information`` tab on your
`mixpanel account... | bsd-3-clause |
gsehub/edx-platform | common/djangoapps/student/tests/test_reset_password.py | 8 | 17950 | """
Test the various password reset flows
"""
import json
import re
import unittest
import ddt
from django.conf import settings
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_token_generator
from django.core.ca... | agpl-3.0 |
mxamin/youtube-dl | youtube_dl/extractor/fivemin.py | 79 | 1917 | from __future__ import unicode_literals
from .common import InfoExtractor
class FiveMinIE(InfoExtractor):
IE_NAME = '5min'
_VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)'
_TESTS = [
{
... | unlicense |
thomasrogers03/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/xml.py | 187 | 2044 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
Maksimall89/houmpack | lcdmy.py | 1 | 4270 | #!/usr/bin/python
# --------------------------------------
# ___ ___ _ ____
# / _ \/ _ \(_) __/__ __ __
# / , _/ ___/ /\ \/ _ \/ // /
# /_/|_/_/ /_/___/ .__/\_, /
# /_/ /___/
#
# lcd_16x2.py
# 20x4 LCD Test Script with
# backlight control and text justification
#
# Author : Matt Hawkins
# ... | gpl-3.0 |
talbrecht/pism_pik06 | doc/site-packages/sphinxcontrib/bibtex/latex_codec.py | 2 | 36564 | # -*- coding: utf-8 -*-
"""
Character translation utilities for LaTeX-formatted text
========================================================
Usage:
- unicode(string,'latex')
- ustring.decode('latex')
are both available just by letting "import latex" find this file.
- unicode(string,'latex+latin1')
- ustring.decod... | gpl-3.0 |
CameronLonsdale/sec-tools | python2/lib/python2.7/site-packages/pip/_vendor/html5lib/_trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | mit |
unseenlaser/python-for-android | python3-alpha/python3-src/Tools/gdb/libpython.py | 88 | 56224 | #!/usr/bin/python
'''
From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
to be extended with Python code e.g. for library-specific data visualizations,
such as for the C++ STL types. Documentation on this API can be seen at:
http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html
... | apache-2.0 |
CasparLi/calibre | src/calibre/ebooks/textile/functions.py | 14 | 39331 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
PyTextile
A Humane Web Text Generator
"""
# Last upstream version basis
# __version__ = '2.1.4'
#__date__ = '2009/12/04'
__copyright__ = """
Copyright (c) 2011, Leigh Parry <leighparry@blueyonder.co.uk>
Copyright (c) 2011, John Schember <john@nachtimwald.com>
Copyr... | gpl-3.0 |
kaichogami/scikit-learn | sklearn/utils/multiclass.py | 40 | 12966 |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... | bsd-3-clause |
h2oai/h2o | py/testdir_single_jvm/test_GLM2_gaussian_rand2.py | 9 | 1837 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_import as h2i
def define_params():
paramDict = {
'standardize': [None, 0,1],
'beta_epsilon': [None, 0.0001],
'ignored_cols': [None, 0, 1, 15, 33, 34],
'family': ['gaussian']... | apache-2.0 |
ONEcampaign/humanitarian-data-service | displacement_tracker_data.py | 1 | 27157 | import requests
import pandas as pd
import os.path
import resources.constants
import json
from pandas.io.json import json_normalize
from utils.data_utils import get_ordinal_number
"""
This script aggregates data from multiple endpoints and returns a single .json file containing all data
used in the displacement tracke... | mit |
anthonyalmarza/trex | tests/test_pipelining.py | 1 | 4322 | # import sys
from twisted.trial import unittest
from twisted.internet import defer
# from twisted.python import log
import trex
from trex import redis
from .mixins import REDIS_HOST, REDIS_PORT
# log.startLogging(sys.stdout)
class InspectableTransport(object):
def __init__(self, transport):
self.orig... | mit |
adedayo/intellij-community | python/lib/Lib/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py | 71 | 8207 | import os
import sys
import shutil
from optparse import make_option
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.core.management.base import CommandError, NoArgsCommand
from django.contrib.staticfiles import finders
class Command(NoArgsCommand):
"""
Com... | apache-2.0 |
ganeshgore/myremolab | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment/experiment16/server_config.py | 242 | 1525 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... | bsd-2-clause |
stshine/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/py.py | 817 | 1763 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError("All keys m... | mpl-2.0 |
rhertzog/django | django/contrib/admin/models.py | 72 | 5618 | from __future__ import unicode_literals
import json
from django.conf import settings
from django.contrib.admin.utils import quote
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.urls import NoReverseMatch, reverse
from django.utils import timezone
from django.utils.... | bsd-3-clause |
silenceli/nova | nova/objects/network.py | 6 | 10160 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
paulsmith/geodjango | django/contrib/localflavor/jp/jp_prefectures.py | 543 | 2089 | from django.utils.translation import ugettext_lazy
JP_PREFECTURES = (
('hokkaido', ugettext_lazy('Hokkaido'),),
('aomori', ugettext_lazy('Aomori'),),
('iwate', ugettext_lazy('Iwate'),),
('miyagi', ugettext_lazy('Miyagi'),),
('akita', ugettext_lazy('Akita'),),
('yamagata', ugettext_lazy('Yamagat... | bsd-3-clause |
MCGarvey/django-calaccess-raw-data | calaccess_raw/models/campaign.py | 15 | 138941 | from __future__ import unicode_literals
from calaccess_raw import fields
from django.utils.encoding import python_2_unicode_compatible
from .base import CalAccessBaseModel
@python_2_unicode_compatible
class CvrSoCd(CalAccessBaseModel):
"""
Cover page for a statement of organization creation or termination
... | mit |
QijunPan/ansible | lib/ansible/modules/system/osx_defaults.py | 25 | 14472 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, GeekChimp - Franck Nijhof <franck@geekchimp.com>
#
# 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 you... | gpl-3.0 |
sam17/room-of-requirement | alexa_skill/alexa_dumbledore_skill.py | 1 | 3214 | import logging
import json
from flask_ask import Ask,request,session, question, statement
from flask import Flask
import requests
import datetime
SERVER_IP = "http://ec2-52-221-204-189.ap-southeast-1.compute.amazonaws.com:3000/"
THIS = "Saturn"
app = Flask(__name__)
ask = Ask(app, "/")
logging.getLogger('flask_ask').... | mit |
alrusdi/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/views/tests/debug.py | 50 | 6467 | import inspect
import sys
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import reverse
from django.template import TemplateSyntaxError
from django.views.debug import ExceptionReporter
from r... | gpl-3.0 |
GcsSloop/PythonNote | PythonCode/Python入门/函数/定义可变参数.py | 1 | 1027 | #coding=utf-8
#author: sloop
'''
ÈÎÎñ
Çë±àд½ÓÊܿɱä²ÎÊýµÄ average() º¯Êý¡£
'''
#´úÂë
def average(*args):
s = sum(args)*1.0 #ºÍ
l = len(args) #¸öÊý
return 0.0 if l==0 else s/l #ƽ¾ùÖµ
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
'''
def average(*args):
retur... | apache-2.0 |
Bostonncity/omaha | installers/tagged_installer.py | 65 | 3236 | #!/usr/bin/python2.4
# Copyright 2009-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 la... | apache-2.0 |
batxes/4Cin | SHH_INV_models/SHH_INV_models_final_output_0.2_-0.1_10000/mtx1_models/SHH_INV_models752.py | 4 | 17573 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
WielderOfMjoelnir/pypeira | pypeira/core/time.py | 1 | 1497 | # This might no have any use anymore, as the HDU objects is the new thing.
# Possibly changed it a bit to a time converter instead of getter I suppose.
def hdu_get_time(hdu, time_format='bmjd'):
"""
Will be used as a key function for the list.sort() or sorted() functions.
Example,
hdus.sort(key=h... | mit |
Ritiek/Spotify-Downloader | spotdl/encode/encoders/ffmpeg.py | 1 | 5171 | import subprocess
import os
from spotdl.encode import EncoderBase
from spotdl.encode.exceptions import EncoderNotFoundError
from spotdl.encode.exceptions import FFmpegNotFoundError
import logging
logger = logging.getLogger(__name__)
# Key: from format
# Subkey: to format
RULES = {
"m4a": {
"mp3": "-code... | mit |
ClusterLabs/pcs | pcs_test/tools/command_env/config_http_files.py | 3 | 4688 | import base64
import json
from pcs_test.tools.command_env.mock_node_communicator import (
place_multinode_call,
)
class FilesShortcuts:
def __init__(self, calls):
self.__calls = calls
def put_files(
self,
node_labels=None,
pcmk_authkey=None,
corosync_authkey=None,... | gpl-2.0 |
mdavid/pledgeservice | testlib/setuptools/command/test.py | 113 | 6526 | import unittest
from unittest import TestLoader
from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import (resource_listdir, resource_exists,
normalize_path, working_set, _namespace_packages, add_activation_listener,
require, EntryPoint)
from setupto... | agpl-3.0 |
hfeeki/transifex | transifex/projects/search_indexes.py | 1 | 1115 | import datetime
from haystack.indexes import *
from haystack import site
from transifex.projects.models import Project
class ProjectIndex(RealTimeSearchIndex):
text = CharField(document=True, use_template=True)
slug = CharField(model_attr='slug', null=False)
name = CharField(model_attr='name', null... | gpl-2.0 |
MiltosD/CEF-ELRC | lib/python2.7/site-packages/django/contrib/auth/tests/models.py | 318 | 1493 | from django.conf import settings
from django.test import TestCase
from django.contrib.auth.models import User, SiteProfileNotAvailable
class ProfileTestCase(TestCase):
fixtures = ['authtestdata.json']
def setUp(self):
"""Backs up the AUTH_PROFILE_MODULE"""
self.old_AUTH_PROFILE_MODULE = getattr... | bsd-3-clause |
GheRivero/ansible | lib/ansible/modules/storage/netapp/netapp_e_hostgroup.py | 45 | 13964 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, NetApp, 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',
'sta... | gpl-3.0 |
fxtentacle/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bug.py | 125 | 5394 | # Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... | bsd-3-clause |
wireservice/agate | agate/csv_py3.py | 1 | 4555 | #!/usr/bin/env python
"""
This module contains the Python 3 replacement for :mod:`csv`.
"""
import csv
import six
from agate.exceptions import FieldSizeLimitError
POSSIBLE_DELIMITERS = [',', '\t', ';', ' ', ':', '|']
class Reader(six.Iterator):
"""
A wrapper around Python 3's builtin :func:`csv.reader`.
... | mit |
atpy/atpy | atpy/fitstable.py | 1 | 11686 | from __future__ import print_function, division
import os
import numpy as np
from astropy.io import fits
from .exceptions import TableException
from .helpers import smart_dtype, smart_mask
from .decorators import auto_download_to_file, auto_fileobj_to_file
standard_keys = ['XTENSION', 'NAXIS', 'NAXIS1', 'NAXIS2', ... | mit |
Kraxi/YTplaylist | venv/Lib/site-packages/pip/commands/install.py | 187 | 14659 | from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
try:
import wheel
except ImportError:
wheel = None
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip.locations import virtualenv_no_global, dis... | gpl-2.0 |
loulich/Couchpotato | libs/pyutil/test/deprecated/test_picklesaver.py | 106 | 1340 | #!/usr/bin/env python
# Copyright (c) 2002 Luke 'Artimage' Nelson
# Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import os
try:
from twisted.trial import unittest
except ImportError, le:
print "Skipping %s since it requires Twisted and Twist... | gpl-3.0 |
skriticos/ac | src/AniChou/myanimelist.py | 1 | 14742 | # =========================================================================== #
# Name: myanimelist.py
# Purpose: Provide an interface to anime data; syncronize with the MyAnimeList
# server;
#
# Copyright (c) 2008 Gareth Latty
# Copyright (c) 2009 Sebastian Bartos
# Copyright (c) 2009 Daniel Anderson - dan... | gpl-3.0 |
rschnapka/bank-payment | account_direct_debit/model/account_invoice.py | 1 | 5845 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# All Rights Reserved
#
# This program is free software: you can redistrib... | agpl-3.0 |
gautam1858/tensorflow | tensorflow/contrib/framework/python/ops/ops_test.py | 118 | 2882 | # 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... | apache-2.0 |
edcast-inc/edx-platform-edcast | common/djangoapps/monitoring/signals.py | 172 | 4584 | """
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... | agpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GL/INTEL/map_texture.py | 9 | 1716 | '''OpenGL extension INTEL.map_texture
This module customises the behaviour of the
OpenGL.raw.GL.INTEL.map_texture to provide a more
Python-friendly API
Overview (from the spec)
Systems with integrated GPUs can share the same physical memory between CPU
and GPU. This feature, if exposed by API, can bring significa... | gpl-3.0 |
analyseuc3m/ANALYSE-v1 | lms/djangoapps/mobile_api/course_info/views.py | 3 | 3753 | """
Views for course info API
"""
from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response
from courseware.courses import get_course_info_section_module
from static_replace import make_static_urls_absolute
from openedx.core.lib.xblock_utils import get_course_upda... | agpl-3.0 |
xianggong/m2c_unit_test | test/math/native_sin_float8/compile.py | 1861 | 4430 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... | gpl-2.0 |
pankajnits/vyked | vyked/registry_client.py | 2 | 6600 | import asyncio
import logging
import random
from collections import defaultdict
from again.utils import unique_hex
from functools import partial
from retrial.retrial import retry
from .packet import ControlPacket
from .protocol_factory import get_vyked_protocol
from .pinger import TCPPinger
def _retry_for_result(res... | mit |
liang42hao/bokeh | bokeh/transforms/image_downsample.py | 43 | 2158 | from __future__ import absolute_import
import numpy as np
from ..models import ServerDataSource
try:
import scipy
import scipy.misc
except ImportError as e:
print(e)
def source(**kwargs):
kwargs['transform'] = {'resample':'heatmap',
'global_x_range' : [0, 10],
... | bsd-3-clause |
serverdensity/sd-agent-core-plugins | kafka/test_kafka.py | 1 | 4269 | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import threading
import time
from types import ListType
import unittest
import os
import mock
# 3p
from nose.plugins.attrib import attr
# project
from aggregator import MetricsAggregator
import logging
... | bsd-3-clause |
Tong-Chen/scikit-learn | sklearn/tests/test_cross_validation.py | 4 | 30858 | """Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing im... | bsd-3-clause |
0-wiz-0/bgfx | 3rdparty/scintilla/scripts/GenerateCaseConvert.py | 71 | 4580 | # Script to generate CaseConvert.cxx from Python's Unicode data
# Should be run rarely when a Python with a new version of Unicode data is available.
# Requires Python 3.3 or later
# Should not be run with old versions of Python.
# Current best approach divides case conversions into two cases:
# simple symmetric and ... | bsd-2-clause |
sfluo/Mr.Bot | crypto/pycrypto-2.6/lib/Crypto/Cipher/blockalgo.py | 133 | 12596 | # -*- coding: utf-8 -*-
#
# Cipher/blockalgo.py
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# ... | bsd-3-clause |
cybertk/mffr | chromium_tools/mffr.py | 1 | 6105 | #!/usr/bin/env python
# Copyright (c) 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.
"""Usage: mffr.py [-d] [-g *.h] [-g *.cc] REGEXP REPLACEMENT
This tool performs a fast find-and-replace operation on files in
the ... | bsd-3-clause |
gmt/portage | pym/portage/tests/sync/test_sync_local.py | 2 | 7630 | # Copyright 2014-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import subprocess
import sys
import textwrap
import time
import portage
from portage import os, shutil, _shell_quote
from portage import _unicode_decode
from portage.const import PORTAGE_PYM_PATH, TIMESTAMP_FORM... | gpl-2.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.2/django/contrib/webdesign/lorem_ipsum.py | 439 | 4872 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo con... | apache-2.0 |
alangwansui/mtl_ordercenter | openerp/addons/base/ir/osv_memory_autovacuum.py | 447 | 1450 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
gminds/rapidnewsng | django/contrib/gis/tests/test_geoforms.py | 110 | 3800 | from django.forms import ValidationError
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
from django.utils import unittest
if HAS_SPATIALREFSYS:
from django.contrib.gis import forms
from django.contrib.gis.geos import GEOSGeometry
@unittest.skipUnless... | bsd-3-clause |
svn2github/django | django/contrib/gis/geos/mutable_list.py | 405 | 10386 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Released under the New BSD license.
"""
This module contains a base type which provides list-style mutations
without specific data storage methods.
See also http://www.aryehleib.com/MutableLists.html
Author: Aryeh Leib Taurog.
"""
class ListMixin(obj... | bsd-3-clause |
xfire/pydzen | pydzen.py | 1 | 11601 | #!/usr/bin/env python
#
# Copyright (C) 2008 Rico Schiekel (fire at downgra dot de)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any l... | gpl-2.0 |
ahoyosid/scikit-learn | examples/applications/plot_stock_market.py | 227 | 8284 | """
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | bsd-3-clause |
a13m/ansible | lib/ansible/runner/lookup_plugins/items.py | 166 | 1405 | # (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... | gpl-3.0 |
vishnugonela/boto | boto/pyami/config.py | 95 | 8016 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Chris Moyer http://coredumped.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, incl... | mit |
hamzehd/edx-platform | common/test/acceptance/fixtures/xqueue.py | 206 | 1402 | """
Fixture to configure XQueue response.
"""
import requests
import json
from . import XQUEUE_STUB_URL
class XQueueResponseFixtureError(Exception):
"""
Error occurred while configuring the stub XQueue.
"""
pass
class XQueueResponseFixture(object):
"""
Configure the XQueue stub's response t... | agpl-3.0 |
eRestin/MezzGIS | mezzanine/forms/tests.py | 6 | 1157 | from __future__ import unicode_literals
from django.test import TestCase
from mezzanine.core.models import CONTENT_STATUS_PUBLISHED
from mezzanine.forms import fields
from mezzanine.forms.models import Form
class TestsForm(TestCase):
def test_forms(self):
"""
Simple 200 status check against ren... | bsd-2-clause |
hashems/Mobile-Cloud-Development-Projects | appengine/flexible/endpoints/main.py | 10 | 2861 | # Copyright 2016 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 a... | apache-2.0 |
joerocklin/gem5 | src/cpu/o3/O3CPU.py | 4 | 6894 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
Distrotech/mozjs | js/src/python/mock-1.0.0/tests/testmock.py | 108 | 42396 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from tests.support import (
callable, unittest2, inPy3k, is_instance, next
)
import copy
import pickle
import sys
import mock
from mock import (
call, DEFAULT, pat... | mpl-2.0 |
A-deLuna/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/optionaltags.py | 1727 | 10500 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2... | mpl-2.0 |
aronsky/home-assistant | homeassistant/components/switch/vultr.py | 7 | 3608 | """
Support for interacting with Vultr subscriptions.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.vultr/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_NA... | apache-2.0 |
mattcaldwell/boto | boto/ec2/autoscale/request.py | 68 | 1549 | # Copyright (c) 2009 Reza Lotun http://reza.lotun.name/
#
# 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, ... | mit |
playm2mboy/edx-platform | lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py | 120 | 8430 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Optout.course_id'
db.alter_column('bulk_email_optout', 'course_id', self.gf('xmodule_djan... | agpl-3.0 |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/python/compat.py | 22 | 11514 | # -*- test-case-name: twisted.test.test_compat -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Compatibility module to provide backwards compatibility for useful Python
features.
This is mainly for use of internal Twisted code. We encourage you to use
the latest version of Python di... | gpl-3.0 |
Architektor/PySnip | venv/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py | 149 | 18680 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib... | gpl-3.0 |
mtconley/turntable | test/lib/python2.7/site-packages/numpy/doc/constants.py | 172 | 8954 | """
=========
Constants
=========
Numpy includes several constants:
%(constant_list)s
"""
#
# Note: the docstring is autogenerated.
#
from __future__ import division, absolute_import, print_function
import textwrap, re
# Maintain same format as in numpy.add_newdocs
constants = []
def add_newdoc(module, name, doc):
... | mit |
gcblue/gcblue | bin/Lib/test/test_dictcomps.py | 93 | 3849 | import unittest
from test import test_support as support
# For scope testing.
g = "Global variable"
class DictComprehensionTest(unittest.TestCase):
def test_basics(self):
expected = {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17,
8: 18, 9: 19}
actual = {k: k + 10 fo... | bsd-3-clause |
sander76/home-assistant | homeassistant/components/sisyphus/media_player.py | 9 | 6557 | """Support for track controls on the Sisyphus Kinetic Art Table."""
import aiohttp
from sisyphus_control import Track
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_PLAY,
SUPPORT_PR... | apache-2.0 |
kamyu104/django | tests/signals/tests.py | 311 | 10273 | from __future__ import unicode_literals
from django.db import models
from django.db.models import signals
from django.dispatch import receiver
from django.test import TestCase
from django.utils import six
from .models import Author, Book, Car, Person
class BaseSignalTest(TestCase):
def setUp(self):
# Sa... | bsd-3-clause |
droidapps/pdfreader4Android | deps/freetype-2.4.10/src/tools/docmaker/docmaker.py | 463 | 2766 | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | gpl-3.0 |
jruiperezv/ANALYSE | lms/djangoapps/psychometrics/management/commands/init_psychometrics.py | 131 | 2392 | #!/usr/bin/python
#
# generate pyschometrics data from tracking logs and student module data
import json
from courseware.models import StudentModule
from track.models import TrackingLog
from psychometrics.models import PsychometricData
from django.conf import settings
from django.core.management.base import BaseComm... | agpl-3.0 |
DESatAPSU/DAWDs | python/origBandpass_FITSToCSV.py | 1 | 1930 | # Converts STD_BANDPASSES_Y3A1_FGCM_20170630_extend3000.fits to
# y3a2_std_passband_extend3000_ugrizYatm.csv
#
# To run (bash):
# python origBandpass_FITSToCSV.py > origBandpass_FITSToCSV.log 2>&1 &
#
# To run (tcsh):
# python origBandpass_FITSToCSV.py >& origBandpass_FITSToCSV.log &
#
# DLT, 2017-06-30
# bas... | mit |
Schwittleymani/ECO | src/python/keras_lstm/lstm_wrapper.py | 2 | 4929 | from keras.models import Sequential
from keras.models import load_model, model_from_json
from keras.layers import Dense, Activation, Dropout
from keras.layers import LSTM
from keras.optimizers import RMSprop
import numpy as np
import pickle
import os
class LSTMWrapper(object):
def __init__(self, maxlen, step):
... | apache-2.0 |
wilvk/ansible | lib/ansible/modules/windows/win_lineinfile.py | 46 | 7167 | #!/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 |
Akasurde/pytest | testing/test_doctest.py | 10 | 12556 | from _pytest.doctest import DoctestItem, DoctestModule, DoctestTextfile
import py
class TestDoctests:
def test_collect_testtextfile(self, testdir):
w = testdir.maketxtfile(whatever="")
checkfile = testdir.maketxtfile(test_something="""
alskdjalsdk
>>> i = 5
>>> ... | mit |
rubgombar1/sharing-cars | sharingcars/common/migrations/0001_initial.py | 1 | 4372 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-02 14:13
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import sharingcars.helpers.User
class Migration(migrations.Migration... | gpl-3.0 |
netzary/Kaline | ldapdb/models/__init__.py | 2 | 1719 | # -*- coding: utf-8 -*-
#
# django-ldapdb
# Copyright (c) 2009-2011, Bolloré telecom
# All rights reserved.
#
# See AUTHORS file for a full list of contributors.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1... | mit |
bbaumer/ansible-modules-core | system/cron.py | 39 | 17136 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms o... | gpl-3.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/test/test_bigmem.py | 123 | 45241 | """Bigmem tests - tests for the 32-bit boundary in containers.
These tests try to exercise the 32-bit boundary that is sometimes, if
rarely, exceeded in practice, but almost never tested. They are really only
meaningful on 64-bit builds on machines with a *lot* of memory, but the
tests are always run, usually with ve... | lgpl-3.0 |
shurihell/testasia | lms/djangoapps/instructor/tests/utils.py | 121 | 2732 | """
Utilities for instructor unit tests
"""
import datetime
import json
import random
from django.utils.timezone import utc
from util.date_utils import get_default_time_display
class FakeInfo(object):
"""Parent class for faking objects used in tests"""
FEATURES = []
def __init__(self):
for featur... | agpl-3.0 |
nmartensen/pandas | asv_bench/benchmarks/gil.py | 7 | 11003 | from .pandas_vb_common import *
from pandas.core.algorithms import take_1d
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
from pandas._libs import algos
except ImportError:
from pandas import algos
try:
from pandas.util.testing import test_parallel
have... | bsd-3-clause |
SophieIPP/openfisca-france | openfisca_france/model/prelevements_obligatoires/prelevements_sociaux/cotisations_sociales/travail_fonction_publique.py | 1 | 13483 | # -*- coding: utf-8 -*-
from __future__ import division
import math
from numpy import minimum as min_
from ....base import * # noqa analysis:ignore
from .base import apply_bareme_for_relevant_type_sal
class allocations_temporaires_invalidite(Variable):
column = FloatCol
entity_class = Individus
label... | agpl-3.0 |
kingvuplus/gui_test5 | lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py | 63 | 27159 | import random
from Screens.Satconfig import NimSelection
from Screens.Screen import Screen
from Screens.TextBox import TextBox
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.ActionMap import ActionMap, NumberActionMap
from Components.NimManager import nimmanager
f... | gpl-2.0 |
Belxjander/Kirito | Python-3.5.0-main/Lib/multiprocessing/queues.py | 9 | 11166 | #
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']
import sys
import os
import threading
import collections
import time
import weakref
import errno
from queue import... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.