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 |
|---|---|---|---|---|---|
BlackBox-CSP/subbrute | dnslib/intercept.py | 13 | 5749 | # -*- coding: utf-8 -*-
"""
InterceptResolver - proxy requests to upstream server
(optionally intercepting)
"""
from __future__ import print_function
import binascii,copy,socket,struct,sys
from dnslib import DNSRecord,RR,QTYPE,RCODE,parse_time
from dnslib.server import DNSServer... | gpl-3.0 |
TridevGuha/django | tests/migrations/test_multidb.py | 366 | 6909 | import unittest
from django.db import connection, migrations, models
from django.db.migrations.state import ProjectState
from django.test import override_settings
from .test_operations import OperationTestBase
try:
import sqlparse
except ImportError:
sqlparse = None
class AgnosticRouter(object):
"""
... | bsd-3-clause |
thomazs/geraldo | site/newsite/site-geraldo/django/template/debug.py | 38 | 3567 | from django.template import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
class DebugLexer(Lexer):
def __init__(self, template_string, origin):
... | lgpl-3.0 |
jgcaaprom/android_external_chromium_org | chrome/tools/build/repack_locales.py | 25 | 10221 | #!/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.
"""Helper script to repack paks for a list of locales.
Gyp doesn't have any built-in looping capability, so this just provides a w... | bsd-3-clause |
django-leonardo/horizon | horizon/test/webdriver.py | 6 | 7136 | #
# Copyright (c) 2011-2013 Canonical Ltd.
#
# This file is part of: SST (selenium-simple-test)
# https://launchpad.net/selenium-simple-test
#
# 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 L... | apache-2.0 |
bakergo/gbnotes | Note.py | 1 | 2690 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Handles note interactions with files"""
import datetime
import sqlite3
class NoteFile:
"""Abstraction of a file containing notes"""
def __init__(self, path):
"""Initialize the note file using the provided path"""
self.open_file = None
self.op... | mit |
peeyush-tm/shinken | test/test_bad_service_interval.py | 17 | 1430 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Sebastien Coavoux, s.coavoux@free.fr
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
davidzchen/tensorflow | tensorflow/python/lib/core/bfloat16_test.py | 5 | 10362 | # 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 |
bottompawn/kbengine | kbe/res/scripts/common/Lib/pickletools.py | 74 | 91170 | '''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None, indentl... | lgpl-3.0 |
jenskutilek/RoboFont | scripts/ChangeUPM.py | 1 | 3437 | # Change upm
# Jens Kutilek 2013-01-02
from mojo.roboFont import version
def scalePoints(glyph, factor):
if version == "1.4":
# stupid workaround for bug in RoboFont 1.4
for contour in glyph:
for point in contour.points:
point.x *= factor
point.y *= fact... | mit |
rodrigods/keystone | keystone/openstack/common/jsonutils.py | 3 | 6840 | # 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 |
mateuszmidor/GumtreeOnMap | src/pygeocoder/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-2.0 |
PaulWay/spacewalk | backend/server/importlib/backendOracle.py | 1 | 23858 | #
# Copyright (c) 2008--2012 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 c... | gpl-2.0 |
davidyezsetz/kuma | vendor/packages/ipython/IPython/usage.py | 7 | 31160 | # -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#**********... | mpl-2.0 |
softlayer/softlayer-python | tests/CLI/modules/licenses_test.py | 2 | 1267 | """
SoftLayer.tests.CLI.modules.licenses_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
from SoftLayer.fixtures import SoftLayer_Product_Order
from SoftLayer.fixtures import SoftLayer_Product_Package
from SoftLayer import testing
class LicensesTests(testi... | mit |
iabdalkader/openmv | scripts/examples/02-Board-Control/hid.py | 1 | 1184 | # Making OpenMV Camera act as a Mouse using HID.
#
# First we need to create boot.py file to change the default USB mode (VCP+MSC).
# Note: It is recommended to save this file to uSD card not the flash storage.
# This will make it easier to restore the default OpenMV (VCP+MSC) USB mode later
# by just deleting boot.py ... | mit |
indexofire/gork | src/gork/application/know/models/urlpath.py | 1 | 11708 | # -*- coding: utf-8 -*-
import logging
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models, tra... | mit |
juanyaw/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/koi8_r.py | 93 | 14342 | """ Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.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_table)
def decode(self... | apache-2.0 |
chongtianfeiyu/kbengine | kbe/res/scripts/common/Lib/encodings/big5hkscs.py | 816 | 1039 | #
# big5hkscs.py: Python Unicode Codec for BIG5HKSCS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_hk, codecs
import _multibytecodec as mbc
codec = _codecs_hk.getcodec('big5hkscs')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.Multib... | lgpl-3.0 |
vineodd/PIMSim | GEM5Simulation/gem5/configs/common/MemConfig.py | 1 | 13489 | # Copyright (c) 2013, 2017 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the function... | gpl-3.0 |
jiongjiongwang/FirstCocos2Ddemo | cocos2d/tools/particle/convert_YCoordFlipped.py | 89 | 2224 | #!/usr/bin/python
#ConvertYCoordFlipped.py
import plistlib
import os.path
import argparse
import glob
import shutil
#keys in dictionary
metaDataKey = 'metaData'
yCoordFlippedConvertedKey = 'yCoordFlippedConverted'
yCoordFlippedKey = 'yCoordFlipped'
#check if the particle file has been converted
def checkFlippedConve... | mit |
nonrational/qt-everywhere-opensource-src-4.8.6 | src/3rdparty/webkit/Source/ThirdParty/gyp/test/actions/gyptest-default.py | 13 | 1923 | #!/usr/bin/env python
# Copyright (c) 2009 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 simple actions when using the default build target.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actions.gyp', ... | lgpl-2.1 |
KamalAwasthi/FullContact | myvenv/lib/python3.4/site-packages/django/db/models/fields/related.py | 31 | 68690 | from __future__ import unicode_literals
import warnings
from functools import partial
from django import forms
from django.apps import apps
from django.core import checks, exceptions
from django.db import connection, router
from django.db.backends import utils
from django.db.models import Q
from django.db.models.dele... | apache-2.0 |
SerpentCS/odoo | addons/l10n_bo/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
bgruening/galaxy-bgisoap | tools/soapdenovo2_contig/soapdenovo2_contig_wrapper.py | 2 | 6057 | """
soapdenovo2_contig.py
A wrapper script for SOAPdenovo2 contig module
Copyright Peter Li - GigaScience and BGI-HK
"""
import optparse
import os
import shutil
import subprocess
import sys
import tempfile
def stop_err(msg):
sys.stderr.write(msg)
sys.exit()
def cleanup_before_exit(tmp_dir):
if tmp_dir... | gpl-3.0 |
loco-odoo/localizacion_co | openerp/addons-extra/account_tax_invoice/account.py | 6 | 4494 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
inovtec-solutions/OpenERP | openerp/addons/mrp/procurement.py | 13 | 7268 | # -*- 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 |
xzturn/tensorflow | tensorflow/python/training/monitored_session.py | 7 | 58287 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
benoitsteiner/tensorflow-xsmm | tensorflow/python/framework/framework_lib.py | 39 | 3589 | # 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 |
LaoZhongGu/kbengine | kbe/src/lib/python/Lib/encodings/hp_roman8.py | 647 | 7391 | """ Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py.
Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen)
Original source: LaserJet IIP Printer User's Manual HP part no
33471-90901, Hewlet-Packard, June 1989.
"""#"
import codecs
### Codec APIs
class ... | lgpl-3.0 |
kevindehecker/paparazzi | sw/airborne/test/ahrs/ahrs_utils.py | 86 | 4923 | #! /usr/bin/env python
# Copyright (C) 2011 Antoine Drouin
#
# This file is part of Paparazzi.
#
# Paparazzi 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, or (at your option)
# any later ... | gpl-2.0 |
wangzheng0822/algo | python/39_back_track/01_bag.py | 1 | 1713 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from typing import List
# 背包选取的物品列表
picks = []
picks_with_max_value = []
def bag(capacity: int, cur_weight: int, items_info: List, pick_idx: int):
"""
回溯法解01背包,穷举
:param capacity: 背包容量
:param cur_weight: 背包当前重量
:param items_info: 物品的重量和价值信息
:param pi... | apache-2.0 |
android-ia/platform_tools_idea | plugins/hg4idea/testData/bin/mercurial/hgweb/server.py | 91 | 11762 | # hgweb/server.py - The standalone hg web server.
#
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, sys,... | apache-2.0 |
cryptogizmo/eschilling | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
david-furminieux/movingForest | src/taj/parser/test.py | 1 | 16179 |
from taj.expr import Expression, Integer, Float, NullConstant, String, Summ, \
Product, Function
from taj.logic import Conjunction, Disjunction, Comparaison, Boolean, IsNull
from taj.parser.stmt import SelectStatement, SimpleRelation, Rename, \
StreamCreationStatement, TableCreationStatement, UpdateStatement, ... | lgpl-3.0 |
renyi533/tensorflow | tensorflow/python/grappler/layout_optimizer_test.py | 4 | 59989 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
felixfontein/ansible | test/support/integration/plugins/modules/ec2_group.py | 49 | 57129 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
# 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',
... | gpl-3.0 |
willingc/oh-mainline | vendor/packages/celery/celery/db/models.py | 18 | 2222 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import datetime
import sqlalchemy as sa
from .. import states
from .session import ResultModelBase
# See docstring of a805d4bd for an explanation for this workaround ;)
if sa.__version__.startswith('0.5'):
from .dfd042c7 import Pickle... | agpl-3.0 |
mikehulluk/ProcessManager | www/js/brython/Lib/test/test_traceback.py | 34 | 13164 | """Test cases for traceback module"""
from _testcapi import traceback_print, exception_print
from io import StringIO
import sys
import unittest
import re
from test.support import run_unittest, Error, captured_output
from test.support import TESTFN, unlink
import traceback
class SyntaxTracebackCases(unittest.TestCas... | bsd-2-clause |
repotvsupertuga/tvsupertuga.repository | plugin.video.TVsupertuga/pyaes.py | 189 | 16661 | """Simple AES cipher implementation in pure Python following PEP-272 API
Homepage: https://bitbucket.org/intgr/pyaes/
The goal of this module is to be as fast as reasonable in Python while still
being Pythonic and readable/understandable. It is licensed under the permissive
MIT license.
Hopefully the code is readabl... | gpl-2.0 |
moijes12/oh-mainline | vendor/packages/sphinx/sphinx/util/matching.py | 16 | 2297 | # -*- coding: utf-8 -*-
"""
sphinx.util.matching
~~~~~~~~~~~~~~~~~~~~
Pattern-matching utility functions for Sphinx.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
def _translate_pattern(pat):
"""Translate a shell-style... | agpl-3.0 |
hgl888/blink-crosswalk-efl | Tools/Scripts/webkitpy/layout_tests/port/browser_test_unittest.py | 27 | 4226 | # Copyright (C) 2014 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 |
atvcaptain/enigma2 | lib/python/Components/Task.py | 1 | 15727 | # -*- coding: utf-8 -*-
# A Job consists of many "Tasks".
# A task is the run of an external tool, with proper methods for failure handling
from __future__ import print_function
from Tools.CList import CList
class Job(object):
NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = range(4)
def __init__(self, name):
self.ta... | gpl-2.0 |
mavit/ansible | test/units/module_utils/facts/other/test_facter.py | 118 | 8093 | # unit tests for ansible other facter fact collector
# -*- coding: utf-8 -*-
#
# 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 |
wathen/PhD | MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/GeneralisedEigen/NoBC/3d/MHDfluid.py | 1 | 12701 |
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
Print = PETSc.Sys.Print
from dolfin import *
# from MatrixOperations import *
import numpy as np
#import matplotlib.pylab as plt
import PETScIO as IO
import common
import scipy
import scipy.io
import time
import BiLinear as forms
import... | mit |
cswiercz/sympy | sympy/printing/dot.py | 103 | 6644 | from __future__ import print_function, division
from sympy import (Basic, Expr, Symbol, Integer, Rational, Float,
default_sort_key, Add, Mul)
__all__ = ['dotprint']
default_styles = [(Basic, {'color': 'blue', 'shape': 'ellipse'}),
(Expr, {'color': 'black'})]
sort_classes = (Add, Mul)
slotClasses = (... | bsd-3-clause |
2742195759/my-first-repo | .ycm_extra_conf.py | 5 | 5426 | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | gpl-3.0 |
direvus/ansible | lib/ansible/modules/network/ios/ios_l3_interface.py | 29 | 10186 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
vslavik/poedit | deps/boost/tools/build/test/standalone.py | 51 | 1116 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
# Regression tests: standalone project were not ab... | mit |
SimVascular/VTK | Filters/Core/Testing/Python/mergeFilter.py | 20 | 2976 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
ren2 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSamples(0)
renWin.AddRenderer(ren... | bsd-3-clause |
ralphbean/func-ralphbean-devel | test/unittest/test_config.py | 5 | 7135 | #!/usr/bin/python
import os
import socket
import unittest
from certmaster import config
from test_client import BaseTest
# a test config class we can do mean thigns to
# NOTE: _empty options are disabled at the moment, need a more
# clever way to test those cases
config_file_1 = """
[main]
option = this is an op... | gpl-2.0 |
rruebner/odoo | addons/anonymization/__openerp__.py | 119 | 2235 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
elluvium/Slider | server.py | 1 | 4104 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import time
import os
import bz2
import hashlib
import re
from optparse import OptionParser
import daemon
parser = OptionParser()
# parser.add_option('-t', '--start', dest='state', action='store_true',
# help='start as a daemon')
# parser.... | mit |
william-richard/moto | moto/dynamodb2/parsing/ast_nodes.py | 2 | 10765 | import abc
from abc import abstractmethod
from collections import deque
import six
from moto.dynamodb2.models import DynamoType
@six.add_metaclass(abc.ABCMeta)
class Node:
def __init__(self, children=None):
self.type = self.__class__.__name__
assert children is None or isinstance(children, list)... | apache-2.0 |
ueshin/apache-flink | flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/plan/Constants.py | 22 | 2392 | ################################################################################
# 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... | apache-2.0 |
pimier15/PyGUI | Kivy/Kivy/Bk_Interractive/sample/Chapter_04_code/python3/07 - Recognizing gestures - drawing with the finger/generaloptions.py | 16 | 1662 | # File name: generaloptions.py
import kivy
kivy.require('1.9.0')
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import NumericProperty, ListProperty
class GeneralOptions(BoxLayout):
group_mode = False
translation = ListProperty(None)
rotation = NumericProperty(0)
scale = NumericProperty(... | mit |
jeremydane/Info3180Lab4- | server/lib/werkzeug/local.py | 310 | 14094 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... | apache-2.0 |
arvinsingla/CouchPotatoServer | libs/dateutil/relativedelta.py | 216 | 17224 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
import datetime
import calendar
from six import integer_types
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"]
class wee... | gpl-3.0 |
Intel-tensorflow/tensorflow | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/cyclic_object_graph.py | 22 | 1521 | # Copyright 2019 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 |
lotspaih/dicePy8k | dicepy8k.py | 1 | 2714 | #!/usr/bin/env python3
# Copyright 2017 Mark Lotspaih
# MIT License https://opensource.org/licenses/MIT
# dicePy8k - Pseudorandom word generator for Diceware 8k passwords
# USE: Run this file from the command line adding a number for the
# word length as an argument or input length as needed.
# VERSION: 02... | mit |
louispotok/pandas | pandas/io/sas/sas7bdat.py | 3 | 27470 | """
Read SAS7BDAT files
Based on code written by Jared Hobbs:
https://bitbucket.org/jaredhobbs/sas7bdat
See also:
https://github.com/BioStatMatt/sas7bdat
Partial documentation of the file format:
https://cran.r-project.org/web/packages/sas7bdat/vignettes/sas7bdat.pdf
Reference for binary data compression:
h... | bsd-3-clause |
isislovecruft/leap_mx | src/leap/mx/util/net.py | 1 | 3493 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
net.py
-------
Utilities for networking.
@authors: Isis Agora Lovecruft, <isis@leap.se> 0x2cdb8b35
@license: see included LICENSE file
@copyright: 2013 Isis Agora Lovecruft
'''
import ipaddr
import sys
import socket
from random import randint
from leap.mx.util imp... | agpl-3.0 |
hkawasaki/kawasaki-aio8-0 | cms/djangoapps/models/settings/course_details.py | 10 | 8485 | import re
import logging
import datetime
import json
from json.encoder import JSONEncoder
from xmodule.modulestore import Location
from xmodule.modulestore.exceptions import ItemNotFoundError
from contentstore.utils import get_modulestore, course_image_url
from models.settings import course_grading
from xmodule.fields... | agpl-3.0 |
w1ll1am23/home-assistant | homeassistant/components/recollect_waste/__init__.py | 3 | 2990 | """The ReCollect Waste integration."""
from __future__ import annotations
import asyncio
from datetime import date, timedelta
from aiorecollect.client import Client, PickupEvent
from aiorecollect.errors import RecollectError
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssi... | apache-2.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/compute/rolling_updates/pause.py | 3 | 3017 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
bwrsandman/OpenUpgrade | addons/website_report/controllers/main.py | 243 | 1460 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
chenc10/Spark-PAF | ec2/lib/boto-2.34.0/boto/pyami/__init__.py | 396 | 1107 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | apache-2.0 |
Zack-Tillotson/open-door-the-game | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/PRESUBMIT.py | 496 | 3373 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | mit |
wakatime/vim-wakatime | packages/wakatime/packages/urllib3/filepost.py | 292 | 2321 | 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 embarrassingly-simple replacement for mimetools.choose_... | bsd-3-clause |
thecodinghub/news-for-good | news/models.py | 1 | 3552 | from django.db import models
from django.contrib.auth import get_user_model
from django.conf import settings
from django.core.urlresolvers import reverse
import misaka
# Create your models here.
User = get_user_model()
VOTE_TYPE = (("U", "Up"),("D", "Down"))
class Post(models.Model):
user = models.ForeignKey(Use... | bsd-3-clause |
2014cdag2/w17x1 | static/Brython3.1.3-20150514-095342/Lib/_sysconfigdata.py | 731 | 18167 | build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1... | agpl-3.0 |
nurmd2/nurmd | addons/website_event_track/controllers/event.py | 37 | 6809 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import collections
import datetime
import pytz
import re
import openerp
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.tools import html_escape
class website_event(http.Co... | gpl-3.0 |
Dandandan/wikiprogramming | jsrepl/build/extern/python/closured/lib/python2.7/distutils/command/build_ext.py | 71 | 32327 | """distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os, string, re
from types import *
fr... | mit |
ppyordanov/HCI_4_Future_Cities | Server/src/virtualenv/Lib/site-packages/pip/_vendor/requests/__init__.py | 1 | 1856 | # -*- 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('http://python.org')
>>> r.statu... | mit |
divyang4481/photivo | scons-local-2.2.0/SCons/Tool/packaging/tarbz2.py | 14 | 1837 | """SCons.Tool.Packaging.tarbz2
The tarbz2 SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Soft... | gpl-3.0 |
sgparry/openwrt-patched | scripts/flashing/jungo-image.py | 758 | 7069 | #!/usr/bin/env python
#
# Copyright 2008, 2009 (C) Jose Vasconcellos <jvasco@verizon.net>
#
# A script that can communicate with jungo-based routers
# (such as MI424-WR, USR8200 and WRV54G) to backup the installed
# firmware and replace the boot loader.
#
# Tested with Python 2.5 on Linux and Windows
#
"""Usage: %s [op... | gpl-2.0 |
LordGoodman/light-wallet | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
TLemur/freq-bot | src/plugins/net/quotes.py | 1 | 8245 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Imported from isida, talisman by quality(quality@botaq.net)
#Official conference - botaq@conference.jabber.ru
#Thanks to Disabler, Avinar, Als, Gigabyte, dr.Schmurge, PoisoneD, ferym
import urllib2,re,urllib, simplejson
from re import compile as re_compile
strip_tags = r... | gpl-3.0 |
ssudake21/ifconfig-parser | ifparser/ifconfig.py | 2 | 6703 | from __future__ import unicode_literals, print_function
from .re_scan import ScanEnd, Scanner
class Interface(object):
_attr_list = (
'interface', 'itype', 'mtu', 'ip', 'bcast', 'mask', 'hwaddr', 'ptp'
)
_cnt_field_list = (
'txbytes', 'rxbytes', 'rxpkts', 'txpkts',
'txerrors', 'rxe... | bsd-3-clause |
Pragith/p8ste | src/libs/smoid/languages/klass.py | 2 | 2629 | import re
from smoid.languages import Check, CheckCollection
class KlassCheck (Check):
def __init__ (self):
Check.__init__(self)
self.name = "Class"
self.example = "public class GreatClassRight : DadClass"
self.add_language("csharp")
self.add_language("java")
sel... | gpl-3.0 |
cedriclaunay/gaffer | python/GafferUI/PlugLayout.py | 1 | 9291 | ##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2014, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | bsd-3-clause |
wainersm/buildbot | master/buildbot/test/unit/test_steps_master.py | 6 | 10677 | # 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 |
romain-li/edx-platform | lms/djangoapps/django_comment_client/tests/test_middleware.py | 17 | 1876 | import django.http
from django.test import TestCase
from nose.plugins.attrib import attr
import json
import lms.lib.comment_client
import django_comment_client.middleware as middleware
@attr(shard=1)
class AjaxExceptionTestCase(TestCase):
def setUp(self):
super(AjaxExceptionTestCase, self).setUp()
... | agpl-3.0 |
alan-unravel/bokeh | bokeh/compat/bokeh_exporter.py | 38 | 1508 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | bsd-3-clause |
kmoocdev2/edx-platform | lms/djangoapps/verify_student/views.py | 9 | 51484 | """
Views for the verification flow
"""
import datetime
import decimal
import json
import logging
import urllib
import analytics
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.mail import se... | agpl-3.0 |
pmazurek/ansible-modules-extras | system/lvg.py | 56 | 9688 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
#
# 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 p... | gpl-3.0 |
bbc/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/Introspection/IntrospectionTutorial/IntrospectingChatServer.py | 6 | 1066 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import Axon
from Kamaelia.Chassis.ConnectedServer import FastRestartServer
from Kamaelia.Chassis.Pipeline import Pipeline
from Kamaelia.Util.Backplane import Backplane, PublishTo, SubscribeTo
from Kamaelia.Util.PureTransformer import PureTransformer
# ------- START OF CODE FR... | apache-2.0 |
Venturi/cms | env/lib/python2.7/site-packages/cms/test_utils/project/sampleapp/views.py | 50 | 2452 | # Create your views here.
from django.http import Http404
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base import TemplateView
from cms.test_utils.project.sampleapp.models import Category
from... | gpl-2.0 |
jonfryd/xbmc | lib/gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | gpl-2.0 |
aclifton/cpeg853-gem5 | src/arch/x86/X86ISA.py | 71 | 2246 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
seguijoaquin/taller2-appserver | Appserver/Test/ApiUnitTesting/ArchivosRequests/requests-2.10.0/requests/exceptions.py | 352 | 2776 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... | mit |
olof/debian-svtplay-dl | lib/svtplay_dl/service/svt.py | 1 | 1614 | import codecs
import copy
import json
import re
from svtplay_dl.error import ServiceError
from svtplay_dl.service.svtplay import Svtplay
from svtplay_dl.subtitle import subtitle
class Svt(Svtplay):
supported_domains = ["svt.se", "www.svt.se"]
def get(self):
data = self.get_urldata()
match = ... | mit |
davetcoleman/moveit | moveit_commander/demos/plan_with_constraints.py | 1 | 2630 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2018, Houston Mechatronics, 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 sou... | bsd-3-clause |
muraliselva10/designate | designate/storage/impl_sqlalchemy/migrate_repo/versions/051_scoped_tsig.py | 7 | 2897 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.com>
#
# 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/L... | apache-2.0 |
amenonsen/ansible | lib/ansible/modules/net_tools/nios/nios_member.py | 32 | 15676 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/idlelib/AutoComplete.py | 67 | 9061 | """AutoComplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names of file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import sys
import string
from idlelib.configHandler import idleConf
# This string inclu... | apache-2.0 |
hongbin/magnum | magnum/common/pythonk8sclient/client/models/V1beta3_ContainerState.py | 15 | 1933 | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, 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 require... | apache-2.0 |
odoobgorg/odoo | addons/l10n_nl/__openerp__.py | 17 | 1452 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2009 Veritos - Jan Verlaan - www.veritos.nl
{
'name' : 'Netherlands - Accounting',
'version' : '2.0',
'category': 'Localization',
'description': """
This is the module to manage the acc... | gpl-3.0 |
Cryptoverse/cryptoverse-probe | main.py | 1 | 58080 | from json import dumps as json_dump
from os import getenv, environ
from sys import stdout, platform
from traceback import print_exc as print_exception
from datetime import datetime
from time import sleep
from ete3 import Tree
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.a... | mit |
mmclenna/engine | build/android/pylib/device/device_utils_test.py | 23 | 76512 | #!/usr/bin/env python
# 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.
"""
Unit tests for the contents of device_utils.py (mostly DeviceUtils).
"""
# pylint: disable=C0321
# pylint: disable=W0212
# pylint:... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.