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
ville-k/tensorflow
tensorflow/python/ops/metrics_impl.py
17
130758
# 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
ericholscher/django-kong
kong/utils.py
1
2860
import datetime import StringIO import sys from django.conf import settings from django.core.mail import mail_managers, mail_admins from django.template.loader import render_to_string from django.contrib.sites.models import Site from twill.parse import execute_string from twill.errors import TwillAssertionError def ...
mit
hilaskis/UAV_MissionPlanner
Lib/encodings/mac_cyrillic.py
593
13710
""" Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.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...
gpl-2.0
dna2github/dna2sevord
computer/algorithm/py/treap.py
1
3552
import random class Node(object): val = None pri = 0 parent = None left = None right = None size = 0 def __init__(self, val): self.val = val self.size = 1 self.pri = random.random() def rotate(self): if not self.parent: return p = self.parent gp = self.pare...
gpl-3.0
ninemoreminutes/lmiapi
lmiapi/public.py
1
4461
# Python import json import logging import os # Requests import requests from requests.structures import CaseInsensitiveDict __all__ = [] logger = logging.getLogger('lmiapi.public') class LogMeInPublicAPIBase(object): API_ROOT = None def __init__(self, creds): assert self.API_ROOT self.cr...
bsd-3-clause
kjw0106/boto
tests/integration/route53/test_zone.py
100
7729
# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # Copyright (c) 2012 42 Lines Inc., Jim Browne # # 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 re...
mit
alessiobrozzi/firefox-ios
Client/Assets/Search/scrape_plugins.py
24
7909
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from lxml import html from lxml import etree import copy import json import os import requests im...
mpl-2.0
lmyrefelt/CouchPotatoServer
libs/requests/structures.py
67
3576
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
gpl-3.0
COCS4950G7/COSC4950
Source/Network/GUI_WX_Demo4.py
1
214742
__author__ = 'chris hamm' #GUI_WX_Demo4 #NOTICE: #======================================= #Main Section Header #======================================= #--------------------------------------- #Sub Section Header #--------------------------------------- #....................................... #Secondary Sub Section ...
gpl-3.0
Kagami/kisa
lib/twisted/protocols/dict.py
60
10727
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Dict client protocol implementation. @author: Pavel Pergamenshchik """ from twisted.protocols import basic from twisted.internet import defer, protocol from twisted.python import log from StringIO import StringIO def parseParam(line): ...
cc0-1.0
smurfix/aio-py-amqp
t/unit/test_utils.py
1
2091
from __future__ import absolute_import, unicode_literals from case import Mock, patch from amqp.utils import (NullHandler, bytes_to_str, coro, get_errno, get_logger, str_to_bytes) class test_get_errno: def test_has_attr(self): exc = KeyError('foo') exc.errno = 23 ...
lgpl-2.1
bacaldwell/ironic
ironic/conf/inspector.py
1
1247
# Copyright 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 required by applicable law or agreed to in wri...
apache-2.0
pydsigner/lof-tmwa-client-data
tools/minimap-render.py
1
5665
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import os import subprocess import tempfile import re CLIENT_DATA_ROOT = os.path.realpath( os.path.join( os.path.dirname(__file__), u'..', ) ) class MinimapRenderer(object): MAP_RE = re.compile(r'^\d{3}-\d{1}(\.tmx)?$') PROGRAMS ...
gpl-2.0
munkiat/libcloud
libcloud/common/azure.py
7
6577
# 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 ...
apache-2.0
nycholas/ask-undrgz
src/ask-undrgz/django/core/mail/__init__.py
20
4777
""" Tools for sending email. """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the int...
bsd-3-clause
pongem/python-bot-project
appengine/standard/taskqueue/counter/worker.py
9
1335
# Copyright 2016 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
mawentao007/financial_management
project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
912
3325
# Copyright (c) 2011 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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
apache-2.0
teto/ns-3-dev-git
src/lte/test/examples-to-run.py
4
4190
#! /usr/bin/env python3 # -*- coding: utf-8 -*- ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). #...
gpl-2.0
GuillaumeGomez/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/abort_handshake_wsh.py
465
1781
# Copyright 2012, 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 f...
mpl-2.0
smartforceplus/SmartForceplus
addons/account_cancel/__openerp__.py
261
1621
# -*- 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
robweber/maraschino
lib/werkzeug/testsuite/datastructures.py
76
19939
# -*- coding: utf-8 -*- """ werkzeug.testsuite.datastructures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the functionality of the provided Werkzeug datastructures. TODO: - FileMultiDict - convert to proper asserts - Immutable types undertested - Split up dict tests :copy...
mit
gltn/stdm
stdm/ui/wizard/code_property.py
1
17413
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : code_property Description : Set properties for Lookup data type Date : 09/February/2017 copyright : (C) 2017 by UN-Habitat and implementing partners. ...
gpl-2.0
tobegit3hub/shadowsocks
tests/test.py
26
2032
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import signal import select import time from subprocess import Popen, PIPE sys.path.insert(0, './') if sys.argv[-3] == '-c': client_config = sys.argv[-1] server_config = sys.argv[-2] elif sys.argv[-2] == '-c': client_config = sys.argv[-1] ...
mit
NMGRL/pychron
pychron/spectrometer/graph/marker_overlay.py
2
3454
# =============================================================================== # Copyright 2014 Jake Ross # # 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...
apache-2.0
sklnet/openhdf-enigma2
lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
21
4679
from Plugins.Plugin import PluginDescriptor from GraphMultiEpg import GraphMultiEPG from Screens.ChannelSelection import BouquetSelector from enigma import eServiceCenter, eServiceReference from ServiceReference import ServiceReference from Screens.Screen import Screen from Components.ActionMap import ActionMap from Co...
gpl-2.0
minhphung171093/GreenERP_V7
openerp/addons/note/tests/__init__.py
159
1105
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY 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
abacuspix/NFV_project
Mastering Flask_Code Bundle/Chapter_13/webapp/tasks.py
7
1908
import smtplib import datetime from email.mime.text import MIMEText from flask import render_template from flask_mail import Message from webapp.extensions import celery, mail from webapp.models import Reminder, Post @celery.task() def log(msg): return msg @celery.task() def multiply(x, y): return x * y ...
mit
motion2015/edx-platform
common/djangoapps/student/tests/test_userstanding.py
106
3869
""" These are tests for disabling and enabling student accounts, and for making sure that students with disabled accounts are unable to access the courseware. """ import unittest from student.tests.factories import UserFactory, UserStandingFactory from student.models import UserStanding from django.conf import setting...
agpl-3.0
infoxchange/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/se.py
88
6442
# -*- coding: utf-8 -*- from django.contrib.localflavor.se.forms import (SECountySelect, SEOrganisationNumberField, SEPersonalIdentityNumberField, SEPostalCodeField) import datetime from utils import LocalFlavorTestCase class SELocalFlavorTests(LocalFlavorTestCase): def setUp(self): # Mocking da...
gpl-3.0
habibmasuro/distance.io
node_modules/newrelic/node_modules/bunyan/tools/cutarelease.py
171
22043
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2012 Trent Mick """cutarelease -- Cut a release of your project. A script that will help cut a release for a git-based project that follows a few conventions. It'll update your changelog (CHANGES.md), add a git tag, push those changes, update your ver...
mit
admire93/youtube-dl
youtube_dl/extractor/flickr.py
98
2832
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_request from ..utils import ( ExtractorError, find_xpath_attr, ) class FlickrIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.|secure\.)?flickr\.com/photos/(?P<uploader_id>[\w\-_@]+)/...
unlicense
robhudson/django
django/db/models/deletion.py
105
14193
from collections import Counter, OrderedDict from itertools import chain from operator import attrgetter from django.db import IntegrityError, connections, transaction from django.db.models import signals, sql from django.utils import six class ProtectedError(IntegrityError): def __init__(self, msg, protected_ob...
bsd-3-clause
mmnelemane/neutron
neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py
7
13757
# Copyright 2014 Mellanox Technologies, Ltd # # 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 t...
apache-2.0
jamison904/MK2_Stock_kernel
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
ibmmark/fabric
bddtests/peer/admin_pb2_grpc.py
17
4495
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 import peer.admin_pb2 as peer_dot_admin__pb2 cl...
apache-2.0
alexmogavero/home-assistant
homeassistant/components/sensor/amcrest.py
4
5034
""" This component provides HA sensor support for Amcrest IP cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.amcrest/ """ from datetime import timedelta import logging import voluptuous as vol import homeassistant.helpers.config_validatio...
apache-2.0
ChristophKirst/ClearMapUnstable
ClearMap/Analysis/Tools/Extrapolate.py
2
2174
# -*- coding: utf-8 -*- """ Method to extend interpolation objects to constantly / linearly extrapolate. """ #:copyright: Copyright 2015 by Christoph Kirst, The Rockefeller University, New York City #:license: GNU, see LICENSE.txt for details. import scipy.interpolate from numpy import array def extrap1d(x, y, int...
gpl-3.0
ajclarkson/entrydns-updater
entrydns-updater.py
1
2491
#!/usr/bin/python ''' entrydns-updater.py ~ ajclarkson.co.uk Updater for Dynamic DNS on EntryDNS Domains Performs an update for each given domain access token in the hosts.json file. ''' import json from urllib2 import urlopen import requests import os from time import strftime SCRIPT_PATH = os.path.dirname(os.path.r...
mit
dbaxa/django
tests/template_tests/filter_tests/test_rjust.py
521
1030
from django.template.defaultfilters import rjust from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class RjustTests(SimpleTestCase): @setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'}) def test_rju...
bsd-3-clause
StefanRijnhart/odoo
addons/product/wizard/product_price.py
380
2254
# -*- 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
cwilling/oiio
src/python/iconvert.py
9
9390
#!/usr/bin/env python # Parse the options the user provided from the command line def option_parser(): parser = OptionParser() parser.add_option("-v", action="store_true", dest="verbose", default=False) parser.add_option("--inplace", action="store_true", dest="inplace", default=False) parser.add_option(...
bsd-3-clause
keisuke-umezawa/chainer
tests/chainer_tests/functions_tests/array_tests/test_squeeze.py
8
3111
import unittest import numpy from chainer.backends import cuda from chainer import functions from chainer import testing from chainer.testing import attr from chainer.utils import type_check @testing.inject_backend_tests( None, # CPU tests [ {}, ] # GPU tests + testing.product({ ...
mit
wangdeshui/zulip
zerver/views/__init__.py
41
108563
from __future__ import absolute_import from django.conf import settings from django.contrib.auth import authenticate, login, get_backends from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponseForbidden, HttpRespo...
apache-2.0
normanmaurer/AutobahnTestSuite
autobahntestsuite/autobahntestsuite/case/case9_3_5.py
14
1253
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
apache-2.0
trondhindenes/ansible
lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py
8
25858
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_userstring.py
36
4847
# UserString is a wrapper around the native builtin string type. # UserString instances should behave similar to builtin string objects. import string from test import test_support, string_tests from UserString import UserString, MutableString import warnings class UserStringTest( string_tests.CommonTest, str...
gpl-2.0
wbsoft/frescobaldi
frescobaldi_app/portmidi/pm_ctypes.py
4
7674
# This script embeds the PortMidi Portable MIDI library via ctypes. # It is based on Grant Yoshida's 2007 version with some updates from # Christopher Arndt from 2009 with some bugs fixed and restructured a bit. import os import sys from ctypes import (CDLL, CFUNCTYPE, POINTER, Structure, byref, c_char_p, c_int3...
gpl-2.0
sunu/oppia
core/domain/stats_services_test.py
14
15384
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
highweb-project/highweb-webcl-html5spec
tools/grit/grit/gather/tr_html_unittest.py
60
22159
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit tests for grit.gather.tr_html''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path.d...
bsd-3-clause
kseppi/mrs-mapreduce
mrs/tasks.py
4
11524
# Mrs # Copyright 2008-2012 Brigham Young University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
nathanial/lettuce
tests/integration/lib/Django-1.3/django/conf/locale/nn/formats.py
685
1657
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FOR...
gpl-3.0
msimacek/freeipa
ipaserver/advise/base.py
3
8095
# Authors: Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2013 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 version ...
gpl-3.0
sorgerlab/OMERO.forms
release.py
1
4133
from __future__ import print_function import os import json from subprocess import check_call import git import requests from datetime import datetime def read_file(path, fname, content_type=None): p = os.path.join(path, fname) with open(p) as f: if content_type in ("json",): data = json.l...
agpl-3.0
gangadhar-kadam/laganfrappe
frappe/website/statics.py
7
5670
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, os, time, sys from frappe.utils import update_progress_bar def sync_statics(rebuild=False): s = sync() s.verbose = True while True: s.start(rebuild) fra...
mit
Cinntax/home-assistant
homeassistant/components/ciscospark/notify.py
2
1609
"""Cisco Spark platform for notify component.""" import logging import voluptuous as vol from homeassistant.const import CONF_TOKEN import homeassistant.helpers.config_validation as cv from homeassistant.components.notify import ( ATTR_TITLE, PLATFORM_SCHEMA, BaseNotificationService, ) _LOGGER = logging...
apache-2.0
lipingxue/docker-volume-vsphere
esx_service/utils/auth_data.py
4
55440
# Copyright 2016 VMware, 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
boyuegame/kbengine
kbe/src/lib/python/Lib/test/test_shlex.py
113
5912
import io import shlex import string import unittest from test import support # The original test data set was from shellwords, by Hartmut Goebel. data = r"""x|x| foo bar|foo|bar| foo bar|foo|bar| foo bar |foo|bar| foo bar bla fasel|foo|bar|bla|fasel| x y z xxxx|x|y|z|xxxx| \x bar|\|x|bar| ...
lgpl-3.0
binarydud/django-oscar
src/oscar/test/factories/offer.py
23
1385
import factory from oscar.core.loading import get_model __all__ = [ 'RangeFactory', 'ConditionFactory', 'BenefitFactory', 'ConditionalOfferFactory', ] class RangeFactory(factory.DjangoModelFactory): name = factory.Sequence(lambda n: 'Range %d' % n) slug = factory.Sequence(lambda n: 'range-%d' % n) ...
bsd-3-clause
vovojh/gem5
src/arch/x86/isa/insts/general_purpose/input_output/string_io.py
89
4418
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
hiei23/servo
tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/_stream_hixie75.py
681
8842
# 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 of conditions and the f...
mpl-2.0
procangroup/edx-platform
lms/djangoapps/django_comment_client/utils.py
2
41556
import json import logging from collections import defaultdict from datetime import datetime from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import connection from django.http import HttpResponse from pytz import UTC from opaque_k...
agpl-3.0
bigswitch/nova
nova/scheduler/filters/availability_zone_filter.py
19
2127
# Copyright (c) 2011-2012 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 # # Un...
apache-2.0
kcpawan/django
tests/auth_tests/test_auth_backends.py
200
23799
from __future__ import unicode_literals from datetime import date from django.contrib.auth import ( BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user, ) from django.contrib.auth.backends import ModelBackend from django.contrib.auth.hashers import MD5PasswordHasher from django.contrib.auth.models import Ano...
bsd-3-clause
ilo10/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
127
37672
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import warnings import numpy as np from sklearn import datasets from sklearn.base import clone from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble.grad...
bsd-3-clause
gaumire/heroku-buildpack-python
vendor/pip-pop/pip/_vendor/requests/packages/urllib3/connectionpool.py
477
30319
import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full import Queue as _ # Platform-specific: Windows fr...
mit
jerome-nexedi/dream
dream/simulation/OrderDecomposition.py
5
16797
# =========================================================================== # Copyright 2013 University of Limerick # # This file is part of DREAM. # # DREAM 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 Founda...
gpl-3.0
rvanlaar/easy-transifex
src/transifex/transifex/resources/migrations/0022_auto__add_field_rlstats_reviewed.py
2
17769
# encoding: 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 'RLStats.reviewed' db.add_column('resources_rlstats', 'reviewed', self.gf('django.db.models...
bsd-2-clause
hgdeoro/pilas
ejemplos/interfaz_base.py
6
3028
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'interfaz.ui' # # Created: Fri Apr 18 01:14:00 2014 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attri...
lgpl-3.0
pajowu/scripts
jugendhackt_project_extract/jugendhackt_project_extract.py
1
1802
import re, requests, json from bs4 import BeautifulSoup, NavigableString locs = {"18" :"Berlin", "40" :"Nord", "16" :"Ost", "17" :"Süd", "39" :"West"} bas = {'design': 'Bestes Design', 'world': 'Mit Code die Welt verbessern', 'audience': 'Publikumspreis', 'code': 'Bester Code...
agpl-3.0
Krossom/python-for-android
python3-alpha/python3-src/Lib/test/test_sched.py
49
2584
#!/usr/bin/env python import sched import time import unittest from test import support class TestCase(unittest.TestCase): def test_enter(self): l = [] fun = lambda x: l.append(x) scheduler = sched.scheduler(time.time, time.sleep) for x in [0.05, 0.04, 0.03, 0.02, 0.01]: ...
apache-2.0
giggsey/SickRage
tornado/test/options_test.py
77
8086
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, with_statement import datetime import os import sys from tornado.options import OptionParser, Error from tornado.util import basestring_type from tornado.test.util import unittest try: from cStringIO import StringIO # pyth...
gpl-3.0
Innovahn/cybex
openerp/tools/graph.py
441
26118
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
Ziftr/litecoin
contrib/testgen/gen_base58_test_vectors.py
1064
4344
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
mit
dhermes/gcloud-python
bigquery/google/cloud/bigquery/dataset.py
2
22649
# Copyright 2015 Google LLC # # 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, s...
apache-2.0
jouk0/robotframework-selenium2library
test/resources/testserver/testserver.py
10
3546
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/336012 import SimpleHTTPServer import BaseHTTPServer import httplib import os class StoppableHttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): """http request handler with QUIT stopping the server""" def do_QUIT(self): """send 20...
apache-2.0
mitocw/edx-platform
lms/djangoapps/verify_student/tests/test_integration.py
4
2481
""" Integration tests of the payment flow, including course mode selection. """ import six from django.urls import reverse from course_modes.tests.factories import CourseModeFactory from student.models import CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils...
agpl-3.0
otron/zenodo
zenodo/legacy/utils/migrate_newcollection_tree.py
2
2588
# -*- coding: utf-8 -*- # ## This file is part of Zenodo. ## Copyright (C) 2012, 2013 CERN. ## ## Zenodo 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...
gpl-3.0
kzmkv/SumatraPDF
scripts/build-release.py
1
8550
""" Builds a (pre)release build of SumatraPDF, including the installer, and optionally uploads it to s3. """ import os import os.path import shutil import sys import time import re from util import log, run_cmd_throw, test_for_flag, s3UploadFilePublic from util import s3UploadDataPublic, ensure_s3_doesnt_exist, ensur...
gpl-3.0
Houzz/annoy2
setup.py
1
2366
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2013 Spotify AB # # 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 requi...
apache-2.0
SBillion/timetableasy
src/Settings.py
1
3189
import gtk from db import db from Timetableasy import app # Themes planning_themes = { 'db' : { 'pepper' : 0, 'default' : 1, 'blue' : 2, 'eggplant' : 3, 'lightness' : 4, 'mint' : 5, }, 'db_inv': { 0 : 'pepper', 1 : 'default', 2 : 'blue', 3 : ...
agpl-3.0
ondra-novak/blink
Tools/Scripts/webkitpy/common/host.py
24
7242
# Copyright (c) 2010 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
bsd-3-clause
iw3hxn/LibrERP
data_migration/product.py
1
1150
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2015 Didotech srl (info at didotech.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 Sof...
agpl-3.0
AwesomeLemon/api-extraction
Roslyn_Extract_Methods/seq2seqtest.py
1
5026
import string import numpy as np import keras # import seq2seq # from seq2seq.models import Seq2Seq import seq2seq import modelscopy import operator from keras.models import Sequential from keras.layers.embeddings import Embedding from keras.preprocessing import sequence def main(): max_eng_len = 20 max_api...
mit
github4ry/ashes
tests/comp_helpers.py
3
2629
from __future__ import unicode_literals from .core import AshesTest heading = 'comparator helpers' class eq_const(AshesTest): template = '{@eq key="blue" value="blue"}Blue{/eq}, the color of her eyes.' json_context = '{}' rendered = 'Blue, the color of her eyes.' class ne_const(AshesTest): templat...
bsd-3-clause
edmorley/django
tests/template_tests/syntax_tests/test_cycle.py
79
6974
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class CycleTagTests(SimpleTestCase): @setup({'cycle01': '{% cycle a %}'}) def test_cycle01(self): with self.assertRaises(TemplateSyntaxError): self.engine.get_template('cycle0...
bsd-3-clause
rogthedodge/redux
source/create_DB.py
1
3151
#!/usr/bin/python import time import psycopg2 from os.path import dirname from get_config import config from import_campaigns import import_campaigns from import_members import import_members from import_users import import_users def create_tables(): """ create tables in the PostgreSQL database""" commands =...
mit
victor-prado/broker-manager
environment/lib/python3.5/site-packages/pandas/tests/frame/test_alter_axes.py
7
26538
# -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime, timedelta import numpy as np from pandas.compat import lrange from pandas import (DataFrame, Series, Index, MultiIndex, RangeIndex) import pandas as pd from pandas.util.testing import (assert_series_equ...
mit
Workday/OpenFrame
tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/cloudtrail/test_cert_verification.py
122
1517
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the right...
bsd-3-clause
alxgu/ansible
test/units/modules/storage/netapp/test_na_ontap_unix_user.py
43
11306
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test template for ONTAP Ansible module ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch, Mock from ans...
gpl-3.0
mjg59/python-tss
setup.py
4
1759
#!/usr/bin/env python """ pytss is a python language wrapper for the Tspi library provided by the TrouSerS project. libtspi is a library for interfacing with a TPM services daemon. Author: Matthew Garrett (matthew.garrett@nebula.com) Copyright 2013 Nebula, Inc Licensed under the Apache License, Version 2.0 (the "Lic...
apache-2.0
atombrella/django-rest-framework
tests/test_htmlrenderer.py
7
6188
from __future__ import unicode_literals import django.template.loader import pytest from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.http import Http404 from django.template import Template, TemplateDoesNotExist from django.test import TestCase, ove...
bsd-2-clause
sanguinariojoe/FreeCAD
src/Mod/Fem/femcommands/manager.py
12
14131
# *************************************************************************** # * Copyright (c) 2015 Przemo Fiszt <przemo@firszt.eu> * # * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * Th...
lgpl-2.1
servo/servo
tests/wpt/web-platform-tests/worklets/resources/referrer-checker.py
20
1167
# Returns a valid response when request's |referrer| matches # |expected_referrer|. def main(request, response): # We want |referrer| to be the referrer header with no query params, # because |expected_referrer| will not contain any query params, and # thus cannot be compared with the actual referrer header...
mpl-2.0
spaceof7/QGIS
python/plugins/processing/algs/gdal/ogr2ogr.py
8
3709
# -*- coding: utf-8 -*- """ *************************************************************************** ogr2ogr.py --------------------- Date : November 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************************...
gpl-2.0
jaja14/lab4
lib/werkzeug/testsuite/datastructures.py
97
27488
# -*- coding: utf-8 -*- """ werkzeug.testsuite.datastructures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the functionality of the provided Werkzeug datastructures. TODO: - FileMultiDict - Immutable types undertested - Split up dict tests :copyright: (c) 2013 by Armin Ronacher....
apache-2.0
Endika/c2c-rd-addons
picking_invoice_rel/__openerp__.py
4
2031
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Ferdinand Gassauer (ChriCar Beteiligungs- und Beratungs- GmbH) # # WARNING: This program as such is intended to be us...
agpl-3.0
codekaki/odoo
openerp/tools/float_utils.py
312
10296
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
PongPi/isl-odoo
addons/l10n_cr/__init__.py
438
2045
# -*- encoding: utf-8 -*- ############################################################################## # # __init__.py # l10n_cr_account # First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.) # Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved....
agpl-3.0
dpausp/arguments
src/ekklesia_portal/concepts/proposition/proposition_cells.py
1
19222
import urllib.parse import math from operator import attrgetter from secrets import compare_digest import colander from ekklesia_common.cell import Cell from functools import cached_property from eliot import log_call from sqlalchemy import func from ekklesia_portal.app import App from ekklesia_portal.concepts.argume...
agpl-3.0
gcode-mirror/audacity
lib-src/lv2/lv2/waflib/Tools/msvc.py
70
27831
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys,re,tempfile from waflib import Utils,Task,Logs,Options,Errors from waflib.Logs import debug,warn from waflib.TaskGen import after_method,feature from waflib.Conf...
gpl-2.0