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
maxwen/android_kernel_oppo_msm8916_orig
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
TRex22/Sick-Beard
cherrypy/wsgiserver/ssl_pyopenssl.py
74
9379
"""A library for integrating pyOpenSSL with CherryPy. The OpenSSL module must be importable for SSL functionality. You can obtain it from http://pyopenssl.sourceforge.net/ To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of SSLAdapter. There are two ways to use SSL: Method One: ssl_adapter.c...
gpl-3.0
rahuldhote/odoo
addons/account_analytic_analysis/__init__.py
425
1107
# -*- 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...
agpl-3.0
LarryPham/android-quill
jni/libhpdf-2.3.0RC2/if/python/demo/image_demo.py
32
6106
### ## * << Haru Free PDF Library 2.0.0 >> -- image_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
gpl-3.0
Tejal011089/medsyn2_lib
webnotes/build.py
24
5506
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from webnotes.utils.minify import JavascriptMinify """ Build the `public` folders and setup languages """ import os, sys, webnotes from cssmin import cssmin def bundle(no_...
mit
bow/bioconda-recipes
recipes/peptide-shaker/1.16.15/peptide-shaker.py
46
3272
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
mit
TeamJB/linaro_external_skia
tools/tests/bench_pictures_cfg_test.py
155
1340
# 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. """ Verify that the bench_pictures.cfg file is sane. """ import os import sys def ThrowIfNotAString(obj): """ Raise a TypeError if obj is not a st...
bsd-3-clause
shawnwanderson/cmput404-project
venv/lib/python2.7/site-packages/django/utils/log.py
84
5261
from __future__ import unicode_literals import logging import logging.config # needed when logging_config doesn't start with logging.config import sys import warnings from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.depr...
gpl-3.0
CM-zenfone2/android_kernel_asus_moorefield
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
adamend/django-oscar
src/oscar/apps/wishlists/abstract_models.py
27
4905
import hashlib import random from django.utils import six from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _, pgettext_lazy from django.core.urlresolvers import reverse from oscar.core.compat import AUTH_USER_MODEL @pyth...
bsd-3-clause
opennode/nodeconductor-assembly-waldur
src/waldur_slurm/apps.py
1
2931
from django.apps import AppConfig from django.db.models import signals class SlurmConfig(AppConfig): name = 'waldur_slurm' verbose_name = 'SLURM' service_name = 'SLURM' def ready(self): from waldur_core.quotas.fields import QuotaField, CounterQuotaField from waldur_core.structure impo...
mit
addisonElliott/SmartShopTouchScreen
Windows/ExpirationBox_ui.py
1
8236
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ExpirationBox.ui' # # Created by: PyQt5 UI code generator 5.7.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_ExpirationBox(object): def setupUi(self, ExpirationBox): ...
agpl-3.0
dims/nova
nova/tests/unit/scheduler/test_rpcapi.py
16
4830
# Copyright 2013 Red Hat, 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 agre...
apache-2.0
nubark/odoo
addons/survey/wizard/survey_email_compose_message.py
29
10120
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv from openerp.osv import fields from openerp.tools.translate import _ from datetime import datetime from openerp.exceptions import UserError import re import uuid import urlparse emails_split...
gpl-3.0
h3biomed/ansible
lib/ansible/modules/cloud/ovirt/ovirt_api_facts.py
32
2429
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'st...
gpl-3.0
dexterx17/nodoSocket
clients/Python-2.7.6/Lib/encodings/iso8859_11.py
593
12591
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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,input,errors...
mit
wimnat/ansible-modules-core
network/nxos/nxos_evpn_global.py
21
9097
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
wilsonrivera/scalider-v2
tools/UnidecodeDataCompiler/data/x074.py
252
4696
data = ( 'Han ', # 0x00 'Xuan ', # 0x01 'Yan ', # 0x02 'Qiu ', # 0x03 'Quan ', # 0x04 'Lang ', # 0x05 'Li ', # 0x06 'Xiu ', # 0x07 'Fu ', # 0x08 'Liu ', # 0x09 'Ye ', # 0x0a 'Xi ', # 0x0b 'Ling ', # 0x0c 'Li ', # 0x0d 'Jin ', # 0x0e 'Lian ', # 0x0f 'Suo ', # 0x10 'Chii...
apache-2.0
BeATz-UnKNoWN/python-for-android
python-build/python-libs/gdata/samples/base/dryRunInsert.py
94
2170
#!/usr/bin/python # # Copyright (C) 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
tilacog/rows
to-do/plugin_mysql.py
6
6134
# coding: utf-8 # Copyright 2014 Álvaro Justen <https://github.com/turicas/rows/> # 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 opti...
gpl-3.0
jideobs/twilioAngular
venv/lib/python2.7/site-packages/setuptools/msvc9_support.py
429
2187
try: import distutils.msvc9compiler except ImportError: pass unpatched = dict() def patch_for_specialized_compiler(): """ Patch functions in distutils.msvc9compiler to use the standalone compiler build for Python (Windows only). Fall back to original behavior when the standalone compiler is no...
mit
CSC-ORG/Dynamic-Dashboard-2015
engine/lib/python2.7/site-packages/pip/_vendor/requests/cookies.py
821
16686
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes...
mit
lgrahl/threema-msgapi-sdk-python
threema/gateway/key.py
2
4302
""" Contains functions to decode, encode and generate keys. """ import enum import hashlib import hmac import libnacl.encode import libnacl.public import libnacl.secret from .exception import GatewayKeyError __all__ = ( 'HMAC', 'Key', ) class HMAC: """ A collection of HMAC functions used for the ga...
mit
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/idlelib/TreeWidget.py
10
15037
# XXX TO DO: # - popup menu # - support partial or total redisplay # - key bindings (instead of quick-n-dirty bindings on Canvas): # - up/down arrow keys to move focus around # - ditto for page up/down, home/end # - left/right arrows to expand/collapse & move out/in # - more doc strings # - add icons for "file", ...
gpl-3.0
dsbrown/FreeCAD
src/Mod/Start/StartPage/DefaultWorkbench.py
32
1910
#*************************************************************************** #* * #* Copyright (c) 2012 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
wmbutler/courtlistener
cleaning_scripts/correct_state_cases.py
2
4231
import os import sys execfile('/etc/courtlistener') sys.path.append(INSTALL_ROOT) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") from alert.search.models import Document, Court from alert.lib.db_tools import queryset_generator from optparse import OptionParser def fixer(simulate=False, verbose=False): ...
agpl-3.0
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/plotting/pygletplot/tests/test_plotting.py
109
2653
from sympy.external.importtools import import_module disabled = False # if pyglet.gl fails to import, e.g. opengl is missing, we disable the tests pyglet_gl = import_module("pyglet.gl", catch=(OSError,)) pyglet_window = import_module("pyglet.window", catch=(OSError,)) if not pyglet_gl or not pyglet_window: disabl...
mit
les69/calvin-base
calvin/runtime/south/plugins/async/twistedimpl/client_connection.py
2
6237
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
RydrDojo/Ridr
pylotVenv/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_insert.py
115
8132
from .. import fixtures, config from ..config import requirements from .. import exclusions from ..assertions import eq_ from .. import engines from sqlalchemy import Integer, String, select, literal_column, literal from ..schema import Table, Column class LastrowidTest(fixtures.TablesTest): run_deletes = 'each...
mit
darktears/chromium-crosswalk
build/android/pylib/utils/xvfb.py
143
1551
# Copyright (c) 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. # pylint: disable=W0702 import os import signal import subprocess import sys import time def _IsLinux(): """Return True if on Linux; else False.""" ...
bsd-3-clause
artnavsegda/avrnavsegda
src/ASF/common/services/gfx_mono/tools/dump_display_over_serial.py
73
4558
## # \file # # \brief Convert display data on a serial line to a graphical representation # # Copyright (C) 2011-2014 Atmel Corporation. All rights reserved. # # \page License # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
lgpl-3.0
sarakha63/persomov
couchpotato/core/media/_base/providers/torrent/hd4free.py
22
6068
import re import json import traceback from couchpotato.core.helpers.variable import tryInt, getIdentifier from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentProvider log = CPLog(__name__) class Base(TorrentProvider): urls = { 'test': 'http...
gpl-3.0
goddardl/gaffer
apps/gui/gui-1.py
1
5810
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
bsd-3-clause
lhilt/scipy
scipy/stats/tests/common_tests.py
4
10728
from __future__ import division, print_function, absolute_import import pickle import numpy as np import numpy.testing as npt from numpy.testing import assert_allclose, assert_equal from scipy._lib._numpy_compat import suppress_warnings from pytest import raises as assert_raises import numpy.ma.testutils as ma_npt ...
bsd-3-clause
mbrubeck/servo
tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/text-decor-3/support/generate-text-emphasis-ruby-tests.py
829
3042
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-ruby-001 ~ 004 which tests emphasis marks with ruby in four directions. It outputs a list of all tests it generated in the format of Mozilla reftest.list to the stdout. """ from __future__ import unicode_literals TEST_FIL...
mpl-2.0
HLFH/CouchPotatoServer
libs/caper/constraint.py
81
4048
# Copyright 2013 Dean Gardiner <gardiner91@gmail.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/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
mmmavis/lightbeam-bedrock-website
vendor-local/lib/python/south/db/generic.py
10
45531
from __future__ import print_function import re import sys from django.core.management.color import no_style from django.db import transaction, models from django.db.utils import DatabaseError from django.db.backends.util import truncate_name from django.db.backends.creation import BaseDatabaseCreation from django.db...
mpl-2.0
eonpatapon/contrail-controller
src/container/kube-manager/kube_manager/common/args.py
1
7928
# # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # import sys import argparse from vnc_api.vnc_api import * from pysandesh.sandesh_base import Sandesh, SandeshSystem, SandeshConfig from pysandesh.gen_py.sandesh.ttypes import SandeshLevel from sandesh_common.vns.constants import (HttpPortKubeManager,...
apache-2.0
yousseb/django_pytds
tests/runtests.py
1
14761
#!/usr/bin/env python import logging import os import shutil import subprocess import sys import tempfile import warnings import django from django import contrib from django.utils._os import upath from django.utils import six CONTRIB_MODULE_PATH = 'django.contrib' TEST_TEMPLATE_DIR = 'templates' DJANGO_RUNTESTS_DI...
mit
lzw120/django
django/shortcuts/__init__.py
254
4642
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http import HttpRespon...
bsd-3-clause
mozilla/MozDef
tests/alerts/test_write_audit.py
3
4301
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. # Copyright (c) 2017 Mozilla Corporation from .positive_alert_test_case import PositiveAlertTestCase from .negative_ale...
mpl-2.0
andresgz/django
tests/template_tests/syntax_tests/test_list_index.py
521
2694
from django.test import SimpleTestCase from ..utils import setup class ListIndexTests(SimpleTestCase): @setup({'list-index01': '{{ var.1 }}'}) def test_list_index01(self): """ List-index syntax allows a template to access a certain item of a subscriptable object. """ ...
bsd-3-clause
statsbiblioteket/newspaper-jpylizer-deprecated
src/main/extras/jpylyzer-1.10.1/jpylyzer.py
2
18851
#! /usr/bin/env python # # # # jpylyzer # # Requires: Python 2.7 (older versions won't work) OR Python 3.2 or more recent # (Python 3.0 and 3.1 won't work either!) # # Copyright (C) 2011, 2012 Johan van der Knijff, Koninklijke Bibliotheek - # National Library of the Netherlands # # Contributors: # Rene van der Ark ...
apache-2.0
dyoung418/tensorflow
tensorflow/python/client/session.py
18
63174
# 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
datawire/qpid-proton
proton-c/env.py
12
2444
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
Kazade/NeHe-Website
google_appengine/lib/django-1.4/django/core/management/commands/shell.py
92
3142
import os from django.core.management.base import NoArgsCommand from optparse import make_option class Command(NoArgsCommand): option_list = NoArgsCommand.option_list + ( make_option('--plain', action='store_true', dest='plain', help='Tells Django to use plain Python, not IPython.'), ) ...
bsd-3-clause
mlavin/django
django/contrib/gis/db/backends/postgis/introspection.py
42
5410
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.postgresql.introspection import DatabaseIntrospection class GeoIntrospectionError(Exception): pass class PostGISIntrospection(DatabaseIntrospection): # Reverse dictionary for PostGIS geometry types not populated until # introspectio...
bsd-3-clause
wzhy90/git-repo
subcmds/info.py
46
6021
# # Copyright (C) 2012 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
haiyangd/python-show-me-the-code-
Jaccorot/0006/0006.py
8
1132
#!usr/bin/python #coding=utf-8 """ 第 0006 题:你有一个目录,放了你一个月的日记,都是 txt,为了避免分词的问题, 假设内容都是英文,请统计出你认为每篇日记最重要的词。 """ import os import re def walk_dir(path): file_path = [] for root, dirs, files in os.walk(path): for f in files: if f.lower().endswith('txt'): file_path.append(os.pa...
mit
TechWritingWhiz/indy-node
indy_node/test/upgrade/test_node_control_tool_resolves_dependencies.py
2
1555
import multiprocessing from indy_node.utils.node_control_tool import NodeControlTool from plenum.test.helper import randomText m = multiprocessing.Manager() whitelist = ['Unexpected error in _upgrade test'] def testNodeControlResolvesDependencies(monkeypatch): nct = NodeControlTool() node_package = ('indy-no...
apache-2.0
netvigator/myPyPacks
pyPacks/String/PhoneNos.py
2
49851
#!/usr/bin/pythonTest # -*- coding: utf-8 -*- # # string functions PhoneNos phone numbers # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option)...
gpl-2.0
crichardson17/starburst_atlas
Low_resolution_sims/Dusty_LowRes/Padova_inst/padova_inst_0/fullgrid/UV1.py
31
9315
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
mozilla/make.mozilla.org
vendor-local/lib/python/south/creator/actions.py
20
19103
""" Actions - things like 'a model was removed' or 'a field was changed'. Each one has a class, which can take the action description and insert code blocks into the forwards() and backwards() methods, in the right place. """ import sys from django.db.models.fields.related import RECURSIVE_RELATIONSHIP_CONSTANT from ...
bsd-3-clause
bob-the-hamster/commandergenius
project/jni/python/src/Lib/plat-mac/Carbon/QDOffscreen.py
82
1266
# Generated from 'QDOffscreen.h' def FOUR_CHAR_CODE(x): return x pixPurgeBit = 0 noNewDeviceBit = 1 useTempMemBit = 2 keepLocalBit = 3 useDistantHdwrMemBit = 4 useLocalHdwrMemBit = 5 pixelsPurgeableBit = 6 pixelsLockedBit = 7 mapPixBit = 16 newDepthBit = 17 alignPixBit = 18 newRowBytesBit = 19 reallocPixBit = 20 clipP...
lgpl-2.1
elventear/ansible
lib/ansible/modules/source_control/gitlab_group.py
15
7499
#!/usr/bin/python # (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) # # 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...
gpl-3.0
mcltn/ansible-modules-extras
univention/udm_dns_record.py
28
5619
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # # 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 Fr...
gpl-3.0
jamesblunt/edx-platform
common/djangoapps/track/migrations/0001_initial.py
189
2527
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TrackingLog' db.create_table('track_trackinglog', ( ('id', self.gf('django.db.mo...
agpl-3.0
alexandrucoman/vbox-nova-driver
nova/tests/unit/api/openstack/compute/contrib/test_server_start_stop.py
33
6816
# Copyright (c) 2012 Midokura Japan K.K. # # 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 l...
apache-2.0
asm0dey/Flexget
flexget/plugins/metainfo/nzb_size.py
11
2184
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event log = logging.getLogger('nzb_size') # a bit hacky, add nzb as a known mimetype import mimetypes mimetypes.add_type('application/x-nzb', '.nzb') class NzbSize(object): ""...
mit
JI007/flasky
tests/test_selenium.py
22
2879
import re import threading import unittest from selenium import webdriver from app import create_app, db from app.models import Role, User, Post class SeleniumTestCase(unittest.TestCase): client = None @classmethod def setUpClass(cls): # start Firefox try: cls.client = web...
mit
azatoth/scons
test/Fortran/FORTRANSUFFIXES.py
4
3948
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
mit
benjamindeleener/odoo
addons/anonymization/__openerp__.py
27
1106
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Database Anonymization', 'version': '1.0', 'category': 'Tools', 'description': """ This module allows you to anonymize a database. =============================================== This modul...
gpl-3.0
vFense/vFenseAgent-nix
agent/deps/rpm6-32/Python-2.7.5/lib/python2.7/lib2to3/pgen2/literals.py
399
1614
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Safely evaluate Python string literals without using eval().""" import re simple_escapes = {"a": "\a", "b": "\b", "f": "\f", "n": "\n", ...
lgpl-3.0
nightjean/Deep-Learning
tensorflow/contrib/session_bundle/session_bundle_test.py
133
7571
# 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
idryomov/btrfs-unstable
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
MaStanford/AnglishWordbook
Anglish/SyncWikia.py
1
4522
__author__ = 'm.stanford' import string from socket import error as SocketError import json, httplib STARTING_PAGE = 72; ENDING_PAGE = 98; invalidWords = ["un-English", "Anglish/English", "attested", "unattested", "Class"] delimiter = "\'\'\'" wierdfunkInSomeWords = ["\'\' \'\'\'", "\'\'\',", '\'\'\'\'\'', '\"\'\'']...
apache-2.0
xinwu/horizon
horizon/templatetags/parse_date.py
75
1738
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
jsirois/pants
src/python/pants/backend/python/goals/setup_py.py
1
37779
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import enum import io import itertools import logging import os import pickle from abc import ABC, abstractmethod from collections import abc, defaultdict from dataclasses import dataclass...
apache-2.0
azumimuo/family-xbmc-addon
plugin.video.bubbles/resources/lib/externals/hachoir/hachoir_parser/image/bmp.py
1
6874
""" Microsoft Bitmap picture parser. - file extension: ".bmp" Author: Victor Stinner Creation: 16 december 2005 """ from resources.lib.externals.hachoir.hachoir_parser import Parser from resources.lib.externals.hachoir.hachoir_core.field import (FieldSet, UInt8, UInt16, UInt32, Bits, String, RawBytes, Enum, ...
gpl-2.0
arun6582/django
tests/messages_tests/test_session.py
91
1743
from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.session import SessionStorage from django.test import TestCase from django.utils.safestring import SafeData, mark_safe from .base import BaseTests def set_session_data(storage, ...
bsd-3-clause
Fireblend/chromium-crosswalk
chrome/test/mini_installer/uninstall_chrome.py
123
2753
# 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. """Uninstalls Chrome. This script reads the uninstall command from registry, calls it, and verifies the output status code. """ import _winreg import optpa...
bsd-3-clause
urbn/kombu
t/unit/utils/test_functional.py
1
9030
from __future__ import absolute_import, unicode_literals import pickle import pytest from itertools import count from case import Mock, mock, skip from kombu.five import ( items, PY3, ) from kombu.utils import functional as utils from kombu.utils.functional import ( ChannelPromise, LRUCache, fxrange, fxran...
bsd-3-clause
denisenkom/django
django/core/management/commands/makemigrations.py
5
3802
import sys import os from optparse import make_option from django.core.management.base import BaseCommand from django.core.exceptions import ImproperlyConfigured from django.db import connections, DEFAULT_DB_ALIAS from django.db.migrations.loader import MigrationLoader from django.db.migrations.autodetector import Mig...
bsd-3-clause
tchernomax/ansible
lib/ansible/modules/cloud/amazon/aws_glue_connection.py
27
12285
#!/usr/bin/python # Copyright: (c) 2018, Rob White (@wimnat) # 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'} DOCUMENTATION = ''' --- ...
gpl-3.0
joebowen/LogMyRocket_API
LogMyRocket/libraries/sys_packages/jmespath/functions.py
21
13008
import math import json import weakref from jmespath import exceptions from jmespath.compat import string_type as STRING_TYPE from jmespath.compat import get_methods # python types -> jmespath types TYPES_MAP = { 'bool': 'boolean', 'list': 'array', 'dict': 'object', 'NoneType': 'null', 'unicode':...
gpl-3.0
salguarnieri/intellij-community
python/helpers/epydoc/util.py
91
10077
# epydoc -- Utility functions # # Copyright (C) 2005 Edward Loper # Author: Edward Loper <edloper@loper.org> # URL: <http://epydoc.sf.net> # # $Id: util.py 1671 2008-01-29 02:55:49Z edloper $ """ Miscellaneous utility functions that are used by multiple modules. @group Python source types: is_module_file, is_package_...
apache-2.0
EnviroCentre/jython-upgrade
jython/lib/test/test_seq_jy.py
12
2043
"""Additional seq_tests Made for Jython. """ import unittest from collections import deque from test import test_support class SeqTestCase(unittest.TestCase): types2test = list, tuple, deque def test_seq_item_equality(self): eq_called = [] class Foo(object): def __eq__(self, othe...
mit
msullivan/advent-of-code
2020/17a.py
1
1655
#!/usr/bin/env python3 import copy from collections import defaultdict import sys import re def extract(s): return [int(x) for x in re.findall(r'-?\d+', s)] def first(grid, x, y, dx, dy): while True: x += dx y += dy if x < 0 or x >= len(grid[0]) or y < 0 or y >= len(grid): ...
mit
wimberosa/samba
lib/dnspython/dns/rdataset.py
91
11548
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
asamerh4/mesos
support/push-commits.py
1
4982
#!/usr/bin/env python # # 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 # "...
apache-2.0
davisein/jitsudone
django/django/conf/locale/sv/formats.py
86
1390
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j F Y H:i' YEAR_MONTH_FORMA...
bsd-3-clause
willowtreeapps/python-spreedly
api.py
2
12100
import httplib, urllib2, time, calendar from datetime import datetime from decimal import Decimal from xml.etree.ElementTree import fromstring from xml.etree import ElementTree as ET from base64 import b64encode API_VERSION = 'v4' def utc_to_local(dt): ''' Converts utc datetime to local''' secs = calendar.tim...
mit
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/distutils/tests/test_build_clib.py
73
4970
"""Tests for distutils.command.build_clib.""" import unittest import os import sys from test.test_support import run_unittest from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError from distutils.tests import support from distutils.spawn import find_executable class Buil...
gpl-2.0
indictranstech/omnitech-frappe
frappe/boot.py
5
4919
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ bootstrap client session """ import frappe import frappe.defaults import frappe.desk.desk_page from frappe.utils import get_gravatar, get_url from frappe.desk.form.load impor...
mit
Kiiv/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/khanacademy.py
21
2666
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate, ) class KhanAcademyIE(InfoExtractor): _VALID_URL = r'^https?://(?:(?:www|api)\.)?khanacademy\.org/(?P<key>[^/]+)/(?:[^/]+/){,2}(?P<id>[^?#/]+)(?:$|[?#])' IE_NAME = 'KhanAcademy' ...
gpl-3.0
bgris/ODL_bgris
lib/python3.5/site-packages/numpy/matlib.py
161
9584
from __future__ import division, absolute_import, print_function import numpy as np from numpy.matrixlib.defmatrix import matrix, asmatrix # need * as we're copying the numpy namespace from numpy import * __version__ = np.__version__ __all__ = np.__all__[:] # copy numpy namespace __all__ += ['rand', 'randn', 'repmat...
gpl-3.0
likesxuqiang/fabric
tests/test_context_managers.py
20
8115
from __future__ import with_statement import os import sys from StringIO import StringIO from nose.tools import eq_, ok_ from fabric.state import env, output from fabric.context_managers import (cd, settings, lcd, hide, shell_env, quiet, warn_only, prefix, path) from fabric.operations import run, local, _prefix_...
bsd-2-clause
ATSTI/administra
open_myplace/boleto/boleto.py
1
4123
# -*- coding: utf-8 -*- ################################################################################# # # # Copyright (C) 2011 Vinicius Dittgen - PROGE, Leonardo Santagada - PROGE # # ...
gpl-2.0
dol-sen/portage
pym/portage/tests/ebuild/test_ipc_daemon.py
2
5393
# Copyright 2010-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import tempfile import time from portage import os from portage import shutil from portage import _python_interpreter from portage.tests import TestCase from portage.const import PORTAGE_BIN_PATH from portage.con...
gpl-2.0
Lekensteyn/buildbot
master/buildbot/test/unit/test_www_hooks_poller.py
5
5071
# 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
yoer/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/omnijson/core.py
63
1863
# -*- coding: utf-8 -*- """ omijson.core ~~~~~~~~~~~~ This module provides the core omnijson functionality. """ import sys engine = None _engine = None options = [ ['ujson', 'loads', 'dumps', (ValueError,)], ['yajl', 'loads', 'dumps', (TypeError, ValueError)], ['jsonlib2', 'read', 'write', (ValueErro...
apache-2.0
nanolearningllc/edx-platform-cypress
lms/djangoapps/ccx/tests/test_models.py
45
8622
""" tests for the models """ from datetime import datetime, timedelta from django.utils.timezone import UTC from mock import patch from nose.plugins.attrib import attr from student.roles import CourseCcxCoachRole # pylint: disable=import-error from student.tests.factories import ( # pylint: disable=import-error A...
agpl-3.0
VladimirTyrin/letsencrypt
acme/acme/errors.py
10
2302
"""ACME errors.""" from acme.jose import errors as jose_errors class Error(Exception): """Generic ACME error.""" class SchemaValidationError(jose_errors.DeserializationError): """JSON schema ACME object validation error.""" class ClientError(Error): """Network error.""" class UnexpectedUpdate(Client...
apache-2.0
yavuzovski/playground
python/django/RESTTest/.venv/lib/python3.4/site-packages/django/contrib/gis/geos/prepared.py
180
1575
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 destructor =...
gpl-3.0
GaetanCambier/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/downloader/mplayer.py
18
1555
from __future__ import unicode_literals import os import subprocess from .common import FileDownloader from ..compat import compat_subprocess_get_DEVNULL from ..utils import ( encodeFilename, ) class MplayerFD(FileDownloader): def real_download(self, filename, info_dict): url = info_dict['url'] ...
gpl-3.0
quixey/scrapy-cluster
crawler/tests/tests_online.py
1
3938
''' Online link spider test ''' import unittest from unittest import TestCase import time import sys from os import path sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) import scrapy import redis from redis.exceptions import ConnectionError import json import threading, time from crawling.spiders....
mit
IllusionRom-deprecated/android_platform_external_chromium_org
chrome/common/extensions/docs/server2/update_server.py
152
2046
#!/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. import getpass import os import subprocess import sys import build_server if __name__ == '__main__': additional_args = [] if ...
bsd-3-clause
yfauser/maxwindownotify
setup.py
1
1252
from setuptools import setup import io def read(*filenames, **kwargs): encoding = kwargs.get('encoding', 'utf-8') sep = kwargs.get('sep', '\n') buf = [] for filename in filenames: with io.open(filename, encoding=encoding) as f: buf.append(f.read()) return sep.join(buf) long_des...
mit
hazybluedot/indie_helper
util.py
1
2278
import requests import bleach import sys if sys.version < '3': from urlparse import urlparse text_type = unicode text_types = [ str, unicode ] binary_type = str else: from urllib.parse import urlparse text_type = str text_types = [ str ] binary_type = bytes def is_url(url): try: ...
gpl-3.0
jeenalee/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/internal_error_wsh.py
465
1738
# Copyright 2012, 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...
mpl-2.0