repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
hurricup/intellij-community
python/helpers/py2only/docutils/utils/__init__.py
113
27412
# coding: utf-8 # $Id: __init__.py 7668 2013-06-04 12:46:30Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous utilities for the documentation utilities. """ __docformat__ = 'reStructuredText' import sys import os import os.path impo...
apache-2.0
cloudera/hue
desktop/core/ext-py/docutils-0.14/docutils/parsers/rst/languages/ca.py
128
4467
# $Id: ca.py 7119 2011-09-02 13:00:23Z milde $ # Author: Ivan Vilata i Balaguer <ivan@selidor.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>. Two files must be # trans...
apache-2.0
MiltosD/CEF-ELRC
misc/tools/generateDS-2.7a/tests/simpletype_memberspecs1_sup.py
7
22813
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated by generateDS.py. # import sys import getopt import re as re_ etree_ = None Verbose_import_ = False ( XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree ) = range(3) XMLParser_import_library = None try: # lxml fro...
bsd-3-clause
rhyolight/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/type1font.py
69
6406
""" A class representing a Type 1 font. This version merely reads pfa and pfb files and splits them for embedding in pdf files. There is no support yet for subsetting or anything like that. Usage (subject to change): font = Type1Font(filename) clear_part, encrypted_part, finale = font.parts Source: Adobe Tech...
agpl-3.0
zhengzhihust/tablib
tablib/packages/odf/math.py
100
1066
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
mit
pando85/gourmet
gourmet/plugins/import_export/pdf_plugin/page_drawer.py
7
3491
import gtk class PageDrawer (gtk.DrawingArea): def __init__(self, page_width=None, page_height=None, sub_areas=[],xalign=0.5,yalign=0.5 ): """Draw a page based on page areas given to us. The areas can be given in any scale they like. sub_areas are each (...
gpl-2.0
sbranson/online_crowdsourcing
crowdsourcing/util/multibox/loss.py
1
5401
import numpy as np from scipy.optimize import linear_sum_assignment import tensorflow as tf import tensorflow.contrib.slim as slim SMALL_EPSILON = 1e-10 def compute_assignments(locations, confidences, gt_bboxes, num_gt_bboxes, batch_size, alpha): """ locations: [batch_size * num_predictions, 4] confidences: [ba...
mit
dynamicapp/dynamicapp
lib/iOS/dependencies/cpp/scons/scons-local-2.0.0.final.0/SCons/Warnings.py
34
6804
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
apache-2.0
tbeckham/eutester
eucaops/asops.py
5
21084
# Software License Agreement (BSD License) # # Copyright (c) 2009-2014, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistributions of source ...
bsd-2-clause
lorin/ansible-modules-core
cloud/ec2_ami.py
29
8707
#!/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 distributed...
gpl-3.0
MobinRanjbar/hue
apps/oozie/src/oozie/migrations/0027_auto__chg_field_node_name__chg_field_job_name.py
21
25573
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Node.name' db.alter_column(u'oozie_node', 'name', self...
apache-2.0
nerandell/vyked
vyked/bus.py
1
12997
import asyncio from collections import defaultdict from functools import partial import json import logging import random import uuid from again.utils import unique_hex import aiohttp from retrial.retrial import retry from .services import TCPServiceClient, HTTPServiceClient from .pubsub import PubSub from .packet im...
mit
JTCunning/sentry
src/sentry/migrations/0126_auto__add_field_option_last_updated.py
36
25153
# -*- 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 field 'Option.last_updated' db.add_column('sentry_option', 'last_updated', se...
bsd-3-clause
immstudios/notify
scripts/subscriber.py
1
1544
#!/usr/bin/env python import json import thread import uuid try: from urllib.request import urlopen from urllib.parse import urlparse except ImportError: from urlparse import urlparse from urllib2 import urlopen __all__ = ["NotifyPublisher"] class NotifySubscriber(): def __init__(self, **kwargs)...
gpl-3.0
danicarrion/python-sepa
sepa/debit/core.py
1
6958
# -*- coding: utf-8 -*- import gettext import os import random import string from datetime import datetime from jinja2 import Environment, PackageLoader _ = gettext.translation("sepa", os.path.join(os.path.dirname(os.path.abspath(__file__)), "../locale"), ["es"]).gettext SEQUENCE_TYPES = ("FRST", "RCUR", "FNAL", "O...
mit
GheRivero/ansible
lib/ansible/modules/web_infrastructure/rundeck_project.py
99
6314
#!/usr/bin/python # -*- coding: utf-8 -*- # Ansible module to manage rundeck projects # (c) 2017, Loic Blot <loic.blot@unix-experience.fr> # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org...
gpl-3.0
mulby/edx-idea
edx/idea/workflow.py
1
1760
from edx.idea.common.identifier import generate_uuid class Workflow(object): def __init__(self, phases=None, name=None): self.phases = phases or [] self.name = name or ('workflow_' + generate_uuid()) def __repr__(self): return 'Workflow(phases={0}, name={1})'.format( rep...
agpl-3.0
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/gzip.py
78
18226
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import io import __builtin__ __all__ = ["GzipFile"...
gpl-3.0
mahak/nova
nova/policies/server_diagnostics.py
3
1211
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
apache-2.0
CedricVallee/pythonFinancialAnalyst
FinancialAnalystV2/extractMDA.py
1
2088
# -*- coding: utf-8 -*- """ Created on Wed Mar 02 2016 @author: Cedric Vallee Inspired by Chong Wee Tan """ import os import Helper as helper import Scraper as scraper from textblob import TextBlob from bs4 import BeautifulSoup def getMDAfromText(filename,text): try: soup = BeautifulSoup(te...
mit
csachs/openmicroscopy
components/tools/OmeroPy/src/omero/plugins/delete.py
9
2773
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Startup plugin for command-line deletes Copyright 2009-2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import sys from omero.cli import CLI, GraphControl HELP = """Delete OMERO data. Remove enti...
gpl-2.0
Ichag/odoo
addons/l10n_fr_rib/__init__.py
433
1046
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
luiseduardohdbackup/odoo
addons/crm_partner_assign/crm_lead.py
221
3039
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
lidavidm/sympy
sympy/physics/quantum/piab.py
124
1756
"""1D quantum particle in a box.""" from __future__ import print_function, division from sympy import Symbol, pi, sqrt, sin, Interval, S from sympy.physics.quantum.operator import HermitianOperator from sympy.physics.quantum.state import Ket, Bra from sympy.physics.quantum.constants import hbar from sympy.functions....
bsd-3-clause
s20121035/rk3288_android5.1_repo
external/wpa_supplicant_8/wpa_supplicant/examples/wpas-test.py
189
2571
#!/usr/bin/python import dbus import sys, os import time WPAS_DBUS_SERVICE = "fi.epitest.hostap.WPASupplicant" WPAS_DBUS_INTERFACE = "fi.epitest.hostap.WPASupplicant" WPAS_DBUS_OPATH = "/fi/epitest/hostap/WPASupplicant" WPAS_DBUS_INTERFACES_INTERFACE = "fi.epitest.hostap.WPASupplicant.Interface" WPAS_DBUS_INTERFACES...
gpl-3.0
woodpecker1/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/filesystem.py
126
9517
# Copyright (C) 2010 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 ...
bsd-3-clause
pjdelport/django-devserver
devserver/modules/request.py
13
2777
import urllib from devserver.modules import DevServerModule class SessionInfoModule(DevServerModule): """ Displays information about the currently authenticated user and session. """ logger_name = 'session' def process_request(self, request): self.has_session = bool(getattr(request, 'se...
bsd-3-clause
af1rst/bite-project
deps/gdata-python-client/src/gdata/tlslite/Session.py
359
4733
"""Class representing a TLS session.""" from utils.compat import * from mathtls import * from constants import * class Session: """ This class represents a TLS session. TLS distinguishes between connections and sessions. A new handshake creates both a connection and a session. Data is transmitt...
apache-2.0
KnowNo/reviewboard
reviewboard/ssh/storage.py
8
8054
from __future__ import unicode_literals import logging import os from django.utils.translation import ugettext_lazy as _ import paramiko from reviewboard.ssh.errors import MakeSSHDirError, UnsupportedSSHKeyError class SSHStorage(object): def __init__(self, namespace=None): self.namespace = namespace ...
mit
kingvuplus/enigma2
lib/python/Components/PackageInfo.py
43
12858
import xml.sax from Tools.Directories import crawlDirectory, resolveFilename, SCOPE_CONFIG, SCOPE_SKIN, copyfile, copytree from Components.NimManager import nimmanager from Components.Ipkg import IpkgComponent from Components.config import config, configfile from Tools.HardwareInfo import HardwareInfo from enigma impor...
gpl-2.0
SymbiFlow/python-fpga-interchange
fpga_interchange/constraints/sat.py
1
11109
# -*- coding: utf-8 -*- # # Copyright (C) 2020 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC class AssertStateVariable(): """ Abstract asserted state variab...
isc
takeshineshiro/horizon
openstack_dashboard/dashboards/identity/projects/panel.py
43
1040
# 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
hedaoyuan/Paddle
python/paddle/trainer_config_helpers/tests/configs/projections.py
8
1705
''' Test mixed layer, projections and operators. ''' from paddle.trainer_config_helpers import * settings(batch_size=1000, learning_rate=1e-4) din = data_layer(name='test', size=100) din = embedding_layer(input=din, size=256) with mixed_layer(size=100) as m1: m1 += full_matrix_projection(input=din) with mixed_...
apache-2.0
msarana/selenium_python
ENV/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py
199
4546
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from nt...
apache-2.0
mitchcapper/mythbox
resources/lib/IMDbPY/imdb/_compat.py
128
2753
""" _compat module (imdb package). This module provides compatibility functions used by the imdb package to deal with unusual environments. Copyright 2008-2010 Davide Alberani <da@erlug.linux.it> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License...
gpl-2.0
jackTheRipper/iotrussia
web_server/lib/werkzeug-master/examples/simplewiki/actions.py
45
6428
# -*- coding: utf-8 -*- """ simplewiki.actions ~~~~~~~~~~~~~~~~~~ The per page actions. The actions are defined in the URL with the `action` parameter and directly dispatched to the functions in this module. In the module the actions are prefixed with 'on_', so be careful not to name any othe...
gpl-2.0
greyg00s/googletest
scripts/common.py
1180
2919
# Copyright 2013 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 foll...
bsd-3-clause
CharlesZhong/Blog
app/main/forms.py
2
2058
from flask.ext.wtf import Form from wtforms import StringField, TextAreaField, BooleanField, SelectField,\ SubmitField from wtforms.validators import Required, Length, Email, Regexp from wtforms import ValidationError from ..models import Role, User class NameForm(Form): name = StringField('What is your name?...
gpl-2.0
openhatch/oh-mainline
vendor/packages/Django/django/core/serializers/json.py
113
3461
""" Serialize data to/from JSON """ # Avoid shadowing the standard library json module from __future__ import absolute_import import datetime import decimal import json from django.core.serializers.base import DeserializationError from django.core.serializers.python import Serializer as PythonSerializer from django....
agpl-3.0
mpetyx/pychatbot
AIML/howie-src-0.6.0/howie/frontends/xmpp/filetransfer.py
1
8172
## filetransfer.py ## ## Copyright (C) 2004 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version...
apache-2.0
ratschlab/ASP
examples/undocumented/python_static/kernel_polymatchword.py
22
1186
from tools.load import LoadMatrix from sg import sg lm=LoadMatrix() traindna=lm.load_dna('../data/fm_train_dna.dat') testdna=lm.load_dna('../data/fm_test_dna.dat') trainlabel=lm.load_labels('../data/label_train_dna.dat') parameter_list=[[traindna,testdna,trainlabel,10,2,True,True,3,0,'n'], [traindna,testdna,trainlab...
gpl-2.0
pmarques/ansible
test/units/module_utils/urls/test_fetch_url.py
40
8423
# -*- coding: utf-8 -*- # (c) 2018 Matt Martz <matt@sivel.net> # 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 import socket from ansible.module_utils.six import StringIO from ansible.mo...
gpl-3.0
robhudson/django
tests/gis_tests/relatedapp/tests.py
39
15582
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, skipUnlessDBF...
bsd-3-clause
xlqian/navitia
source/jormungandr/jormungandr/compat.py
3
2439
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
cmsj/pibus
EPD.py
1
4018
# Copyright 2013-2015 Pervasive Displays, 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...
mit
SaikWolf/gnuradio
grc/core/utils/expr_utils.py
17
5486
""" Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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) any l...
gpl-3.0
s3nk4s/flaskTutorials
FlaskApp/FlaskApp/venv/local/lib/python2.7/encodings/ptcp154.py
647
8950
""" Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,err...
mit
klml/kohrsupply
settings.example.py
1
3449
""" Django settings for kohrsupply project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import...
mit
aayush2911/Fibonaccio
web2py/gluon/packages/dal/pydal/adapters/imap.py
8
43003
# -*- coding: utf-8 -*- import datetime import re import sys from .._globals import IDENTITY, GLOBAL_LOCKER from .._compat import PY2, integer_types, basestring from ..connection import ConnectionPool from ..objects import Field, Query, Expression from ..helpers.classes import SQLALL from ..helpers.methods import use_...
gpl-2.0
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/pip/_vendor/requests/cookies.py
413
17191
# -*- 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 copy import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes...
bsd-3-clause
adw0rd/lettuce
tests/integration/lib/Django-1.2.5/django/utils/functional.py
307
14218
# License for code in this file that was taken from Python 2.5. # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 # -------------------------------------------- # # 1. This LICENSE AGREEMENT is between the Python Software Foundation # ("PSF"), and the Individual or Organization ("Licensee") accessing and # otherwise usin...
gpl-3.0
danilobellini/audiolazy
examples/lpc_plot.py
1
1396
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of AudioLazy, the signal processing Python package. # Copyright (C) 2012-2016 Danilo de Jesus da Silva Bellini # # AudioLazy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
gpl-3.0
alexiip/lolapichallengepredict
RiotChallengeWeb/lib/werkzeug/debug/__init__.py
310
7800
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import json import mimetypes from os.path import join, dirname, basename, isfile ...
apache-2.0
lukasjuhrich/pycroft
hades_logs/__init__.py
1
5307
""" hades_logs ---------- This module provides access to Hades' radius logs utilizing its celery RPC api. """ import logging from celery.exceptions import TimeoutError as CeleryTimeoutError from flask.globals import current_app from werkzeug import LocalProxy from .app import HadesCelery from .exc import HadesConfig...
apache-2.0
rsteca/python-social-auth
social/backends/goclio.py
77
1247
from social.backends.oauth import BaseOAuth2 class GoClioOAuth2(BaseOAuth2): name = 'goclio' AUTHORIZATION_URL = 'https://app.goclio.com/oauth/authorize/' ACCESS_TOKEN_METHOD = 'POST' ACCESS_TOKEN_URL = 'https://app.goclio.com/oauth/token/' REDIRECT_STATE = False STATE_PARAMETER = False d...
bsd-3-clause
BFriedland/UserDataBase-Heroku
venv/Lib/site-packages/pip/_vendor/requests/compat.py
571
2556
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
mit
samleybrize/cryptopp-bindings-api
tests/lib/gtest-1.7.0/test/gtest_filter_unittest.py
2826
21261
#!/usr/bin/env python # # Copyright 2005 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...
mit
yazug/shade_janitor
shade_janitor/tests/unit/cleanup/test_cleanup_subnet.py
1
2092
import mock from shade_janitor import cleanup from shade_janitor.tests.unit import base class TestCleanupSubnet(base.BaseTestCase): def setUp(self): super(TestCleanupSubnet, self).setUp() self.cloud.delete_subnet = mock.Mock() self.subnet = mock.Mock() def add_single(self): ...
gpl-3.0
leighpauls/k2cro4
third_party/webdriver/pylib/test/selenium/webdriver/common/alerts_tests.py
1
5602
#Copyright 2007-2009 WebDriver committers #Copyright 2007-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 b...
bsd-3-clause
demon-ru/iml-crm
addons/l10n_fr/report/bilan_report.py
374
6196
# -*- coding: utf-8 -*- # # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users w...
agpl-3.0
fevxie/odoo
addons/account_analytic_default/__init__.py
445
1087
# -*- 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
bartvm/pylearn2
pylearn2/scripts/icml_2013_wrepl/emotions/make_submission.py
21
2184
from __future__ import print_function import sys from theano.compat.six.moves import xrange def usage(): print("""usage: python make_submission.py model.pkl submission.csv) Where model.pkl contains a trained pylearn2.models.mlp.MLP object. The script will make submission.csv, which you may then upload to the kagg...
bsd-3-clause
dsanno/chainer-cifar
src/dataset.py
1
4361
import cPickle as pickle import numpy as np import os from PIL import Image import six train_files = ['data_batch_{}'.format(i + 1) for i in six.moves.range(5)] test_files = ['test_batch'] def load_file(file_path): with open(file_path, 'rb') as f: data = pickle.load(f) return data['data']....
mit
maackle/ILC-app
make.py
1
27624
import csv import os import re import sys import argparse import tempfile from subprocess import call import json from pyspatialite import dbapi2 as sqlite3 import geojson from shapely import wkt, wkb from conf import settings from conf.settings import global_datasets from conf.projects import projects from util impo...
gpl-3.0
jschuecker/nest-simulator
pynest/examples/plot_weight_matrices.py
17
6243
# -*- coding: utf-8 -*- # # plot_weight_matrices.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Li...
gpl-2.0
yland/coala
coalib/output/printers/HTMLWriter.py
14
3253
from pyprint.ClosableObject import ClosableObject class HTMLWriter(ClosableObject): """ Printer for outputting HTML Log files. :param filename: the name of the file to put the data into (string). :param indentation_per_tag: spaces used to indent every subseq...
agpl-3.0
lepistone/stock-logistics-workflow
__unported__/stock_split_picking/__openerp__.py
4
1686
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
Regner/will
will/settings.py
11
7860
import os from utils import show_valid, warn, note from clint.textui import puts, indent from urlparse import urlparse def import_settings(quiet=True): """This method takes care of importing settings from the environment, and config.py file. Order of operations: 1. Imports all WILL_ settings from the env...
mit
mr-ping/WebTesting
test/test.py
1
3234
import unittest from log import Log class LogTest(unittest.TestCase): def test_get_last_logs_one(self): file = '/var/log/siege.log' content = Log.get_last_logs(file, 121) content_list = content.split(",") self.assertEqual(len(content_list), 10) def test_get_last_logs_three(sel...
mit
sunny94/temp
sympy/polys/agca/tests/test_modules.py
121
13526
"""Test modules.py code.""" from sympy.polys.agca.modules import FreeModule, ModuleOrder, FreeModulePolyRing from sympy.polys import CoercionFailed, QQ, lex, grlex, ilex, ZZ from sympy.abc import x, y, z from sympy.utilities.pytest import raises from sympy import S def test_FreeModuleElement(): M = QQ.old_poly_r...
bsd-3-clause
darcyfdu/findlicense
etc/scripts/json2csv.py
4
9466
#!/usr/bin/python2 # # Copyright (c) 2017 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. ...
apache-2.0
muraliselva10/cloudkitty-dashboard
cloudkittydashboard/dashboards/admin/pyscripts/tables.py
1
2361
# Copyright 2015 Objectif Libre # # 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
maxamillion/ansible-modules-extras
cloud/cloudstack/cs_cluster.py
44
12964
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
tamihiro/grpc
src/python/grpcio/tests/unit/framework/face/testing/__init__.py
1496
1530
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
ntuecon/server
pyenv/Lib/site-packages/django/contrib/staticfiles/views.py
581
1329
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath from django.conf import settings from django.contrib.staticfiles import finders from django.http import Http404 from django.utils.six.moves.url...
bsd-3-clause
Unow/edx-platform
common/djangoapps/course_groups/views.py
8
7573
from django_future.csrf import ensure_csrf_cookie from django.views.decorators.http import require_POST from django.contrib.auth.models import User from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.http import HttpResponse import json impor...
agpl-3.0
daimajia/duktape
src/dukutil.py
14
3679
#!/usr/bin/python # # Python utilities shared by the build scripts. # import datetime import json class BitEncoder: "Bitstream encoder." _bits = None def __init__(self): self._bits = [] def bits(self, x, nbits): if (x >> nbits) != 0: raise Exception('input value has too many bits (value: %d, bits: %d)'...
mit
PennyQ/astro-vispy
glue_vispy_viewers/common/tools.py
3
3653
import os from qtpy import QtGui, compat from glue.viewers.common.tool import Tool, CheckableTool from glue.config import viewer_tool from vispy import app, io RECORD_START_ICON = os.path.join(os.path.dirname(__file__), 'glue_record_start.png') RECORD_STOP_ICON = os.path.join(os.path.dirname(__file__), 'glue_reco...
bsd-2-clause
MobinRanjbar/hue
desktop/core/ext-py/boto-2.38.0/boto/opsworks/layer1.py
132
129869
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
apache-2.0
mmezzavilla/ns3-mmwave
.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Tools/suncc.py
11
1168
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_scc(conf): v=conf.env cc=conf.find_program('cc',var='CC') try: conf.cmd_and_log(cc+['-flags']) except Excepti...
gpl-2.0
elioth010/lugama
venv/lib/python2.7/site-packages/pip/index.py
45
40374
"""Routines related to PyPI, indexes""" import sys import os import re import mimetypes import posixpath from pip.log import logger from pip.util import Inf, normalize_name, splitext, is_prerelease from pip.exceptions import (DistributionNotFound, BestVersionAlreadyInstalled, InstallationE...
gpl-2.0
JaDogg/__py_playground
reference/pages/sum1/_stops.py
1
9394
nltkStops = { '.': True, ',': True, ':': True, 'a': True, "a's": True, 'able': True, 'about': True, 'above': True, 'according': True, 'accordingly': True, 'across': True, 'actually': True, 'after': True, 'afterwards': True, 'again': True, 'against': True, "ain't": True, 'all': True, 'allow': True, ...
mit
kxxoling/support-tools
googlecode-issues-exporter/github_issue_converter.py
4
16928
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
aakashsinha19/Aspectus
Image Classification/models/differential_privacy/dp_sgd/dp_optimizer/sanitizer.py
19
4433
# 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
spacewalkproject/spacewalk
client/tools/rhn-virtualization/virtualization/init_action.py
7
1286
# # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
denis-pitul/django
django/core/management/commands/dumpdata.py
51
7861
from collections import OrderedDict from django.apps import apps from django.core import serializers from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, router class Command(BaseCommand): help = ("Output the contents of the database as a fixture of the given ...
bsd-3-clause
TRox1972/youtube-dl
youtube_dl/extractor/drtuber.py
4
3040
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( NO_DEFAULT, str_to_int, ) class DrTuberIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?drtuber\.com/(?:video|embed)/(?P<id>\d+)(?:/(?P<display_id>[\w-]+))?' _TESTS = [{ 'url': 'http...
unlicense
elaginm/python_training
fixture/contact.py
1
11101
from selenium.webdriver.support.ui import Select from model.contact import Contact import re class ContactHelper: def __init__(self, app): self.app = app def open_new_address(self): wd = self.app.wd wd.find_element_by_link_text("add new").click() def create(self, contact): ...
apache-2.0
Neamar/django
django/contrib/sessions/backends/file.py
336
7715
import datetime import errno import logging import os import shutil import tempfile from django.conf import settings from django.contrib.sessions.backends.base import ( VALID_KEY_CHARS, CreateError, SessionBase, ) from django.contrib.sessions.exceptions import InvalidSessionKey from django.core.exceptions import I...
bsd-3-clause
boundarydevices/android_external_chromium_org
build/android/pylib/valgrind_tools.py
8
8691
# 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. """ Classes in this file define additional actions that need to be taken to run a test under some kind of runtime error detection tool. The interface is...
bsd-3-clause
LeartS/odoo
addons/website_blog/wizard/document_page_show_diff.py
372
2184
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
TheWardoctor/Wardoctors-repo
script.module.uncoded/lib/resources/lib/sources/en/movie4uch.py
6
4375
# -*- coding: utf-8 -*- ''' Covenant Add-on 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 prog...
apache-2.0
pam-bot/SMSQuery
lib/flask/testsuite/helpers.py
405
21973
# -*- coding: utf-8 -*- """ flask.testsuite.helpers ~~~~~~~~~~~~~~~~~~~~~~~ Various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import flask import unittest from logging import StreamHandler from flask.testsuite import FlaskTestCase,...
gpl-2.0
NeCTAR-RC/horizon
openstack_dashboard/test/unit/api/test_network.py
3
6498
# Copyright 2013 NEC 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 required by applicable law or ag...
apache-2.0
shakamunyi/tensorflow
tensorflow/python/ops/sets.py
109
1167
# 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
381426068/MissionPlanner
Lib/ihooks.py
59
19540
"""Import hook support. Consistent use of this module will make it possible to change the different mechanisms involved in loading modules independently. While the built-in module imp exports interfaces to the built-in module searching and loading algorithm, and it is possible to replace the built-in function ...
gpl-3.0
dfalt974/SickRage
lib/pyasn1/codec/cer/decoder.py
261
1230
# CER decoder from pyasn1.type import univ from pyasn1.codec.ber import decoder from pyasn1.compat.octets import oct2int from pyasn1 import error class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent = univ.Boolean(0) def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, ...
gpl-3.0
Batterfii/django
django/dispatch/weakref_backports.py
414
2151
""" weakref_backports is a partial backport of the weakref module for python versions below 3.4. Copyright (C) 2013 Python Software Foundation, see license.python.txt for details. The following changes were made to the original sources during backporting: * Added `self` to `super` calls. * Removed `from None` when...
bsd-3-clause
efortuna/AndroidSDKClone
ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/json/tests/test_fail.py
108
3915
from json.tests import PyTest, CTest # 2007-10-05 JSONDOCS = [ # http://json.org/JSON_checker/test/fail1.json '"A JSON payload should be an object or array, not a string."', # http://json.org/JSON_checker/test/fail2.json '["Unclosed array"', # http://json.org/JSON_checker/test/fail3.json '{unqu...
apache-2.0
lanselin/pysal
pysal/esda/tests/test_join_counts.py
6
2224
import unittest import numpy as np from ..join_counts import Join_Counts from ...weights import lat2W from ...common import pandas PANDAS_EXTINCT = pandas is None class Join_Counts_Tester(unittest.TestCase): """Unit test for Join Counts""" def setUp(self): self.w = lat2W(4, 4) self.y = np.one...
bsd-3-clause