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
m15k/mongrel2
examples/python/mongrel2/config/args.py
97
8060
import re import sys import inspect from mongrel2.config import rc S_IP_ADDRESS = lambda x, token: ['ip_address', token] S_WORD = lambda x, token: ['word', token] S_EMAIL_ADDR = lambda x, token: ['email', token] S_OPTION = lambda x, token: ['option', token.split("-")[-1]] S_INT = lambda x, token: ['int', int(toke...
bsd-3-clause
mglukhikh/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/us/us_states.py
69
7577
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and alphabetical lists of US states, territories, military mail regions and non-US states to which the US provides postal service. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ # The...
apache-2.0
prakritish/ansible
lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels.py
26
6877
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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
Lynx187/script.module.urlresolver
lib/urlresolver/plugins/up2stream.py
3
2642
""" up2stream urlresolver plugin Copyright (C) 2015 tknorris 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 d...
gpl-2.0
RackSec/ansible
lib/ansible/modules/system/sysctl.py
9
13601
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com> # (c) 2014, James Tanner <tanner.jc@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 ...
gpl-3.0
yarikoptic/NiPy-OLD
nipy/fixes/scipy/stats/models/tests/rmodelwrap.py
1
1153
''' Wrapper for R models to allow comparison to scipy models ''' import numpy as np from rpy import r from exampledata import x, y class RModel(object): ''' Class gives R models scipy.models -like interface ''' def __init__(self, y, design, model_type=r.lm): ''' Set up and estimate R model with data...
bsd-3-clause
defionscode/ansible
lib/ansible/modules/network/cnos/cnos_showrun.py
17
3517
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, Inc. # # 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 Licens...
gpl-3.0
Eluvatar/trawler-python-region-scan
wa_scanner.py
1
3652
#!/usr/bin/python from parser import api from ns import id_str import urllib2 import time import json from operator import itemgetter as get import argparse parser = argparse.ArgumentParser(description="Scan region") parser.add_argument('-u', '--user', metavar='USER', required=True, help='a nation name, email, or we...
gpl-3.0
xodus7/tensorflow
tensorflow/contrib/estimator/python/estimator/linear_test.py
21
5525
# 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
bnkr/suds
suds/xsd/__init__.py
205
3007
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 ...
lgpl-3.0
xpavlus/parabaramba
venv/lib/python2.7/site-packages/mako/ext/extract.py
76
4261
import re from mako import compat from mako import lexer from mako import parsetree class MessageExtractor(object): def process_file(self, fileobj): template_node = lexer.Lexer( fileobj.read(), input_encoding=self.config['encoding']).parse() for extracted in self.extract_n...
gpl-3.0
lokirius/python-for-android
python3-alpha/python3-src/Lib/xmlrpc/server.py
45
35818
"""XML-RPC Servers. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI environment using CGIXMLRPCRequestHandler. The Doc* classes can be...
apache-2.0
songyi199111/sentry
src/sentry/migrations/0075_add_groupbookmark_index.py
36
20591
# -*- 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): db.create_index('sentry_groupbookmark', ['user_id', 'group_id']) def backwards(self, orm): db.delete_in...
bsd-3-clause
tsdmgz/ansible
test/units/module_utils/ec2/test_camel_to_snake.py
35
1301
# -*- coding: utf-8 -*- # (c) 2017, Will Thames <will.thames@xvt.com.au> # # 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 y...
gpl-3.0
meganbkratz/acq4
acq4/pyqtgraph/opengl/items/GLScatterPlotItem.py
39
7429
from OpenGL.GL import * from OpenGL.arrays import vbo from .. GLGraphicsItem import GLGraphicsItem from .. import shaders from ... import QtGui import numpy as np __all__ = ['GLScatterPlotItem'] class GLScatterPlotItem(GLGraphicsItem): """Draws points at a list of 3D positions.""" def __init__(self, **kw...
mit
cpyou/odoo
openerp/addons/base/ir/ir_default.py
342
1883
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
safwanrahman/linuxdesh
kitsune/wiki/tests/test_views.py
2
25140
# -*- coding: utf-8 -*- import json from django.conf import settings from django.contrib.sites.models import Site import mock from nose.tools import eq_ from nose import SkipTest from pyquery import PyQuery as pq from kitsune.products.tests import product from kitsune.sumo.tests import TestCase, LocalizingClient fr...
bsd-3-clause
Team-Exhibit/android_kernel_samsung_u8500
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
bwsblake/lettercounter
django-norel-env/lib/python2.7/site-packages/django/contrib/messages/storage/__init__.py
116
1185
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module def get_storage(import_path): """ Imports the message storage class described by import_path, where import_path is the full Python path to the class. """ try: ...
mit
cpascoe95/cryptotools
tests/cipher_tests.py
1
4829
import unittest import crypto.ciphers as ciphers from crypto.alphabets import EnglishAlphabet class SubstitutionCipherTests(unittest.TestCase): def setUp(self): self.alph = EnglishAlphabet() self.key = {letter: letter for letter in self.alph} def test_invalid_key_type(self): with self...
gpl-2.0
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/test/test_mailcap.py
1
10130
import mailcap import os import shutil import copy import test.support import unittest # Location of mailcap file MAILCAPFILE = test.support.findfile("mailcap.txt") # Dict to act as mock mailcap entry for this test # The keys and values should match the contents of MAILCAPFILE MAILCAPDICT = { 'application/x-movie...
apache-2.0
nishad-jobsglobal/odoo-marriot
addons/bus/bus.py
325
7324
# -*- coding: utf-8 -*- import datetime import json import logging import select import threading import time import random import simplejson import openerp from openerp.osv import osv, fields from openerp.http import request from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT _logger = logging.getLogger(__...
agpl-3.0
drmrd/ansible
test/units/plugins/filter/test_network.py
38
4647
# 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 distributed in the hope that ...
gpl-3.0
rockyzhengwu/mlscratch
rnn/char_rnn.py
1
4815
#!/usr/bin/env python # -*-coding:utf-8-*- """ Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) BSD License """ import numpy as np # data I/O data = open('input.txt', 'r').read() # should be simple plain text file chars = list(set(data)) data_size, vocab_size = len(data), len(chars) ...
apache-2.0
fhe-odoo/odoo
addons/report/models/report_paperformat.py
311
7814
# -*- 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
ashvina/heron
heron/instance/src/python/utils/system_config.py
4
1442
#!/usr/bin/env python # -*- encoding: utf-8 -*- # 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...
apache-2.0
sensusaps/RoboBraille.Web.API
WorkingDirectory/DaisyPipeline/transformers/ca_cnib_rtf2dtbook/rtf2xml-py/rtf2xml/delete_info.py
1
8983
######################################################################### # # # # # copyright 2002 Paul Henry Tremblay # # ...
apache-2.0
brandond/ansible
lib/ansible/plugins/doc_fragments/sros.py
44
2445
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: provider: descriptio...
gpl-3.0
nhalloran/three.js
utils/exporters/blender/addons/io_three/exporter/api/camera.py
73
2028
import math from bpy import data, types, context from .. import logger def _camera(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :param *args: :param **kwargs: """ if isinstance(name, types.Camera): came...
mit
MikeWinter/bio-data-repository
bdr/utils/transports.py
1
13814
""" A set of classes for abstracting communication with remote servers. While the urllib-family of modules provides similar functionality, they not provide for querying the source for its metadata (size and modification date, in this case) prior to fetching the resource itself. All exceptions raised by these types inh...
gpl-2.0
kaplun/inspire-next
inspirehep/modules/forms/bundles.py
6
1950
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
vperron/django-storages
tests.py
19
2082
import os import sys import django BASE_PATH = os.path.dirname(__file__) def main(): """ Standalone django model test with a 'memory-only-django-installation'. You can play with a django model without a complete django app installation. http://www.djangosnippets.org/snippets/1044/ """ sys.exc_...
bsd-3-clause
matthiasdiener/spack
var/spack/repos/builtin/packages/py-dbf/package.py
5
1648
############################################################################## # 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
SimonGriffioen/pascal
PASCAL/external/networkx/linalg/tests/test_laplacian.py
40
5461
from nose import SkipTest import networkx as nx from networkx.generators.degree_seq import havel_hakimi_graph class TestLaplacian(object): numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test @classmethod def setupClass(cls): global numpy global scipy global ass...
gpl-2.0
brockwhittaker/zulip
zerver/views/user_settings.py
2
12517
from typing import Optional, Any, Dict, Text from django.utils.translation import ugettext as _ from django.conf import settings from django.contrib.auth import authenticate, update_session_auth_hash from django.http import HttpRequest, HttpResponse from django.shortcuts import redirect, render from django.urls import...
apache-2.0
rehandalal/buchner
buchner/cmdline.py
1
4058
import os import os.path import string from optparse import OptionParser from buchner import __version__ USAGE = '%prog [options] [command] [command-options]' VERSION = '%prog ' + __version__ def build_parser(usage): parser = OptionParser(usage=usage, version=VERSION) return parser DIGIT_TO_WORD = { ...
bsd-3-clause
altsen/diandiyun-platform
lms/djangoapps/certificates/migrations/0005_auto__add_field_generatedcertificate_name.py
188
7270
# encoding: 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 field 'GeneratedCertificate.name' db.add_column('certificates_generatedcertificate', 'name', self.gf('dj...
agpl-3.0
dcf21/meteor-pi
src/diagnostics/turnCameraOff.py
2
1212
#!../../virtual-env/bin/python # Meteor Pi, Cambridge Science Centre # Dominic Ford # ------------------------------------------------- # Copyright 2016 Cambridge Science Centre. # This file is part of Meteor Pi. # Meteor Pi is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
sudheesh001/oh-mainline
vendor/packages/requests/requests/packages/urllib3/_collections.py
484
10454
from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): pass try: # Python 2.7+ from ...
agpl-3.0
rjeschmi/easybuild-easyblocks
easybuild/easyblocks/a/ansys.py
2
3596
## # Copyright 2009-2014 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
blbarker/spark-tk
python/sparktk/frame/ops/count.py
14
2213
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
wtmmac/p2pool
SOAPpy/NS.py
289
3724
from __future__ import nested_scopes """ ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (Gregory.R.Warnes@Pfizer.com) # Christopher Blunck (blunck...
gpl-3.0
cjcjameson/gpdb
src/test/tinc/ext/suds/sax/date.py
160
10456
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 ...
apache-2.0
ioram7/keystone-federado-pgid2013
keystone/middleware/s3_token.py
5
8715
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011,2012 Akira YOSHIYAMA <akirayoshiyama@gmail.com> # All Rights Reserved. # # Licensed under the...
apache-2.0
AxelDelmas/ansible
lib/ansible/plugins/action/assemble.py
67
5506
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # Stephen Fromm <sfromm@gmail.com> # Brian Coca <briancoca+dev@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
gpl-3.0
iallison/gauntlt
vendor/gruyere/source/gtl.py
7
10338
"""Gruyere Template Language, part of Gruyere, a web application with holes. Copyright 2010 Google Inc. All rights reserved. This code is licensed under the http://creativecommons.org/licenses/by-nd/3.0/us Creative Commons Attribution-No Derivative Works 3.0 United States license. DO NOT COPY THIS CODE! This applic...
mit
0k/openerp-server
openerp/tests/test_acl.py
40
5922
import unittest2 from lxml import etree import openerp from openerp.tools.misc import mute_logger import common # test group that demo user should not have GROUP_TECHNICAL_FEATURES = 'base.group_no_one' class TestACL(common.TransactionCase): def setUp(self): super(TestACL, self).setUp() self.r...
agpl-3.0
dan-git/outdoor_bot
vision/scripts/script_good_features.py
4
1179
#!/usr/bin/env python from cv2 import cv as cv import cv2 from common import anorm, clock from functools import partial import numpy as np help_message = '''Good Features to Track USAGE: good_features.py [ <image> ] ''' if __name__ == '__main__': import sys try: fn1 = sys.argv[1] except:...
bsd-2-clause
queria/my-tempest
tempest/thirdparty/boto/test_ec2_instance_run.py
2
14111
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
MobinRanjbar/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/thumbnail.py
135
31736
#!/usr/bin/python # -*- coding: utf-8 -*- # This contains a 128x128 px thumbnail in PNG format # Taken from http://www.zwahlendesign.ch/en/node/20 # openoffice_icons/openoffice_icons_linux/openoffice11.png # License: Freeware import base64 iconstr = """\ iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAAG0OVFdAAAABGdBTUEAANbY1E9Y...
apache-2.0
OTWillems/GEO1005
SpatialDecision/external/networkx/classes/tests/test_graph.py
31
21330
#!/usr/bin/env python from nose.tools import * import networkx class BaseGraphTester(object): """ Tests for data-structure independent graph class features.""" def test_contains(self): G=self.K3 assert(1 in G ) assert(4 not in G ) assert('b' not in G ) assert([] not in G...
gpl-2.0
chengdh/openerp-ktv
openerp/addons/google_base_account/wizard/__init__.py
62
1076
# -*- 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
jackrzhang/zulip
zerver/management/commands/set_message_flags.py
14
3137
import logging import sys from typing import Any, Iterable from django.core.management.base import CommandParser from django.db import models from zerver.lib import utils from zerver.lib.management import ZulipBaseCommand from zerver.models import UserMessage class Command(ZulipBaseCommand): help = """Sets user...
apache-2.0
SellWellDesigns/orion
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/native.py
364
1938
# -*- coding: utf-8 -*- """ pygments.styles.native ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "native" vim theme. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
mit
unseenlaser/python-for-android
python-build/python-libs/gdata/build/lib/atom/http_core.py
133
17418
#!/usr/bin/env python # # Copyright (C) 2009 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...
apache-2.0
gorkinovich/DefendersOfMankind
dependencies/boost-1.46.0/boost-build/test/inherit_toolset.py
4
1176
#!/usr/bin/python # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) from BoostBuild import Tester, List from string import find t = Tester(pass_toolset=0) t.write("a.cpp", """ """) t.writ...
gpl-3.0
thomasw/convertly
converter/views.py
1
3286
from converter import * from django.template import RequestContext, Context, loader from django.shortcuts import render_to_response from django.http import HttpResponse, Http404 from converter.forms import UploadDoc from zipfile import ZipFile def index(request): """ Interface for uploading, co...
mit
welshjf/bitcoin
qa/rpc-tests/rawtransactions.py
46
5925
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly) coin...
mit
HiroIshikawa/21playground
microblog/flask/lib/python3.5/site-packages/sqlalchemy/dialects/mysql/oursql.py
59
8124
# mysql/oursql.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+oursql :name: OurSQL :dbapi: oursql :connectstri...
mit
ecederstrand/django
tests/template_tests/syntax_tests/test_extends.py
176
15503
from django.test import SimpleTestCase from ..utils import setup inheritance_templates = { 'inheritance01': "1{% block first %}&{% endblock %}3{% block second %}_{% endblock %}", 'inheritance02': "{% extends 'inheritance01' %}" "{% block first %}2{% endblock %}{% block second %}4{% endblo...
bsd-3-clause
rbaghdadi/ISIR
benchmarks/DNN/layers/convolution/direct/cpu_optimal_unrolled/conv_tensorflow.py
6
1206
# For convenience, disable warnings of type FutureWarning import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import tensorflow as tf import numpy as np import time, sys from tensorflow import nn BATCH_SIZE = 32 N = 112 FIN = 32 FOUT = 32 K_Y = 3 K_X = 3 NB_TESTS = 101 def Convolution(X...
mit
propdata/scrum-pm
scrum_pm/artifacts/migrations/0001_initial.py
1
5055
# -*- 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 'Sprint' db.create_table('artifacts_sprint', ( ('id', self.gf('django.db.models.f...
mit
foursquare/luigi
test/contrib/hadoop_test.py
11
18182
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify 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 law...
apache-2.0
davidpaulrosser/Forms
forms/util/mesh.py
1
3205
""" This module provides various mesh utilities for cleaning and extruding. """ import pymel.core as pm import maya.mel as mel """ Combine multiple polygon meshes with the option of removing duplicate internal faces. Parameters: instanceGroup -- A group of meshes to combine ( pymel.core.general.group ) ...
mit
andreif/django
tests/sitemaps_tests/urls/http.py
311
4069
from datetime import date, datetime from django.conf.urls import url from django.conf.urls.i18n import i18n_patterns from django.contrib.sitemaps import GenericSitemap, Sitemap, views from django.http import HttpResponse from django.utils import timezone from django.views.decorators.cache import cache_page from ..mod...
bsd-3-clause
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/GL/VERSION/GL_1_1.py
9
3918
'''OpenGL extension VERSION.GL_1_1 This module customises the behaviour of the OpenGL.raw.GL.VERSION.GL_1_1 to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/VERSION/GL_1_1.txt ''' from OpenGL import platform, constant, arrays fro...
lgpl-3.0
2ndQuadrant/ansible
lib/ansible/modules/web_infrastructure/taiga_issue.py
47
10952
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Alejandro Guirao <lekumberri@gmail.com> # 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....
gpl-3.0
jerjorg/BZI
BZI/convergence.py
1
6793
import numpy as np import matplotlib.pyplot as plt import time from BZI.symmetry import make_ptvecs from BZI.sampling import make_grid from BZI.pseudopots import Al_PP from BZI.integration import monte_carlo from BZI.plots import PlotMesh class Convergence(object): """ Compare integrations of pseudo-potentials by...
gpl-3.0
manderson23/NewsBlur
vendor/feedvalidator/logging.py
16
11350
"""$Id: logging.py 749 2007-04-02 15:45:49Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 749 $" __date__ = "$Date: 2007-04-02 15:45:49 +0000 (Mon, 02 Apr 2007) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" # fee...
mit
andras-tim/sphinxcontrib-httpdomain
doc/conf.py
1
8340
# -*- coding: utf-8 -*- # # sphinxcontrib-httpdomain documentation build configuration file, created by # sphinx-quickstart on Thu Jun 2 13:27:52 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenera...
bsd-2-clause
alphafoobar/intellij-community
python/lib/Lib/encodings/iso8859_15.py
593
13468
""" Python Character Mapping Codec iso8859_15 generated from 'MAPPINGS/ISO8859/8859-15.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...
apache-2.0
shamilbi/loxodo
src/frontends/ppygui/ppygui/dialoghdr.py
2
2318
## Copyright (c) Alexandre Delattre 2008 ## 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, pu...
gpl-2.0
1200wd/antfs-cli
antfs_cli/__init__.py
2
1168
# Ant # # Copyright (c) 2015, Gustav Tiger <gustav@tiger.name> # # 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, m...
mit
gpoulin/luigi
examples/foo.py
6
1521
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify 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 law...
apache-2.0
boyers/hamlit
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
10585
# Copyright (c) 2014 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
mit
CCI-MOC/nova
nova/scheduler/rpcapi.py
51
5956
# 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 agr...
apache-2.0
AnthonyBroadCrawford/servo
tests/wpt/harness/wptrunner/wptlogging.py
57
3870
# 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 http://mozilla.org/MPL/2.0/. import logging import sys import threading from StringIO import StringIO from multiprocessing import Queue from mozlog ...
mpl-2.0
ArianaGashi/Techstitution
venv/lib/python2.7/site-packages/pymongo/command_cursor.py
4
6602
# Copyright 2014-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...
cc0-1.0
pczerkas/tempest
tempest/common/accounts.py
11
14883
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 re...
apache-2.0
emersonsoftware/ansiblefork
lib/ansible/modules/system/runit.py
25
9034
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Brian Coca <bcoca@ansible.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 Licen...
gpl-3.0
zhounanshu/Flask-AppBuilder
flask_appbuilder/tests/test_mongoengine.py
3
21385
from nose.tools import eq_, ok_, raises import unittest import os import string import random import datetime from flask_mongoengine import MongoEngine from mongoengine import Document from mongoengine import IntField, FloatField, DateTimeField, StringField, ReferenceField, ListField, FileField, ImageField from flask_a...
bsd-3-clause
dstanek/keystone
keystone/common/sql/migrate_repo/versions/053_endpoint_to_region_association.py
11
3146
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P # # 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 applic...
apache-2.0
sysadmin75/ansible-modules-core
network/nxos/nxos_vrf.py
15
9900
#!/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
coderbone/SickRage
lib/enzyme/parsers/ebml/core.py
74
9965
# -*- coding: utf-8 -*- from ...exceptions import ReadError from .readers import * from pkg_resources import resource_stream # @UnresolvedImport from xml.dom import minidom import logging __all__ = ['INTEGER', 'UINTEGER', 'FLOAT', 'STRING', 'UNICODE', 'DATE', 'MASTER', 'BINARY', 'SPEC_TYPES', 'READERS', '...
gpl-3.0
darktears/chromium-crosswalk
tools/auto_bisect/bisect_results.py
22
10530
# 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. import math import os import bisect_utils import math_utils import source_control import ttest from bisect_state import RevisionState class BisectResults...
bsd-3-clause
bfirsh/docker-py
tests/unit/auth_test.py
1
16214
# -*- coding: utf-8 -*- import base64 import json import os import os.path import random import shutil import tempfile import unittest from docker import auth, errors try: from unittest import mock except ImportError: import mock class RegressionTest(unittest.TestCase): def test_803_urlsafe_encode(self...
apache-2.0
HM2MC/Webfront
reportlab-2.5/build/lib.win32-2.7/reportlab/lib/textsplit.py
10
8284
#Copyright ReportLab Europe Ltd. 2000-2006 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/textsplit.py """Helpers for text wrapping, hyphenation, Asian text splitting and kinsoku shori. How to split a 'big word' depends on the language...
mit
benoitsteiner/tensorflow-opencl
tensorflow/python/estimator/inputs/numpy_io.py
36
5108
# 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
stxnext-kindergarten/presence-analyzer-pzarebski
src/presence_analyzer/utils.py
1
3612
# -*- coding: utf-8 -*- """ Helper functions used in views. """ import csv from json import dumps from functools import wraps from datetime import datetime from flask import Response from presence_analyzer.main import app import logging log = logging.getLogger(__name__) # pylint: disable=invalid-name def jsonify...
mit
ceramos/micropython
tests/float/float2int.py
43
2631
# check cases converting float to int, relying only on single precision float try: import ustruct as struct except: import struct # work out configuration values is_64bit = struct.calcsize("P") == 8 # 0 = none, 1 = long long, 2 = mpz try: dummy = 0x7fffffffffffffff try: if (0xffffffffffffffff ...
mit
FlaPer87/django-nonrel
django/contrib/localflavor/nl/forms.py
311
2796
""" NL-specific Form helpers """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode pc_re = re.compile('^\d{4}[A-Z]{2}$...
bsd-3-clause
robot-tools/iconograph
server/modules/persistent.py
1
1150
#!/usr/bin/python3 import argparse import os import icon_lib parser = argparse.ArgumentParser(description='iconograph persistent') parser.add_argument( '--chroot-path', dest='chroot_path', action='store', required=True) FLAGS = parser.parse_args() def main(): module = icon_lib.IconModule(FLAGS.c...
apache-2.0
cgimenop/Excel2Testlink
ExcelParser/lib/openpyxl/styles/numbers.py
13
3360
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl import re from openpyxl.descriptors import String from .hashable import HashableObject BUILTIN_FORMATS = { 0: 'General', 1: '0', 2: '0.00', 3: '#,##0', 4: '#,##0.00', 5: '"$"#,##0_);("$"#,##0)', 6: '"$"#,##0_);[Red]...
mit
ratoaq2/deluge
packaging/win32/deluge-bbfreeze.py
1
7783
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Calum Lind <calumlind@gmail.com> # Copyright (C) 2010 Damien Churchill <damoxc@gmail.com> # Copyright (C) 2009-2010 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2009 Jesper Lund <mail@jesperlund.com> # # This file is part of Deluge and is...
gpl-3.0
zplab/rpc-scope
scope/gui/microscope_widget.py
1
23339
# This code is licensed under the MIT License (see LICENSE file for details) from PyQt5 import Qt import pkg_resources from . import device_widget from . import status_widget from ..simple_rpc import rpc_client from .. import util class MicroscopeWidget(device_widget.DeviceWidget): PROPERTY_ROOT = 'scope.' P...
mit
victoryckl/zxing-2.2
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/linkloc.py
34
4004
"""SCons.Tool.linkloc Tool specification for the LinkLoc linker for the Phar Lap ETS embedded operating system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005,...
apache-2.0
Antreasgr/Random-Graphs
Python/SHET.py
1
8516
import os # import networkx as nx import numpy from numpy.random import RandomState from clique_tree import * from nx_converters import * from randomizer import * from subtrees import * from datetime import datetime from Runners import * from report_generator import * from enum import Enum import yaml from yaml import...
mit
zouyapeng/horizon_change
openstack_dashboard/dashboards/admin/instances/tables.py
5
7557
# Copyright 2012 OpenStack Foundation # 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 License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
lmiphay/gentoo-oam
oam/eventparser/scanner.py
1
1799
#!/usr/bin/python from __future__ import print_function import sys import os import subprocess import logging import glob import collections import unittest import re class Scanner: def __init__(self, report, checker): self.report = report self.checker = checker self.logger = logging.getL...
gpl-2.0
ronakkhunt/kuma
vendor/packages/translate/tools/poclean.py
25
2318
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007 Zuza Software Foundation # # This file is part of translate. # # translate 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 t...
mpl-2.0