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
benoitsteiner/tensorflow-opencl
tensorflow/python/framework/graph_to_function_def.py
12
6549
# 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
CopyChat/Plotting
Python/PythonNetCDF.py
1
10821
''' NAME NetCDF with Python PURPOSE To demonstrate how to read and write data with NetCDF files using a NetCDF file from the NCEP/NCAR Reanalysis. Plotting using Matplotlib and Basemap is also shown. PROGRAMMER(S) Chris Slocum REVISION HISTORY 20140320 -- Initial version created and posted onlin...
gpl-3.0
hlzz/dotfiles
graphics/VTK-7.0.0/Examples/VisualizationAlgorithms/Python/BandContourTerrain.py
2
4445
#!/usr/bin/env python # In this example we show the use of the # vtkBandedPolyDataContourFilter. This filter creates separate, # constant colored bands for a range of scalar values. Each band is # bounded by two scalar values, and the cell data laying within the # value has the same cell scalar value. import...
bsd-3-clause
michaella2013/py-flask-signup-
application.py
48
4768
# Copyright 2013. Amazon Web Services, 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 a...
apache-2.0
twitchyliquid64/misc-scripts
s3tool/boto-develop/boto/contrib/__init__.py
147
1105
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
tek/amino
amino/tree.py
1
14049
import abc from typing import Callable, TypeVar, Generic, Union, cast, Any from amino.logging import Logging from amino import LazyList, Boolean, __, _, Either, Right, Maybe, Left, L, Map, curried from amino.boolean import false, true from amino.tc.base import Implicits from amino.tc.flat_map import FlatMap from amino...
mit
hachreak/invenio-comments
invenio_comments/api.py
3
100378
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, # 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Fre...
gpl-2.0
knifenomad/django
django/contrib/admin/__init__.py
562
1243
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.decorators import register from django.contrib.admin.filters import ( AllValuesFieldListFilter, BooleanFieldListFilter, ChoicesFieldListFilter, DateFieldListFilter, Fiel...
bsd-3-clause
waytai/odoo
addons/point_of_sale/report/pos_order_report.py
283
4297
# -*- 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
marshallward/payu
test/test_manifest.py
1
16595
import copy import os from pathlib import Path import pdb import pytest import shutil import yaml import payu import payu.models.test from .common import cd, make_random_file, get_manifests from .common import tmpdir, ctrldir, labdir, workdir from .common import sweep_work, payu_init, payu_setup from .common import c...
apache-2.0
mancoast/CPythonPyc_test
cpython/277_test_bytes.py
71
43726
"""Unit tests for the bytes and bytearray types. XXX This is a mess. Common tests should be moved to buffer_tests.py, which itself ought to be unified with string_tests.py (and the latter should be modernized). """ import os import re import sys import copy import functools import pickle import tempfile import unitt...
gpl-3.0
SOKP/external_chromium_org
third_party/tlslite/tlslite/utils/cryptomath.py
55
8268
# Authors: # Trevor Perrin # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. """cryptomath module This module has basic math/crypto code.""" from __future__ import print_function import os import math import base64 import binascii from .compat import ...
bsd-3-clause
jacquesqiao/Paddle
python/paddle/dataset/imdb.py
5
4370
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
jacklicn/googletest
googletest/scripts/upload.py
2511
51024
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
KyleJamesWalker/ansible-modules-core
cloud/amazon/ec2_asg.py
1
34388
#!/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
sireliah/poniat
menu.py
1
2882
#-*- coding: utf-8 -*- import sys import pygame from pygame.locals import * from utils import * from initial import LoadMenuTextures class MainMenu(LoadMenuTextures): def __init__(self, modes, win_w, win_h): self.showmain = True self.submenu = False self.click = False self.mod...
gpl-3.0
mou4e/zirconium
build/android/generate_emma_html.py
96
2874
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Aggregates EMMA coverage files to produce html output.""" import fnmatch import json import optparse import os import sys from py...
bsd-3-clause
FeodorM/some_code
some_nice_python_things/weather.py
1
2096
#! /usr/bin/env python3 import pyowm import datetime owm = pyowm.OWM('2642ecf7132b8918b8f073910006483c', language='ru') now = pyowm.timeutils.now().date() tomorrow = pyowm.timeutils.tomorrow().date() def to_human_time(unix): return datetime.datetime.fromtimestamp(unix) def weather_date(weather): return t...
mit
alexissmirnov/donomo
donomo_archive/lib/reportlab/tools/py2pdf/idle_print.py
2
1738
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/py2pdf/idle_print.py # idle_print [py2pdf_options] filename __version__=''' $Id: idle_print.py 2385 2004-06-17 15:26:05Z rgbecker $ ''' # you sh...
bsd-3-clause
jeremiedecock/snippets
python/tkinter/python3/cairo_with_pil.py
1
3643
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # 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 witho...
mit
ostinelli/pyopenspime
lib/dns/rdataset.py
1
11607
# Copyright (C) 2001-2007 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND ...
gpl-3.0
beermix/namebench
nb_third_party/dns/rdtypes/ANY/X25.py
248
2123
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
killbill/killbill-client-python
killbill/api/account_api.py
1
210059
# coding: utf-8 # # Copyright 2010-2014 Ning, Inc. # Copyright 2014-2020 Groupon, Inc # Copyright 2020-2021 Equinix, Inc # Copyright 2014-2021 The Billing Project, LLC # # The Billing Project, LLC licenses this file to you under the Apache License, version 2.0 # (the "License"); you may not use this file except in com...
apache-2.0
dcroc16/skunk_works
google_appengine/google/appengine/tools/devappserver2/admin/static_file_handler.py
10
2329
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
mit
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_extcall.py
55
6263
"""Doctest for method/function calls. We're going the use these types for extra testing >>> from UserList import UserList >>> from UserDict import UserDict We're defining four helper functions >>> def e(a,b): ... print a, b >>> def f(*a, **k): ... print a, test_support.sortdict(k) ...
apache-2.0
dmitriy0611/django
tests/template_tests/test_parser.py
288
4109
""" Testing some internals of the template processing. These are *not* examples to be copied in user code. """ from __future__ import unicode_literals from unittest import TestCase from django.template import Library, TemplateSyntaxError from django.template.base import ( TOKEN_BLOCK, FilterExpression, Parser, To...
bsd-3-clause
analytics-pros/mozilla-bedrock
tests/redirects/test_redirects.py
5
1491
"""Test redirects from the global.conf file.""" from __future__ import absolute_import from operator import itemgetter import pytest from .base import assert_valid_url from .map_301 import URLS as REDIRECT_URLS from .map_htaccess import URLS as HTA_URLS from .map_globalconf import URLS as GLOBAL_URLS from .map_extern...
mpl-2.0
mrquim/repository.mrquim
repo/script.module.youtube.dl/lib/youtube_dl/YoutubeDL.py
7
106570
#!/usr/bin/env python # coding: utf-8 from __future__ import absolute_import, unicode_literals import collections import contextlib import copy import datetime import errno import fileinput import io import itertools import json import locale import operator import os import platform import re import shutil import su...
gpl-2.0
nmarley/dash
contrib/zmq/zmq_sub.py
1
5988
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ ZMQ example using python3's asyncio Dash should be started with the command line arguments: ...
mit
dfalt974/SickRage
lib/github/GitBlob.py
10
4004
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
apixandru/intellij-community
plugins/hg4idea/testData/bin/mercurial/repoview.py
92
8696
# repoview.py - Filtered view of a localrepo object # # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org> # Logilab SA <contact@logilab.fr> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. impo...
apache-2.0
fanxiaochen/mypcltest
doc/tutorials/content/conf.py
66
4604
# All configuration values have a default; values that are commented out # serve to show the default. import sys, os # -- General configuration ----------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext...
bsd-3-clause
Anonymouslemming/ansible
lib/ansible/modules/cloud/cloudstack/cs_network_acl.py
18
5812
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, 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
mpoullet/audio-tools
KissFFT/kiss_fft130/test/testkiss.py
1
3565
#!/usr/bin/env python import math import sys import os import random import struct import popen2 import getopt import numpy pi=math.pi e=math.e j=complex(0,1) doreal=0 datatype = os.environ.get('DATATYPE','float') util = '../tools/fft_' + datatype minsnr=90 if datatype == 'double': fmt='d' elif datatype=='int1...
mit
akintoey/django
tests/flatpages_tests/test_forms.py
155
4568
from __future__ import unicode_literals from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from django.utils impor...
bsd-3-clause
DavidNorman/tensorflow
tensorflow/compiler/tests/conv_node_name_test.py
9
3901
# 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
JuliBakagianni/CEF-ELRC
lib/python2.7/site-packages/unidecode/x020.py
87
4070
data = ( ' ', # 0x00 ' ', # 0x01 ' ', # 0x02 ' ', # 0x03 ' ', # 0x04 ' ', # 0x05 ' ', # 0x06 ' ', # 0x07 ' ', # 0x08 ' ', # 0x09 ' ', # 0x0a ' ', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '-', # 0x10 '-', # 0x11 '-', # 0x12 '-', # 0x13 '--', # 0x14...
bsd-3-clause
tunneff/tef
deps/boost_1_63_0/libs/metaparse/tools/benchmark/generate.py
13
8790
#!/usr/bin/python """Utility to generate files to benchmark""" # Copyright Abel Sinkovics (abel@sinkovics.hu) 2016. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import argparse import os import stri...
lgpl-3.0
chrissorchard/malucrawl
malware_crawl/tasks.py
1
2599
from celery import task, chord from .scan import scanners, heavy_scanners from .search import search_engines from .source import sources from datetime import datetime from dateutil.tz import tzutc from models import TopicSet # validator = jsonschema.Draft3Validator(json.loads(pkgutil.get_data("malware_cr...
mit
hslee16/ansible-modules-extras
packaging/language/composer.py
37
8376
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@gmail.com> # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
gpl-3.0
Gagaro/django
django/contrib/gis/admin/widgets.py
73
4807
import logging from django.contrib.gis.gdal import GDALException from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Textarea from django.template import loader from django.utils import six, translation # Creating a template context that contains Django settings # values n...
bsd-3-clause
atlassian/boto
tests/unit/manage/test_ssh.py
114
2004
#!/usr/bin/env python # Copyright (c) 2013 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 ...
mit
datakurre/xhtml2pdf
xhtml2pdf/tags.py
2
20305
# -*- coding: utf-8 -*- from reportlab.graphics.barcode import createBarcodeDrawing from reportlab.lib.pagesizes import A4 from reportlab.lib.units import inch, mm from reportlab.platypus.doctemplate import NextPageTemplate, FrameBreak from reportlab.platypus.flowables import Spacer, HRFlowable, PageBreak, Flowable fro...
apache-2.0
atvKumar/TheWatcher
mkEmail.py
1
5302
from smtplib import SMTP, SMTP_SSL from smtplib import SMTPException from mimetypes import guess_type from os.path import basename from email.utils import COMMASPACE from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email.encoders import encode...
apache-2.0
doganaltunbay/odoo
addons/hr_contract/hr_contract.py
302
5377
# -*- 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
radhika-raghavendran/mbed-os5.1-onsemi
tools/host_tests/tcpecho_server.py
73
1516
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
Lucasgscruz/harpia
harpia/s2icommonproperties.py
2
5499
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
gpl-2.0
chrislit/abydos
tests/distance/test_distance_faith.py
1
4993
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
Metrological/openwebrtc
bindings/java/gen_jni.py
21
6214
#!/usr/bin/env python # Copyright (c) 2014-2015, Ericsson AB. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # li...
bsd-2-clause
nikitakurylev/TuxemonX
tuxemon/main.py
4
1091
#!/usr/bin/python # -*- coding: utf-8 -*- # # Tuxemon # Copyright (C) 2014, William Edwards <shadowapex@gmail.com>, # Benjamin Bean <superman2k5@gmail.com> # # This file is part of Tuxemon. # # Tuxemon is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pu...
gpl-3.0
lxzhu/ehow
inaction/Ch09/regTrees.py
4
5577
''' Created on Feb 4, 2011 Tree-Based Regression Methods @author: Peter Harrington ''' from numpy import * def loadDataSet(fileName): #general function to parse tab -delimited floats dataMat = [] #assume last column is target value fr = open(fileName) for line in fr.readlines(): ...
mit
drawks/ansible
lib/ansible/modules/network/cloudengine/ce_ip_interface.py
37
24036
#!/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
openpaul/DNApy
pyperclip.py
9
5759
# Pyperclip v1.3 # A cross-platform clipboard module for Python. (only handles plain text for now) # By Al Sweigart al@coffeeghost.net # Usage: # import pyperclip # pyperclip.copy('The text to be copied to the clipboard.') # spam = pyperclip.paste() # On Mac, this module makes use of the pbcopy and pbp...
gpl-3.0
ephes/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
thinkle/gourmet
gourmet/plugins/duplicate_finder/recipeMerger.py
1
25533
"""recipeMerger.py This module contains code for handling the 'merging' of duplicate recipes. """ import os.path import time from typing import Union from gettext import gettext as _ from gi.repository import Gtk, Pango from gourmet import convert, gglobals, recipeIdentifier, recipeManager from gourmet.gtk_extras im...
gpl-2.0
equialgo/scikit-learn
examples/hetero_feature_union.py
81
6241
""" ============================================= Feature Union with Heterogeneous Data Sources ============================================= Datasets can often contain components of that require different feature extraction and processing pipelines. This scenario might occur when: 1. Your dataset consists of hetero...
bsd-3-clause
grap/OCB
openerp/addons/base_quality_interrogation.py
58
14692
#!/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 ...
agpl-3.0
zero-ui/miniblink49
v8_5_1/tools/testrunner/objects/testcase.py
8
4425
# Copyright 2012 the V8 project authors. 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 conditi...
gpl-3.0
JoseBlanca/seq_crumbs
test/seq/test_seqio.py
1
10372
# Copyright 2012 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia # This file is part of seq_crumbs. # seq_crumbs 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, ...
gpl-3.0
theo-l/django
django/contrib/gis/gdal/geometries.py
25
23869
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see https://www.gdal.org/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" unli...
bsd-3-clause
popazerty/obh-sh4
lib/python/Components/Sources/ServiceList.py
132
1171
from Source import Source from enigma import eServiceCenter, eServiceReference class ServiceList(Source): def __init__(self, root, command_func = None, validate_commands = True): Source.__init__(self) self.root = root self.command_func = command_func self.validate_commands = validate_commands def getService...
gpl-2.0
ishanatmuz/HangmanMinimalist
hangman.py
1
4431
import random import string import os import platform # Defining the text file containing the list of words WORDLIST_FILENAME = "words.txt" MAX_GUESSES = 8 def loadWords(): # Returns a list of valid words. Words are taken from the file words.txt print "Loading word list from file..." # Open file for ...
mit
horance-liu/tensorflow
tensorflow/contrib/ffmpeg/__init__.py
4
1329
# 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
omni5cience/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/django/contrib/sessions/models.py
51
2039
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ class SessionManager(models.Manager): def encode(self, session_dict): """ Returns the given session dictionary serialized and encoded as a string. """ retur...
mit
Lokke/eden
modules/templates/default/menus.py
38
4148
# -*- coding: utf-8 -*- from gluon import * from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default # Below is an example which you can base your own template's menus.py on # - there are also other examples in the other templates folders # =====...
mit
mirestrepo/voxels-at-lems
registration_eval/results/compute_trans_geo_accuracy.py
1
13935
#!/usr/bin/env python # encoding: utf-8 """ compute_transformation_error.py Created by Maria Isabel Restrepo on 2012-09-24. Copyright (c) 2012 . All rights reserved. This script computes the distances betweeen an estimated similarity transformation and its ground truth The transformation is used to transform a "source...
bsd-2-clause
zlsun/XX-Net
code/default/gae_proxy/server/lib/google/appengine/ext/remote_api/throttle.py
7
24094
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-2-clause
okwow123/djangol2
example/env/lib/python2.7/site-packages/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
mit
smpss91341/2016springcd_aG8
static/publishconf.py
1
1717
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * # 因為 publishconf.py 在 pelicanconf.py 之後, 因此若兩處有相同變數的設定, ...
agpl-3.0
WilliamKinaan/scrapy
tests/test_responsetypes.py
97
3803
import unittest from scrapy.responsetypes import responsetypes from scrapy.http import Response, TextResponse, XmlResponse, HtmlResponse, Headers class ResponseTypesTest(unittest.TestCase): def test_from_filename(self): mappings = [ ('data.bin', Response), ('file.txt', TextRespons...
bsd-3-clause
denizs/torchUp
torchup/logging/logger.py
1
1865
import tensorflow as tf import numpy as np import scipy.misc from tensorboardX.src.summary_pb2 import Summary from tensorboardX import SummaryWriter try: from StringIO import StringIO except ImportError: from io import BytesIO class Logger(object): def __init__(self, log_dir): ''' Create...
bsd-2-clause
fp7-alien/OCF-TBAM
AMsoil/src/vendor/geni_trust/ext/geni/am1.py
4
30287
#---------------------------------------------------------------------- # Copyright (c) 2011-2013 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
bsd-3-clause
leonardowolf/bookfree
flask/lib/python3.5/site-packages/alembic/operations/base.py
28
16494
from contextlib import contextmanager from .. import util from ..util import sqla_compat from . import batch from . import schemaobj from ..util.compat import exec_ import textwrap import inspect __all__ = ('Operations', 'BatchOperations') try: from sqlalchemy.sql.naming import conv except: conv = None cla...
mit
ziir/caliopen.api
caliopen/api/__init__.py
1
1127
# -*- coding: utf-8 -*- __version__ = '0.0.1' try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) import logging from pyramid.config import Configurator from caliopen.base.config import Configuratio...
gpl-3.0
DelazJ/QGIS
tests/src/python/test_provider_shapefile.py
8
55646
# -*- coding: utf-8 -*- """QGIS Unit tests for the OGR/Shapefile provider. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ver...
gpl-2.0
elmerdpadilla/iv
addons/account_followup/report/account_followup_print.py
63
5695
# -*- 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
chirpd/chirpd-platform
node_modules/grunt-coffee/node_modules/grunt/node_modules/gzip-js/node_modules/deflate-js/test/runner.py
177
1688
#!/usr/bin/env python import argparse import deflate import inflate from colorama import Fore testDir = 'test-files' outDir = 'test-outs' allPassed = True parser = argparse.ArgumentParser(description='Process command-line arguments') parser.add_argument('--test', metavar='path/to/file', type=str, default='both', na...
mit
jwhui/openthread
tests/scripts/thread-cert/Cert_9_2_17_Orphan.py
3
5916
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
groovecoder/kuma
vendor/packages/translate/filters/decoration.py
25
10556
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2008 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...
mpl-2.0
TrossSoftwareAndTech/webvt
lib/node-v7.2.0/deps/v8/gypfiles/landmines.py
13
8388
#!/usr/bin/env python # Copyright 2014 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This script runs every build as the first hook (See DEPS). If it detects that the build should be clobbered, it will delete the c...
gpl-3.0
elioth010/lugama
activate/lib/python3.4/site-packages/wheel/test/test_wheelfile.py
238
1990
import wheel.install import hashlib try: from StringIO import StringIO except ImportError: from io import BytesIO as StringIO import zipfile import pytest def test_verifying_zipfile(): if not hasattr(zipfile.ZipExtFile, '_update_crc'): pytest.skip('No ZIP verification. Missing ZipExtFile._update_cr...
gpl-2.0
MechCoder/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
noironetworks/networking-cisco
networking_cisco/tests/unit/cisco/l3/l3_router_test_support.py
1
6077
# Copyright 2014 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
HXLStandard/libhxl-python
hxl/model.py
1
48776
"""Main data-model classes for the Humanitarian Exchange Language (HXL). This module defines the basic classes for working with HXL data. Other modules have classes derived from these (e.g. in [hxl.filters](filters.html) or [hxl.io](io.html)). The core class is [Dataset](#hxl.model.Dataset), which defines the operatio...
unlicense
HPPTECH/hpp_IOSTressTest
Resources/ssh/pexpect-3.2/tests/test_constructor.py
2
1911
#!/usr/bin/env python ''' PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY PURPOSE WITH OR WIT...
mit
cyberark-bizdev/ansible
lib/ansible/plugins/connection/ssh.py
13
45581
# Copyright (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com> # Copyright 2017 Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __futu...
gpl-3.0
teamfx/openjfx-10-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/net/failuremap_unittest.py
7
3830
# 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 ...
gpl-2.0
oandrew/home-assistant
homeassistant/components/sensor/bbox.py
29
4641
""" Support for Bbox Bouygues Modem Router. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.bbox/ """ import logging from datetime import timedelta import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHE...
mit
RyanChinSang/ECNG3020-ORSS4SCVI
BETA/TestCode/Tensorflow/Test/object_detection/utils/per_image_evaluation.py
21
12745
# 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...
gpl-3.0
KDD-OpenSource/geox-young-academy
day-3/Kalman-filter_Mark.py
1
1494
# -*- coding: utf-8 -*- """ Created on Wed Oct 11 10:10:24 2017 @author: Mark """ import numpy as np import matplotlib.pyplot as plt #Define functions def model(state_0,A,B): state_1 = A*state_0 + np.random.normal(0,B) return state_1 state_null=np.random.normal(0,0.4) def observation_functi...
mit
gminds/rapidnewsng
django/contrib/comments/templatetags/comments.py
104
11719
from django import template from django.template.loader import render_to_string from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib import comments from django.utils.encoding import smart_text register = template.Library() class BaseCommentNode(template.Node...
bsd-3-clause
Brazelton-Lab/lab_scripts
edit-esom-class-file.py
1
1891
#! /usr/bin/env python """ edit user-provided ESOM class file with new assignments in user-provided file each line of user-provided file of new assignments should contain a data point number and a class number, separated by tabs usage: python edit-esom-class-file.py esom.cls new-assignments.tsv new-class-filename.cl...
gpl-2.0
nickanderson/ansible
v2/ansible/playbook/base.py
10
5174
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered.py
10
1189
# 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
henocdz/dotcom-legacy
PIL/ImageStat.py
40
4272
# # The Python Imaging Library. # $Id$ # # global image statistics # # History: # 1996-04-05 fl Created # 1997-05-21 fl Added mask; added rms, var, stddev attributes # 1997-08-05 fl Added median # 1998-07-05 hk Fixed integer overflow error # # Notes: # This class shows how to implement delayed evaluation of att...
mit
eugena/django
tests/gis_tests/geoapp/test_regress.py
318
3857
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime from django.contrib.gis.db.models import Extent from django.contrib.gis.shortcuts import render_to_kmz from django.db.models import Count, Min from django.test import TestCase, skipUnlessDBFeature from ..utils import no_o...
bsd-3-clause
40223114/w16
static/Brython3.1.3-20150514-095342/Lib/io.py
623
9405
import builtins open = builtins.open # for seek() SEEK_SET = 0 SEEK_CUR = 1 SEEK_END = 2 r"""File-like objects that read from or write to a string buffer. This implements (nearly) all stdio methods. f = StringIO() # ready for writing f = StringIO(buf) # ready for reading f.close() # explicitly rel...
agpl-3.0
dimtruck/magnum
magnum/tests/functional/k8s/test_k8s_python_client.py
1
6881
# 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 writing, software # distributed under the Li...
apache-2.0
lpramuk/robottelo
tests/foreman/cli/test_satellitesync.py
1
80631
# -*- encoding: utf-8 -*- """Test class for InterSatellite Sync :Requirement: Satellitesync :CaseAutomation: Automated :CaseLevel: Component :CaseComponent: InterSatelliteSync :TestType: Functional :CaseImportance: High :Upstream: No """ import json from random import randint from fauxfactory import gen_integer...
gpl-3.0
MrHyde03/android_kernel_samsung_konawifixx
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