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
AzCiS/autorest
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/HeadExceptions/setup.py
10
1146
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
sergiocorato/bank-payment
account_banking/res_partner.py
14
2871
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Therp BV (<http://therp.nl>). # # All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
agpl-3.0
mateusz880/mtasa-blue
vendor/google-breakpad/src/tools/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py
164
1699
#!/usr/bin/env python # 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. """ Make sure overwriting read-only files works as expected (via win-tool). """ import TestGyp import filecmp import os import stat import...
gpl-3.0
kylehogan/haas
tests/unit/model.py
3
3270
# Copyright 2013-2014 Massachusetts Open Cloud Contributors # # 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 applicab...
apache-2.0
minhtuancn/odoo
addons/l10n_be_coda/__init__.py
430
1105
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
xen0l/ansible
test/units/modules/network/ios/test_ios_banner.py
52
2546
# 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
radiasoft/radtrack
experimental/tshaftan/2dipoles1.py
2
10661
# -*- coding: utf-8 -*- """Simulation of SR from 2 dipole edges """ from __future__ import absolute_import, division, print_function from pykern.pkdebug import pkdc, pkdp from pykern import pkarray import srwlib from array import array import uti_plot print('1. Defining Particle for Trajectory Calculations...') # Pa...
apache-2.0
colinligertwood/odoo
addons/account_analytic_plans/__init__.py
445
1104
# -*- 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
RossBrunton/django
tests/utils_tests/test_crypto.py
447
4581
from __future__ import unicode_literals import binascii import hashlib import unittest from django.utils.crypto import constant_time_compare, pbkdf2 class TestUtilsCryptoMisc(unittest.TestCase): def test_constant_time_compare(self): # It's hard to test for constant time, just test the result. s...
bsd-3-clause
ucbrise/clipper
containers/python/rpc.py
1
27820
from __future__ import print_function import zmq import threading import numpy as np import struct import time from datetime import datetime import socket import sys import os import yaml import logging from collections import deque if sys.version_info < (3, 0): from subprocess32 import Popen, PIPE else: from s...
apache-2.0
tarsqi/ttk
utilities/convert.py
1
46925
"""convert.py Some format conversion utilities. Run all commands below from the parent directory using the -m option. 1. Convert LDC TimeBank into a modern TimeBank in the TTK format. $ python -m utilities.convert --timebank2ttk TIMEBANK_DIR TTK_DIR Converts TimeBank 1.2 as released by LDC into a version with...
apache-2.0
zeapo/UberWriter_old
uberwriter_lib/Builder.py
6
11432
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012, Wolf Vollprecht <w.vollprecht@gmail.com> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Fre...
gpl-3.0
manipopopo/tensorflow
tensorflow/python/grappler/cluster_test.py
33
7748
# 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
seem-sky/kbengine
kbe/res/scripts/common/Lib/test/test_sys_settrace.py
99
24959
# Testing the line trace facility. from test import support import unittest import sys import difflib import gc # A very basic example. If this fails, we're in deep trouble. def basic(): return 1 basic.events = [(0, 'call'), (1, 'line'), (1, 'return')] # Many of the tests below ...
lgpl-3.0
melqkiades/yelp
source/python/topicmodeling/external/topicensemble/unsupervised/nmf.py
2
1622
import numpy as np from sklearn import decomposition import logging as log # -------------------------------------------------------------- class SklNMF: """ Wrapper class backed by the scikit-learn package NMF implementation. """ def __init__( self, max_iters = 100, init_strategy = "random" ): self.max_iters =...
lgpl-2.1
40223145c2g18/c2g18
wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/case.py
743
48873
"""Test case implementation""" import sys import functools import difflib import pprint import re import warnings import collections from . import result from .util import (strclass, safe_repr, _count_diff_all_purpose, _count_diff_hashable) __unittest = True DIFF_OMITTED = ('\nDiff is %s charact...
gpl-2.0
ibrikin/hide_my_python
regex.py
3
2916
#!/usr/bin/env python3 # -*- coding: utf8 -*- # # HideMyPython! - A parser for the free proxy list on HideMyAss! # # This file defines the different needed regular expressions to retrieve # the proxy's parameters from the HideMyAss! proxy list. # # Copyright (C) 2013 Yannick Méheut <useless (at) utouch (dot) fr> # ...
gpl-3.0
LumPenPacK/NetworkExtractionFromImages
osx_build/nefi2_osx_amd64_xcode_2015/site-packages/networkx/classes/ordered.py
48
1041
""" OrderedDict variants of the default base classes. """ from collections import OrderedDict from .graph import Graph from .multigraph import MultiGraph from .digraph import DiGraph from .multidigraph import MultiDiGraph __all__ = [] __all__.extend([ 'OrderedGraph', 'OrderedDiGraph', 'OrderedMultiGraph...
bsd-2-clause
chrisseto/osf.io
api/nodes/views.py
1
154904
import re from django.apps import apps from modularodm import Q as MQ from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import PermissionDenied, ValidationError, NotFound, MethodNotAllowed, NotAuthenticated from rest_framework.response import Response from rest_framewor...
apache-2.0
arbn/pysaml2
src/saml2/assertion.py
1
24504
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010-2011 Umeå University # # 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...
bsd-2-clause
cernops/python-neutronclient
neutronclient/tests/unit/test_client_extension.py
2
3466
# Copyright 2015 Rackspace Hosting 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 req...
apache-2.0
bhavin04890/finaldashboard
modules/s3/s3import.py
4
120832
# -*- coding: utf-8 -*- """ Resource Import Tools @copyright: 2011-12 (c) Sahana Software Foundation @license: MIT 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 ...
mit
brandond/ansible
test/units/module_utils/gcp/test_auth.py
45
6823
# -*- coding: utf-8 -*- # (c) 2016, Tom Melendez (@supertom) <tom@supertom.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
mpasternak/pyglet-fix-issue-552
contrib/wydget/wydget/widgets/checkbox.py
29
1402
from pyglet.gl import * from pyglet import clock from pyglet.window import key, mouse from wydget import element, event, util, anim, data class Checkbox(element.Element): name='checkbox' is_focusable = True def __init__(self, parent, value=False, width=16, height=16, **kw): self.parent = parent ...
bsd-3-clause
FBSLikan/Cetico-TCC
data/libs/reportlab/lib/logger.py
3
1760
#!/bin/env python #Copyright ReportLab Europe Ltd. 2000-2016 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/logger.py __version__='3.3.0' __doc__="Logging and warning framework, predating Python's logging package" from sys import stderr ...
gpl-3.0
vmalloc/weber-utils
weber_utils/sorting.py
1
1136
import functools from flask import request from sqlalchemy import desc from ._compat import httplib from .request_utils import error_abort def sort_query(query, allowed_fields=(), default=None): allowed_fields = set(allowed_fields) sort_param = request.args.get("sort", None) if sort_param: sort_...
bsd-3-clause
dongjoon-hyun/tensorflow
tensorflow/python/keras/preprocessing/sequence.py
12
4152
# 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
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/matplotlib/tri/triplot.py
8
3150
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import numpy as np from matplotlib.tri.triangulation import Triangulation def triplot(ax, *args, **kwargs): """ Draw a unstructured triangular grid as lines and/o...
apache-2.0
magvugr/AT
EntVirtual/lib/python2.7/site-packages/django/templatetags/tz.py
277
5572
from datetime import datetime, tzinfo from django.template import Library, Node, TemplateSyntaxError from django.utils import six, timezone try: import pytz except ImportError: pytz = None register = Library() # HACK: datetime is an old-style class, create a new-style equivalent # so we can define additio...
gpl-3.0
ArnossArnossi/django
tests/generic_inline_admin/tests.py
154
22749
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.contrib import admin from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from django.contrib.contenttypes.admin import GenericTabularInline from django.contrib.contenttypes.forms import...
bsd-3-clause
azumimuo/family-xbmc-addon
plugin.video.elysium/resources/lib/sources/tvhd.py
1
3687
import re import urllib import requests import urlparse import json import xbmc import datetime from BeautifulSoup import BeautifulSoup from resources.lib.modules import control from resources.lib.modules import cleantitle from schism_commons import quality_tag, google_tag, parseDOM, replaceHTMLCodes ,cleantitle_get, ...
gpl-2.0
sudheerchintala/LearnEraPlatForm
common/lib/symmath/symmath/formula.py
46
25839
#!/usr/bin/python # -*- coding: utf-8 -*- """ Flexible python representation of a symbolic mathematical formula. Acceptes Presentation MathML, Content MathML (and could also do OpenMath). Provides sympy representation. """ # # File: formula.py # Date: 04-May-12 (creation) # Author: I. Chuang <ichuang@mit.edu> # im...
agpl-3.0
yland/coala
coalib/parsing/StringProcessing/Core.py
9
20330
import re from coalib.parsing.StringProcessing import InBetweenMatch from coalib.parsing.StringProcessing.Filters import limit, trim_empty_matches def search_for(pattern, string, flags=0, max_match=0, use_regex=False): """ Searches for a given pattern in a string. :param pattern: A pattern that define...
agpl-3.0
rkokkelk/CouchPotatoServer
libs/rtorrent/err.py
182
1638
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # 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, ...
gpl-3.0
kg-bot/SupyBot
plugins/Nag/plugin.py
1
4578
### # Copyright (c) 2006, Jeremy Kelley # 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...
gpl-3.0
maartenq/ansible
lib/ansible/modules/network/f5/bigip_remote_role.py
6
18384
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
ziel980/website
app/mod_streams/views.py
1
2619
from flask import * from app.mod_streams.models import Stream from app.mod_streams import stream_api from .forms import ConfigForm from app.mod_adminpanel.views import register_adminpanel from flask_login import login_required mod_streams = Blueprint('streams', __name__, url_prefix='/streams', template_folder='templat...
mit
ahmetyazar/adj-demo
dbinit/pymysql/err.py
20
3612
import struct from .constants import ER class MySQLError(Exception): """Exception related to operation with MySQL.""" class Warning(Warning, MySQLError): """Exception raised for important warnings like data truncations while inserting, etc.""" class Error(MySQLError): """Exception that is the bas...
mit
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/fileinput.py
21
13746
"""Helper class to quickly write a loop over all standard input files. Typical use is: import fileinput for line in fileinput.input(): process(line) This iterates over the lines of all files listed in sys.argv[1:], defaulting to sys.stdin if the list is empty. If a filename is '-' it is also replace...
mit
stamhe/namecoin
client/DNS/__init__.py
40
1895
# -*- encoding: utf-8 -*- # $Id: __init__.py,v 1.8.2.7 2009/06/09 18:05:29 customdesigned Exp $ # # This file is part of the pydns project. # Homepage: http://pydns.sourceforge.net # # This code is covered by the standard Python License. # # __init__.py for DNS class. __version__ = '2.3.4' import Type,Opcode,Status,...
mit
chirilo/phantomjs
src/breakpad/src/tools/gyp/test/subdirectory/gyptest-SYMROOT-all.py
399
1269
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
bsd-3-clause
spadae22/odoo
openerp/tools/graph.py
441
26118
#!/usr/bin/env python # -*- 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 unde...
agpl-3.0
tsabi/Odoo-tsabi-fixes
addons/account/tests/test_tax.py
449
1740
from openerp.tests.common import TransactionCase class TestTax(TransactionCase): """Tests for taxes (account.tax) We don't really need at this point to link taxes to tax codes (account.tax.code) nor to companies (base.company) to check computation results. """ def setUp(self): super(T...
agpl-3.0
magul/pywikibot-core
generate_family_file.py
1
6872
#!/usr/bin/python # -*- coding: utf-8 -*- """This script generates a family file from a given URL.""" from __future__ import (absolute_import, division, print_function, unicode_literals) # # (C) Merlijn van Deen, 2010-2013 # (C) Pywikibot team, 2010-2018 # # Distributed under the terms of the MI...
mit
ohio813/pyflag
src/plugins_old/DiskForensics/FileHandlers/Extractor.py
5
2138
""" This is a scanner which utilises libextractor to collect metadata about some files. """ from pyflag.Scanner import * import pyflag.Reports as Reports from pyflag.ColumnTypes import StringType, TimestampType active = False try: import extractor E = extractor.Extractor() class ExtractorScan(GenSca...
gpl-2.0
jumoconnect/openjumo
jumodjango/miner/web/feed_items_to_hdfs.py
1
3768
#!/usr/bin/env python from crawler import WebCrawler, log import logging import os import hashlib from miner.text.util import strip_control_characters import MySQLdb from MySQLdb import cursors class FeedItemWebCrawler(WebCrawler): temp_outfile_path = '/tmp/feed_items' outfile_base_path = '/tmp/scraped' ...
mit
omprakasha/odoo
addons/mail/mail_followers.py
168
12482
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
joshgabriel/dft-crossfilter
CompleteApp/crossfilter_app/old_mains/old_main.py
3
10263
# main.py that controls the whole app # to run: just run bokeh serve --show crossfilter_app in the benchmark-view repo from random import random import os from bokeh.layouts import column from bokeh.models import Button from bokeh.models.widgets import Select, MultiSelect, Slider from bokeh.palettes import RdYlBu3 fr...
mit
cardforcoin/chain-bitcoin-python
chain_bitcoin/models.py
2
7168
from __future__ import absolute_import __all__ = ( 'Address', 'Transaction', 'Output', 'OpReturn', 'Block', 'Webhook', 'WebhookEvent', 'EchoVerificationEvent', 'AddressTransactionEvent', 'SendTransactionResult' ) import dateutil.parser from .func_util import compose, if_not_none from .map_list import * f...
mit
Agana/MyBlogAgain
django/utils/_os.py
153
2736
import os import stat from os.path import join, normcase, normpath, abspath, isabs, sep from django.utils.encoding import force_unicode # Define our own abspath function that can handle joining # unicode paths to a current working directory that has non-ASCII # characters in it. This isn't necessary on Windows since...
bsd-3-clause
moritzpein/airflow
airflow/hooks/__init__.py
7
1089
# Imports the hooks dynamically while keeping the package API clean, # abstracting the underlying modules from airflow.utils import import_module_attrs as _import_module_attrs from airflow.hooks.base_hook import BaseHook as _BaseHook _hooks = { 'hive_hooks': [ 'HiveCliHook', 'HiveMetastoreHook', ...
apache-2.0
zootsuitbrian/zxing
cpp/scons/scons-local-2.0.0.final.0/SCons/Node/FS.py
34
110895
"""scons.Node.FS File system nodes. These Nodes represent the canonical external objects that people think of when they think of building software: files and directories. This holds a "default_fs" variable that should be initialized with an FS that can be used by scripts or modules looking for the canonical default....
apache-2.0
ivan73/smarthome
plugins/logo/__init__.py
1
25174
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2013 KNX-User-Forum e.V. http://knx-user-forum.de/ ######################################################################### # ...
gpl-3.0
bendykst/deluge
setup.py
1
12762
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2009 Damien Churchill <damoxc@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of t...
gpl-3.0
dwitvliet/CATMAID
django/applications/performancetests/migrations/0001_initial.py
2
2042
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.utils import timezone import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Event', ...
gpl-3.0
pacoqueen/bbinn
framework/caneloni_di_merda.py
1
5754
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, pclases, mx sys.path.append(os.path.join("..", "formularios")) import utils def buscar_rollos_existencias(fecha): """ Devuelve una lista de rollos en almacén hasta (incluida) la fecha dada. """ sqlfecha = fecha.strftime('%Y-%m-%d') ...
gpl-2.0
ASOdesk/selenium-pytest-fix
py/test/selenium/webdriver/marionette/mn_options_tests.py
10
4563
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
fired334/zeroclickinfo-goodies
share/goodie/currency_in/parse.py
87
2347
#!/usr/bin/python # -*- coding: utf-8 -*- # Released under the GPL v2 license # https://www.gnu.org/licenses/old-licenses/gpl-2.0.html import lxml.html import sys #url = "http://en.wikipedia.org/wiki/List_of_circulating_currencies" url = "https://secure.wikimedia.org/wikipedia/en/wiki/List_of_circulating_currencies"...
apache-2.0
jessstrap/servotk
tests/wpt/web-platform-tests/tools/pytest/_pytest/genscript.py
191
4129
""" (deprecated) generate a single-file self-contained version of pytest """ import os import sys import pkgutil import py import _pytest def find_toplevel(name): for syspath in sys.path: base = py.path.local(syspath) lib = base/name if lib.check(dir=1): return lib mo...
mpl-2.0
knowsis/django
django/conf/locale/sv/formats.py
118
1568
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # 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' DATETI...
bsd-3-clause
sharhar/USB-Thing
UpdaterFiles/Lib/python-3.5.1.amd64/Lib/encodings/iso8859_1.py
266
13176
""" Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.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
massifor/distcc
bench/Summary.py
28
4249
# benchmark -- automated system for testing distcc correctness # and performance on various source trees. # Copyright (C) 2002, 2003 by Martin Pool # Copyright 2008 Google Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published...
gpl-2.0
ovnicraft/edx-platform
common/lib/capa/capa/customrender.py
60
5603
""" This has custom renderers: classes that know how to render certain problem tags (e.g. <math> and <solution>) to html. These tags do not have state, so they just get passed the system (for access to render_template), and the xml element. """ import logging import re from cgi import escape as cgi_escape from lxml ...
agpl-3.0
lukeiwanski/tensorflow
tensorflow/python/eager/tensor_test.py
9
12405
# 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
yyzybb537/libgo
third_party/boost.context/tools/build/src/build/property.py
11
20200
# Status: ported, except for tests. # Base revision: 64070 # # Copyright 2001, 2002, 2003 Dave Abrahams # Copyright 2006 Rene Rivera # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENS...
mit
malikabhi05/upm
examples/python/o2.py
6
1981
#!/usr/bin/env python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 ...
mit
Sourcegasm/gradientni-spust-predstavitev
Elipsa/select_data.py
2
3571
from gradient_descent import get_data def select_data(): done = False while not done: try: print('Select input data set:') print(' 1 Mars half year') print(' 2 Mars full (whole year measured every Earth month)') print(' 3 Mars small (every fourth...
gpl-3.0
alex/pinax
pinax/projects/social_project/manage.py
20
1092
#!/usr/bin/env python import sys from os.path import abspath, dirname, join try: import pinax except ImportError: sys.stderr.write("Error: Can't import Pinax. Make sure you are in a virtual environment that has Pinax installed or create one with pinax-boot.py.\n") sys.exit(1) from django.conf import sett...
mit
mcella/django
tests/test_runner/test_debug_sql.py
146
2971
import sys import unittest from django.db import connection from django.test import TestCase from django.test.runner import DiscoverRunner from django.utils import six from django.utils.encoding import force_text from .models import Person @unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w...
bsd-3-clause
openradar/TINT
tint/data_utils.py
1
2323
""" tint.data_utils =============== Tools for obtaining and handling radar data. """ import tempfile from boto.s3.connection import S3Connection from datetime import datetime, timedelta import pyart def read_nexrad_key(key): """ Returns pyart radar object from nexrad S3 key. """ tmp = tempfile.Nam...
bsd-2-clause
jlgoldman/writetogov
util/fips.py
1
3649
import collections FIPSInfo = collections.namedtuple('FIPSInfo', ['name', 'fips_code', 'state_code']) def get_by_fips_code(fips_code): return INFOS_BY_FIPS_CODE.get(fips_code) def get_by_state_code(state_code): return INFOS_BY_STATE_CODE.get(state_code) def get_by_state_name(state_name): return INFOS_B...
bsd-3-clause
netscaler/neutron
neutron/tests/unit/cisco/test_nexus_db.py
4
7652
# Copyright (c) 2013 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 ...
apache-2.0
machinelearningnanodegree/stanford-cs231
solutions/vijendra/assignment3/cs231n/coco_utils.py
18
2650
import os, json import numpy as np import h5py def load_coco_data(base_dir='cs231n/datasets/coco_captioning', max_train=None, pca_features=True): data = {} caption_file = os.path.join(base_dir, 'coco2014_captions.h5') with h5py.File(caption_file, 'r') as f: for k, v in ...
mit
apark263/tensorflow
tensorflow/contrib/image/python/ops/single_image_random_dot_stereograms.py
36
5712
# 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
ghutchis/avogadro
libavogadro/src/python/unittest/extension.py
9
1763
import Avogadro import unittest from numpy import * from PyQt4.Qt import * import sys class TestExtension(unittest.TestCase): def setUp(self): self.extensions = [] for extension in Avogadro.PluginManager.instance.extensions(None): self.extensions.append(extension) self.assertNotEqual(len(self...
gpl-2.0
openearth/stack
roles/wps/files/wps/openlayers/tests/selenium/remotecontrol/test_ol.py
254
2873
from selenium import selenium import time import sys from ConfigParser import ConfigParser MAX_TEST_LENGTH = 300 if len(sys.argv) > 2: filename = sys.argv[2] else: filename = "config.cfg" c = ConfigParser() c.read(filename) targets = {} server = c.get('config', 'server') url= c.get('config', 'url') if c.h...
gpl-3.0
huseyinbiyik/plugin.video.videostream
resources/lib/third/humanize/number.py
10
4567
#!/usr/bin/env python # -*- coding: utf-8 -*- """Humanizing functions for numbers.""" import re from fractions import Fraction from .import compat from .i18n import gettext as _, gettext_noop as N_, pgettext as P_ def ordinal(value): """Converts an integer to its ordinal as a string. 1 is '1st', 2 is '2nd', ...
gpl-2.0
rooneykev/testAngular
js/node_modules/jasmine/node_modules/jasmine-core/setup.py
191
1983
from setuptools import setup, find_packages, os import json with open('package.json') as packageFile: version = json.load(packageFile)['version'] setup( name="jasmine-core", version=version, url="http://pivotal.github.io/jasmine/", author="Pivotal Labs", author_email="jasmine-js@googlegroups.com...
mit
aashish24/VTK-old
Wrapping/Python/vtk/wx/wxVTKRenderWindow.py
10
23312
""" A simple VTK widget for wxPython. Find wxPython info at http://wxPython.org Created by David Gobbi, December 2001 Based on vtkTkRenderWindget.py Updated to new wx namespace and some cleaning by Andrea Gavana, December 2006 """ """ Please see the example at the end of this file. -------------------------------...
bsd-3-clause
joaormatos/anaconda
mmfparser/player/event/expressions/application.py
1
1112
# Copyright (c) Mathias Kaerlev 2012. # This file is part of Anaconda. # Anaconda is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
henriquesouza/toply
TestDisplayer.py
1
2569
import gi gi.require_version('Gtk', '3.0') import threading import time from gi.repository import Gtk, Gdk from gi.repository import GObject as GObject from src.view import LyricsDisplayer GObject.threads_init() insta = LyricsDisplayer.LyricsDisplayer() #w = Gtk.Window() w = insta.lyrics_window() #l = Gtk.Label() #w...
gpl-3.0
prtx/What-I-learned-in-college
Data_Structures/binary_search_tree.py
1
1159
class BST_Node: #initialize binary search tree def __init__(self, item = None, left = None, right = None): self.item = item self.left = left self.right = right #traversals def preorder(self): print self.item if self.left: self.left.inorder() if self.right: self.right.inorder() def inor...
mit
Fermi-Dirac/mathtests
pyggel/event.py
1
12361
""" pyggle.event This library (PYGGEL) is licensed under the LGPL by Matthew Roe and PYGGEL contributors. The event module contains classes to grab and access events. """ from .include import * from . import view import string import time class Keyboard(object): """A simple class to store keyboard e...
mit
swarna-k/MyDiary
flask/lib/python2.7/site-packages/migrate/versioning/script/base.py
79
1700
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging from migrate import exceptions from migrate.versioning.config import operations from migrate.versioning import pathed log = logging.getLogger(__name__) class BaseScript(pathed.Pathed): """Base class for other types of scripts. All scripts have the...
bsd-3-clause
timopulkkinen/BubbleFish
chrome/common/extensions/docs/server2/reference_resolver.py
3
7449
# 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. from file_system import FileNotFoundError import logging import object_store import re import string def _ClassifySchemaNode(node_name, api): """Attem...
bsd-3-clause
beepscore/fibonacci
logging_util.py
1
1709
# https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial import logging import sys def get_logger(name): """ Log to stream only. Don't add a handler to log to a file. Let program user decide if they want to pipe stream output to a file e.g. python3 fibonacci.py >> ../fib.log ...
mit
red-hood/calendarserver
txweb2/auth/basic.py
1
2307
# -*- test-case-name: txweb2.test.test_httpauth -*- ## # Copyright (c) 2006-2009 Twisted Matrix Laboratories. # Copyright (c) 2010-2015 Apple Inc. 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"),...
apache-2.0
Klaudit/phantomjs
src/breakpad/src/tools/gyp/pylib/gyp/__init__.py
137
17502
#!/usr/bin/python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import gyp.input import optparse import os.path import re import shlex import sys # Default debug modes for GYP debug = {} # List ...
bsd-3-clause
peterjoel/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorselenium.py
2
14864
import json import os import socket import threading import time import traceback import urlparse import uuid from .base import (CallbackHandler, RefTestExecutor, RefTestImplementation, TestharnessExecutor, extra_timeout, st...
mpl-2.0
chaen/DIRAC
DataManagementSystem/scripts/dirac-dms-create-removal-request.py
4
3446
#!/usr/bin/env python """ Create a DIRAC RemoveReplica|RemoveFile request to be executed by the RMS """ from __future__ import print_function __RCSID__ = "ea64b42 (2012-07-29 16:45:05 +0200) ricardo <Ricardo.Graciani@gmail.com>" import os from hashlib import md5 import time from DIRAC.Core.Base import Script from DIRA...
gpl-3.0
jackkiej/SickRage
lib/guessit/rules/properties/mimetype.py
32
1032
#!/usr/bin/env python # -*- coding: utf-8 -*- """ mimetype property """ import mimetypes from rebulk import Rebulk, CustomRule, POST_PROCESS from rebulk.match import Match from ...rules.processors import Processors def mimetype(): """ Builder for rebulk object. :return: Created Rebulk object :rtype:...
gpl-3.0
jarshwah/django
django/utils/dateformat.py
57
11885
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import calendar import datetime import re impo...
bsd-3-clause
JuniorCru/coastline
coastline/config.py
1
1643
import json BASE_ENV = 'common' ENV_OPTIONS = ['development', 'staging', 'production'] # Currently Config class is just a dict sub-class. # # A dict-like interface may be all we need, but we use a sub-class so we # can change construction later, possibly use an IoC container or type # checking, etc. class Config(dict...
mit
2013Commons/hue
desktop/core/ext-py/PyYAML-3.09/tests/lib3/test_input_output.py
57
6057
import yaml import codecs, io, tempfile, os, os.path def test_unicode_input(unicode_filename, verbose=False): data = open(unicode_filename, 'rb').read().decode('utf-8') value = ' '.join(data.split()) output = yaml.load(data) assert output == value, (output, value) output = yaml.load(io.StringIO(da...
apache-2.0
jctanner/scrapers
scommerce_com.py
1
4085
#!/usr/bin/env python # http://sccommerce.com/sc-industrial-directory import requests import requests_cache from pprint import pprint from bs4 import BeautifulSoup from lib.csvtools import dict_to_csv def main(): # This page has a search form that must be submitted to get the list of companies. # To post da...
apache-2.0
mcmaxwell/idea_digital_agency
idea/feincms/module/mixins.py
2
7981
from __future__ import absolute_import, unicode_literals from collections import OrderedDict from django.http import Http404 from django.template import Template from django.utils.decorators import method_decorator from django.views import generic from django.views.generic.base import TemplateResponseMixin from fein...
mit
QuLogic/vispy
codegen/annotations.py
18
17242
# -*- coding: utf-8 -*- # Copyright (c) 2013, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ This module contains manual annotations for the gl backends. Together with the header files, we can generatre the full ES 2.0 API. Every function-annotations consists of...
bsd-3-clause
vvovo/vvo
model/follow.py
1
2334
#!/usr/bin/env python # coding=utf-8 # # Copyright 2014 vvovo.com # Very way to victory. # Let the dream set sail. import time from lib.query import Query class FollowModel(Query): def __init__(self, db): self.db = db self.table_name = "follow" super(FollowModel, self).__init__() def ...
bsd-3-clause
michaelroland/wdnas-dl2100-hwtools
wdhwdaemon/client.py
1
21754
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Western Digital Hardware Controller Client. Copyright (c) 2017 Michael Roland <mi.roland@gmail.com> 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, ...
gpl-3.0
fyookball/electrum
plugins/ledger/auth2fa.py
1
6760
from PyQt5.QtWidgets import * from electroncash.i18n import _ from electroncash_gui.qt.util import * from electroncash.util import print_error from electroncash.address import Address from electroncash import networks import copy from btchip.btchip import BTChipException helpTxt = [_("Your Ledger Wallet wants to te...
mit