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 |
|---|---|---|---|---|---|
KellyChan/Python | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/utils/html.py | 78 | 9474 | """HTML utilities suitable for global use."""
import re
import string
import urllib
import urlparse
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
from django.utils.text import normalize_newlines
# Conf... | mit |
bottompawn/kbengine | kbe/src/lib/python/Tools/scripts/fixcid.py | 47 | 9989 | #! /usr/bin/env python3
# Perform massive identifier substitution on C source files.
# This actually tokenizes the files (to some extent) so it can
# avoid making substitutions inside strings or comments.
# Inside strings, substitutions are never made; inside comments,
# it is a user option (off by default).
#
# The s... | lgpl-3.0 |
odoo-turkiye/odoo | openerp/service/report.py | 324 | 5148 | # -*- coding: utf-8 -*-
import base64
import logging
import sys
import threading
import openerp
import openerp.report
from openerp import tools
import security
_logger = logging.getLogger(__name__)
# TODO: set a maximum report number per user to avoid DOS attacks
#
# Report state:
# False -> True
self_reports... | agpl-3.0 |
sighill/shade_app | apis/raw/017_raw/017_cleaner.py | 1 | 1278 | # -*- coding: utf-8 -*-
# 017_cleaner.py
# CODED TO BE EXECUTED SERVER SIDE :
# cd /home/common/shade
# python3 manage.py shell
import sys
from apis.voca import *
##################################
# Init des paths et noms de fichiers
AddLog('title' , 'Début du nettoyage du fichier')
work_dir = '/home/com... | mit |
reprah/shy | shy.py | 1 | 2992 | #!/usr/bin/env python
import sys, os, re, subprocess
# begin loop:
# - reading from stdin
# - forking a child
# - executing a new process in the child
def main():
while True:
sys.stdout.write(os.environ['PROMPT'])
line = sys.stdin.readline()
commands = split_on_pipes(line)
placeholder_in = sys.stdin
plac... | mit |
eamuntz/Django-Tut | env/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos_mutation.py | 109 | 5305 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
from django.utils import unittest
from django.utils.unittest import skipUnless
from .. import HAS_GEOS
if HAS_GEOS:
from .. import *
fr... | mit |
WingGao/mongo-python-driver | test/test_read_preferences.py | 13 | 20145 | # Copyright 2011-2015 MongoDB, 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 writin... | apache-2.0 |
0x7678/youtube-dl | youtube_dl/extractor/muzu.py | 147 | 2224 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
class MuzuTVIE(InfoExtractor):
_VALID_URL = r'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)'
IE_NAME = 'muzu.tv'
_TEST = {
'url': 'http://www.muzu.tv/defected/marcashken-f... | unlicense |
mdanielwork/intellij-community | python/testData/highlighting/awaitInGenerator.py | 23 | 1205 | async def f11(x):
y = (await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []) # fail
await x
def f12(x):
y = (await for await in [])
return x
async def f21(x):
y = (mapper(await<error descr="expression expected">)</error> for await<error des... | apache-2.0 |
JeyZeta/Dangerous | Dangerous/sqlmap/thirdparty/chardet/euctwfreq.py | 3133 | 34872 | ######################## 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... | mit |
benoitsteiner/tensorflow-opencl | tensorflow/contrib/timeseries/python/timeseries/state_space_models/structural_ensemble_test.py | 92 | 6385 | # 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 |
chen0510566/MissionPlanner | Lib/site-packages/numpy/distutils/mingw32ccompiler.py | 76 | 19091 | """
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
import os
import subprocess
import sys
import subp... | gpl-3.0 |
kaiix/depot_tools | third_party/logilab/common/ureports/docbook_writer.py | 93 | 5706 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | bsd-3-clause |
Just-D/chromium-1 | tools/git/move_source_file.py | 16 | 9341 | #!/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.
"""Moves C++ files to a new location, updating any include paths that point
to them, and re-ordering headers as needed. If multipl... | bsd-3-clause |
venzozhang/GProject | doc/tutorial/pickle-to-xml.py | 392 | 1500 | #!/usr/bin/python
# output xml format:
# <pages>
# <page url="xx"><prev url="yyy">zzz</prev><next url="hhh">lll</next><fragment>file.frag</fragment></page>
# ...
# </pages>
import pickle
import os
import codecs
def dump_pickles(out, dirname, filename, path):
f = open(os.path.join(dirname, filename), 'r')
da... | gpl-2.0 |
albertjan/pypyjs | website/js/pypy.js-0.2.0/lib/modules/distutils/sysconfig_pypy.py | 10 | 4713 | """Provide access to Python's configuration information.
This is actually PyPy's minimal 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_co... | mit |
willingc/oh-mainline | vendor/packages/Django/django/contrib/localflavor/id/id_choices.py | 439 | 3217 | import warnings
from django.utils.translation import ugettext_lazy as _
# Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia
# Indonesia does not have an official Province code standard.
# I decided to use unambiguous and consistent (some are common) 3-letter codes.
warnings.warn(
'There have been... | agpl-3.0 |
gqwest-erp/server | openerp/addons/fetchmail/res_config.py | 437 | 5234 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/psrc/household_x_gridcell/ln_retail_sector_employment_within_walking_distance_if_has_less_cars_than_workers.py | 2 | 2357 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from urbansim.functions import attribute_label
class ln_retail_sector_employment_within_walking_distance_if_has_less_cars_than_workers(Variabl... | gpl-2.0 |
brainwane/zulip | zerver/views/storage.py | 6 | 1723 | from typing import Dict, List, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables
from zerver.lib.bot_storage import (
StateError,
get_bot_storage,
get_keys_in_bot_storage,
remove_bot_storage,
set_bot_storage,
)
from zerver.lib.respon... | apache-2.0 |
RalphBariz/RalphsDotNet | Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/SocketServer.py | 50 | 24058 | """Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <s... | gpl-3.0 |
totolef/Sick-beard | lib/requests/packages/chardet2/chardistribution.py | 62 | 8495 | ######################## 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 ... | gpl-3.0 |
laszlocsomor/tensorflow | tensorflow/python/kernel_tests/check_ops_test.py | 5 | 48105 | # 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 |
csiro-rds/casda-samples | cutouts_by_proj.py | 1 | 7634 | #############################################################################################
#
# Python script to demonstrate interacting with CASDA's SODA implementation to
# retrieve cutout images around a list of sources.
#
# This script creates a job to produce and download cutouts from the specified image at
# t... | apache-2.0 |
tjhunter/phd-thesis-tjhunter | python/kdd/plot_network.py | 1 | 1065 |
__author__ = 'tjhunter'
import build
import json
import pylab as pl
from matplotlib.collections import LineCollection
# Draws the network as a pdf and SVG file.
def draw_network(ax, fd, link_style):
def decode_line(l):
#print l
dct = json.loads(l)
lats = dct['lats']
lons = dct['lons']
return zi... | apache-2.0 |
interalia/cmsplugin_availablejobs | availablejob/views.py | 1 | 3330 | from django.views.generic.simple import direct_to_template
from django.views.generic.list_detail import object_detail
from django.contrib.sites.models import Site
from django.shortcuts import get_object_or_404
from django.contrib import messages
from models import EnableOpening, Opening, Candidate
from forms import Ap... | bsd-3-clause |
wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py | 5 | 13554 | #!/usr/bin/env python
# encoding: utf-8
"""
The IPython engine application
Authors:
* Brian Granger
* MinRK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full licen... | mit |
calio/cflow2dot | cflow2dot.py | 1 | 9602 | #!/usr/bin/env python
import os.path
import sys
import subprocess
import re
import argparse
import json
from sys import exit
from os import system
cflow_path = "/usr/local/bin/cflow"
dot_path = "/usr/local/bin/dot"
color = ["#eecc80", "#ccee80", "#80ccee", "#eecc80", "#80eecc"];
shape =["box", "ellipse", "octagon", ... | mit |
kokosowy/vuadek | vuadek.py | 1 | 1180 | #!/usr/bin/python3.4
import sys
import os
import subprocess
zm_home = os.path.expanduser("~")
zm_pth_workdir = zm_home+"/.vuadek/"
if not os.path.exists(zm_pth_workdir):
os.makedirs(zm_pth_workdir)
zm_fl_remains = zm_pth_workdir+"remains"
pathname = os.path.dirname(sys.argv[1])
if not os.path.isfile(zm_fl_rema... | gpl-2.0 |
danieljaouen/ansible | lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py | 75 | 5267 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... | gpl-3.0 |
gavioto/rethinkdb | test/rql_test/connections/http_support/flask/sessions.py | 428 | 13107 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... | agpl-3.0 |
avmarchenko/exa | exa/core/tests/test_editor.py | 2 | 2573 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2018, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Tests for :mod:`~exa.core.editor`
#################################
"""
import os, six
from unittest import TestCase
from exa import Editor
class TestEditor(TestCase):
def ... | apache-2.0 |
petemounce/ansible-modules-extras | system/selinux_permissive.py | 88 | 4067 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Michael Scherer <misc@zarb.org>
# inspired by code of github.com/dandiker/
#
# 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 Softwar... | gpl-3.0 |
denbedilov/ATTENDER | server/attender-mobile/lib/requests/packages/urllib3/util/connection.py | 252 | 3265 | import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dropped(conn): # Platform-... | mit |
inirudebwoy/AutobahnPython | examples/twisted/wamp/rpc/timeservice/frontend.py | 8 | 2292 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
rennhak/Dia | plug-ins/python/wdeps.py | 2 | 28887 | # Generates a weighted dependencies graph from DLLs
# Copyright (c) 2001, 2005, 2007 Hans Breuer <hans@breuer.org>
# 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... | gpl-2.0 |
aeph6Ee0/youtube-dl | youtube_dl/extractor/fc2.py | 40 | 5593 | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata,
)
class FC2IE(Info... | unlicense |
yongshengwang/builthue | desktop/core/ext-py/Mako-0.8.1/test/test_babelplugin.py | 36 | 1647 |
from test import TemplateTest, template_base, skip_if
try:
import babel
from mako.ext.babelplugin import extract
except:
babel = None
import os
class ExtractMakoTestCase(TemplateTest):
@skip_if(lambda: not babel, 'babel not installed: skipping babelplugin test')
def test_extract(self):
... | apache-2.0 |
heeraj123/oh-mainline | vendor/packages/docutils/docutils/languages/zh_tw.py | 148 | 2771 | # -*- coding: utf-8 -*-
# $Id: zh_tw.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Joe YS Jaw <joeysj@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html... | agpl-3.0 |
teamosceola/bitbake | lib/bb/ui/knotty.py | 1 | 12691 | #
# BitBake (No)TTY UI Implementation
#
# Handling output to TTYs or files (no TTY)
#
# Copyright (C) 2006-2007 Richard Purdie
#
# 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.
#
# Thi... | gpl-2.0 |
jonasstein/cryspy | cryspy/fromstr.py | 3 | 10829 | from cryspy import numbers as nb
import quicktions as fr
import uncertainties as uc
from cryspy import geo as geo
import re
def removeletters(string):
assert isinstance(string, str), \
"Argument must be of type str."
string = re.sub("[a-zA-Z]", " ", string)
return string
def str2linearterm(string,... | gpl-3.0 |
vikatory/kbengine | kbe/res/scripts/common/Lib/test/test_asyncio/test_transports.py | 60 | 3435 | """Tests for transports.py."""
import unittest
from unittest import mock
import asyncio
from asyncio import transports
class TransportTests(unittest.TestCase):
def test_ctor_extra_is_none(self):
transport = asyncio.Transport()
self.assertEqual(transport._extra, {})
def test_get_extra_info(... | lgpl-3.0 |
matiasb/django | django/db/models/fields/__init__.py | 57 | 89296 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import math
import uuid
import warnings
from base64 import b64decode, b64encode
from functools import total_ordering
from django import forms
from django.apps import apps
from django.conf impo... | bsd-3-clause |
hoangt/ScaffCC | scaffold/flatten-qasm.py | 2 | 7835 | import argparse
import re
def process_qasm(fname):
qgates = ['H','X','CNOT','Y','Z','S','T','Tdag','Sdag','Rz','PrepX','PrepZ','MeasX','MeasZ','Toffoli','Fredkin']
qgates_1 = ['H','X','Y','Z','S','T','Tdag']
qgates_1a = ['Sdag']
qgates_2 = ['CNOT']
qgates_3 = ['Toffoli','Fredkin']
qga... | bsd-2-clause |
JonatanAntoni/CMSIS_5 | CMSIS/DSP/PythonWrapper/setup.py | 2 | 5357 | from distutils.core import setup, Extension
import glob
import numpy
import config
import sys
import os
from config import ROOT
import re
includes = [os.path.join(ROOT,"Include"),os.path.join(ROOT,"PrivateInclude"),os.path.join("cmsisdsp_pkg","src")]
if sys.platform == 'win32':
cflags = ["-DWIN",config.cflags,"-DUN... | apache-2.0 |
dol-sen/portage | pym/portage/emaint/modules/sync/__init__.py | 8 | 1496 | # Copyright 2014-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from ....sync import _SUBMODULE_PATH_MAP
doc = """Check repos.conf settings and sync repositories."""
__doc__ = doc[:]
module_spec = {
'name': 'sync',
'description': doc,
'provides':{
'sync-module': {
'... | gpl-2.0 |
redq81/redq81.github.io | test/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 1355 | 44604 | # 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... | mit |
kenorb/BitTorrent | python_bt_codebase_library/BTL/log.py | 5 | 14279 | # 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 program is distributed in the hope that it will be useful,
# bu... | gpl-3.0 |
marctc/django | tests/gis_tests/relatedapp/tests.py | 199 | 15937 | from __future__ import unicode_literals
from django.contrib.gis.db.models import F, Collect, Count, Extent, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point
from django.db import connection
from django.test import TestCase, ignore_warnin... | bsd-3-clause |
ThiagoGarciaAlves/three.js | utils/exporters/blender/addons/io_three/exporter/utilities.py | 225 | 1229 | import uuid
import hashlib
from .. import constants
ROUND = constants.DEFAULT_PRECISION
def bit_mask(flags):
"""Generate a bit mask.
:type flags: dict
:return: int
"""
bit = 0
true = lambda x, y: (x | (1 << y))
false = lambda x, y: (x & (~(1 << y)))
for mask, position in constant... | mit |
jzoldak/edx-platform | openedx/core/djangoapps/cors_csrf/views.py | 10 | 2496 | """Views for enabling cross-domain requests. """
import logging
import json
from django.conf import settings
from django.views.decorators.cache import cache_page
from django.http import HttpResponseNotFound
from edxmako.shortcuts import render_to_response
from .models import XDomainProxyConfiguration
log = logging.g... | agpl-3.0 |
iulian787/spack | var/spack/repos/builtin/packages/double-conversion/package.py | 5 | 1446 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class DoubleConversion(CMakePackage):
"""This project (double-conversion) provides binary-decima... | lgpl-2.1 |
leafsand/TeamTalk | win-client/3rdParty/src/json/scons-tools/substinfile.py | 258 | 3216 | import re
from SCons.Script import * # the usual scons stuff you get in a SConscript
def generate(env):
"""
Add builders and construction variables for the
SubstInFile tool.
Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
from the source to the target.
The values of... | apache-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/r-forcats/package.py | 5 | 1945 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
idncom/odoo | openerp/addons/test_new_api/tests/test_related.py | 247 | 8446 | #
# test cases for related fields, etc.
#
import unittest
from openerp.osv import fields
from openerp.tests import common
class TestRelatedField(common.TransactionCase):
def setUp(self):
super(TestRelatedField, self).setUp()
self.partner = self.registry('res.partner')
self.company = self.... | agpl-3.0 |
dwillmer/numpy | numpy/distutils/fcompiler/nag.py | 228 | 1403 | from __future__ import division, absolute_import, print_function
import sys
from numpy.distutils.fcompiler import FCompiler
compilers = ['NAGFCompiler']
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
description = 'NAGWare Fortran 95 Compiler'
version_pattern = r'NAGWare Fortran 95 compiler Relea... | bsd-3-clause |
Darkmer/masterchief | CourseBuilderenv/lib/python2.7/distutils/__init__.py | 1211 | 3983 | import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = o... | mit |
arvinsingla/CouchPotatoServer | libs/guessit/matchtree.py | 102 | 9116 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
pschwartz/ansible | lib/ansible/cli/playbook.py | 11 | 8150 | #!/usr/bin/env python
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | gpl-3.0 |
agoodm/climate | ocw-ui/backend/local_file_metadata_extractors.py | 12 | 7096 | #
# 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 n... | apache-2.0 |
mexeniz/django-oscar | src/oscar/apps/offer/views.py | 23 | 2060 | from django.views.generic import ListView
from django import http
from django.conf import settings
from django.shortcuts import get_object_or_404
from oscar.core.loading import get_model
ConditionalOffer = get_model('offer', 'ConditionalOffer')
Range = get_model('offer', 'Range')
Product = get_model('catalogue', 'Pro... | bsd-3-clause |
FreeAgent/djangoappengine-starter | django/contrib/gis/geos/base.py | 321 | 1698 | from ctypes import c_void_p
from types import NoneType
from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
# Trying to import GDAL libraries, if available. Have to place in
# try/except since this package may be used outside GeoDjango.
try:
from django.contrib.gis import gdal
except ImportErro... | bsd-3-clause |
superdesk/eve | eve/tests/renders.py | 1 | 11071 | # -*- coding: utf-8 -*-
from eve.tests import TestBase
from eve.utils import api_prefix
from eve.tests.test_settings import MONGO_DBNAME
import simplejson as json
class TestRenders(TestBase):
def test_default_render(self):
r = self.test_client.get('/')
self.assertEqual(r.content_type, 'applicati... | bsd-3-clause |
MaxLinCode/tardy-HackIllinois-2017 | alexa/lambda_function.py | 1 | 6803 | """
This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit.
The Intent Schema, Built-in Slots, and Sample Utterances for this skill, as well
as testing instructions are located at http://amzn.to/1LzFrj6
For additional samples, visit the Alexa Skills Kit Getting Started guide at
http://amzn.to/1... | mit |
klusark/android_external_chromium_org | media/tools/layout_tests/trend_graph.py | 174 | 3309 | # 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.
"""A module for manipulating trend graph with analyzer result history."""
import os
import layouttest_analyzer_helpers
DEFAULT_TREND_GRAPH_PATH = os.p... | bsd-3-clause |
RapidApplicationDevelopment/tensorflow | tensorflow/contrib/training/python/training/feeder_test.py | 9 | 10130 | # 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 |
dokterbob/satchmo | satchmo/apps/product/modules/subscription/models.py | 8 | 6116 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from product.models import Product, get_product_quantity_price, get_product_quantity_adjustments
from decimal import Decimal
import datetime
from satchmo_utils import add_month
from satchmo_utils.fields import CurrencyField
SATCHMO_PR... | bsd-3-clause |
mapr/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/messages/tests/base.py | 104 | 14243 | from django import http
from django.conf import settings, global_settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import M... | apache-2.0 |
theflofly/tensorflow | tensorflow/python/data/benchmarks/filter_benchmark.py | 22 | 1636 | # 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 |
Kazade/NeHe-Website | django/contrib/auth/handlers/modpython.py | 436 | 1899 | from mod_python import apache
import os
def authenhandler(req, **kwargs):
"""
Authentication handler that checks against Django's auth database.
"""
# mod_python fakes the environ, and thus doesn't process SetEnv. This fixes
# that so that the following import works
os.environ.update(req.subp... | bsd-3-clause |
peircej/moviepy | moviepy/video/fx/headblur.py | 16 | 1768 | import numpy as np
#------- CHECKING DEPENDENCIES -----------------------------------------
try:
import cv2
headblur_possible = True
except:
headblur_possible = False
#-----------------------------------------------------------------------
def headblur(clip,fx,fy,r_zone,r_blur=None):
"""
Return... | mit |
quru/qis | src/imageserver/errors.py | 1 | 2593 | #
# Quru Image Server
#
# Document: errors.py
# Date started: 31 Mar 2011
# By: Matt Fozard
# Purpose: Internal errors and exceptions
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
GladeRom/android_external_chromium_org | chrome/browser/resources/chromeos/chromevox/tools/generate_test_messages.py | 62 | 1237 | #!/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.
'''Generates test_messages.js from an extension message json file.'''
import optparse
import sys
def Die(message):
'''Prints an er... | bsd-3-clause |
Theer108/invenio | invenio/modules/upgrader/logging.py | 20 | 2014 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014 CERN.
#
# Invenio 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 optio... | gpl-2.0 |
lukas-bednar/python-rrmngmnt | rrmngmnt/ssh.py | 1 | 10209 | import os
import time
import socket
import paramiko
import contextlib
import subprocess
from rrmngmnt.executor import Executor
AUTHORIZED_KEYS = os.path.join("%s", ".ssh/authorized_keys")
KNOWN_HOSTS = os.path.join("%s", ".ssh/known_hosts")
ID_RSA_PUB = os.path.join("%s", ".ssh/id_rsa.pub")
ID_RSA_PRV = os.path.join("... | gpl-2.0 |
ardi69/pyload-0.4.10 | pyload/Api/types.py | 1 | 11175 | # -*- coding: utf-8 -*-
# Autogenerated by pyload
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
class BaseObject(object):
__slots__ = []
class Destination(object):
Collector = 0
Queue = 1
class DownloadStatus(object):
Aborted = 9
Custom = 11
Decrypting = 10
Download... | gpl-3.0 |
40223102/w110519 | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/pool.py | 694 | 23263 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing ... | agpl-3.0 |
inveniosoftware/jsonalchemy | jsonalchemy/wrappers.py | 2 | 26586 | # -*- coding: utf-8 -*-
#
# This file is part of JSONAlchemy.
# Copyright (C) 2013, 2014, 2015 CERN.
#
# JSONAlchemy 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 yo... | gpl-2.0 |
lipro-yocto/git-repo | subcmds/cherry_pick.py | 1 | 3421 | # Copyright (C) 2010 The Android Open Source Project
#
# 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 |
40223142/CDA0629 | static/Brython3.1.1-20150328-091302/Lib/_abcoll.py | 688 | 5155 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | gpl-3.0 |
CloudBoltSoftware/cloudbolt-forge | ui_extensions/multilevelapprovals/views.py | 1 | 14185 | from urllib.parse import urlparse
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.template import loader
from django.urls import reverse
from django.utils.translation import ugettext as _, ungettext
from accou... | apache-2.0 |
LeandroRoberto/sapl | sapl/comissoes/views.py | 1 | 3353 |
from django.core.urlresolvers import reverse
from django.db.models import F
from django.views.generic import ListView
from sapl.crud.base import RP_DETAIL, RP_LIST, Crud, CrudAux, MasterDetailCrud
from sapl.materia.models import MateriaLegislativa, Tramitacao
from .models import (CargoComissao, Comissao, Composicao,... | gpl-3.0 |
HKUST-SING/tensorflow | tensorflow/contrib/learn/python/learn/trainable.py | 68 | 3234 | # 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 |
k3nnyfr/s2a_fr-nsis | s2a/Python/Lib/distutils/tests/test_dist.py | 83 | 15708 | # -*- coding: utf8 -*-
"""Tests for distutils.dist."""
import os
import StringIO
import sys
import unittest
import warnings
import textwrap
from distutils.dist import Distribution, fix_help_options
from distutils.cmd import Command
import distutils.dist
from test.test_support import TESTFN, captured_stdout, run_unitt... | gpl-3.0 |
ansible/ansible-modules-extras | windows/win_timezone.py | 23 | 1552 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Phil Schwartz <schwartzmx@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 ... | gpl-3.0 |
Evervolv/android_kernel_lge_v500 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
gammalib/gammalib | inst/cta/test/dev/test_irf_trafo.py | 2 | 1694 | #! /usr/bin/env python
# ===========================================================================================#
# Test coordinate transformations for IRF computation.
# ===========================================================================================#
from gammalib import *
from math import *
# ======... | gpl-3.0 |
sudheesh001/oh-mainline | mysite/search/tests.py | 8 | 57916 | # This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2010 Jack Grigg
# Copyright (C) 2009, 2010 OpenHatch, Inc.
# Copyright (C) 2010 Jessica McKellar
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as... | agpl-3.0 |
mdovgialo/steam-vr-wheel | steam_vr_wheel/pyvjoy/_wrapper.py | 1 | 2789 | import os
import sys
from ctypes import *
dll_filename = "vJoyInterface.dll"
dll_path = os.path.dirname(__file__) + os.sep + dll_filename
try:
_vj = cdll.LoadLibrary(dll_path)
except OSError:
sys.exit("Unable to load vJoy SDK DLL. Ensure that %s is present" % dll_filename)
def vJoyEnabled():
"""... | mit |
mbernasocchi/QGIS | python/plugins/processing/gui/AutofillDialog.py | 30 | 2422 | # -*- coding: utf-8 -*-
"""
***************************************************************************
AutofillDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************************... | gpl-2.0 |
baidurom/repo | manifest_xml.py | 4 | 25259 | #
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
mvaled/sentry | tests/sentry/attachments/test_redis.py | 1 | 2148 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
import zlib
from sentry.cache.redis import RedisClusterCache, RbCache
from sentry.testutils import TestCase
from sentry.utils.imports import import_string
class FakeClient(object):
def get(self, key):
if key == "c:1:foo:a":
... | bsd-3-clause |
kcompher/thunder | thunder/extraction/source.py | 6 | 31847 | from numpy import asarray, mean, sqrt, ndarray, amin, amax, concatenate, sum, zeros, maximum, \
argmin, newaxis, ones, delete, NaN, inf, isnan, clip, logical_or, unique, where, all
from thunder.utils.serializable import Serializable
from thunder.utils.common import checkParams, aslist
from thunder.rdds.images impo... | apache-2.0 |
marscher/tmpnb | dockworker.py | 5 | 7431 | from concurrent.futures import ThreadPoolExecutor
from collections import namedtuple
import re
import docker
import requests
from docker.utils import create_host_config, kwargs_from_env
from tornado import gen, web
from tornado.log import app_log
ContainerConfig = namedtuple('ContainerConfig', [
'image', 'comma... | bsd-3-clause |
sztena/DG08_android4.1 | mm/tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
nfco/netforce | netforce_ecom/netforce_ecom/controllers/ecom_coupon.py | 4 | 3614 | # Copyright (c) 2015, Netforce Co., Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions ... | mit |
zsoltdudas/lis-tempest | tempest/scenario/test_network_v6.py | 2 | 10204 | # Copyright 2014 Cisco Systems, 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... | apache-2.0 |
millken/simple-rtmp-server | trunk/research/community/server.py | 1 | 4633 | #!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2013-2014 winlin
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, cop... | mit |
golya/FuzzLabs | engine/tests/steps/modules.py | 1 | 1961 | from behave import *
import os
import sys
import inspect
ROOT_DIR = os.path.dirname(
os.path.abspath(
inspect.getfile(inspect.currentframe()
)))
sys.path.append(ROOT_DIR + "/../../classes")
from ConfigurationHandler import ConfigurationHandler
from ModuleHandler imp... | gpl-2.0 |
mtnsat/ansible-cmdb | lib/mako/exceptions.py | 60 | 12406 | # mako/exceptions.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""exception classes"""
import traceback
import sys
from mako import util, compat
class MakoE... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.