repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
GoteoFoundation/goteo-api
goteoapi/auth/decorators.py
1
6707
# -*- coding: utf-8 -*- # # Currently this module only handles an implicit oauth authentication. # # ---------------------------------------- # Access token authorization # ---------------------------------------- # # With Basic HTTP Auth: # # HTTP AUTH # User owner | ---user/password--> | /login # ...
agpl-3.0
jaggu303619/asylum-v2.0
openerp/addons/edi/models/edi.py
16
32166
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
nck0405/MyOwn
modules/templates/NYC/controllers.py
8
27529
# -*- coding: utf-8 -*- from gluon import * from s3 import S3CustomController, S3DataTable, S3Method, s3_request THEME = "NYC" # ============================================================================= class index(S3CustomController): """ Custom Home Page """ def __call__(self): output = {} ...
mit
chen0510566/MissionPlanner
Lib/site-packages/numpy/oldnumeric/arrayfns.py
86
2532
"""Backward compatible with arrayfns from Numeric """ __all__ = ['array_set', 'construct3', 'digitize', 'error', 'find_mask', 'histogram', 'index_sort', 'interp', 'nz', 'reverse', 'span', 'to_corners', 'zmin_zmax'] import numpy as np from numpy import asarray class error(Exception): pass d...
gpl-3.0
WMD-group/effectivemasstheory
examples/pbs.py
2
6662
#! /usr/bin/env python """Calculate simple semiconductor properties from effective mass theory""" ################################################################################ # Aron Walsh 2014 # ##########################################################...
gpl-2.0
inveniosoftware/invenio-webhooks
tests/test_invenio_webhooks.py
2
2538
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
lscheinkman/nupic
tests/swarming/nupic/swarming/experiments/simpleV2/description.py
10
15403
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
st135yle/django-site
dbenv/lib/python3.4/site-packages/psycopg2/extras.py
8
42565
"""Miscellaneous goodies for psycopg2 This module is a generic place used to hold little helper functions and classes until a better place in the distribution is found. """ # psycopg/extras.py - miscellaneous extra goodies for psycopg # # Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 is f...
mit
espadrine/opera
chromium/src/third_party/protobuf/python/google/protobuf/internal/wire_format.py
561
8431
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
awkspace/ansible
lib/ansible/modules/network/f5/_bigip_gtm_facts.py
21
32103
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, 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
ljhljh235/AutoRest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ModelFlattening/setup.py
28
1139
# 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
rvalyi/OpenUpgrade
addons/auth_openid/__openerp__.py
62
1630
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
x303597316/hue
desktop/core/ext-py/Django-1.6.10/django/core/handlers/base.py
74
12481
from __future__ import unicode_literals import logging import sys import types from django import http from django.conf import settings from django.core import urlresolvers from django.core import signals from django.core.exceptions import MiddlewareNotUsed, PermissionDenied, SuspiciousOperation from django.db import...
apache-2.0
damilare/opencore
opencore/utilities/converters/tests.py
3
7994
# -*- coding: iso-8859-15 -*- # Copyright (C) 2008-2009 Open Society Institute # Thomas Moroz: tmoroz.org # 2010-2011 Large Blue # Fergus Doyle: fergus.doyle@largeblue.com # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU ...
gpl-2.0
Antiun/connector-magento
magentoerpconnect_order_comment/__openerp__.py
11
2018
# -*- coding: utf-8 -*- ############################################################################## # # Author: David BEAL Copyright 2014 Akretion # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
lwbrooke/slackbot
fangorn/records.py
1
3467
from .configuration import config from collections import namedtuple from datetime import datetime, timezone from os.path import expanduser import falcon import json import marshmallow class TinnitusRecorder: def __init__(self): self._schema = SlashCommandDataSchema(config['slack']['tinnitus_command']['to...
apache-2.0
rizac/gfzreport
gfzreport/templates/network/__init__.py
2
8938
#!/usr/bin/env ptatioython # -*- coding: utf-8 -*- ''' Created on May 18, 2016 @author: riccardo ''' from __future__ import print_function import os import sys # @UnusedImport from gfzreport.templates.network.core.utils import relpath from gfzreport.templates.network.core import get_noise_pdfs_content, gen_title,\ ...
gpl-3.0
Gravecorp/Gap
packages/IronPython.StdLib.2.7.3/content/Lib/encodings/cp869.py
593
33221
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.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_map) def decode(self,input,errors='strict'): ...
mpl-2.0
xinwu/horizon
openstack_dashboard/contrib/sahara/content/data_processing/jobs/tabs.py
25
1331
# 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...
apache-2.0
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/lib/util/menu.py
1
6238
import math import os SPACER = None QUIT_OPTION = 'Done' INVALID_CHOICE = (-1) def clear_screen(): os.system(('cls' if (os.name == 'nt') else 'clear')) class Menu(object, ): def __init__(self, heading, choices, choice_heading, prompt): self.heading = heading self.choices = choices se...
unlicense
xme1226/sahara
sahara/db/api.py
4
10563
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
suyashphadtare/vestasi-erp-final
erpnext/support/doctype/newsletter/newsletter.py
31
4539
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.utils from frappe.utils import cstr from frappe import throw, _ from frappe.model.document import Document import erpnex...
agpl-3.0
theplaymate/ferra
scripts/tracing/draw_functrace.py
170
3543
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
erasche/jbrowse
tests/selenium_tests/volvox_biodb_121_test.py
3
1208
import os import unittest import re from volvox_biodb_test import AbstractVolvoxBiodbTest class VolvoxBiodbTest121 ( AbstractVolvoxBiodbTest, unittest.TestCase ): data_dir = 'tests/data/volvox_formatted_1_2_1/' def setUp( self ): # skip calling VolvoxBiodbTest's setUp, cause we are not # actu...
lgpl-2.1
quinot/ansible
lib/ansible/modules/remote_management/oneview/oneview_enclosure_facts.py
84
6416
#!/usr/bin/python # Copyright: (c) 2016-2017, Hewlett Packard Enterprise Development LP # 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
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/keras/api/keras/datasets/__init__.py
133
1271
# 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...
mit
runetvilum/skolevej
ogr2osm/langleyroad.py
2
5104
''' A translation function for Township of Langley Roads_shp.shp roads data. The shapefiles are availble under the PDDL as "Roads" from the Township of Langley at http://www.tol.ca/ServicesContact/OpenData/OpenDataCatalogue.aspx The following fields are dropped from the source shapefile: Field De...
gpl-3.0
jicruz/heroku-bot
lib/pip/utils/__init__.py
323
27187
from __future__ import absolute_import from collections import deque import contextlib import errno import io import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging import re import os import posixpath import shutil import stat import su...
gpl-3.0
dvliman/jaikuengine
.google_appengine/lib/django-1.5/django/contrib/admin/validation.py
100
20755
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model, _get_foreign_key) from django.contrib.admin import ListFilter, FieldListFilter from django.co...
apache-2.0
mrroach/CentralServer
csrv/model/cards/corp/__init__.py
1
1920
from card01054 import Card01054 from card01055 import Card01055 from card01056 import Card01056 from card01057 import Card01057 from card01058 import Card01058 from card01059 import Card01059 from card01060 import Card01060 from card01061 import Card01061 from card01062 import Card01062 from card01063 import Card01063 ...
apache-2.0
CallaJun/hackprince
indico/PIL/OleFileIO.py
7
89128
#!/usr/bin/env python ## OleFileIO_PL: ## Module to read Microsoft OLE2 files (also called Structured Storage or ## Microsoft Compound Document File Format), such as Microsoft Office ## documents, Image Composer and FlashPix files, Outlook messages, ... ## This version is compatible with Python 2.6+ and 3.x ## version...
lgpl-3.0
cbeloni/pychronesapp
backend/venv/lib/python2.7/site-packages/babel/messages/extract.py
151
22695
# -*- coding: utf-8 -*- """ babel.messages.extract ~~~~~~~~~~~~~~~~~~~~~~ Basic infrastructure for extracting localizable messages from source files. This module defines an extensible system for collecting localizable message strings from a variety of sources. A native extractor for Python source ...
mit
JVillella/tensorflow
tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py
25
8860
# 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
grantsewell/nzbToMedia
libs/guessit/containers.py
6
28866
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # Copyright (c) 2013 Rémi Alvergnat <toilal.dev@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Le...
gpl-3.0
embox/mybuild
tests/test_solver.py
2
8677
from __future__ import absolute_import, division, print_function from mybuild._compat import * import functools import unittest from mybuild.req import pgraph from mybuild.req.solver import (ComparableSolution, create_trunk, solve_trunk, ...
bsd-2-clause
elijah513/scikit-learn
sklearn/decomposition/truncated_svd.py
199
7744
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA). """ # Author: Lars Buitinck <L.J.Buitinck@uva.nl> # Olivier Grisel <olivier.grisel@ensta.org> # Michael Becker <mike@beckerfuffle.com> # License: 3-clause BSD. import numpy as np import scipy.sparse as sp try: from scipy.sp...
bsd-3-clause
Jgarcia-IAS/Fidelizacion_odoo
openerp/report/render/rml2pdf/utils.py
381
7143
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2003, Fabien Pinckaers, UCL, FSA # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
agpl-3.0
addition-it-solutions/project-all
addons/mrp/res_config.py
4
3430
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
RockySteveJobs/python-for-android
python3-alpha/python3-src/Lib/test/test_structmembers.py
88
4796
from _testcapi import _test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX, \ PY_SSIZE_T_MAX, PY_SSIZE_T_MIN import unittest from test import support ts=_test...
apache-2.0
RO-ny9/python-for-android
python3-alpha/python3-src/Lib/tkinter/tix.py
45
77690
# -*-mode: python; fill-column: 75; tab-width: 8 -*- # # $Id$ # # Tix.py -- Tix widget wrappers. # # For Tix, see http://tix.sourceforge.net # # - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995. # based on an idea of Jean-Marc Lugrin (lugrin@ms.com) # # NOTE: In order to minimize changes to Tkinter.py, ...
apache-2.0
sobomax/virtualbox_64bit_edd
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Table/TableDsc.py
11
4793
## @file # This file is used to create/update/query/erase table for dsc datas # # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The ...
gpl-2.0
Acehaidrey/incubator-airflow
tests/sensors/test_filesystem.py
7
5534
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
walac/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_stream.py
446
6264
from __future__ import absolute_import, division, unicode_literals from . import support # flake8: noqa import unittest import codecs from io import BytesIO from six.moves import http_client from html5lib.inputstream import (BufferedStream, HTMLInputStream, HTMLUnicodeInputStream, ...
mpl-2.0
pkilambi/ceilometer
ceilometer/event/converter.py
2
16032
# # Copyright 2013 Rackspace Hosting. # # 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...
apache-2.0
xzhou/AppDepriv
androguard/core/analysis/sign.py
38
13670
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
apache-2.0
UnbDroid/robomagellan
Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/geometry_msgs/msg/_Point32.py
1
3876
# This Python file uses the following encoding: utf-8 """autogenerated by genpy from geometry_msgs/Point32.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct class Point32(genpy.Message): _md5sum = "cc153912f1453b708d221682bc23d9ac" _type = "geometr...
gpl-3.0
lahwaacz/qutebrowser
tests/helpers/test_stubs.py
2
2854
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
radicalbit/ambari
ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor_perf.py
1
3190
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
apache-2.0
mpasternak/michaldtz-fixes-518-522
tests/window/WINDOW_SET_VSYNC.py
29
2009
#!/usr/bin/env python '''Test that vsync can be set. Expected behaviour: A window will alternate between red and green fill. - Press "v" to toggle vsync on/off. "Tearing" should only be visible when vsync is off (as indicated at the terminal). Not all video drivers support vsync. On Linux,...
bsd-3-clause
gabisurita/kinto-codegen-tutorial
python-client/test/test_inline_response_200.py
1
2249
# coding: utf-8 """ kinto Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch ...
mit
jlegendary/opencog
tests/python/blending_test/test_conceptual_blending_base.py
4
6851
__author__ = 'DongMin Kim' from opencog.atomspace import * # Only run the unit tests if the required dependencies have been installed # (see: https://github.com/opencog/opencog/issues/337) try: __import__("nose.tools") except ImportError: import unittest raise unittest.SkipTest( "ImportError exce...
agpl-3.0
nerzhul/ansible
lib/ansible/module_utils/api.py
106
3560
# # (c) 2015 Brian Ccoa, <bcoca@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
gpl-3.0
tboyce021/home-assistant
homeassistant/components/wink/lock.py
9
6584
"""Support for Wink locks.""" import pywink import voluptuous as vol from homeassistant.components.lock import LockEntity from homeassistant.const import ( ATTR_CODE, ATTR_ENTITY_ID, ATTR_MODE, ATTR_NAME, STATE_UNKNOWN, ) import homeassistant.helpers.config_validation as cv from . import DOMAIN, W...
apache-2.0
NeuralEnsemble/neuroConstruct
lib/jython/Lib/test/test_userdict.py
23
13413
# Check every path through every method of UserDict import test.test_support, unittest from sets import Set import UserDict class TestMappingProtocol(unittest.TestCase): # This base class can be used to check that an object conforms to the # mapping protocol # Functions that can be useful to override to...
gpl-2.0
philetus/geosolver
workbench/ui_prefViews.py
1
18004
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'prefviews.ui' # # Created: Mon Oct 15 21:18:35 2007 # by: PyQt4 UI code generator 4.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_viewsForm(object): def setupUi(self, viewsForm...
gpl-3.0
Kemanth/Implementation-of-MRED-in-NS3
src/dsdv/bindings/modulegen__gcc_ILP32.py
10
510679
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
dmlc/tvm
python/tvm/relay/op/vision/_vision.py
3
3411
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
pspacek/freeipa
ipatests/test_xmlrpc/test_replace.py
3
4816
# Authors: # Rob Crittenden <rcritten@redhat.com> # # Copyright (C) 2011 Red Hat # see file 'COPYING' for use and warranty information # # 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...
gpl-3.0
kidburglar/youtube-dl
youtube_dl/extractor/rtl2.py
12
7153
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..aes import aes_cbc_decrypt from ..compat import ( compat_b64decode, compat_ord, compat_str, ) from ..utils import ( bytes_to_intlist, ExtractorError, intlist_to_bytes, int_or_none, ...
unlicense
postlund/home-assistant
homeassistant/components/volkszaehler/sensor.py
19
4129
"""Support for consuming values for the Volkszaehler API.""" from datetime import timedelta import logging from volkszaehler import Volkszaehler from volkszaehler.exceptions import VolkszaehlerApiConnectionError import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.co...
apache-2.0
lucywyman/slides-ii
v/lib/python2.7/site-packages/pygments/styles/fruity.py
135
1298
# -*- coding: utf-8 -*- """ pygments.styles.fruity ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "fruity" vim theme. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Token, Co...
apache-2.0
caslei/TfModels
textsum/data_convert_example.py
26
2271
"""Example of Converting TextSum model data. Usage: python data_convert_example.py --command binary_to_text --in_file data/data --out_file data/text_data python data_convert_example.py --command text_to_binary --in_file data/text_data --out_file data/binary_data python data_convert_example.py --command binary_to_text -...
apache-2.0
narry/odenos
src/main/python/org/o3project/odenos/core/component/network/packet/ofp_in_packet.py
6
2181
# -*- coding:utf-8 -*- # Copyright 2015 NEC Corporation. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License...
apache-2.0
miroi/xcint
doc/conf.py
4
7747
# -*- coding: utf-8 -*- # # XCint documentation build configuration file, created by # sphinx-quickstart on Thu Jun 12 14:59:50 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
bsd-3-clause
thjashin/tensorflow
tensorflow/contrib/learn/python/learn/utils/input_fn_utils.py
69
4846
# 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
canavandl/bokeh
examples/plotting/file/hover.py
43
1384
from __future__ import division import itertools import numpy as np from six.moves import zip from collections import OrderedDict from bokeh.plotting import ColumnDataSource, figure, show, output_file from bokeh.models import HoverTool output_file("hover.html") TOOLS="crosshair,pan,wheel_zoom,box_zoom,reset,hover,...
bsd-3-clause
cholarajaa/cold-temperature
hotorcold/reactor/views.py
1
1489
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.http import HttpResponse from rest_framework import status from rest_framework.response import Response from rest_framework import viewsets from rest_framework.decorators import api_view from reactor.models ...
gpl-3.0
pauljohnleonard/pod-world
CI_2015/demos/brains/feedforwardbrain.py
1
6562
# converted to java and then to python by p.j.leonard # based on C++ code found at # http://www.codeproject.com/KB/recipes/BP.aspx?msg=2809798#xx2809798xx import math import random import copy import pickle """ multilayer neural network """ def sigmoid(x): if x < -100.0: # avoid...
gpl-2.0
palas/otp
lib/asn1/test/asn1_SUITE_data/BitStr.py
97
1813
BitStr DEFINITIONS ::= BEGIN -- F.2.5.1 -- Use a bit string type to model binary data whose format and -- length are unspecified, -- or specified elsewhere, and whose length in bits is not necessarily -- a multiple of eight. -- EXAMPLE G3FacsimilePage ::= BIT STRING -- a sequence of bits conforming to...
apache-2.0
wilvk/ansible
lib/ansible/modules/monitoring/zabbix/zabbix_host.py
5
37010
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, 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
nestukh/trash-cli
unit_tests/test_trashdir.py
2
2738
# Copyright (C) 2011 Andrea Francia Trivolzio(PV) Italy from nose.tools import assert_equals from trashcli.trash import TrashDir from trashcli.trash import TrashDirectory class TestTrashDir: def test_path(self): trash_dir = TrashDirectory('/Trash-501', '/') assert_equals('/Trash-501', trash_dir.pa...
gpl-2.0
yuanming-hu/taichi
tests/python/test_ndrange.py
1
4333
import numpy as np import taichi as ti @ti.all_archs def test_1d(): x = ti.field(ti.f32, shape=(16)) @ti.kernel def func(): for i in ti.ndrange((4, 10)): x[i] = i func() for i in range(16): if 4 <= i < 10: assert x[i] == i else: asser...
mit
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_display_units06.py
1
1414
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
KDE/kcm-userconfig
models.py
1
10076
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################# ## ## Copyright 2009 Yuriy Kozlov <yuriy-kozlov@kubuntu.org> ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## p...
gpl-2.0
decode-dev/shodan-python
shodan/client.py
3
15861
# -*- coding: utf-8 -*- """ shodan.client ~~~~~~~~~~~~~ This module implements the Shodan API. :copyright: (c) 2014-2015 by John Matherly """ import requests import simplejson import time import shodan.exception as exception import shodan.helpers as helpers import shodan.stream as stream # Tr...
mit
CongSmile/tp-qemu
qemu/tests/smartcard_setup.py
9
2568
""" smartcard_setup.py - Used as a setup test for smartcard tests. Before doing a remote viewer connection there is some setup required for smartcard tests: On the client, certs that will be put into the smartcard will need to be generated. """ import logging from autotest.client.shared import error from virttest ...
gpl-2.0
jbruestle/aggregate_btree
python/bar.py
1
1368
import stat_tree tree = stat_tree.StatsTree('/tmp/thetree') tree.write(0, ['foobar'], {'a': 0.1, 'c': 1, 'b': 1}) tree.write(1, ['foobar'], {'a': 0.1, 'c': 1, 'b': 2}) tree.write(2, ['foobar'], {'a': 0.1, 'c': 100, 'b': 3}) tree.write(3, ['foobar'], {'a': 0.1, 'c': 1, 'b': 4}) tree.write(0.0, ['tag1'], {'m1':500, 'm...
agpl-3.0
splunk/splunk-webframework
contrib/django/django/utils/dateparse.py
229
2817
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime import re from django.utils ...
apache-2.0
BaladiDogGames/baladidoggames.github.io
mingw/bin/lib/msilib/text.py
159
9313
import msilib,os;dirname=os.path.dirname(__file__) ActionText = [ (u'InstallValidate', u'Validating install', None), (u'InstallFiles', u'Copying new files', u'File: [1], Directory: [9], Size: [6]'), (u'InstallAdminPackage', u'Copying network install files', u'File: [1], Directory: [9], Size: [6]'), (u'FileCost', u'C...
mit
JonathanStein/odoo
addons/account_test/report/account_test_report.py
194
3819
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
awangga/tweepy
tests/test_rate_limit.py
47
5416
import unittest import os from tweepy import API, Cursor from tweepy.error import TweepError import six if six.PY3: import unittest else: import unittest2 as unittest from .config import create_auth testratelimit = 'TEST_RATE_LIMIT' in os.environ @unittest.skipIf(not testratelimit, "skipping rate limiting t...
mit
RuudBurger/CouchPotatoServer
couchpotato/core/_base/clientscript.py
37
1500
import os from couchpotato.core.event import addEvent from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.environment import Env log = CPLog(__name__) autoload = 'ClientScript' class ClientScript(Plugin): ...
gpl-3.0
bencorbett90/Graph
graph/datastream.py
1
5964
import numpy as np from PyQt4 import QtCore, QtGui import h5py from utils import * class DataStream(): def __init__(self, path, dataPath): """Initializes a HDF5 DataStream. PATH is the path to the .hdf5 file, and DATAPATH is the path within the file to the specific dataset. """ ...
gpl-2.0
ak2703/edx-platform
lms/djangoapps/commerce/tests/test_views.py
85
4208
""" Tests for commerce views. """ import json from uuid import uuid4 from nose.plugins.attrib import attr import ddt from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase import mock from student.tests.factories import UserFactory class UserMixin(object): ...
agpl-3.0
mjtamlyn/django
tests/admin_ordering/tests.py
37
6637
from django.contrib import admin from django.contrib.admin.options import ModelAdmin from django.contrib.auth.models import User from django.test import RequestFactory, TestCase from .models import ( Band, DynOrderingBandAdmin, Song, SongInlineDefaultOrdering, SongInlineNewOrdering, ) class MockRequest: ...
bsd-3-clause
c3pko/GovScrape
dynamic_scraper/spiders/checker_test.py
4
4107
from scrapy import log, signals from scrapy.exceptions import CloseSpider from scrapy.http import Request from scrapy.xlib.pydispatch import dispatcher from dynamic_scraper.spiders.django_base_spider import DjangoBaseSpider from dynamic_scraper.models import Scraper class CheckerTest(DjangoBaseSpider): name ...
bsd-3-clause
zappyk-github/zappyk-python
src/src_zappyk/queryExecWebZI/setup.py
1
3114
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'zappyk' import os, sys from lib_zappyk import _setup from QueryExecWebZI.xlsX2splits_sheets import _project, _description, _version #CZ#project = 'QueryExecWebZI' #CZ#name = __import__(project).get_project() #CZ#description = __import__(project)...
gpl-2.0
roboogle/gtkmvc3
gtkmvco/gtkmvc3/support/utils.py
1
5390
# Author: Roberto Cavada <roboogle@gmail.com> # # Copyright (C) 2007-2015 by Roberto Cavada # # gtkmvc3 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 of the License, or (at yo...
lgpl-2.1
firmlyjin/brython
www/gallery/sudoku.py
16
1493
# Boris Borcic 2006 # Quick and concise Python 2.5 sudoku solver # # Adapted for Brython by Pierre Quentel # load pre-computed tables import json data = json.loads(open('sudoku.json').read()) w2q = data['w2q'] q2w = data['q2w'] w2q2w = data['w2q2w'] class Completed(Exception) : pass def sudoku99(problem) : given...
bsd-3-clause
teriyakichild/ansible-modules-extras
cloud/cloudstack/cs_network.py
33
17539
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, 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
alexgibson/bedrock
lib/fluent_migrations/firefox/new.py
6
12542
from __future__ import absolute_import import fluent.syntax.ast as FTL from fluent.migrate.helpers import transforms_from from fluent.migrate.helpers import VARIABLE_REFERENCE, TERM_REFERENCE from fluent.migrate import REPLACE, COPY trailhead = "firefox/new/trailhead.lang" def migrate(ctx): """Migrate bedrock/fir...
mpl-2.0
sdague/home-assistant
homeassistant/components/aqualogic/sensor.py
9
3466
"""Support for AquaLogic sensors.""" import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_MONITORED_CONDITIONS, PERCENTAGE, POWER_WATT, TEMP_CELSIUS, TEMP_FAHRENHEIT, ) from homeassistant.core import callback import homeassista...
apache-2.0
turon/openthread
tests/scripts/thread-cert/test_coaps.py
1
3715
#!/usr/bin/env python # # Copyright (c) 2018, 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
Joshuaalbert/IonoTomo
src/ionotomo/tomography/model.py
1
2831
import tensorflow as tf import numpy as np from ionotomo.settings import TFSettings from ionotomo import * from ionotomo.ionosphere.iri import a_priori_model import astropy.coordinates as ac import astropy.units as au import astropy.time as at def calc_rays_and_initial_model(antennas,directions,times,zmax=1000.,res_n...
apache-2.0
DiCarloLab-Delft/PycQED_py3
pycqed/instrument_drivers/physical_instruments/SCPIBase.py
1
7440
""" File: SCPIBase.py Author: Wouter Vlothuizen, TNO/QuTech Purpose: self contained base class for SCPI ('Standard Commands for Programmable Instruments') commands, with selectable transport Usage: don't use directly, use a derived class (e.g. Qutech_CC) Notes: ...
mit
zbsz/micro-protobuf
python/google/protobuf/message.py
43
9283
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
laiqiqi886/kbengine
kbe/src/lib/python/Tools/scripts/patchcheck.py
36
5829
#!/usr/bin/env python3 import re import sys import shutil import os.path import subprocess import sysconfig import reindent import untabify SRCDIR = sysconfig.get_config_var('srcdir') def n_files_str(count): """Return 'N file(s)' with the proper plurality on 'file'.""" return "{} file{}".format(count, "s" ...
lgpl-3.0
pratikmallya/hue
desktop/core/ext-py/Babel-0.9.6/babel/messages/frontend.py
67
51292
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. ...
apache-2.0
ronny3050/MobileNet
retrain.py
1
56996
# 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...
mit
LANGFAN/APM
libraries/AP_InertialSensor/examples/coning.py
241
10508
#!/usr/bin/python from math import * from pymavlink.rotmat import Vector3, Matrix3 from numpy import linspace from visual import * class Quat: def __init__(self,w=1.0,x=0.0,y=0.0,z=0.0): self.w = w self.x = x self.y = y self.z = z def to_euler(self): roll = (atan2(2.0*...
gpl-3.0