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
nicanor-romero/OctoPrint
src/octoprint/_version.py
29
10232
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (build by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
agpl-3.0
foreni-packages/golismero
thirdparty_libs/django/utils/version.py
228
1785
from __future__ import unicode_literals import datetime import os import subprocess def get_version(version=None): "Returns a PEP 386-compliant version number from VERSION." if version is None: from django import VERSION as version else: assert len(version) == 5 assert version[3] i...
gpl-2.0
spbguru/repo1
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py
70
9051
from __future__ import division """ backend_wxagg.py A wxPython backend for Agg. This uses the GUI widgets written by Jeremy O'Donoghue (jeremy@o-donoghue.com) and the Agg backend by John Hunter (jdhunter@ace.bsd.uchicago.edu) Copyright (C) 2003-5 Jeremy O'Donoghue, John Hunter, Illinois Institute of Technolo...
gpl-3.0
JohnLunzer/flexx
flexx/ui/widgets/_html.py
1
3211
""" Simple example: .. UIExample:: 75 from flexx import app, ui class Example(ui.Widget): def init(self): with ui.html.UL(): ui.html.LI(text='foo') ui.html.LI(text='bar') .. UIExample:: 150 from flexx import app, ui, ev...
bsd-2-clause
shangvven/Wox
PythonHome/Lib/site-packages/pip/commands/__init__.py
476
2236
""" Package containing all pip commands """ from pip.commands.bundle import BundleCommand from pip.commands.completion import CompletionCommand from pip.commands.freeze import FreezeCommand from pip.commands.help import HelpCommand from pip.commands.list import ListCommand from pip.commands.search import SearchComman...
mit
hvanhovell/spark
python/pyspark/ml/util.py
8
18904
# # 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 us...
apache-2.0
kotovaleksandr/inbot
bot.py
2
5664
from time import sleep import datetime __author__ = 'kotov.a' import options import logging import coloredlogs import sys logger = logging.getLogger('inbot') level = logging.DEBUG handler = logging.StreamHandler(stream=sys.stdout) handler.setLevel(level) logger.addHandler(handler) coloredlogs.install(level=logging.D...
apache-2.0
jorik041/paramiko
tests/test_transport.py
22
28620
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
lgpl-2.1
oskyar/test-TFG
TFG/urls.py
1
2144
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.views import login, logout_then_login from django.views.static import serve import logging from importlib import import_module from django.conf import settings from TFG.apps.ha...
gpl-2.0
nfedera/rg3-youtube-dl
test/test_iqiyi_sdk_interpreter.py
16
1103
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL from youtube_dl.extractor import IqiyiIE class IqiyiIEWithCredentials(IqiyiIE):...
unlicense
Hubert51/AutoGrading
learning/web_Haotian/venv/Lib/encodings/mac_romanian.py
272
13661
""" Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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,inp...
mit
LeslieW/protobuf
python/google/protobuf/descriptor_database.py
57
5062
# 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
orangejulius/openaddresses
apply-us-data.py
5
3020
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv, json from glob import glob from os.path import basename, join with open(join('us-data', 'codes.txt')) as f: rows = list(csv.DictReader(f, dialect='excel-tab')) codes = dict([(row['Postal Code'].lower(), row['State']) for row in rows]) with open(join('...
bsd-3-clause
KevZho/mallbot
kol/request/EquipRequest.py
4
1196
import kol.Error as Error from GenericRequest import GenericRequest from kol.manager import PatternManager class EquipRequest(GenericRequest): """ Equips items from the inventory passed by itemId. If a slot is specified, it will attempt to equip accessories into that slot. """ def __init__(self, sess...
mit
dingzg/onepanel
lib/module/user.py
1
10650
#!/usr/bin/env python2.6 #-*- coding: utf-8 -*- # Copyright [OnePanel] # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
276361270/sqlalchemy
lib/sqlalchemy/orm/scoping.py
80
6101
# orm/scoping.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .. import exc as sa_exc from ..util import ScopedRegistry, ThreadLocalRegistry, ...
mit
Noviat/odoo
addons/website_sale/controllers/main.py
32
44543
# -*- coding: utf-8 -*- import logging import werkzeug from openerp import SUPERUSER_ID from openerp import http from openerp import tools from openerp.http import request from openerp.tools.translate import _ from openerp.addons.website.models.website import slug from openerp.addons.web.controllers.main import login_...
agpl-3.0
Aldenis2112/qutepart
qutepart/brackethlighter.py
4
5503
"""Bracket highlighter. Calculates list of QTextEdit.ExtraSelection """ import time from PyQt5.QtCore import Qt from PyQt5.QtGui import QTextCursor from PyQt5.QtWidgets import QTextEdit class _TimeoutException(UserWarning): """Operation timeout happened """ pass class BracketHighlighter: """Bracke...
lgpl-2.1
NeovaHealth/odoo
addons/sale/wizard/sale_make_invoice_advance.py
163
10872
############################################################################## # # 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 Affero General Public L...
agpl-3.0
scrollback/kuma
vendor/packages/ipython/IPython/DPyGetOpt.py
7
26702
# -*- coding: utf-8 -*- """DPyGetOpt -- Demiurge Python GetOptions Module This module is modeled after perl's Getopt::Long module-- which is, in turn, modeled after GNU's extended getopt() function. Upon instantiation, the option specification should be a sequence (list) of option definitions. Options that take no a...
mpl-2.0
tellesnobrega/horizon
horizon/test/tests/exceptions.py
54
1695
# 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 # d...
apache-2.0
resmo/ansible
test/units/modules/network/check_point/test_cp_mgmt_service_group.py
19
4015
# Ansible module to manage CheckPoint Firewall (c) 2019 # # 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 dist...
gpl-3.0
Fat-Zer/FreeCAD_sf_master
src/Tools/updatefromcrowdin.py
11
12203
#!/usr/bin/python #*************************************************************************** #* * #* Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
tlksio/tlksio
env/lib/python3.4/site-packages/logilab/astng/mixins.py
1
4348
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-astng. # # logilab-astng is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publis...
mit
kinglogxzl/rqalpha
rqalpha/examples/simple_macd.py
2
2164
# 可以自己import我们平台支持的第三方python模块,比如pandas、numpy等。 import talib import numpy as np import math import pandas # 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。 def init(context): context.s1 = "000001.XSHE" # 使用MACD需要设置长短均线和macd平均线的参数 context.SHORTPERIOD = 12 context.LONGPERIOD = 26 context.SMOOTHPERIOD...
apache-2.0
jmouriz/sanaviron
sanaviron/objects/charts/chart.py
3
23696
# Copyright(c) 2007-2009 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # # This file is part of PyCha. # # PyCha 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 3 of the License,...
apache-2.0
KapecK/or-tools
examples/python/jobshop_ft06.py
5
3543
# Copyright 2010-2014 Google # 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, so...
apache-2.0
marionleborgne/nupic
src/nupic/support/feature_groups.py
5
3245
# ---------------------------------------------------------------------- # 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
naturali/tensorflow
tensorflow/python/kernel_tests/variable_scope_test.py
1
35348
# 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
nfletton/django-oscar
src/oscar/apps/order/abstract_models.py
22
37192
from collections import OrderedDict from decimal import Decimal as D import hashlib from django.conf import settings from django.db import models from django.db.models import Sum from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettex...
bsd-3-clause
JioCloud/python-cinderclient
cinderclient/tests/v2/test_volumes.py
3
6885
# 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 # # Unles...
apache-2.0
justyns/home-assistant
homeassistant/components/verisure.py
3
5709
""" Support for Verisure components. For more details about this component, please refer to the documentation at https://home-assistant.io/components/verisure/ """ import logging import threading import time from datetime import timedelta from homeassistant import bootstrap from homeassistant.const import ( ATTR_...
mit
GdZ/scriptfile
software/googleAppEngine/lib/webob_0_9/setup.py
32
1070
from setuptools import setup, find_packages import sys, os version = '0.9' setup(name='WebOb', version=version, description="WSGI request and response object", long_description="""\ WebOb provides wrappers around the WSGI request environment, and an object to help create WSGI responses. The objects...
mit
thodoris/djangoPharma
djangoPharma/env/Lib/site-packages/django/db/models/options.py
10
36750
from __future__ import unicode_literals import copy import warnings from bisect import bisect from collections import OrderedDict, defaultdict from itertools import chain from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.db import connection...
apache-2.0
craigderington/striker_api
tutorial/snippets/views4.py
1
1130
from snippets.models import Snippet from snippets.serializers import SnippetSerializer from rest_framework import mixins from rest_framework import generics class SnippetList(mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView): queryset = Snippet.objects.al...
gpl-3.0
bretttegart/treadmill
lib/python/treadmill/runtime/linux/image/native.py
1
18468
"""A collection of native images. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import glob import io import logging import os import pwd import shutil import stat from treadmill import appcfg from...
apache-2.0
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/twisted/scripts/tap2deb.py
27
7227
# -*- test-case-name: twisted.scripts.test.test_tap2deb -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ tap2deb creates Debian packages which wrap .tap files. """ import os import sys import shutil import subprocess from email.utils import formatdate as now from twisted.python import ...
gpl-2.0
WatanabeYasumasa/edx-platform
common/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py
52
5637
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserCourseTags' db.create_table('user_api_usercoursetags', ( ('id', self.gf('dja...
agpl-3.0
onsightit/solarcoin
qa/rpc-tests/receivedby.py
37
6488
#!/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. # Exercise the listreceivedbyaddress API from test_framework.test_framework import BitcoinTestFramework ...
mit
tiggerntatie/ggame
ggame/sound.py
2
1888
""" Tools for loading and playing sound resources in ggame applications. """ from ggame.sysdeps import SND_Sound class SoundAsset: """ Class representing a single sound asset (sound file, such as .mp3 or .wav). :param str url: The URL or file name of the desired sound. Sound file formats may inc...
mit
b0ttl3z/SickRage
lib/urllib3/contrib/_securetransport/bindings.py
42
17446
""" This module uses ctypes to bind a whole bunch of functions and constants from SecureTransport. The goal here is to provide the low-level API to SecureTransport. These are essentially the C-level functions and constants, and they're pretty gross to work with. This code is a bastardised version of the code found in ...
gpl-3.0
nazeehshoura/crawler
env/lib/python2.7/site-packages/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
mit
catalpainternational/OIPA
OIPA/api/v3/resources/csv_serializer.py
1
7048
from __future__ import print_function from future import standard_library standard_library.install_aliases() import csv import io from tastypie.serializers import Serializer import string class CsvSerializer(Serializer): formats = ['json', 'xml', 'csv'] content_types = { 'json': 'application/json', ...
agpl-3.0
ClimbsRocks/auto_ml
tests/advanced_tests/automated_tests.py
1
1586
from collections import OrderedDict import os import sys sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path os.environ['is_test_suite'] = 'True' import classifiers as classifier_tests import regressors as regressor_tests training_parameters = { 'model_names': ['DeepLearning', 'GradientBoosting', ...
mit
dwadler/QGIS
python/plugins/processing/algs/qgis/PointsFromLines.py
4
7767
# -*- coding: utf-8 -*- """ *************************************************************************** PointsFromLines.py --------------------- Date : August 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com **********...
gpl-2.0
Dfelker/ansible
lib/ansible/plugins/filter/mathstuff.py
55
4026
# (c) 2014, Brian Coca <bcoca@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
hlange/LogSoCR
.waf/waflib/extras/use_config.py
1
5505
#!/usr/bin/env python # coding=utf-8 # Mathieu Courtois - EDF R&D, 2013 - http://www.code-aster.org """ When a project has a lot of options the 'waf configure' command line can be very long and it becomes a cause of error. This tool provides a convenient way to load a set of configuration parameters from a local file ...
agpl-3.0
suyashphadtare/vestasi-erp-1
erpnext/erpnext/config/selling.py
22
6601
from frappe import _ def get_data(): return [ { "label": _("Documents"), "icon": "icon-star", "items": [ { "type": "doctype", "name": "Lead", "description": _("Database of potential customers."), }, { "type": "doctype", "name": "Customer", "description": _("Custome...
agpl-3.0
leonardocsantoss/ehventos
lib/reportlab/graphics/renderSVG.py
10
30320
__doc__="""An experimental SVG renderer for the ReportLab graphics framework. This will create SVG code from the ReportLab Graphics API (RLG). To read existing SVG code and convert it into ReportLab graphics objects download the svglib module here: http://python.net/~gherman/#svglib """ import math, types, sys, os...
gpl-2.0
peeyush-tm/shinken
test/test_notif_too_much.py
18
2795
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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
pymedusa/SickRage
ext/wrapt/importer.py
12
7726
"""This module implements a post import hook mechanism styled after what is described in PEP-369. Note that it doesn't cope with modules being reloaded. """ import sys import threading PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY3: import importlib string_types = str, else: string...
gpl-3.0
gdimitris/FleetManagerBackend
virtual_env/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.py
51
21552
# orm/interfaces.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Contains various base classes used throughout the ORM. Defines some key base...
mit
madedotcom/photon-pump
test/conversations/test_read_all_events_stream_conversation.py
1
4703
from asyncio import Queue from uuid import uuid4 import pytest from photonpump import messages as msg, exceptions from photonpump import messages_pb2 as proto from photonpump.conversations import ReadAllEvents @pytest.mark.asyncio async def test_read_all_request(): output = Queue() convo = ReadAllEvents(m...
mit
fraricci/pymatgen
pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py
3
99980
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module contains the main object used to identify the coordination environments in a given structure. If you use this module, please cite the following: David Waroquiers, Xavier Gonze, Gian-Marco Rign...
mit
candy7393/VTK
ThirdParty/Twisted/twisted/trial/test/erroneous.py
33
4273
# -*- test-case-name: twisted.trial.test.test_tests -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Definitions of test cases with various interesting error-related behaviors, to be used by test modules to exercise different features of trial's test runner. See the L{twisted.trial.test...
bsd-3-clause
sdague/home-assistant
homeassistant/components/deconz/climate.py
5
3948
"""Support for deCONZ climate devices.""" from pydeconz.sensor import Thermostat from homeassistant.components.climate import DOMAIN, ClimateEntity from homeassistant.components.climate.const import ( HVAC_MODE_AUTO, HVAC_MODE_HEAT, HVAC_MODE_OFF, SUPPORT_TARGET_TEMPERATURE, ) from homeassistant.const ...
apache-2.0
takeflight/wagtail
wagtail/core/blocks/list_block.py
3
7034
from django import forms from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.utils.html import format_html, format_html_join from django.utils.safestring import mark_safe from wagtail.admin.staticfiles import versio...
bsd-3-clause
sxjscience/mxnet
cd/utils/artifact_repository.py
4
22674
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache Licen...
apache-2.0
seanli9jan/tensorflow
tensorflow/python/kernel_tests/batchtospace_op_test.py
10
11772
# 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
YinThong/intel-iot-refkit
meta-iotqa/lib/oeqa/runtime/programming/nodejs/iotivity_node_upstream_parser_log.py
7
1570
import json import os import sys SCRIPT_PATH = os.path.realpath(__file__) CONST_PATH = os.path.dirname(SCRIPT_PATH) JSON_PATH = os.path.join(CONST_PATH, "tests/results.json") def format_results(json_path): with open(json_path) as data_file: data = json.load(data_file) res_list = data["output"] log...
mit
edxzw/edx-platform
openedx/core/djangoapps/user_api/tests/test_views.py
16
71023
"""Tests for the user API at the HTTP request level. """ import datetime import base64 import json import re from unittest import skipUnless, SkipTest import ddt import httpretty from pytz import UTC import mock from django.conf import settings from django.core.urlresolvers import reverse from django.core import mai...
agpl-3.0
unixunion/python-libsolace
bin/solace-list-clients.py
1
4986
#!/usr/bin/env python """ Show solace clients and counts, optionally pump all stats into influxdb """ import logging import sys logging.basicConfig(format='[%(module)s] %(filename)s:%(lineno)s %(asctime)s %(levelname)s %(message)s', stream=sys.stderr) import libsolace.settingsloader as settings...
mit
sonicyang/TIE
src/forwarder/dev-bluetooth.py
1
4067
#!/usr/bin/env python # # Copyright (C) 2013 AcoMo Technology. # All rights reserved. # # Authored by Jyun-Yu Huang <yillkid@acomotech.com> # # This is a bluetooth forwarder. # # AcoMo forwarder bridge sensor and server, the protocol of client (sensor) is bluetooth RFCOMM, # and the protocol of server is XML-RPC. # # ...
gpl-2.0
agry/NGECore2
scripts/mobiles/dathomir/kamurith_snapper.py
2
1326
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobil...
lgpl-3.0
dendisuhubdy/tensorflow
tensorflow/java/maven/tensorflow-android/update.py
14
4419
# 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 appl...
apache-2.0
wxkdesky/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py
124
3269
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
curtislacy/omniwallet
api/accept.py
6
7735
import urlparse import os, sys tools_dir = os.environ.get('TOOLSDIR') lib_path = os.path.abspath(tools_dir) sys.path.append(lib_path) from msc_utils_parsing import * from msc_apps import * import random data_dir_root = os.environ.get('DATADIR') def accept_form_response(response_dict): expected_fields=['buyer', '...
agpl-3.0
ingadhoc/sale
sale_require_ref/__manifest__.py
1
1503
############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.7.2/Lib/test/test_sgmllib.py
139
15728
import pprint import re import unittest from test import test_support sgmllib = test_support.import_module('sgmllib', deprecated=True) class EventCollector(sgmllib.SGMLParser): def __init__(self): self.events = [] self.append = self.events.append sgmllib.SGMLParser.__init__(self) def...
mit
DeepThoughtTeam/tensorflow
tensorflow/python/training/moving_averages_test.py
7
7808
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
espensirnes/paneltime
paneltime/system/system_arguments.py
1
8361
#!/usr/bin/env python # -*- coding: utf-8 -*- #This module contains the arguments class used to handle regression arguments import numpy as np import functions as fu import stat_functions as stat class arguments: """Sets initial arguments and stores static properties of the arguments""" def __init__(self,panel, a...
gpl-3.0
hgl888/chromium-crosswalk
tools/telemetry/telemetry/web_perf/metrics/memory_timeline.py
5
1559
# Copyright 2015 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 telemetry.timeline import memory_dump_event from telemetry.value import list_of_scalar_values from telemetry.web_perf.metrics import timeline_based_metr...
bsd-3-clause
pilou-/ansible
lib/ansible/modules/storage/purestorage/purefb_ds.py
13
8491
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
gpl-3.0
patriciolobos/desa8
openerp/addons/email_template/tests/test_ir_actions.py
382
2587
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
xobs/novena-linux
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
KurtDeGreeff/infernal-twin
build/pip/build/lib.linux-i686-2.7/pip/_vendor/six.py
878
29664
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
gpl-3.0
wangmiao1981/spark
python/pyspark/mllib/stat/__init__.py
22
1309
# # 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 us...
apache-2.0
eskibars/domoticz
scripts/python/reloader.py
36
1116
""" Python only loads modules once, so domoticz will only load a module the first time it is needed. Code changes will not be reflected, only after a restart of domoticz. Note that doesn't hold for scripts, they always get reloaded. To have your module reloaded, you can enter the following code in it. import reloader r...
gpl-3.0
praekelt/panya-event
event/models.py
1
1514
from django.db import models from django.core.urlresolvers import reverse from ckeditor.fields import RichTextField from panya.models import ModelBase PROVINCES = ( ('Eastern Cape', 'Eastern Cape'), ('Free State', 'Free State'), ('Gauteng', 'Gauteng'), ('KwaZulu-Natal', 'KwaZulu-Natal'), ('Limpopo...
bsd-3-clause
daoluan/decode-Django
Django-1.5.1/django/core/management/base.py
4
15897
""" Base classes for writing management commands (named commands which can be executed through ``django-admin.py`` or ``manage.py``). 命令基础类, 可以被 django-admin.py 或者 manage.py 执行 """ import os import sys from optparse import make_option, OptionParser import traceback import django from django.core.exceptions import Im...
gpl-2.0
RafaelRMachado/qtwebkit
Tools/Scripts/webkitpy/tool/steps/postdiff.py
132
2433
# 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 th...
gpl-2.0
PatKayongo/patkayongo.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexer.py
95
26928
# -*- coding: utf-8 -*- """ pygments.lexer ~~~~~~~~~~~~~~ Base lexer classes. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re, itertools from pygments.filter import apply_filters, Filter from pygments.filters import get_filt...
mit
kenbeese/DataProcessor
lib/dataprocessor/nodes.py
2
12490
# coding=utf-8 """Tools for manipulation of node_list.""" from .exception import DataProcessorError from . import utility node_types = ["run", "project", "figure", "ipynb"] class DataProcessorNodesError(DataProcessorError): """Exception about Nodes processings.""" def __init__(self, msg): DataProce...
gpl-3.0
xindiguo/pythonSynapseUtils
pythonSynapseUtils/synutils.py
1
4081
#!/usr/bin/env python import argparse import os import sys import synapseclient import hashlib import string script_path = os.path.dirname(__file__) local_module_path = os.path.abspath(os.path.join(script_path,'lib')) sys.path.append(local_module_path) import s3 STATIC_BUCKET = "static.synapse.org" def create_html...
apache-2.0
adoosii/edx-platform
common/lib/xmodule/xmodule/imageannotation_module.py
107
7163
""" Module for Image annotations using annotator. """ from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xblock.core import Scope, String from xmodule.annotator_mixin import get_instructions, html_to_text from xmodule....
agpl-3.0
silenceli/nova
nova/db/sqlalchemy/migrate_repo/versions/231_add_ephemeral_key_uuid.py
48
1782
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory # 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/l...
apache-2.0
yqm/sl4a
python/src/Lib/idlelib/OutputWindow.py
67
4396
from Tkinter import * from EditorWindow import EditorWindow import re import tkMessageBox import IOBinding class OutputWindow(EditorWindow): """An editor window that can serve as an output file. Also the future base class for the Python shell window. This class has no input facilities. """ def _...
apache-2.0
MartinDelzant/scikit-learn
examples/classification/plot_lda.py
70
2413
""" ==================================================================== Normal and Shrinkage Linear Discriminant Analysis for classification ==================================================================== Shows how shrinkage improves classification. """ from __future__ import division import numpy as np import...
bsd-3-clause
jmetzen/scikit-learn
examples/svm/plot_oneclass.py
80
2338
""" ========================================== One-class SVM with non-linear kernel (RBF) ========================================== An example using a one-class SVM for novelty detection. :ref:`One-class SVM <svm_outlier_detection>` is an unsupervised algorithm that learns a decision function for novelty detection: ...
bsd-3-clause
encukou/samba
third_party/dnspython/dns/rdtypes/IN/NSAP.py
100
2181
# Copyright (C) 2003-2007, 2009-2011 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 "...
gpl-3.0
roandelyf/iTerm2
tools/ply/ply-3.4/test/yacc_simple.py
174
1542
# ----------------------------------------------------------------------------- # yacc_simple.py # # A simple, properly specifier grammar # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex imp...
gpl-2.0
dddomodossola/remi
examples/onclose_window_app.py
1
1513
""" 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 ...
apache-2.0
Tennyson53/SUR
magnum/common/pythonk8sclient/client/models/V1beta3_ReplicationControllerSpec.py
15
2286
#!/usr/bin/env python """ Copyright 2015 Reverb Technologies, 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 require...
apache-2.0
ylcolala/scrapy
scrapy/utils/trackref.py
120
2081
"""This module provides some functions and classes to record and report references to live object instances. If you want live objects for a particular class to be tracked, you only have to subclass from object_ref (instead of object). About performance: This library has a minimal performance impact when enabled, and ...
bsd-3-clause
twiest/openshift-tools
scripts/monitoring/cron-send-service-web-check.py
7
5738
#!/usr/bin/env python ''' Send Pod status checks to Zagg ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Copyright 2015 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at ...
apache-2.0
mhcrnl/pygubu
pygubudesigner/util/__init__.py
2
3471
# encoding: UTF-8 # # Copyright 2012-2013 Alejandro Autalán # # 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 Free Software Foundation. # # This program is distributed in the hope that it will be useful, but #...
gpl-3.0
silentfuzzle/calibre
src/calibre/gui2/convert/mobi_output.py
14
1148
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre.gui2.convert.mobi_output_ui import Ui_Form from calibre.gui2.convert i...
gpl-3.0
internap/fake-switches
fake_switches/cisco/cisco_core.py
4
4168
# Copyright 2015 Internap. # # 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, so...
apache-2.0
opentripplanner/OTPQA
hreport.py
1
2481
import simplejson as json import numpy as np def parsetime(aa): if aa is None: return None return float( aa.split()[0] ) def main(filenames): if len(filenames)==0: return yield "<html>" yield """<head><style>table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { text-ali...
gpl-3.0
chirpradio/chirpradio-volunteers
site-packages/django/utils/encoding.py
6
5406
import types import urllib import locale import datetime import codecs from django.utils.functional import Promise try: from decimal import Decimal except ImportError: from django.utils._decimal import Decimal # Python 2.3 fallback class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, o...
mit