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
decvalts/iris
lib/iris/fileformats/netcdf.py
2
69416
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
gpl-3.0
taoger/shadowsocks
tests/coverage_server.py
1072
1655
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
apache-2.0
chirilo/kuma
vendor/packages/pygments/lexers/sql.py
72
25929
# -*- coding: utf-8 -*- """ pygments.lexers.sql ~~~~~~~~~~~~~~~~~~~ Lexers for various SQL dialects and related interactive sessions. Postgres specific lexers: `PostgresLexer` A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL lexer are: - keywords and dat...
mpl-2.0
goyalankit/po-compiler
object_files/networkx-1.8.1/networkx/algorithms/distance_measures.py
33
3876
# -*- coding: utf-8 -*- """ Graph diameter, radius, eccentricity and other properties. """ __author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)', 'Dan Schult(dschult@colgate.edu)']) # Copyright (C) 2004-2010 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # ...
apache-2.0
nickleefly/youtube-dl
youtube_dl/extractor/funimation.py
23
10206
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_urllib_parse_unquote_plus, ) from ..utils import ( clean_html, determine_ext, int_or_none, sanitized_Request, ExtractorError, urlencode_postdata ) ...
unlicense
Nicop06/ansible
lib/ansible/utils/module_docs_fragments/files.py
36
3351
# (c) 2014, Matt Martz <matt@sivel.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
holygits/incubator-airflow
tests/contrib/operators/test_emr_create_job_flow_operator.py
56
1746
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
h3biomed/ansible-modules-core
system/user.py
13
75467
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
ychen820/microblog
y/google-cloud-sdk/lib/googlecloudapis/apitools/base/py/app2.py
2
10620
"""Appcommands-compatible command class with extra fixins.""" from __future__ import print_function import cmd import inspect import pdb import shlex import sys import traceback import types import six from google.apputils import app from google.apputils import appcommands import gflags as flags __all__ = [ 'Ne...
bsd-3-clause
olivierdalang/QGIS
tests/src/python/test_qgsvectorlayertools.py
45
2025
# -*- coding: utf-8 -*- """QGIS Unit test utils for provider tests. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. "...
gpl-2.0
tusharmakkar08/AlphaPy
Syntax/syntaxhighlighter.py
1
2865
#!/usr/bin/env python # -*- coding: utf-8 -*- # # syntaxhighlighter.py # # Copyright 2013 tusharmakkar08 <tusharmakkar08@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 published by # the Free Software Foundation; eit...
mit
madjar/cython
Cython/Debugger/DebugWriter.py
10
2205
from __future__ import with_statement import os import sys import errno try: from lxml import etree have_lxml = True except ImportError: have_lxml = False try: # Python 2.5 from xml.etree import cElementTree as etree except ImportError: try: # Python 2.5 ...
apache-2.0
NeCTAR-RC/ceilometer
ceilometer/storage/sqlalchemy/migrate_repo/versions/008_add_events.py
5
2313
# -*- encoding: 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, so...
apache-2.0
stuarteberg/numpy
numpy/doc/basics.py
39
7870
""" ============ Array basics ============ Array types and conversions between types ========================================= NumPy supports a much greater variety of numerical types than Python does. This section shows which are available, and how to modify an array's data-type. ========== =======================...
bsd-3-clause
ity/pants
tests/python/pants_test/python/test_python_run_integration.py
9
2656
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.util.cont...
apache-2.0
Rashminadig/SDN
ryu/lib/ofctl_v1_0.py
9
10199
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
mjtamlyn/django-denorm
test_project/test_app/tests.py
1
17380
from djangosanetesting import cases from django.contrib.auth.models import User,Permission from django.contrib.contenttypes.models import ContentType import denorm from denorm import denorms import models class TestSkip(cases.DestructiveDatabaseTestCase): """ Tests for the skip feature. """ def ...
bsd-3-clause
CPedrini/TateTRES
requests/packages/chardet/jpcntx.py
949
19104
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
apache-2.0
nwpointer/proj5-mongo
db_trial.py
2
1358
""" Just to test database functions, outside of Flask. We want to open our MongoDB database, insert some memos, and read them back """ import arrow # Mongo database from pymongo import MongoClient import CONFIG try: dbclient = MongoClient(CONFIG.MONGO_URL) db = dbclient.memos collection = db.dated excep...
artistic-2.0
dvdotsenko/git_http_backend.py
test_git_http_backend.py
1
4625
import os import sys import threading import socket import tempfile import shutil import random import time try: # 3.x style module import urllib.request as urlopenlib except: # 2.x style module import urllib as urlopenlib import git_http_backend import cherrypy as wsgiserver import ...
gpl-2.0
vfulco/scalpel
lib/gravity/tae/linkage/wikipedia.py
2
7271
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in ...
lgpl-3.0
novoid/tstest
tagstore-src/tsgui/tagcompleter.py
1
17006
#!/usr/bin/env python # -*- coding: iso-8859-15 -*- ## this file is part of tagstore, an alternative way of storing and retrieving information ## Copyright (C) 2010 Karl Voit, Christoph Friedl, Wolfgang Wintersteller ## ## This program is free software; you can redistribute it and/or modify it under the terms ## of t...
gpl-3.0
jonieli/flask
tests/test_blueprints.py
143
18147
# -*- coding: utf-8 -*- """ tests.blueprints ~~~~~~~~~~~~~~~~ Blueprints (and currently modules) :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask from flask._compat import text_type from werkzeug.http import parse_cache_control_...
bsd-3-clause
anneline/Bika-LIMS
bika/lims/controlpanel/bika_attachmenttypes.py
5
2865
from AccessControl import ClassSecurityInfo from Products.ATContentTypes.content import schemata from Products.CMFCore.utils import getToolByName from Products.Archetypes import atapi from Products.Archetypes.ArchetypeTool import registerType from Products.CMFCore.utils import getToolByName from bika.lims.browser.bika_...
agpl-3.0
Lucifer-Kim/scrapy
tests/test_pipeline_images.py
88
9639
import os import hashlib import warnings from tempfile import mkdtemp, TemporaryFile from shutil import rmtree from twisted.trial import unittest from scrapy.item import Item, Field from scrapy.http import Request, Response from scrapy.settings import Settings from scrapy.pipelines.images import ImagesPipeline from s...
bsd-3-clause
junghans/lammps
tools/moltemplate/moltemplate/force_fields/amber/amberparm_dihedral_to_lt.py
8
5258
#!/usr/bin/env python # SOME UGLY CODE HERE import sys lines_gaff = sys.stdin.readlines() dihedral_style_name = 'fourier' in_dihedral_coeffs = [] for i in range(0, len(lines_gaff)): line = lines_gaff[i] atypes = line[:11].split('-') atype1 = atypes[0].strip() atype2 = atypes[1].strip() atype3 =...
gpl-2.0
mattrobenolt/carbon
lib/carbon/protocols.py
2
6077
import time from twisted.internet import reactor from twisted.internet.protocol import DatagramProtocol from twisted.internet.error import ConnectionDone from twisted.protocols.basic import LineOnlyReceiver, Int32StringReceiver from carbon import log, events, state, management from carbon.conf import settings from car...
apache-2.0
fergalmoran/Chrome2Kindle
server/html5lib/inputstream.py
25
27975
import codecs import re import types import sys from constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from constants import encodings, ReparseException #Non-unicode versions of constants for use in the pre-parser spaceCharactersBytes = frozenset([str(item) for item in spaceCharacters]) asciiLetters...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/distutils/sysconfig.py
1
20130
"""Provide access to Python's configuration information. The specific configuration variables available depend heavily on the platform and configuration. The values may be retrieved using get_config_var(name), and the list of variables is available via get_config_vars().keys(). Additional convenience functions are a...
mit
odicraig/kodi2odi
addons/plugin.video.cartoons8/requests/__init__.py
151
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
gpl-3.0
fgirault/smeuhsocial
apps/threadedcomments/tests/test_views.py
1
26436
from django.core.urlresolvers import reverse from django.test import TestCase from json import loads from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from threadedcomments.models import FreeThreadedComment, ThreadedComment from threadedcomments.models import TestM...
mit
delfick/harpoon
harpoon/helpers.py
1
2085
from contextlib import contextmanager from io import StringIO import tempfile import logging import time import os log = logging.getLogger("harpoon.helpers") @contextmanager def a_temp_file(): """Yield the name of a temporary file and ensure it's removed after use""" filename = None try: tmpfile ...
mit
meiavy/python-weixin
lib/python2.7/site-packages/pip/vendor/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...
apache-2.0
fpsluozi/youtube-dl
youtube_dl/extractor/twentyfourvideo.py
105
3896
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_iso8601, int_or_none, ) class TwentyFourVideoIE(InfoExtractor): IE_NAME = '24video' _VALID_URL = r'https?://(?:www\.)?24video\.net/(?:video/(?:view|xml)/|player/new24_play\.swf\?id=)(...
unlicense
tuxfux-hlp-notes/python-batches
archieves/batch-59/modules/sheets/lib/python2.7/site-packages/setuptools/command/install_scripts.py
285
2068
from distutils.command.install_scripts import install_scripts \ as _install_scripts from pkg_resources import Distribution, PathMetadata, ensure_directory import os from distutils import log class install_scripts(_install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def ini...
gpl-3.0
coreycb/horizon
horizon/test/urls.py
4
1565
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
pyfa-org/Pyfa
gui/fitCommands/gui/booster/remove.py
2
1509
import wx import eos.db import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.calc.booster.remove import CalcRemoveBoosterCommand from gui.fitCommands.helpers import InternalCommandHistory from service.fit import Fit from service.market import Market class GuiRemoveBoostersCommand(wx.Command):...
gpl-3.0
wschenck/nest-simulator
pynest/nest/tests/test_sp/test_disconnect_multiple.py
17
11105
# -*- coding: utf-8 -*- # # test_disconnect_multiple.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 th...
gpl-2.0
memsharded/conan
conans/test/integration/conanfile_errors_test.py
1
5092
import unittest from conans.test.utils.tools import TestClient class ConanfileErrorsTest(unittest.TestCase): def copy_error_test(self): client = TestClient() conanfile = ''' from conans import ConanFile class HelloConan(ConanFile): name = "Hello" version = "0.1" exports = "*" de...
mit
kifcaliph/odoo
addons/account/project/wizard/account_analytic_journal_report.py
378
3164
# -*- 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
probablytom/tomwallis.net
venv/lib/python2.7/site-packages/django/db/backends/mysql/creation.py
70
3036
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict...
artistic-2.0
emergebtc/forknote
external/miniupnpc/pymoduletest.py
158
1377
#! /usr/bin/python # MiniUPnP project # Author : Thomas Bernard # This Sample code is public domain. # website : http://miniupnp.tuxfamily.org/ # import the python miniupnpc module import miniupnpc import sys # create the object u = miniupnpc.UPnP() print 'inital(default) values :' print ' discoverdelay', u.discoverd...
lgpl-3.0
akosyakov/intellij-community
python/lib/Lib/distutils/text_file.py
85
15152
"""text_file provides the TextFile class, which gives an interface to text files that (optionally) takes care of stripping comments, ignoring blank lines, and joining lines with backslashes.""" __revision__ = "$Id: text_file.py 29687 2002-11-14 02:25:42Z akuchling $" from types import * import sys, os, string clas...
apache-2.0
MatthewWilkes/django
django/db/backends/base/schema.py
339
43421
import hashlib import logging from django.db.backends.utils import truncate_name from django.db.transaction import atomic from django.utils import six from django.utils.encoding import force_bytes logger = logging.getLogger('django.db.backends.schema') def _related_non_m2m_objects(old_field, new_field): # Filte...
bsd-3-clause
nin042/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
118
23190
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
EvanCase54/PyBot
cacobot/woah.py
1
40992
# pylint: disable=c0302 import random import json import discord import cacobot.base as base @base.postcommand async def woah(message, client): c = message.content.lower() send = None if message.author.id != client.user.id: if c == 'woah' or\ c == 'woah.' or\ c == ...
gpl-3.0
simbha/GAE-appswell
appspot/framework/lib/error_handling.py
1
1373
""" Appswell Error Handling Lib functions for handling errors USAGE from lib import error_handling error_details = error_handling.get_error_details() error_page = error_handling.render_error_page(error_details) """ # # IMPORTS # import sys, os, logging, inspect from os.path import (abspath, di...
mit
billy-inn/scikit-learn
examples/model_selection/grid_search_digits.py
227
2665
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.grid_search.GridSearc...
bsd-3-clause
edgedb/edgedb
edb/schema/schema.py
1
63607
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB authors. # # 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...
apache-2.0
awkspace/ansible
lib/ansible/modules/network/onyx/onyx_lldp_interface.py
118
7407
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
napkindrawing/ansible
lib/ansible/plugins/callback/profile_roles.py
37
3886
# (C) 2017, Tennis Smith, http://github.com/gamename # # This file 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. # # File is distribu...
gpl-3.0
radosuav/QGIS
tests/src/python/test_qgsserver_wms_getprint.py
14
25941
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS GetPrint. From build dir, run: ctest -R PyQgsServerWMSGetPrint -V .. note:: 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 versi...
gpl-2.0
ubc/edx-platform
cms/djangoapps/contentstore/tests/utils.py
56
17991
''' Utilities for contentstore tests ''' import json import textwrap from mock import Mock from django.conf import settings from django.contrib.auth.models import User from django.test.client import Client from opaque_keys.edx.locations import SlashSeparatedCourseKey, AssetLocation from contentstore.utils import reve...
agpl-3.0
yytang2012/novels-crawler
simpleSpiders/m-ifuwen.py
1
1913
import os import requests from parsel import Selector from urllib.parse import urljoin from libs.polish import polish_content, polish_title, polish_subtitle def parse_content(url): page = requests.get(url) html = page.text sel = Selector(text=html) title = sel.xpath('//title/text()').extract()[0] ...
mit
ravindrasingh22/ansible
v1/ansible/runner/action_plugins/copy.py
109
16890
# (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
JeffRoy/mi-dataset
mi/dataset/parser/dbg_pdbg_cspp.py
3
19012
#!/usr/bin/env python """ @package mi.dataset.parser @file marine-integrations/mi/dataset/parser/dbg_pdbg_cspp.py @author Jeff Roy @brief Parser for the dbg_pdbg_cspp dataset driver Release notes: initial release """ import copy import re import string import numpy from mi.core.log import get_logger from mi.core.c...
bsd-2-clause
JimmyLin192/MLSS2014Contest
codebases/liblinear-1.94/python/liblinear.py
37
8400
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library from os import path import sys try: dirname = path.dirname(path.abspath(__file__)) if sys.platform == 'win32': liblinear = CDLL(path.join(dirname, r'..\windows\liblinear.dll')) else: liblinear = CDLL(path.join(dirname, '../liblinea...
mit
kvar/ansible
lib/ansible/modules/network/nxos/nxos_ospf_vrf.py
1
17083
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
hortonworks/hortonworks-sandbox
apps/oozie/src/oozie/management/commands/oozie_setup.py
1
3188
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (...
apache-2.0
cuilishen/cuilishenMissionPlanner
Lib/site-packages/scipy/ndimage/__init__.py
55
1880
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 following d...
gpl-3.0
djludo/navitia
source/tyr/tyr/tasks.py
3
11323
# 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 public tr...
agpl-3.0
ddworken/cubeOfResistors
2D.py
1
2155
DIFF_THRESHOLD = 1e-40 width = height = 10 class Fixed: FREE = 0 A = 1 B = 2 class Node: __slots__ = ["voltage", "fixed"] def __init__(self, v=0.0, f=Fixed.FREE): self.voltage = v self.fixed = f def set_boundary(mesh): mesh[width / 2][height / 2] = Node(1.0, Fixed.A) m...
gpl-2.0
ollie314/browserscope
test/test_user_agent_release_dates.py
9
4518
#!/usr/bin/python2.5 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the 'License') # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
iamkingmaker/zipline
tests/risk/test_risk_period.py
17
23419
# # Copyright 2013 Quantopian, 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 agreed to in wr...
apache-2.0
BiaDarkia/scikit-learn
sklearn/utils/tests/test_sparsefuncs.py
22
18104
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from numpy.random import RandomState from sklearn.datasets import make_classification from sklearn.utils.s...
bsd-3-clause
ze-phyr-us/redis-py
tests/test_connection_pool.py
7
17820
from __future__ import with_statement import os import pytest import redis import time import re from threading import Thread from redis.connection import ssl_available, to_bool from .conftest import skip_if_server_version_lt class DummyConnection(object): description_format = "DummyConnection<>" def __init...
mit
irzaip/chippy
cp_calendar.py
2
1787
import math from datetime import * import subprocess, shlex import commons from pytz import timezone import calendar from dateutil.relativedelta import * def dt(str): r = datetime.strptime(str,"%Y-%m-%d") return r def get_cal(): f = file("agenda.txt","rb") ap = f.readlines() data = [] for dt in ap:...
lgpl-3.0
mblondel/scikit-learn
sklearn/utils/tests/test_utils.py
23
6045
import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import pinv2 from sklearn.utils.testing import (assert_equal, assert_raises, assert_true, assert_almost_equal, assert_array_equal, SkipTest) from sklearn.utils import c...
bsd-3-clause
Hackplayers/Empire-mod-Hackplayers
lib/modules/powershell/privesc/bypassuac_env.py
12
4153
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-EnvBypass', 'Author': ['Petr Medonos'], 'Description': ("Bypasses UAC (even with Always Notify level set) by by performing an registry modification" ...
bsd-3-clause
ahmetdaglarbas/e-commerce
oscar/apps/partner/south_migrations/0010_auto__chg_field_stockrecord_product__del_unique_stockrecord_product.py
18
20027
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'StockRecord', f...
bsd-3-clause
sudheesh001/oh-mainline
vendor/packages/twisted/twisted/protocols/memcache.py
29
23329
# -*- test-case-name: twisted.test.test_memcache -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Memcache client protocol. Memcached is a caching server, storing data in the form of pairs key/value, and memcache is the protocol to talk with it. To connect to a server, create a factory ...
agpl-3.0
aoakeson/home-assistant
tests/components/test_logbook.py
4
5844
"""The tests for the logbook component.""" # pylint: disable=protected-access,too-many-public-methods import unittest from datetime import timedelta import homeassistant.core as ha from homeassistant.const import ( EVENT_STATE_CHANGED, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP) import homeassistant.util....
mit
rynomster/django
django/contrib/gis/serializers/geojson.py
5
3110
from __future__ import unicode_literals from django.contrib.gis.gdal import HAS_GDAL from django.core.serializers.base import ( SerializationError, SerializerDoesNotExist, ) from django.core.serializers.json import Serializer as JSONSerializer if HAS_GDAL: from django.contrib.gis.gdal import CoordTransform, S...
bsd-3-clause
mjvakili/ccppabc
ccppabc/code/archive/wp_covariance.py
1
1717
from halotools.empirical_models import Zheng07 , model_defaults from halotools.mock_observables import wp from halotools.mock_observables.clustering import tpcf from halotools.empirical_models.mock_helpers import (three_dim_pos_bundle, infer_mask_from_kwargs) from ha...
mit
spadae22/odoo
addons/payment_buckaroo/controllers/main.py
53
1155
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class BuckarooController(http.Controller): _return_url = '/pa...
agpl-3.0
elky/django
django/db/models/functions/base.py
5
7155
""" Classes that represent database functions. """ from django.db.models import Func, Transform, Value, fields class Cast(Func): """Coerce an expression to a new field type.""" function = 'CAST' template = '%(function)s(%(expressions)s AS %(db_type)s)' def __init__(self, expression, output_field): ...
bsd-3-clause
fnouama/intellij-community
python/helpers/epydoc/docwriter/html.py
89
143938
# # epydoc -- HTML output generator # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: html.py 1674 2008-01-29 06:03:36Z edloper $ # """ The HTML output generator for epydoc. The main interface provided by this module is the L{HTMLWriter} class. @todo: Add a cache to L{HTMLWriter.url()}? """ __docformat__ = 'epyt...
apache-2.0
milrob/essentia
test/src/unittest/spectral/test_rolloff.py
10
2171
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
agpl-3.0
jzoldak/edx-platform
cms/djangoapps/contentstore/courseware_index.py
52
27599
""" Code to allow module store to interface with courseware index """ from __future__ import absolute_import from abc import ABCMeta, abstractmethod from datetime import timedelta import logging import re from six import add_metaclass from django.conf import settings from django.utils.translation import ugettext_lazy,...
agpl-3.0
vprime/puuuu
env/bin/pilfile.py
1
2645
#!/Users/Vincent/lm_svn/checkouts/personal/papertrail-django/env/bin/python # # The Python Imaging Library. # $Id$ # # a utility to identify image files # # this script identifies image files, extracting size and # pixel mode information for known file formats. Note that # you don't need the PIL C extension to use thi...
mit
felixjimenez/django
django/contrib/gis/db/backends/mysql/compiler.py
120
1089
from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler from django.db.backends.mysql import compiler SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler): def resolve_columns(self, row, fields=()): """ Integrate the cases hand...
bsd-3-clause
beni55/django
tests/urlpatterns_reverse/namespace_urls.py
19
2458
from django.conf.urls import include, url from . import views class URLObject(object): def __init__(self, app_name, namespace): self.app_name = app_name self.namespace = namespace def urls(self): return ([ url(r'^inner/$', views.empty_view, name='urlobject-view'), ...
bsd-3-clause
bsmrstu-warriors/Moytri---The-Drone-Aider
Lib/site-packages/scipy/signal/tests/test_windows.py
61
2756
from numpy import array, ones_like from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy import signal cheb_odd_true = array([0.200938, 0.107729, 0.134941, 0.165348, 0.198891, 0.235450, 0.274846, 0.316836, 0.361119, 0.407338, 0.455079, 0.5038...
gpl-3.0
lucernae/feti
django_project/feti/tests/test_views.py
2
2404
# # coding=utf-8 # """Module related to test for all the models.""" # from django.test import TestCase # from django.test.client import Client # from django.core.urlresolvers import reverse # from django.utils.http import urlsafe_base64_encode # from django.utils.encoding import force_bytes # # from feti.tests.model_fa...
bsd-2-clause
indictranstech/buyback-erp
erpnext/stock/report/stock_ageing/stock_ageing.py
21
3496
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import date_diff, flt def execute(filters=None): columns = get_columns() item_details = get_...
agpl-3.0
swegener/gruvi
src/build_http.py
1
3155
# # This file is part of Gruvi. Gruvi is free software available under the # terms of the MIT license. See the file "LICENSE" that was provided # together with this source file for the licensing terms. # # Copyright (c) 2012-2017 the Gruvi authors. See the file "AUTHORS" for a # complete list. from __future__ import a...
mit
aroberge/docpicture
examples/fake_turtle.py
1
7015
""" This is a fake turtle module (with no relevant executable code, other than a local docpicture parser included for testing) obtained through severely amputating the original turtle module, for the purpose of demonstrating the docpicture concept. We start by including a drawing made with a docpicture "parser" that i...
bsd-3-clause
sunzhxjs/JobGIS
lib/python2.7/site-packages/numpy/distutils/cpuinfo.py
173
22970
#!/usr/bin/env python """ cpuinfo Copyright 2002 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. NO WARRANTY IS EXP...
mit
eric02138/iot_harvard
node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
pedrobaeza/OpenUpgrade
addons/account_anglo_saxon/invoice.py
50
13086
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) # 2004-2010 Tiny SPRL (<http://tiny.be>). # 2009-2010 Veritos (http://veritos.nl). # All Rights Reserved # # This program is free software: you can redistri...
agpl-3.0
jbrendel/RESTx
src/python/restx/components/test/test_Filter.py
1
7040
""" RESTx: Sane, simple and effective data publishing and integration. Copyright (C) 2010 MuleSoft Inc. http://www.mulesoft.com 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...
gpl-3.0
DARKPOP/external_chromium_org
tools/telemetry/third_party/png/png.py
161
157814
#!/usr/bin/env python # $URL$ # $Rev$ # png.py - PNG encoder/decoder in pure Python # # Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org> # Portions Copyright (C) 2009 David Jones <drj@pobox.com> # And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org> # # Original concept by Johann...
bsd-3-clause
espadrine/opera
chromium/src/third_party/scons-2.0.1/engine/SCons/Tool/MSCommon/vs.py
61
18216
# # 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 restriction, including # without li...
bsd-3-clause
godiard/tamtam
common/Util/ThemeWidgets.py
2
49812
from gi.repository import Gtk, Gdk, GdkPixbuf import cairo import logging import common.Config as Config from common.Config import imagefile from common.Util import CairoUtil from sugar3.graphics.combobox import ComboBox from sugar3.graphics.palette import Palette, WidgetInvoker class ImageVScale(Gtk.VScale): ...
gpl-2.0
Brainiq7/Ananse
ananse_dl/extractor/worldstarhiphop.py
31
1824
from __future__ import unicode_literals import re from .common import InfoExtractor class WorldStarHipHopIE(InfoExtractor): _VALID_URL = r'https?://(?:www|m)\.worldstar(?:candy|hiphop)\.com/videos/video\.php\?v=(?P<id>.*)' _TEST = { "url": "http://www.worldstarhiphop.com/videos/video.php?v=wshh6a7q1...
unlicense
OSEHRA/VistA
Utilities/Dox/PythonScripts/DataDictionaryParser.py
2
30479
#!/usr/bin/env python # A logFileParser class to parse VistA FileMan Schema log files and generate # the FileMan Schema and dependencies among packages. #--------------------------------------------------------------------------- # Copyright 2012 The Open Source Electronic Health Record Agent # # Licensed under the Ap...
apache-2.0
hmarkus/dynclasp
DflatDecomposition.py
1
2536
#!/bin/python class DflatIdentifiable(object): def __init__(self, keys): self._keys = keys def add(self, val): self._keys.append(val) def __repr__(self): return self.__str__() def __str__(self): return str(self._keys) def id(self): return DflatIdentifiable.idstr(self._keys) def keys(self): retu...
gpl-3.0
weka-io/boto
boto/cloudhsm/exceptions.py
135
1347
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. 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 ...
mit
wghoffa/op-build
doc/conf.py
3
5445
# -*- coding: utf-8 -*- # # OpenPOWER Firmware documentation build configuration file, created by # sphinx-quickstart on Thu Oct 12 14:38:45 2017. # # 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 ...
gpl-2.0
simzacks/jjb
jenkins_jobs/xml_config.py
17
3416
#!/usr/bin/env python # Copyright (C) 2015 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0