repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
DimiterM/santander
functions.py
1
2185
import keras import tensorflow as tf import keras.backend as K K_VAL = 7 def bin_crossentropy_true_only(y_true, y_pred): return (1 + K.sum(y_pred, axis=-1)) * K.mean(K.binary_crossentropy(y_true * y_pred, y_true), axis=-1) # def tf_sparse_precision_at_k(y_true, y_pred): # y_true_labels = tf.transpose(tf.wh...
mit
gnieboer/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/kernel_tests/routing_function_op_test.py
102
2327
# 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
marinho/geraldo
site/newsite/django_1_0/django/contrib/comments/views/comments.py
12
19367
import base64 import datetime from django.core import validators from django import oldforms from django.core.mail import mail_admins, mail_managers from django.http import Http404 from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import render_to_response from django.template import RequestC...
lgpl-3.0
drzoidberg33/plexpy
lib/xmltodict.py
65
12585
#!/usr/bin/env python "Makes working with XML feel like you are working with JSON" from xml.parsers import expat from xml.sax.saxutils import XMLGenerator from xml.sax.xmlreader import AttributesImpl try: # pragma no cover from cStringIO import StringIO except ImportError: # pragma no cover try: from...
gpl-3.0
cvegaj/ElectriCERT
venv3/lib/python3.6/site-packages/pip/_vendor/ordereddict.py
1047
4094
# Copyright (c) 2009 Raymond Hettinger # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, merge, # publish,...
gpl-3.0
ChiefzReloaded/lge-kernel-startablet-new
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
183
3245
# Core.py - Python extension for perf trace, core functions # # 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. from collections import defaultdict def auto...
gpl-2.0
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/test/test_decorators.py
182
9828
import unittest from test import support def funcattrs(**kwds): def decorate(func): func.__dict__.update(kwds) return func return decorate class MiscDecorators (object): @staticmethod def author(name): def decorate(func): func.__dict__['author'] = name r...
apache-2.0
bmgee/cvxopt
examples/book/chap8/ellipsoids.py
3
7106
# Figures 8.3 and 8.4, pages 412 and 416. # Ellipsoidal approximations. from math import log, pi from cvxopt import blas, lapack, solvers, matrix, sqrt, mul, cos, sin #solvers.options['show_progress'] = False try: import pylab except ImportError: pylab_installed = False else: pylab_installed = True # Extreme points ...
gpl-3.0
jordanbtucker/dpapick
DPAPI/Core/registry.py
2
5624
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################# ## ## ## This file is part of DPAPIck ## ## Windows DPAPI decryption & forensic ...
gpl-3.0
jackrzhang/zulip
zerver/data_import/hipchat.py
1
27932
import base64 import dateutil import glob import logging import os import re import shutil import subprocess import ujson from typing import Any, Callable, Dict, List, Optional, Set from django.conf import settings from django.forms.models import model_to_dict from django.utils.timezone import now as timezone_now fr...
apache-2.0
AtomisCZ/chilligolf
node_modules/node-gyp/gyp/tools/pretty_vcproj.py
2637
9586
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
mit
xuxiao19910803/edx
common/djangoapps/monkey_patch/__init__.py
129
2808
""" Monkey-patch the edX platform Here be dragons (and simians!) * USE WITH CAUTION * No, but seriously, you probably never really want to make changes here. This module contains methods to monkey-patch [0] the edx-platform. Patches are to be applied as early as possible in the callstack (currently lms/startup.py and...
agpl-3.0
xkollar/spacewalk
projects/python-gzipstream/gzipstream.py
9
22720
"""GzipStream & GzipStreamXL Classes GzipStream (Python v1.5.2 - v2.2.*): A streaming gzip handler. gzipstream.GzipStream extends the functionality of the gzip.GzipFile class to allow the processing of streaming data. This is done by buffering the stream as it passes through (a seekable object is n...
gpl-2.0
TankCommander/pythonCode
gui.py
1
2023
# coding=utf-8 from Tkinter import * from game_logic.model.player import * from game_logic.model.match import * from game_logic.match_builder import * import math fenster = Tk() height = 400 width = 600 flaeche = Canvas(fenster, width=width, height=height) def zeichnen(): player1 = Player('A',None) player2 ...
gpl-2.0
byte-up/custom-filter-django-oscar
shop/catalogue/search_handlers.py
1
3343
from django.conf import settings from django.views.generic.list import MultipleObjectMixin from oscar.core.loading import get_class, get_model BrowseCategoryForm = get_class('search.forms', 'BrowseCategoryForm') SearchHandler = get_class('search.search_handlers', 'SearchHandler') is_solr_supported = get_class('search...
mit
hg42/Printrun
pronterface.py
4
2428
#!/usr/bin/env python3 # This file is part of the Printrun suite. # # Printrun 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. # # Pri...
gpl-3.0
catalyst/stacktask-tempest
stacktask_tempest_plugin/tests/scenario/test_signup.py
1
2420
from stacktask_tempest_plugin.tests import base from tempest.common import utils from tempest.lib import decorators from tempest.lib.common.utils import data_utils class StacktaskSignup(base.BaseStacktaskTest): credential_roles = ['admin'] @classmethod def resource_setup(cls): super(StacktaskSign...
apache-2.0
papados/ordersys
Lib/site-packages/django/contrib/admindocs/middleware.py
327
1197
from django.conf import settings from django import http class XViewMiddleware(object): """ Adds an X-View header to internal HEAD requests -- used by the documentation system. """ def process_view(self, request, view_func, view_args, view_kwargs): """ If the request method is HEAD and ...
unlicense
hbradleyiii/nwid
setup.py
1
1507
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=bad-whitespace,redefined-builtin """ nwid setup """ from codecs import open from setuptools import setup, find_packages from os import path from nwid import __version__ as version with open('README.rst', 'r', 'utf-8') as f: README = f.read() url...
mit
vialectrum/vialectrum
electrum_ltc/gui/kivy/uix/dialogs/qr_scanner.py
1
1161
from kivy.app import App from kivy.factory import Factory from kivy.lang import Builder Factory.register('QRScanner', module='electrum_ltc.gui.kivy.qr_scanner') class QrScannerDialog(Factory.AnimatedPopup): __events__ = ('on_complete', ) def on_symbols(self, instance, value): instance.stop() ...
mit
nparley/mylatitude
lib/google/auth/crypt/base.py
12
4210
# Copyright 2016 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 or agreed to in writing,...
mit
lythien/pokemongo
pokemongo_bot/walkers/step_walker.py
3
3557
from math import sqrt from random import uniform from pokemongo_bot.cell_workers.utils import distance from pokemongo_bot.human_behaviour import random_lat_long_delta, sleep, random_alt_delta class StepWalker(object): def __init__(self, bot, dest_lat, dest_lng, dest_alt = None): self.bot = bot se...
mit
mtougeron/python-openstacksdk
openstack/telemetry/v2/capability.py
3
1253
# 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 t...
apache-2.0
ezequielfreire007/proyectoIonic
mypiano/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
960
45344
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
catapult-project/catapult-csm
third_party/gsutil/third_party/boto/boto/dynamodb/batch.py
153
9810
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 ...
bsd-3-clause
leocomelli/ansible-modules-extras
packaging/os/portage.py
5
11100
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Yap Sok Ann # Written by Yap Sok Ann <sokann@gmail.com> # Based on apt module written by Matthew Williams <matthew@flowroute.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-3.0
eeshangarg/zulip
zproject/wsgi.py
6
1917
""" WSGI config for zulip project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
apache-2.0
bbenko/shinkicker
django/core/management/commands/flush.py
249
3437
from optparse import make_option from django.conf import settings from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS from django.core.management import call_command from django.core.management.base import NoArgsCommand, CommandError from django.core.management.color import no_style from d...
bsd-3-clause
pombredanne/django-tenant-schemas
tenant_schemas/utils.py
4
2757
from contextlib import contextmanager from django.conf import settings from django.db import connection try: from django.apps import apps get_model = apps.get_model except ImportError: from django.db.models.loading import get_model from django.core import mail @contextmanager def schema_context(schema_nam...
mit
apolloliu/ZCP
zcp/task/polling/mongodb_handler.py
1
7659
# Copyright 2017 EasyStack, Inc # Authors: Branty <jun.wang@easystack.cn> # # 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....
apache-2.0
Polyconseil/tornado
tornado/test/wsgi_test.py
180
3714
from __future__ import absolute_import, division, print_function, with_statement from wsgiref.validate import validator from tornado.escape import json_decode from tornado.test.httpserver_test import TypeCheckHandler from tornado.testing import AsyncHTTPTestCase from tornado.util import u from tornado.web import Reque...
apache-2.0
uas/mavlink
pymavlink/generator/mavgen.py
27
6271
#!/usr/bin/env python ''' parse a MAVLink protocol XML file and generate a python implementation Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import sys, textwrap, os from . import mavparse # XSD schema file schemaFile = os.path.join(os.path.dirname(os.path.realpath(__file__)), "mavs...
lgpl-3.0
Haleyo/spark-tk
regression-tests/exampletests/cumsum_doc_test.py
11
2530
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
yanchen036/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
mujiansu/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/toolmenu.py
17
7743
# toolmenu.py import win32ui import win32con import win32api import app import sys import string tools = {} idPos = 100 # The default items should no tools menu exist in the INI file. defaultToolMenuItems = [ ('Browser', 'win32ui.GetApp().OnViewBrowse(0,0)'), ('Browse PythonPath', 'from pywin.tools import br...
apache-2.0
ycaihua/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/distlib/manifest.py
367
13497
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re from . import DistlibEx...
lgpl-3.0
Ambuj-UF/ConCat-1.0
src/Utils/Bio/SearchIO/ExonerateIO/exonerate_vulgar.py
1
8213
# Copyright 2012 by Wibowo Arindrarto. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Bio.SearchIO parser for Exonerate vulgar output format.""" import sys # Add path to Bi...
gpl-2.0
Eloff/silvershell
client/silvershell/default_prefs.py
1
7115
# You can edit these settings and save them, they # will be applied immediately and remembered for next time. # This will reset the interpreter. # ******************************************************************************* # # If changing these settings makes the interpreter unrecoverable, you # # can...
bsd-3-clause
gaddman/ansible
lib/ansible/module_utils/facts/system/python.py
232
1999
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
ngonzalvez/sentry
src/sentry/migrations/0119_auto__add_field_projectkey_label.py
36
22691
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ProjectKey.label' db.add_column('sentry_projectkey', 'label', self.gf(...
bsd-3-clause
omprakasha/odoo
addons/website_blog/__init__.py
373
1036
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
ipcamit/ipcamit.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/plugin.py
365
1862
# -*- coding: utf-8 -*- """ pygments.plugin ~~~~~~~~~~~~~~~ Pygments setuptools plugin interface. The methods defined here also work if setuptools isn't installed but they just return nothing. lexer plugins:: [pygments.lexers] yourlexer = yourmodule:YourLexer formatter pl...
mit
android-ia/platform_external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
25
17290
# 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. import logging import os import pipes import re import subprocess import sys import time from telemetry.core import exceptions from telemetry.core import fo...
bsd-3-clause
xiaxia47/Python-learning
async_package/sock_sample.py
1
1529
# _*_ coding:utf-8 _*_ __author__ = 'Sheldon' __date__ = '2019/2/21 20:29' import socket from datetime import datetime from concurrent import futures from multiprocessing import Pool import os def blocking_way(): sock = socket.socket() # blocking sock.connect(('example.com', 80)) request = 'GET / HTTP...
gpl-3.0
postlund/home-assistant
tests/components/counter/common.py
24
1035
"""Collection of helper methods. All containing methods are legacy helpers that should not be used by new components. Instead call the service directly. """ from homeassistant.components.counter import ( DOMAIN, SERVICE_DECREMENT, SERVICE_INCREMENT, SERVICE_RESET, ) from homeassistant.const import ATTR...
apache-2.0
rpmoseley/pyisam
utils/pip-update.py
1
2361
''' This program will update all those packages consider by pip to outdated. It makes the assumption that those package that are wheels do not cause breakage of other packages already installed. ''' from distutils.version import LooseVersion from subprocess import check_output, check_call import re test_pip_output = '...
gpl-3.0
crosswalk-project/chromium-crosswalk-efl
tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
25
17290
# 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. import logging import os import pipes import re import subprocess import sys import time from telemetry.core import exceptions from telemetry.core import fo...
bsd-3-clause
m-lab/mlab-metrics-api
metrics_computation_system/worker.py
2
18673
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
angelrca/dealii
contrib/utilities/wrapcomments.py
8
17572
#!/usr/bin/python ## --------------------------------------------------------------------- ## ## Copyright (C) 2016 by the deal.II authors ## ## This file is part of the deal.II library. ## ## The deal.II library is free software; you can use it, redistribute ## it, and/or modify it under the terms of the GNU Lesser G...
lgpl-2.1
al1221/ghost-openshift
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/style.py
270
3743
# -*- coding: utf-8 -*- """ pygments.style ~~~~~~~~~~~~~~ Basic style object. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.token import Token, STANDARD_TYPES class StyleMeta(type): def __new__(mcs, name, bases,...
mit
wilmoz/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_client.py
442
44484
#!/usr/bin/env python # # Copyright 2011, 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...
mpl-2.0
willingc/oh-mainline
vendor/packages/Django/django/contrib/localflavor/mk/forms.py
109
3594
from __future__ import absolute_import, unicode_literals import datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.mk.mk_choices im...
agpl-3.0
chronicwaffle/PokemonGo-DesktopMap
app/pywin/Lib/encodings/cp1251.py
593
13617
""" Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.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,in...
mit
pawkoz/dyplom
blender/release/scripts/startup/bl_ui/properties_data_metaball.py
5
4123
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 version. # # This program is distrib...
gpl-2.0
gitromand/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
117
39195
# Copyright (c) 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # Copyright (c) 2010 Research In Motion Limited. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are...
bsd-3-clause
nagius/cxm
tests/vm_test.py
1
3230
#!/usr/bin/env python # -*- coding:Utf-8 -*- # cxm - Clustered Xen Management API and tools # Copyleft 2010-2012 - Nicolas AGIUS <nicolas.agius@lps-it.fr> ########################################################################### # # This file is part of cxm. # # cxm is free software: you can redistribute it and/or ...
gpl-3.0
vmindru/ansible
lib/ansible/plugins/action/service.py
23
3498
# (c) 2015, Ansible Inc, # # 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 di...
gpl-3.0
justyns/home-assistant
homeassistant/components/device_tracker/tomato.py
12
4676
""" Support for Tomato routers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.tomato/ """ import json import logging import re import threading from datetime import timedelta import requests from homeassistant.components.device_tracker ...
mit
FrogLogics/mget
build/lib.linux-x86_64-2.7/Mget/mget.py
6
7775
#!/usr/bin/env python3 import time import os, sys from .utils import * from .downloader import * from .extractor import * class MGetDL(FileDownloader): def __init__(self, opts, info): super(MGetDL, self).__init__(info) if opts.verbose: common.debug_info(info) self.info = info self.params = opts self.defur...
gpl-2.0
Xbalien/Mobile-Security-Framework-MobSF
DynamicAnalyzer/tools/pyWebProxy/socket_wrapper.py
37
4249
#!/usr/bin/env python ''' owtf is an OWASP+PTES-focused try to unite great tools & facilitate pentesting Copyright (c) 2013, Abraham Aranguren <name.surname@gmail.com> http://7-a.org All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the f...
gpl-3.0
matlongsi/micropay
qa/rpc-tests/p2p-mempool.py
45
3287
#!/usr/bin/env python3 # Copyright (c) 2015-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. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from...
mit
j-mracek/dnf
doc/examples/list_obsoletes_plugin.py
4
3462
# Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be u...
gpl-2.0
shanemcd/ansible
lib/ansible/modules/network/f5/bigip_snmp.py
16
8025
#!/usr/bin/python # # Copyright 2017 F5 Networks Inc. # # 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 lat...
gpl-3.0
Grumbel/rfactortools
gtr2-to-gsc2013.py
1
1698
#!/usr/bin/env python3 # GTR2 to GSC2013 converter # Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
gpl-3.0
prisae/pelican-plugins
pdf/pdf.py
24
3984
# -*- coding: utf-8 -*- ''' PDF Generator ------- The pdf plugin generates PDF files from reStructuredText and Markdown sources. ''' from __future__ import unicode_literals, print_function from io import open from pelican import signals from pelican.generators import Generator from pelican.readers import MarkdownRea...
agpl-3.0
willingc/oh-mainline
vendor/packages/whoosh/src/whoosh/qparser/dateparse.py
21
32746
# Copyright 2010 Matt Chaput. 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 list of conditions and the...
agpl-3.0
shizhai/wprobe
build_dir/host/u-boot-2013.07-rc1/tools/buildman/buildman.py
32
4642
#!/usr/bin/python # # Copyright (c) 2012 The Chromium OS Authors. # # See file CREDITS for list of people who contributed to this # project. # # 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; eit...
gpl-2.0
bamueh/dark-matter
bin/convert-diamond-to-json.py
3
1584
#!/usr/bin/env python import argparse import bz2file import sys from dark.diamond.conversion import DiamondTabularFormatReader if __name__ == '__main__': parser = argparse.ArgumentParser( description='Convert DIAMOND tabular output to JSON.', epilog=('Give a DIAMOND tabular file and convert it ...
mit
zedr/django
django/contrib/auth/tests/test_handlers.py
88
2999
from __future__ import unicode_literals from django.contrib.auth.handlers.modwsgi import check_password, groups_for_user from django.contrib.auth.models import User, Group from django.contrib.auth.tests.custom_user import CustomUser from django.contrib.auth.tests.utils import skipIfCustomUser from django.test import T...
bsd-3-clause
mochio326/SiShelf
Contents/scripts/sishelf/multi_edit.py
1
11199
# -*- coding: utf-8 -*- from .vendor.Qt import QtCore, QtGui, QtWidgets from . import lib from . import button import sys # from __future__ import absolute_import, division, print_function SORT_ROLE = QtCore.Qt.UserRole + 1 class Column(object): u"""カラム情報""" def __init__(self, index, value): self.va...
mit
binhqnguyen/lena
src/mpi/bindings/modulegen__gcc_LP64.py
10
192255
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
CiscoUcs/Ironic-UCS
build/lib.linux-x86_64-2.7/ironic/openstack/common/versionutils.py
8
6438
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
nash-x/hws
nova/service.py
1
16741
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
mgadi/naemonbox
sources/psdash/pyzmq-13.1.0/perf/local_lat.py
3
2046
# # Copyright (c) 2007-2010 iMatix Corporation # # This file is part of 0MQ. # # 0MQ is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your opti...
gpl-2.0
erikr/django
tests/template_tests/syntax_tests/test_spaceless.py
521
1766
from django.test import SimpleTestCase from ..utils import setup class SpacelessTagTests(SimpleTestCase): @setup({'spaceless01': "{% spaceless %} <b> <i> text </i> </b> {% endspaceless %}"}) def test_spaceless01(self): output = self.engine.render_to_string('spaceless01') self.assertEqu...
bsd-3-clause
hiroakis/ansible
lib/ansible/module_utils/openstack.py
198
4502
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
huazhisong/graduate_text
src/contrib_cnn/data_helper.py
2
2520
#!/usr/lib/env python # -*- code:utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import csv import numpy as np import pandas as pd from sklearn.preprocessing import LabelBinarizer from tensorflow.contrib import learn...
agpl-3.0
pentestfail/TA-Github
bin/ta_github/solnlib/packages/requests/packages/urllib3/filepost.py
713
2320
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_b...
mit
nitzmahone/ansible
lib/ansible/plugins/inventory/virtualbox.py
15
9742
# Copyright (c) 2017 Ansible Project # 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 DOCUMENTATION = ''' name: virtualbox plugin_type: inventory short_description: virtualbo...
gpl-3.0
omprakasha/odoo
addons/website_blog/wizard/document_page_show_diff.py
372
2184
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
vmahuli/tempest
tempest/api/compute/v3/admin/test_hypervisor_negative.py
4
4759
# Copyright 2013 Huawei Technologies Co.,LTD. # 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 # # Unl...
apache-2.0
pedro2d10/SickRage-FR
lib/sqlalchemy/dialects/postgresql/ranges.py
79
4805
# Copyright (C) 2013-2014 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 .base import ischema_names from ... import types as sqltypes __all__ = ('INT4RANGE', 'INT8RANGE', ...
gpl-3.0
jmerkow/VTK
Filters/Texture/Testing/Python/triangularTCoords.py
20
1976
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() def GetRGBColor(colorName): ''' Return the red, green and blue components for a color as doubles. ''' rgb = [0.0, 0.0, 0.0] # black vtk.vtkNamedColors...
bsd-3-clause
vakaras/nmadb-session
src/nmadb_session/models.py
1
5752
from django.db import models from django.utils.translation import ugettext_lazy as _ from nmadb_academics.models import Academic, Section from nmadb_contacts.models import Human class Session(models.Model): """ Information about session. """ SESSION_TYPE = ( (u'Wi', _(u'winter'),), ...
lgpl-3.0
wmde/do-index
debug_toolbar/utils/sqlparse/sql.py
12
16742
# -*- coding: utf-8 -*- """This module contains classes representing syntactical elements of SQL.""" import re from debug_toolbar.utils.sqlparse import tokens as T class Token(object): """Base class for all other classes in this module. It represents a single token and has two instance attributes: ``v...
gpl-3.0
enjaz/enjaz
niqati/migrations/0002_add_categories.py
2
1163
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def add_categories(apps, schema_editor): Category = apps.get_model('niqati', 'Category') # We are going to add categories only if none already exists. if not Category.objects.exists(): Category...
agpl-3.0
PokeHunterProject/pogom-updated
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/UseItemCaptureMessage_pb2.py
15
3621
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/UseItemCaptureMessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _me...
mit
zack3241/incubator-airflow
tests/utils/test_dates.py
7
2088
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
JamesClough/networkx
networkx/algorithms/components/tests/test_attracting.py
53
2023
#!/usr/bin/env python from nose.tools import * import networkx as nx from networkx import NetworkXNotImplemented class TestAttractingComponents(object): def setUp(self): self.G1 = nx.DiGraph() self.G1.add_edges_from([(5, 11), (11, 2), (11, 9), (11, 10), (7, 11), (7,...
bsd-3-clause
jjyycchh/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/ordered_dict.py
131
2984
# Copyright (c) 2009 Raymond Hettinger. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, ...
bsd-3-clause
NeuralEnsemble/NeuroTools
src/datastore/keygenerators.py
3
1817
""" Key generators for data store objects """ import hashlib import pickle import sys import os.path def full_type(component): """Returns a string representing the full type of the component.""" if component.__class__.__name__ == 'module': # component is a module if component.__name__ == "__main__": ...
gpl-2.0
z0rr0/t34.me
handlers/t34base.py
1
5333
#!/usr/bin/env python3 #-*- coding: utf-8 -*- """ Base MongoDB classes """ from handlers.settings import LOGGER, DB from pymongo import MongoReplicaSetClient, MongoClient from pymongo.errors import OperationFailure, ConnectionFailure from pymongo.read_preferences import ReadPreference from pymongo.ssl_support import s...
agpl-3.0
nlalevee/spark
python/pyspark/ml/tests.py
3
100846
# -*- 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 License, Version 2.0 # (the "L...
apache-2.0
glatard/nipype
nipype/interfaces/diffusion_toolkit/base.py
15
1311
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The dtk module provides basic functions for interfacing with Diffusion Toolkit tools. Currently these tools are supported: * TODO Examples -------- See the docstrings for the individual classes fo...
bsd-3-clause
RexFuzzle/sfepy
sfepy/discrete/fem/poly_spaces.py
1
30611
import numpy as nm import numpy.linalg as nla from sfepy.base.base import find_subclasses, assert_, Struct from sfepy.linalg import combine, insert_strided_axis # Requires fixed vertex numbering! vertex_maps = {3 : [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]...
bsd-3-clause
grap/stock-logistics-workflow
__unported__/stock_obsolete/__openerp__.py
19
1967
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joël Grand-Guillaume, Matthieu Dietrich # Copyright 2008-2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
agpl-3.0
michaelMinar/limbo
limbo/slackclient/_server.py
8
4189
from ._slackrequest import SlackRequest from ._channel import Channel from ._user import User from ._util import SearchList from websocket import create_connection import json class Server(object): def __init__(self, token, connect=True): self.token = token self.username = None self.domai...
mit
caotianwei/django
tests/model_inheritance_regress/models.py
243
5863
from __future__ import unicode_literals import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Meta: ...
bsd-3-clause
tamasgal/km3pipe
km3pipe/io/hdf5.py
1
37296
# Filename: hdf5.py # pylint: disable=C0103,R0903,C901 # vim:set ts=4 sts=4 sw=4 et: """ Read and write KM3NeT-formatted HDF5 files. """ from collections import OrderedDict, defaultdict, namedtuple from functools import singledispatch import os.path import warnings from uuid import uuid4 import numpy as np import ta...
mit
Radiotechniman/Anorak
lib/web/contrib/template.py
100
3449
""" Interface to various templating engines. """ import os.path __all__ = [ "render_cheetah", "render_genshi", "render_mako", "cache", ] class render_cheetah: """Rendering interface to Cheetah Templates. Example: render = render_cheetah('templates') render.hello(name="cheetah") ...
gpl-3.0