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
Irrelium/obs-studio
deps/jansson/doc/conf.py
64
7025
# -*- coding: utf-8 -*- # # Jansson documentation build configuration file, created by # sphinx-quickstart on Sun Sep 5 21:47:20 2010. # # 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 # autogenerated file. # # All...
gpl-2.0
rcurtiss/tweethread
tweethread/core.py
1
4001
'''Tweethread core module''' from os import getenv import sys import tweepy import nltk import math def get_environment_variable(environment_variable_name): ''' Returns an environment variable's value or raises an error''' key = getenv(environment_variable_name) if not key: raise LookupError('Ple...
mit
highweb-project/highweb-webcl-html5spec
tools/perf/page_sets/page_cycler/dom.py
22
1322
# 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 telemetry.page import page as page_module from telemetry import story class DomPage(page_module.Page): def __init__(self, url, page_set): super(...
bsd-3-clause
Duoxilian/home-assistant
tests/components/test_logentries.py
17
3597
"""The tests for the Logentries component.""" import unittest from unittest import mock from homeassistant.bootstrap import setup_component import homeassistant.components.logentries as logentries from homeassistant.const import STATE_ON, STATE_OFF, EVENT_STATE_CHANGED from tests.common import get_test_home_assistan...
mit
isoboroff/crawl-eval
scripts/fgrep-json.py
1
1136
#!/usr/bin/env python3.5 import json from json import JSONDecodeError import sys import argparse import gzip import re parser = argparse.ArgumentParser(description='Match multiple patterns against a JSON field') parser.add_argument('--field', help='Field to grep', default='url') parser.add_argument('file', help='File...
mit
tchernomax/ansible
lib/ansible/modules/database/mysql/mysql_db.py
21
15602
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Mark Theunissen <mark.theunissen@gmail.com> # Sponsored by Four Kitchens http://fourkitchens.com. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metacl...
gpl-3.0
taito/xhtml2pdf
xhtml2pdf/w3c/cssDOMElementInterface.py
61
4189
#!/usr/bin/env python ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##~ Copyright (C) 2002-2004 TechGame Networks, LLC. ##~ ##~ This library is free software; you can redistribute it and/or ##~ modify it under the terms of the BSD style License as found in the ##~ LICENSE file included with this distribution....
apache-2.0
renatoGarcia/tangram
tangram/_utility.py
1
5188
# Copyright 2017 The Tangram Developers. See the AUTHORS file at the # top-level directory of this distribution and at # https://github.com/renatoGarcia/tangram/blob/master/AUTHORS. # # This file is part of Tangram. # # Tangram is free software: you can redistribute it and/or modify # it under the terms of the GNU Less...
lgpl-3.0
vanceza/short-programs
dfa2regex.py
2
5610
import itertools, functools, copy, re # x%7 == 0 dfa DFA = {str(x): { "0": str((x*2)%7), "1": str((x*2+1)%7) } for x in range(7) } DFA_START = "0" DFA_ACCEPT = {"0"} # Make sure there's a unique start and end state with no transitions in or out DFA["start"] = copy.copy(DFA[DFA_START]) DFA["end"] = {} for state in DF...
cc0-1.0
lovesnow/GHi
src/logger.py
1
3672
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2012 smallevilbeast # # Author: smallevilbeast <houshao55@gmail.com> # Maintainer: smallevilbeast <houshao55@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
gpl-3.0
kadhikari/navitia
source/jormungandr/jormungandr/modules_loader.py
3
4832
# coding=utf-8 # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open p...
agpl-3.0
mtmosier/gateAlarm
gateAlarmLib/gateAlarm.py
1
7162
import os from pwd import getpwnam from grp import getgrnam import configparser from time import sleep from datetime import datetime, timedelta from gateAlarmLib.sensor import Sensor from gateAlarmLib.doorbellSensor import DoorbellSensor from gateAlarmLib.sms import Sms from gateAlarmLib.adminEmail import AdminEmail fr...
gpl-3.0
andrey-kuznetsov/ignite
modules/platforms/python/tests/test_cache_class_sql.py
11
3012
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
lucius-feng/flaskbb
flaskbb/message/models.py
5
3574
# -*- coding: utf-8 -*- """ flaskbb.message.models ~~~~~~~~~~~~~~~~~~~~~~ The models for the conversations and messages are located here. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ from datetime import datetime from sqlalchemy_utils import UUIDType ...
bsd-3-clause
EiSandi/greetingslack
greetingslack/lib/python2.7/site-packages/setuptools/ssl_support.py
104
8220
import os import socket import atexit import re import functools from setuptools.extern.six.moves import urllib, http_client, map, filter from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_a...
mit
szopu/django
django/contrib/gis/tests/geoapp/test_feeds.py
36
4270
from __future__ import unicode_literals from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.contrib.gis.geos import HAS_GEOS from django.test import ( TestCase, modify_settings, override_settings, skipUnlessDBFeature ) if HAS_GEOS: from .model...
bsd-3-clause
stephaneAG/Python_tests
pyxhook/arduino_companion_utf8.py
1
22086
#!/usr/bin/env python # "Arduino companion" # test-implm of a python-based keyboard keys events handler to interface an Arduino connected to an Xbox Controller S #-------------------------------------------- # import the needed libraries import os import sys # needed to print stuff on the same line in stdout impo...
mit
dbtsai/spark
dev/sparktestsupport/__init__.py
140
1375
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
Aravind-Sundararajan/kongcoin
test/functional/bipdersig-p2p.py
10
6387
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP66 (DER SIG). Test that the DERSIG soft-fork activates at (regtest) height 1251. """ from tes...
mit
huongttlan/statsmodels
statsmodels/tsa/tests/results/arima111nc_results.py
36
43835
import numpy as np llf = np.array([-243.77512585356]) nobs = np.array([ 202]) k = np.array([ 3]) k_exog = np.array([ 1]) sigma = np.array([ .80556855709271]) chi2 = np.array([ 14938.241729056]) df_model = np.array([ 2]) k_ar = np.array([ 1]) k...
bsd-3-clause
dajusc/trimesh
tests/test_segments.py
2
4204
try: from . import generic as g except BaseException: import generic as g class SegmentsTest(g.unittest.TestCase): def test_param(self): from trimesh.path import segments # check 2D and 3D for dimension in [2, 3]: # a bunch of random line segments s = g.np...
mit
shichao-an/leetcode-python
jump_game_ii/solution3.py
3
1104
""" Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. For example: Given array A = [2,3,1,1,4] The minimum number ...
bsd-2-clause
s1341/pyg13
pyg13.py
1
5972
#!/usr/bin/env python import usb.core import usb.util import os import select import commands G13_VENDOR_ID = 0x046d G13_PRODUCT_ID = 0xc21c G13_KEY_ENDPOINT = 1 G13_LCD_ENDPOINT = 2 G13_REPORT_SIZE = 8 G13_LCD_BUFFER_SIZE = 0x3c0 G13_NUM_KEYS = 40 G13_NUM_MODES = 4 G13_KEYS = (["G%d" % x for x in range(1, 23)] + ...
apache-2.0
CityOfNewYork/NYCOpenRecords
app/agency/utils.py
1
4158
from datetime import datetime from flask_login import current_user from app.lib.utils import eval_request_bool from app.lib.db_utils import ( update_object, create_object ) from app.models import ( Agencies, Events, AgencyUsers ) from app.constants.event_type import ( AGENCY_ACTIVATED, AGE...
apache-2.0
jtrag/namebench
nb_third_party/dns/rdtypes/IN/APL.py
248
5525
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 ...
apache-2.0
neerajvashistha/pa-dude
lib/python2.7/site-packages/nltk/tag/hmm.py
3
49253
# Natural Language Toolkit: Hidden Markov Model # # Copyright (C) 2001-2015 NLTK Project # Author: Trevor Cohn <tacohn@csse.unimelb.edu.au> # Philip Blunsom <pcbl@csse.unimelb.edu.au> # Tiago Tresoldi <tiago@tresoldi.pro.br> (fixes) # Steven Bird <stevenbird1@gmail.com> (fixes) # Joseph ...
mit
BIMSBbioinfo/bioconda-recipes
bootstrap.py
14
4242
#!/usr/bin/env python import os import sys import subprocess as sp import argparse if sys.version_info.major == 3: PY3 = True from urllib.request import urlretrieve else: PY3 = True from urllib import urlretrieve usage = """ The easy way to test recipes is by using `circleci build`. However this doe...
mit
matpow2/opensnd
common.py
1
38772
# Copyright (c) Mathias Kaerlev 2012. # This file is part of OpenSND. # OpenSND 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. # Op...
gpl-3.0
Alshak/clowdflows
workflows/scikitAlgorithms/library.py
4
7339
import re # # CLASSIFICATION ALGORITHMS # def scikitAlgorithms_naiveBayes(input_dict): from sklearn.naive_bayes import GaussianNB y_pred = GaussianNB() output_dict={} output_dict['bayesout'] = y_pred return output_dict def scikitAlgorithms_J48(input_dict): from sklearn import tree #pars...
mit
daodaoliang/neural-network-animation
matplotlib/tri/trirefine.py
20
14567
""" Mesh refinement for triangular grids. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np from matplotlib.tri.triangulation import Triangulation import matplotlib.tri.triinterpolate class TriRefiner(object): """ A...
mit
maohongyuan/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/compat.py
571
2556
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
lgpl-3.0
artoonie/transcroobie
hit/views.py
1
2550
from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.template import loader from django.views.decorators.clickjacking import xframe_options_exempt from hitrequest.models import AudioSnippet from transcroobie import settings from hit.transcriptProcessUtils import transcriptWith...
gpl-3.0
hobarrera/django
tests/sitemaps_tests/base.py
380
1079
from django.apps import apps from django.contrib.sites.models import Site from django.core.cache import cache from django.test import TestCase, modify_settings, override_settings from .models import I18nTestModel, TestModel @modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'}) @override_settings(ROO...
bsd-3-clause
bmanojlovic/ansible
test/units/plugins/test_plugins.py
104
3581
# (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
firerszd/kbengine
kbe/res/scripts/common/Lib/lib2to3/fixes/fix_itertools.py
136
1548
""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363) imports from itertools are fixed in fix_itertools_import.py If itertools is imported as something else (ie: import itertools as it; it.izip(spam, eggs)) method calls w...
lgpl-3.0
raildo/nova
nova/tests/unit/objects/test_keypair.py
33
4493
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
nanolearningllc/edx-platform-cypress-2
lms/djangoapps/instructor/tests/test_spoc_gradebook.py
29
6312
""" Tests of the instructor dashboard spoc gradebook """ from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from student.tests.factories import UserFactory, CourseEnrollmentFactory, AdminFactory from xmodule.modul...
agpl-3.0
ychen820/microblog
y/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/integration/gs/util.py
101
3241
# Copyright (c) 2012, Google, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify...
bsd-3-clause
KhronosGroup/COLLADA-CTS
StandardDataSets/1_5/collada/library_animations/animation/channel/animation_channel_scale_y/animation_channel_scale_y.py
52
3916
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ...
mit
mufaddalq/cloudstack-datera-driver
tools/marvin/marvin/codes.py
1
1882
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
AndroidOpenDevelopment/android_external_chromium_org
chrome/common/extensions/docs/server2/api_categorizer_test.py
10
2368
#!/usr/bin/env python # 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 unittest from api_categorizer import APICategorizer from compiled_file_system import CompiledFileSystem from extensions_paths im...
bsd-3-clause
WillisXChen/django-oscar
tests/integration/payment/model_tests.py
40
1412
from decimal import Decimal as D import datetime from django.test import TestCase from oscar.apps.payment.models import Bankcard from oscar.test import factories class TestAPaymentSource(TestCase): def setUp(self): order = factories.create_order() self.source = factories.SourceFactory(order=ord...
bsd-3-clause
clausqr/HTPC-Manager
libs/cherrypy/_cprequest.py
58
37180
import os import sys import time import warnings import cherrypy from cherrypy._cpcompat import basestring, copykeys, ntob, unicodestr from cherrypy._cpcompat import SimpleCookie, CookieError, py3k from cherrypy import _cpreqbody, _cpconfig from cherrypy._cperror import format_exc, bare_error from cherrypy.lib import...
mit
JianyuWang/neutron
neutron/db/migration/alembic_migrations/versions/4119216b7365_add_tenant_id_idx.py
47
1466
# Copyright 2015 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 # # Unless required by applicable law ...
apache-2.0
ewbankkit/cloud-custodian
c7n/resources/ecs.py
5
27419
# Copyright 2015-2017 Capital One Services, 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 ...
apache-2.0
RedhawkSDR/integration-gnuhawk
gnuradio/grc/base/Param.py
28
6313
""" Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any l...
gpl-3.0
rosenvladimirov/odoo
point_of_sale/wizard/pos_payment.py
344
4976
# -*- 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
chrisenuf/fullerite
src/diamond/collectors/chronyd/test/testchronyd.py
33
3277
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from chronyd import ...
apache-2.0
xaviercobain88/framework-python
openerp/addons/account_anglo_saxon/product.py
51
3427
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
agpl-3.0
salaria/odoo
addons/account/wizard/account_vat.py
378
2896
# -*- 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
liaoqingwei/werkzeug
examples/httpbasicauth.py
44
1529
# -*- coding: utf-8 -*- """ HTTP Basic Auth Example ~~~~~~~~~~~~~~~~~~~~~~~ Shows how you can implement HTTP basic auth support without an additional component. :copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ from werkzeug.serving import run_simple f...
bsd-3-clause
jaydenkieran/Turbo
turbo/req.py
1
1537
import aiohttp import asyncio import logging from .constants import USER_AGENT log = logging.getLogger(__name__) class HTTPClient: """ Client for interacting with HTTP """ def __init__(self, *, session=None, loop=asyncio.get_event_loop()): if session is None: self.session = aio...
mit
CEG-FYP-OpenStack/scheduler
nova/api/metadata/vendordata_json.py
23
2129
# Copyright 2013 Canonical Ltd # 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
NUAAXXY/globOpt
evaluation/deps/plyfile.py
2
20622
# Copyright 2014 Darsh Ranjan # # This file is part of python-plyfile. # # python-plyfile 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 ...
apache-2.0
librasungirl/openthread
tools/harness-automation/cases/border_7_1_2.py
9
1877
#!/usr/bin/env python # # Copyright (c) 2019, The OpenThread Authors. # 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 # notic...
bsd-3-clause
x303597316/hue
desktop/core/ext-py/Django-1.6.10/django/middleware/clickjacking.py
329
1993
""" Clickjacking Protection Middleware. This module provides a middleware that implements protection against a malicious site loading resources from your site in a hidden frame. """ from django.conf import settings class XFrameOptionsMiddleware(object): """ Middleware that sets the X-Frame-Options HTTP heade...
apache-2.0
Nabs007/ansible
lib/ansible/plugins/lookup/dig.py
82
8222
# (c) 2015, Jan-Piet Mens <jpmens(at)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 later ver...
gpl-3.0
Eficent/hr
hr_family/models/hr_employee.py
22
1436
# -*- coding:utf-8 -*- # # # Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # 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...
agpl-3.0
RPGOne/Skynet
numpy-master/numpy/distutils/command/autodist.py
148
2048
"""This module implements additional tests ala autoconf which can be useful. """ from __future__ import division, absolute_import, print_function # We put them here since they could be easily reused outside numpy.distutils def check_inline(cmd): """Return the inline identifier (may be empty).""" cmd._check_...
bsd-3-clause
Kbman99/PlayMeThis
app/toolbox/albumdetails.py
1
1967
# webhook.py import requests from bs4 import BeautifulSoup from urllib.parse import urlparse import sys def get_song_details(link): """ Gathers the details of each song such as artist name and song name etc... :param link: Link to the soundcloud song :return: Dictionary including the song url, name, a...
mit
hltcoe/rebar
examples/py/sample-ingest.py
1
1562
#!/usr/bin/python # # Copyright 2012-2013 Johns Hopkins University HLTCOE. All rights reserved. # This software is released under the 2-clause BSD license. # See LICENSE in the project root directory. # """ This is a small script that demonstrates how to use a Python client to ingest Communications into rebar. To us...
bsd-2-clause
mcanthony/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/texmanager.py
69
16818
""" This module supports embedded TeX expressions in matplotlib via dvipng and dvips for the raster and postscript backends. The tex and dvipng/dvips information is cached in ~/.matplotlib/tex.cache for reuse between sessions Requirements: * latex * \*Agg backends: dvipng * PS backend: latex w/ psfrag, dvips, and Gh...
agpl-3.0
erwilan/ansible
lib/ansible/modules/network/cumulus/_cl_bond.py
49
15980
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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...
gpl-3.0
pombredanne/parakeet
parakeet/c_backend/prepare_args.py
2
1344
from itertools import izip import numpy as np from ..ndtypes import (type_conv, ScalarT, ArrayT, FnT, ClosureT, SliceT, NoneT, TupleT, TypeValueT) from ..syntax import TypedFn, UntypedFn def prepare_closure_args(untyped_fn): closure_args = untyped_fn.python_nonlocals() closure_arg_types = [type_conv.typeof(v) fo...
bsd-3-clause
Manojkumar91/odoo_inresto
addons/board/board.py
4
6579
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
mhvk/astropy
astropy/table/tests/test_masked.py
8
24896
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test behavior related to masked tables""" import pytest import numpy as np import numpy.ma as ma from astropy.table import Column, MaskedColumn, Table, QTable from astropy.table.column import BaseColumn from astropy.time import Time import astropy.uni...
bsd-3-clause
ujdhesa/unisubs
apps/statistic/migrations/0009_drop_old_count_tables.py
1
27599
# encoding: 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): # Deleting model 'SubtitleFetchCounters' db.delete_table('statistic_subtitlefetchcounters') #...
agpl-3.0
agildehaus/pyfmkr
pyfmkr/__init__.py
1
4781
import requests from pyfmkr import data from xml.etree import ElementTree class FilemakerServer(object): NAMESPACES = {'fm': 'http://www.filemaker.com/xml/fmresultset'} def __init__(self, base_uri, username, passcode): self._base_uri = base_uri self._session = requests.Session() self._...
mit
unnikrishnankgs/va
venv/lib/python3.5/site-packages/django/template/loaders/base.py
199
3759
import warnings from django.template import Origin, Template, TemplateDoesNotExist from django.utils.deprecation import RemovedInDjango20Warning from django.utils.inspect import func_supports_parameter class Loader(object): def __init__(self, engine): self.engine = engine def __call__(self, templat...
bsd-2-clause
jmptrader/dirigible-spreadsheet
dirigible/sheet/utils/cell_name_utils.py
2
2608
# Copyright (c) 2005-2009 Resolver Systems Ltd, PythonAnywhere LLP # See LICENSE.md # import sys # We allow 3 letter column names MAX_COL = (26 ** 3) + (26 ** 2) + 26 def column_name_to_index(colName): if not colName.isalpha(): return None result = 0 for letter in colName.upper(): result...
mit
asajeffrey/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
tanglei528/horizon
openstack_dashboard/dashboards/router/nexus1000v/views.py
7
4967
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
OpenUpgrade-dev/OpenUpgrade
openerp/addons/base/tests/test_ir_filters.py
285
11000
# -*- coding: utf-8 -*- import functools from openerp import exceptions from openerp.tests import common def noid(d): """ Removes values that are not relevant for the test comparisons """ d.pop('id', None) d.pop('action_id', None) return d class FiltersCase(common.TransactionCase): def build(self...
agpl-3.0
mhue/scikit-learn
sklearn/preprocessing/__init__.py
14
1184
""" The :mod:`sklearn.preprocessing` module includes scaling, centering, normalization, binarization and imputation methods. """ from .data import Binarizer from .data import KernelCenterer from .data import MinMaxScaler from .data import MaxAbsScaler from .data import Normalizer from .data import RobustScaler from .d...
bsd-3-clause
cboling/SDNdbg
docs/old-stuff/pydzcvr/doc/neutron/openstack/common/jsonutils.py
13
6751
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
abhishekgahlot/scikit-learn
sklearn/cluster/affinity_propagation_.py
10
10465
""" Algorithms for clustering : Meanshift, Affinity propagation and spectral clustering. """ # Author: Alexandre Gramfort alexandre.gramfort@inria.fr # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import a...
bsd-3-clause
ihsanudin/odoo
openerp/tools/which.py
456
6884
#!/usr/bin/env python """ Which - locate a command * adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch * see http://bugs.python.org/issue444582 * uses ``PATHEXT`` on Windows * searches current directory before ``PATH`` on Windows, but not before an explicitly passed ...
agpl-3.0
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/mpl_toolkits/axisartist/axislines.py
6
25977
""" Axislines includes modified implementation of the Axes class. The biggest difference is that the artists responsible to draw axis line, ticks, ticklabel and axis labels are separated out from the mpl's Axis class, which are much more than artists in the original mpl. Originally, this change was motivated to support...
mit
luis-rr/nest-simulator
topology/examples/test_3d.py
13
2824
# -*- coding: utf-8 -*- # # test_3d.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 # (...
gpl-2.0
okaram/python
db_excel/query2xl_classes.py
1
3028
import psycopg2 as dbapi2 import sys from openpyxl import Workbook #from openpyxl.cell import get_column_letter from openpyxl.styles import Color, Style, PatternFill headerStyle=Style(fill=PatternFill(patternType='solid', fgColor=Color('008080FF'))) class QuerySpec(object): def __init__(self, title, db...
unlicense
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/grit/grit/node/mapping.py
62
1760
#!/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. '''Maps each node type to an implementation class. When adding a new node type, you add to this mapping. ''' from grit import exc...
gpl-3.0
andreimatei/congratboto
app_engine/adaptors/facebook_page.py
1
3843
import sys sys.path.insert(0, 'third_party') import cookielib import datetime import logging import urllib import urllib2 import bs4 logger = logging.getLogger() OPENER_TTS_SEC = 29 * 60 class FacebookSession(object): def __init__(self, user_name, user_email, user_password): # User information for login. Th...
mit
Petraea/jsonbot
jsb/contrib/sleekxmpp/exceptions.py
2
3079
# -*- coding: utf-8 -*- """ sleekxmpp.exceptions ~~~~~~~~~~~~~~~~~~~~ Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 Nathanael C. Fritz :license: MIT, see LICENSE for more details """ class XMPPError(Exception): """ A generic exception that may be raised while processing...
mit
throwable-one/lettuce
tests/integration/lib/Django-1.3/django/contrib/localflavor/it/it_province.py
406
2740
# -*- coding: utf-8 -* PROVINCE_CHOICES = ( ('AG', 'Agrigento'), ('AL', 'Alessandria'), ('AN', 'Ancona'), ('AO', 'Aosta'), ('AR', 'Arezzo'), ('AP', 'Ascoli Piceno'), ('AT', 'Asti'), ('AV', 'Avellino'), ('BA', 'Bari'), ('BT', 'Barletta-Andria-Trani'), # active starting from 2009 ...
gpl-3.0
hiisi13/python-mock
tests/testmock.py
1
42737
# 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...
bsd-2-clause
simonwydooghe/ansible
lib/ansible/modules/files/replace.py
38
10934
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Evan Kaufman <evan@digitalflophouse.com # Copyright: (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__ = ...
gpl-3.0
jiwanlimbu/aura
keystone/tests/unit/token/test_token_data_helper.py
7
2350
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
kaushik94/sympy
examples/all.py
27
6771
#!/usr/bin/env python from __future__ import print_function DESCRIPTION = """ Runs all the examples for testing purposes and reports successes and failures to stderr. An example is marked successful if the running thread does not throw an exception, for threaded examples, such as plotting, one needs to check the stde...
bsd-3-clause
Roguelazer/onepasswordpy
tests/unit/crypt_util_tests.py
2
9199
import base64 import hashlib import hmac import struct from unittest2 import TestCase import simplejson from onepassword import crypt_util from ..helpers import assert_raises class HexizeTestCase(TestCase): VECTORS = ( (b'', b''), (b'\x00', b'00'), (b'abcd', b'61626364'), (b'\x00...
isc
spnow/grr
lib/stats.py
2
14868
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. """Statistics collection classes.""" import bisect import functools import threading import time from grr.lib import registry from grr.lib import utils # Stats decorators class Timed(object): """A decorator to automatically export timing ...
apache-2.0
spnow/grr
lib/email_alerts.py
2
1781
#!/usr/bin/env python """A simple wrapper to send email alerts.""" from email import encoders from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import re import smtplib import socket from grr.lib import config_lib from grr.lib import utils de...
apache-2.0
hgl888/blink-crosswalk-efl
Source/devtools/scripts/generate_devtools_grd.py
9
5565
#!/usr/bin/env python # # Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this...
bsd-3-clause
tmerrick1/spack
var/spack/repos/builtin/packages/r-prodlim/package.py
5
2024
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
pettarin/aeneas
aeneas/tests/bench_test_task_misc.py
5
9104
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, A...
agpl-3.0
drtuxwang/system-config
bin/index.py
1
7374
#!/usr/bin/env python3 """ Generate 'index.xhtml' & 'index.fsum' files plus '.../fsum' cache files """ import glob import logging import os import re import shutil import signal import sys from typing import List import command_mod import file_mod import logging_mod import subtask_mod logger = logging.getLogger(__na...
gpl-2.0
ApplauseAQI/androguard
androcsign.py
23
2496
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard 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,...
apache-2.0
pollen/pyrobus
pyluos/modules/servo.py
1
1559
from __future__ import division from .module import Module, interact class Servo(Module): def __init__(self, id, alias, device): Module.__init__(self, 'Servo', id, alias, device) self._max_angle = 180.0 self._min_pulse = 0.0005 self._max_pulse = 0.0015 self._angle = 0.0 ...
mit
PerilousApricot/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/ilink32.py
61
2096
"""SCons.Tool.ilink32 XXX """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 re...
apache-2.0
CrackerJoe/p2pool-cesc
p2pool/test/test_p2p.py
269
2724
import random from twisted.internet import defer, endpoints, protocol, reactor from twisted.trial import unittest from p2pool import networks, p2p from p2pool.bitcoin import data as bitcoin_data from p2pool.util import deferral class Test(unittest.TestCase): @defer.inlineCallbacks def test_sharereq(self): ...
gpl-3.0
tosfan4ever/hacktheplanet
users/views.py
58
1475
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from braces.views import LoginRequiredMixin from .forms import UserForm from .models import User class UserDe...
bsd-3-clause