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
bop/foundation
lib/python2.7/site-packages/django/utils/translation/trans_null.py
97
1983
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_unicode from django...
gpl-2.0
Awesomeomics/webserver
env/lib/python2.7/site-packages/pip/_vendor/html5lib/ihatexml.py
1727
16581
from __future__ import absolute_import, division, unicode_literals import re import warnings from .constants import DataLossWarning baseChar = """ [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-...
mit
scikit-xray/scikit-xray
doc/sphinxext/plot_generator.py
8
10150
""" Sphinx plugin to run example scripts and create a gallery page. Taken from seaborn project, which is turn was lightly modified from the mpld3 project. """ from __future__ import division import os import os.path as op import re import glob import token import tokenize import shutil import json import matplotlib ...
bsd-3-clause
relateiq/dd-agent
modules.py
50
3205
""" Tools for loading Python modules from arbitrary locations. """ # stdlib import imp import os import re import sys # project from util import windows_friendly_colon_split WINDOWS_PATH = re.compile('[A-Z]:.*', re.IGNORECASE) def imp_type_for_filename(filename): """Given the name of a Python module, return a t...
bsd-3-clause
optima-ict/odoo
addons/mail/models/mail_mail.py
1
14858
# -*- coding: utf-8 -*- import base64 import logging from email.utils import formataddr import psycopg2 from openerp import _, api, fields, models from openerp import tools from openerp.addons.base.ir.ir_mail_server import MailDeliveryException from openerp.tools.safe_eval import safe_eval as eval _logger = logging...
agpl-3.0
Feed-The-Web/ok-deploy
src/ok_deploy/__main__.py
1
2907
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Command line interface. """ # Copyright © 2015 1&1 Group # # 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.apa...
apache-2.0
nealtodd/django
django/contrib/gis/geos/prepared.py
17
1636
from .base import GEOSBase from .prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes the contains covers, and intersects operations. """ ptr_type = capi.PREPGEOM_PTR def __init_...
bsd-3-clause
wfxiang08/django178
tests/httpwrappers/tests.py
5
25983
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import copy import json import os import pickle import unittest import warnings from django.core.exceptions import SuspiciousOperation from django.core.serializers.json import DjangoJSONEncoder from django.core.signals import request_finished from djan...
bsd-3-clause
spinellic/Mission-Planner
Lib/site-packages/numpy/lib/tests/test_financial.py
83
1912
from numpy.testing import * import numpy as np class TestFinancial(TestCase): def test_rate(self): assert_almost_equal(np.rate(10,0,-3500,10000), 0.1107, 4) def test_irr(self): v = [-150000, 15000, 25000, 35000, 45000, 60000] assert_almost_equal(np.irr(v), ...
gpl-3.0
trnewman/VT-USRP-daughterboard-drivers
gr-howto-write-a-block/python/qa_howto.py
19
1960
#!/usr/bin/env python # # Copyright 2004,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your opt...
gpl-3.0
bguillot/OpenUpgrade
openerp/report/render/rml2pdf/customfonts.py
119
3491
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 P. Christeas, Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP SA. (http://www.openerp.com) # # This program is free so...
agpl-3.0
alejob/mdanalysis
testsuite/MDAnalysisTests/coordinates/test_gro.py
1
15800
from unittest import TestCase import MDAnalysis as mda import numpy as np from MDAnalysis.coordinates.GRO import GROReader, GROWriter from MDAnalysisTests import make_Universe from MDAnalysisTests.coordinates.base import BaseReference, BaseReaderTest, BaseWriterTest, BaseTimestepTest from MDAnalysisTests.coordinates.r...
gpl-2.0
essanpupil/ScamSearcher
website_analyzer/views.py
1
19014
"""views module for website_analyzer app.""" from django.shortcuts import render, get_object_or_404, redirect from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.contrib.auth.decorators import login_required from website_management.models import Website, Webpage, Domain from website_an...
gpl-3.0
rooshilp/CMPUT410Lab6
virt_env/virt1/lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py
102
1585
from __future__ import unicode_literals from unittest import skipUnless from django.apps import apps from django.conf import settings from .base import SitemapTestsBase class FlatpagesSitemapTests(SitemapTestsBase): @skipUnless(apps.is_installed('django.contrib.flatpages'), "django.contrib.fla...
apache-2.0
geonition/releases
geonition/geonition/settings_example.py
1
2722
from settings.base import * # Make this unique, and don't share it with anybody. SECRET_KEY = 'a(oav_%x)udnsh5w$=4@+pyxp93ys%c9wa8ck(=22_1d*w2gws' ADMINS = ( ('firstname lastname', 'firstname.lastname@somewhere.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.ba...
mit
8devices/IoTPy
IoTPy/detect_sfp_serial.py
1
1800
import platform import glob import serial from IoTPy.sfp import encode_sfp, decode_sfp from IoTPy.errors import IoTPy_APIError from uuid import UUID def detect_sfp_serial(uid=None): ports_list = [] my_platform = platform.system() if uid: uid = UUID(uid) if my_platform == "Windows": fo...
mit
czgu/metaHack
env/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py
69
2285
import calendar from email.utils import formatdate, parsedate from datetime import datetime, timedelta def expire_after(delta, date=None): date = date or datetime.now() return date + delta def datetime_to_header(dt): return formatdate(calendar.timegm(dt.timetuple())) class BaseHeuristic(object): ...
apache-2.0
cewood/ansible
docsite/build-site.py
211
2937
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of the Ansible Documentation # # 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 th...
gpl-3.0
dotpmrcunha/gnuradio
gr-blocks/python/blocks/qa_affinity.py
57
1481
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
bsipocz/statsmodels
statsmodels/tsa/tests/results/results_ar.py
36
9626
import numpy as np import os class ARLagResults(object): """ Results are from R vars::VARselect for sunspot data. Comands run were var_select <- VARselect(SUNACTIVITY, lag.max=16, type=c("const")) """ def __init__(self, type="const"): # order of results is AIC, HQ, SC, FPE if ...
bsd-3-clause
FYP-DES5/deepscan-core
misc/Calibrator.py
1
1514
import numpy as np import cv2 import freenect # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((7*9,3), np.float32) objp[:,:2] = np.mgrid[0:9,0:7].T.reshape(-1,2) # Arrays to store ob...
mit
shareefalis/ace-iphone
tools/python/doc/source/pyqt_linphone_example.py
32
1340
import linphone import logging import sys from PyQt4.QtCore import QTimer from PyQt4.QtGui import QApplication def main(): logging.basicConfig(level=logging.INFO) app = QApplication(sys.argv) def log_handler(level, msg): method = getattr(logging, level) method(msg) d...
gpl-2.0
bokeh/bokeh
bokeh/model.py
1
31808
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
baliga-lab/cmonkey2
cmonkey/organism.py
1
13572
# vi: sw=4 ts=4 et: """organism.py - organism-specific functionality in cMonkey This module captures a microbial organism that receives data from Microbes Online and RSAT This file is part of cMonkey Python. Please see README and LICENSE for more information and licensing details. """ import logging import collections...
lgpl-3.0
TheTimmy/spack
var/spack/repos/builtin/packages/x11perf/package.py
3
1787
############################################################################## # Copyright (c) 2013-2017, 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
andyofmelbourne/crappy-crystals
utils/phasing_3d/utils/duck.py
2
3322
import os import numpy as np from . import noise from . import support from . import circle def generate_diff(config): solid_unit = make_3D_duck(shape = config['sample']['shape']) Solid_unit = np.fft.fftn(solid_unit, config['detector']['shape']) solid_unit_expanded = np.fft.ifftn(Solid_unit) diff...
gpl-3.0
embray/numpy
numpy/core/tests/test_multiarray_assignment.py
47
1922
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import TestCase ndims = 2 size = 10 shape = tuple([size] * ndims) def _indices_for_nelems(nelems): """Returns slices of length nelems, from start onwards, in direction sign.""" if nelems == 0: ret...
bsd-3-clause
40023154/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/base.py
603
4652
#!/usr/bin/env python ## https://bitbucket.org/pygame/pygame/raw/2383b8ab0e2273bc83c545ab9c18fee1f3459c64/pygame/base.py '''Pygame core routines Contains the core routines that are used by the rest of the pygame modules. Its routines are merged directly into the pygame namespace. This mainly includes the auto-initia...
gpl-2.0
Mistobaan/tensorflow
tensorflow/python/training/proximal_adagrad.py
100
5237
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
krishna-pandey-git/django
django/contrib/admin/actions.py
395
3316
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
bsd-3-clause
FireBladeNooT/Medusa_1_6
lib/sqlalchemy/testing/plugin/bootstrap.py
156
1634
""" Bootstrapper for nose/pytest plugins. The entire rationale for this system is to get the modules in plugin/ imported without importing all of the supporting library, so that we can set up things for testing before coverage starts. The rationale for all of plugin/ being *in* the supporting library in the first pla...
gpl-3.0
shirou/ansible
lib/ansible/utils/__init__.py
2
55660
# (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
inonit/wagtail
wagtail/tests/snippets/models.py
5
1397
from django.db import models from django.utils.encoding import python_2_unicode_compatible from wagtail.wagtailsearch import index from wagtail.wagtailsnippets.models import register_snippet # AlphaSnippet and ZuluSnippet are for testing ordering of # snippets when registering. They are named as such to ensure # t...
bsd-3-clause
gengue/django
tests/model_fields/test_imagefield.py
181
16062
from __future__ import unicode_literals import os import shutil from unittest import skipIf from django.core.exceptions import ImproperlyConfigured from django.core.files import File from django.core.files.images import ImageFile from django.test import TestCase from django.utils._os import upath try: from .mode...
bsd-3-clause
qgis/QGIS
python/plugins/processing/algs/gdal/hillshade.py
30
9025
# -*- coding: utf-8 -*- """ *************************************************************************** hillshade.py --------------------- Date : October 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com ***************...
gpl-2.0
mov-q/dumpy
discariche/model/bibmedia.py
1
1155
"""Person model""" from sqlalchemy import Column, UniqueConstraint, ForeignKey from sqlalchemy import schema as saschema from sqlalchemy.types import Integer, String, Unicode, Float, UnicodeText, Date, DateTime from discariche.model.meta import Base class BibMedia(Base): __tablename__ = "bib_media" id = Colu...
gpl-3.0
dillonjerry/aws
AWS-ElasticBeanstalk-CLI-2.6.2/eb/macosx/python2.7/scli/api_wrapper.py
9
10150
#!/usr/bin/env python #============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the...
gpl-2.0
saddamhbb/social-media
node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# Copyright (c) 2012 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
mit
joshuajan/odoo
addons/hr_evaluation/report/hr_evaluation_report.py
44
4676
# -*- 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
justinlulejian/fah-gae
lib/pyasn1/type/univ.py
20
88472
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # import operator import sys import math from pyasn1.type import base, tag, constraint, namedtype, namedval, tagmap from pyasn1.codec.ber import eoo from pyasn1.compat imp...
mit
YongseopKim/crosswalk-test-suite
wrt/wrt-digitalsign-tizen-tests/inst.wgt.py
9
7049
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
reubano/tabutils
meza/io.py
2
52280
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ meza.io ~~~~~~~ Provides methods for reading/writing/processing tabular formatted files Examples: basic usage:: >>> from meza.io import read_csv >>> >>> path = p.join(DATA_DIR, 'test.csv') >>> csv_record...
mit
bobisme/odoo
addons/hr_contract/hr_contract.py
302
5377
# -*- 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
s20121035/rk3288_android5.1_repo
external/chromium_org/tools/json_schema_compiler/schema_util.py
139
1125
# 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. """Utilies for the processing of schema python structures. """ def CapitalizeFirstLetter(value): return value[0].capitalize() + value[1:] def GetName...
gpl-3.0
muddy1/herckernels
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
h4wkmoon/shinken
shinken/reactionnerlink.py
1
2145
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you c...
agpl-3.0
ehogan/iris
lib/iris/tests/unit/util/test_array_equal.py
17
4717
# (C) British Crown Copyright 2014 - 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...
lgpl-3.0
hunter007/django
tests/utils_tests/test_archive.py
372
2386
import os import shutil import tempfile import unittest from django.utils._os import upath from django.utils.archive import Archive, extract TEST_DIR = os.path.join(os.path.dirname(upath(__file__)), 'archives') class ArchiveTester(object): archive = None def setUp(self): """ Create temporar...
bsd-3-clause
chenjun0210/tensorflow
tensorflow/tools/dist_test/scripts/k8s_tensorflow_lib.py
131
9280
# 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
Nihn/Diamond-1
src/collectors/aurora/test/testaurora.py
31
2449
#!/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 aurora import A...
mit
Dandandan/wikiprogramming
jsrepl/extern/python/closured/lib/python2.7/hotshot/stats.py
252
2582
"""Statistics analyzer for HotShot.""" import profile import pstats import hotshot.log from hotshot.log import ENTER, EXIT def load(filename): return StatsLoader(filename).load() class StatsLoader: def __init__(self, logfn): self._logfn = logfn self._code = {} self._stack = [] ...
mit
ProjectOpenCannibal/android_kernel_lg_geehrc4g
scripts/build-all.py
1250
9474
#! /usr/bin/env python # Copyright (c) 2009-2011, Code Aurora Forum. 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 # n...
gpl-2.0
Carrotsmile/CS428
steerstats/steersuitedb/CompositePLEBenchmark.py
8
13506
import psycopg2 from steersuitedb.Test import Test from steersuitedb.Composite2Benchmark import Composite2Benchmark class CompositePLEBenchmark(Composite2Benchmark): """A simple example class""" _id_name = "benchmark_id" _table_name = "compositeple_benchmark_technique" # Ensures proper ordering when ins...
gpl-3.0
MostAwesomeDude/construct
construct/lib/container.py
1
3947
""" Various containers. """ from UserDict import DictMixin from pprint import pformat def recursion_lock(retval, lock_name = "__recursion_lock__"): def decorator(func): def wrapper(self, *args, **kw): if getattr(self, lock_name, False): return retval setattr(self, l...
mit
viridia/coda
third-party/python/ply-3.4/test/yacc_missing1.py
174
1539
# ----------------------------------------------------------------------------- # yacc_missing1.py # # Grammar with a missing rule # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tok...
apache-2.0
maxamillion/tito
test/functional/builder_tests.py
8
3048
# # Copyright (c) 2008-2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a co...
gpl-2.0
kochetov-a/python_training
fixture/db.py
1
2732
import mysql.connector from model.group import Group from model.contact import Contact # Класс для работы с базой данных class DbFixture(): def __init__(self, host, name, user, password): # Инициализация параметров подключения к БД self.host = host self.name = name self.user = user ...
apache-2.0
mahajrod/MACE
scripts/draw_boxplots.py
1
5821
#!/usr/bin/env python __author__ = 'Sergei F. Kliver' import argparse from collections import OrderedDict import pandas as pd import matplotlib.pyplot as plt parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", action="store", dest="input", required=True, help="Input file with ...
apache-2.0
rew4332/tensorflow
tensorflow/contrib/slim/python/slim/learning.py
4
27076
# 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
ericd/redeem
redeem/Autotune_2.py
2
135061
""" Autotune for Redeem Author: Elias Bakken email: elias(dot)bakken(at)gmail(dot)com Website: http://www.thing-printer.com License: GNU GPL v3: http://www.gnu.org/copyleft/gpl.html Redeem is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by t...
gpl-3.0
Colonel-Top/Line-Bot-Python
python/gspread/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
mit
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/build/rmdir_and_stamp.py
54
1424
#!/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. """Wipes out a directory recursively and then touches a stamp file. This odd pairing of operations is used to support build script...
mit
centrumholdings/buildbot
twisted/plugins/buildbot_trial.py
1
1687
from zope.interface import implements from twisted.trial.itrial import IReporter from twisted.plugin import IPlugin # register a plugin that can create our CoverageReporter. The reporter itself # lives separately, in buildbot/test/trial_figleaf.py # note that this buildbot_trial.py file is *not* in a package: there ...
gpl-2.0
fpy171/scrapy
scrapy/commands/parse.py
108
8286
from __future__ import print_function import logging from w3lib.url import is_url from scrapy.commands import ScrapyCommand from scrapy.http import Request from scrapy.item import BaseItem from scrapy.utils import display from scrapy.utils.conf import arglist_to_dict from scrapy.utils.spider import iterate_spider_out...
bsd-3-clause
buildbot/buildbot
master/buildbot/steps/download_secret_to_worker.py
5
2760
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
shipEZ/flaskApp
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
713
2320
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_b...
mit
albertomurillo/ansible
lib/ansible/plugins/action/patch.py
107
2644
# (c) 2015, Brian Coca <briancoca+dev@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 v...
gpl-3.0
jfhumann/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/endtoend_with_external_server.py
496
2541
#!/usr/bin/env python # # Copyright 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 list...
mpl-2.0
tuhangdi/django
django/utils/baseconv.py
650
2982
# Copyright (c) 2010 Guilherme Gondim. All rights reserved. # Copyright (c) 2009 Simon Willison. All rights reserved. # Copyright (c) 2002 Drew Perttula. All rights reserved. # # License: # Python Software Foundation License version 2 # # See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF # ...
bsd-3-clause
nathanbjenx/cairis
cairis/core/Borg.py
2
2113
# 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...
apache-2.0
guaix-ucm/django-megaraetc
etc/output_table_MOS_E_S.py
2
4851
def tablenewpsfMES(snr_string, numframe_val_string, snrpframe_string, exptimepframe_val_string, exptime_val_string, etpframe_c_voxel_string, etallframe_c_voxel_string, etpframe_cr1_voxel_string, etallframe_cr1_voxel_string, etpframe_cr1r2_voxel_string, etallframe_cr1r2_voxel_string, etpframe_c_aa_string, etallframe_c_a...
gpl-3.0
mikewiebe-ansible/ansible
lib/ansible/module_utils/network/frr/providers/cli/config/bgp/neighbors.py
38
6708
# # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # import re from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import to_list from ansible.module_utils.network.frr.providers.providers import Cl...
gpl-3.0
goliate/sarakha63-persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/quickvid.py
36
1663
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( determine_ext, int_or_none, ) class QuickVidIE(InfoExtractor): _VALID_URL = r'https?://(www\.)?quickvid\.org/watch\.php\?v=(?P<id>[a-zA-Z_0-9-]+)' _...
gpl-3.0
javaos74/neutron
neutron/agent/linux/ra.py
41
5394
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
FlaPer87/django-nonrel
django/utils/functional.py
307
14218
# License for code in this file that was taken from Python 2.5. # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 # -------------------------------------------- # # 1. This LICENSE AGREEMENT is between the Python Software Foundation # ("PSF"), and the Individual or Organization ("Licensee") accessing and # otherwise usin...
bsd-3-clause
khs26/pele
cpp_tests/source/benchmarks/bench_minimization.py
5
2618
import time import sys import tempfile import subprocess import argparse import numpy as np from pele.potentials._lj_cpp import LJ as LJcpp from pele.potentials.lj import LJ as LJfortran from pele.optimize._quench import mylbfgs, lbfgs_py, lbfgs_cpp, lbfgs_scipy optimizers = { mylbfgs : "fortran lbfgs...
gpl-3.0
djabber/Dashboard
bottle/dash/local/lib/python2.7/encodings/cp852.py
593
35258
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
mit
dreilly369/MITMf
core/sslstrip/CookieCleaner.py
36
4385
# Copyright (c) 2014-2016 Moxie Marlinspike, Marcello Salvati # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This...
gpl-3.0
sudosurootdev/external_chromium_org
tools/deep_memory_profiler/lib/subcommand.py
62
5284
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import optparse import os import re from lib.bucket import BucketSet from lib.dump import Dump, DumpList from lib.symbol import SymbolDataSou...
bsd-3-clause
apache/incubator-eagle
eagle-external/hadoop_jmx_collector/lib/kafka-python/load_example.py
47
1473
#!/usr/bin/env python import threading, logging, time, collections from kafka.client import KafkaClient from kafka.consumer import SimpleConsumer from kafka.producer import SimpleProducer msg_size = 524288 class Producer(threading.Thread): daemon = True big_msg = "1" * msg_size def run(self): cl...
apache-2.0
songmonit/CTTMSONLINE_V8
openerp/report/printscreen/ps_list.py
381
11955
# -*- coding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
b-me/django
django/template/context.py
105
9348
import warnings from contextlib import contextmanager from copy import copy from django.utils.deprecation import RemovedInDjango110Warning # Hard-coded processor for easier use of CSRF protection. _builtin_context_processors = ('django.template.context_processors.csrf',) _current_app_undefined = object() class Con...
bsd-3-clause
dulems/hue
desktop/core/ext-py/Django-1.6.10/tests/many_to_one_null/tests.py
111
4478
from __future__ import absolute_import from django.test import TestCase from .models import Reporter, Article class ManyToOneNullTests(TestCase): def setUp(self): # Create a Reporter. self.r = Reporter(name='John Smith') self.r.save() # Create an Article. self.a = Article...
apache-2.0
flycn1985/shadowsocks
shadowsocks/daemon.py
386
5602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-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 requi...
apache-2.0
nishad-jobsglobal/odoo-marriot
openerp/tools/pdf_utils.py
456
3659
# -*- coding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
amazinger2013/OpenSesame
libqtopensesame/runners/external_runner.py
2
3049
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
gpl-3.0
xxd3vin/spp-sdk
tools/script/python/config.py
1
4192
# coding=utf-8 import os import sys ################################################################# #### 工具的环境变量 ################################################################# # SPP_HOME SPP_HOME = os.environ['SPP_HOME'] # SPP HOME SPP_BIN = '%s%s' % (SPP_HOME, '\spp') # chenyang: 该变量已经由`SPP_CONVERTER`变量取代...
mit
hatwar/buyback-frappe
frappe/integrations/doctype/dropbox_backup/dropbox_backup.py
6
6716
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # SETUP: # install pip install --upgrade dropbox # # Create new Dropbox App # # in conf.py, set oauth2 settings # dropbox_access_key # dropbox_access_secret from __future__ im...
mit
wa1tnr/ainsuSPI
0-Distribution.d/circuitpython-master/tests/float/string_format_modulo.py
8
1241
print("%s" % 1.0) print("%r" % 1.0) print("%d" % 1.0) print("%i" % 1.0) print("%u" % 1.0) # these 3 have different behaviour in Python 3.x versions # uPy raises a TypeError, following Python 3.5 (earlier versions don't) #print("%x" % 18.0) #print("%o" % 18.0) #print("%X" % 18.0) print("%e" % 1.23456) print("%E" % 1....
mit
bankonme/cjdns
node_build/dependencies/libuv/build/gyp/test/subdirectory/gyptest-subdir-default.py
185
1026
#!/usr/bin/env python # Copyright (c) 2012 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. """ Verifies building a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output build director...
gpl-3.0
jriguera/Diamond
src/collectors/jcollectd/jcollectd.py
30
5977
# coding=utf-8 """ The JCollectdCollector is capable of receiving Collectd network traffic as sent by the JCollectd jvm agent (and child Collectd processes). Reason for developing this collector is allowing to use JCollectd, without the need for Collectd. A few notes: This collector starts a UDP server to receive d...
mit
chrismeyersfsu/ansible
lib/ansible/modules/system/debconf.py
23
5865
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to configure .deb packages. (c) 2014, Brian Coca <briancoca+ansible@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 Softwa...
gpl-3.0
rht/universe
universe/rewarder/connection_timer.py
2
2645
import os import re import signal import time from universe import error from universe.twisty import reactor from twisted.internet import defer, protocol import twisted.internet.error import logging logger = logging.getLogger(__name__) extra_logger = logging.getLogger('universe.extra.'+__name__) class ConnectionTime...
mit
luotao1/Paddle
python/paddle/fluid/tests/unittests/test_elementwise_min_op.py
2
5408
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
Alignak-monitoring-contrib/alignak-backend
alignak_backend/models/host.py
1
40791
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(friendly=False): """Get name of this resource :return: name of this resource :rtype: str """ if friendly: # pragma: no cover return 'Monitored host' return 'host' def get_doc(): # pragm...
agpl-3.0
kustodian/ansible
lib/ansible/modules/network/check_point/cp_mgmt_threat_exception_facts.py
20
8026
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
aman-tugnawat/namebench
libnamebench/site_connector.py
175
4048
# Copyright 2010 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 ...
apache-2.0
rosswhitfield/mantid
qt/python/mantidqt/dialogs/test/test_algorithm_dialog.py
3
2348
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2017 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
google/loaner
loaner/web_app/backend/lib/user_test.py
1
1999
# Copyright 2018 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
thefab/docker-consul-driven-haproxy
root/usr/local/bin/consul_request.py
1
6987
#!/bin/env python import os import sys import uuid import json import argparse import random def _id_to_container_name_fn(service_id): tmp = service_id.split(':') if len(tmp) == 3 or len(tmp) == 4: return tmp[1] else: return service_id def consul_kv(consul, path, timeout=10): random...
mit