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 |
|---|---|---|---|---|---|
annarev/tensorflow | tensorflow/python/keras/distribute/keras_rnn_model_correctness_test.py | 4 | 5523 | # Copyright 2019 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 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_3_0/infra_device_broker.py | 16 | 210714 | from ..broker import Broker
class InfraDeviceBroker(Broker):
controller = "infra_devices"
def index(self, **kwargs):
"""Lists the available infra devices. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is... | apache-2.0 |
balister/gnuradio | gr-qtgui/examples/pyqt_waterfall_c.py | 38 | 6535 | #!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
mysee1989/parallel-ssh | psshlib/cli.py | 58 | 4364 | # Copyright (c) 2009-2012, Andrew McNabb
# Copyright (c) 2003-2008, Brent N. Chun
import optparse
import os
import shlex
import sys
import textwrap
from psshlib import version
_DEFAULT_PARALLELISM = 32
_DEFAULT_TIMEOUT = 0 # "infinity" by default
def common_parser():
"""
Create a basic OptionParser wit... | bsd-3-clause |
saadbinakhlaq/django-oscar | oscar/apps/customer/migrations/0003_auto__add_productalert.py | 16 | 19453 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
depends_on = (
('catalogue', '0001_initial'),
)
def forwards(self, orm... | bsd-3-clause |
maestrano/openerp | openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py | 90 | 13231 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
IRI-Research/django | django/contrib/gis/db/backends/postgis/introspection.py | 12 | 4610 | from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection
from django.contrib.gis.gdal import OGRGeomType
class GeoIntrospectionError(Exception):
pass
class PostGISIntrospection(DatabaseIntrospection):
# Reverse dictionary for PostGIS geometry types not populated until
# int... | bsd-3-clause |
qiuzhong/crosswalk-test-suite | webapi/tct-jsenhance-html5-tests/inst.wgt.py | 372 | 6809 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
maxziv/SEApp | server/lib/werkzeug/test.py | 77 | 32616 | # -*- coding: utf-8 -*-
"""
werkzeug.test
~~~~~~~~~~~~~
This module implements a client to WSGI applications for testing.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sys
import urlparse
import mimetypes
from time ... | apache-2.0 |
sjperkins/tensorflow | tensorflow/examples/learn/random_forest_mnist.py | 73 | 4030 | # 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 appl... | apache-2.0 |
mrramazani/mysql-replicant-python-1 | lib/tests/test_commands.py | 2 | 4096 | # Copyright (c) 2010, Mats Kindahl, Charles Bell, and Lars Thalmann
# All rights reserved.
#
# Use of this source code is goverened by a BSD licence that can be
# found in the LICENCE file.
import sys
import os.path
here = os.path.dirname(os.path.abspath(__file__))
rootpath = os.path.split(here)[0]
sys.path.append(roo... | bsd-3-clause |
Antiun/odoomrp-wip | stock_move_purchase_price/__openerp__.py | 27 | 1368 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of th... | agpl-3.0 |
maciek263/django2 | myvenv/Lib/site-packages/django/contrib/admin/templatetags/admin_modify.py | 139 | 2353 | from django import template
register = template.Library()
@register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and i... | mit |
10clouds/edx-platform | lms/djangoapps/verify_student/views.py | 1 | 66191 | """
Views for the verification flow
"""
import datetime
import decimal
import json
import logging
import urllib
from pytz import UTC
from ipware.ip import get_ip
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.core.urlresolv... | agpl-3.0 |
cedrichu/kernel_tcp_stack | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
pcolmant/repanier | repanier/views/unsubscribe_view.py | 1 | 1150 | from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_protect
from repanier.models.customer import Customer
from repanier.tools import get_repanier_template_name
@csrf_protect
@never_cache
d... | gpl-3.0 |
gregdek/ansible | lib/ansible/modules/network/junos/junos_lldp_interface.py | 29 | 4865 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
rodorad/spark-tk | integration-tests/tests/test_frame_take.py | 14 | 3764 | # 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 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_0_0/iprg_broker.py | 17 | 54667 | from ..broker import Broker
class IprgBroker(Broker):
controller = "iprgs"
def show(self, **kwargs):
"""Shows the details for the specified iprg.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ... | apache-2.0 |
subhrm/google-code-jam-solutions | solutions/2013/Q/A/A.py | 1 | 1485 | # 2013-Q-A : Tic-Tac-Toe-Tomek
def check_row(row):
if "." not in row:
s = list(set(row))
if len(s) == 1:
return "{} won".format(s[0])
elif ("T" in s) and (len(s) == 2):
for c in s:
if c != "T":
return "{} won".format(s[0])
re... | mit |
etuna-SBF-kog/Stadsparken | env/lib/python2.7/site-packages/django/contrib/sitemaps/tests/base.py | 87 | 1028 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.test import TestCase
class SitemapTestsBase(TestCase):
protocol = 'http'
domain = 'example.com' if Site._meta.installed else 'testserver'
urls = 'django.contrib.... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-65/16-files/sheets/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.py | 1107 | 28025 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | gpl-3.0 |
intersense/stencil-overlapped-tiling-ics | scripts/utils.py | 2 | 10594 | #
# Support routines for experiment harness
#
import os
import subprocess
import sys
import time
try:
import yaml
except:
print('Please install PyYAML')
sys.exit(1)
def _parse_range(value):
if isinstance(value, int):
return [value]
elif len(value) == 3:
return range(value[0], valu... | mit |
doantranhoang/namebench | nb_third_party/dns/rdtypes/ANY/GPOS.py | 248 | 5304 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
nikhil9/QGC | libs/mavlink/share/pyshared/pymavlink/examples/magtest.py | 30 | 3949 | #!/usr/bin/env python
'''
rotate APMs on bench to test magnetometers
'''
import sys, os, time
from math import radians
# allow import from the parent directory, where mavlink.py is
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
import mavlink, mavutil
from optparse import Opti... | agpl-3.0 |
BeiLuoShiMen/nupic | tests/integration/nupic/opf/opf_checkpoint_test/opf_checkpoint_test.py | 23 | 16466 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | agpl-3.0 |
jazkarta/edx-platform | lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py | 114 | 8621 | # -*- 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 'OrderItem.fulfilled_time'
db.add_column('shoppingcart_orderitem', 'fulfilled_time',
... | agpl-3.0 |
google/mirandum | alerts/youtubesubs/support.py | 1 | 2287 | # 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 applica... | apache-2.0 |
blinktrade/bitex | apps/ws_gateway/rest_api_handler.py | 10 | 2993 | import tornado.web
import tornado.httpclient
import calendar
import json
from market_data_helper import MarketDataSubscriber
class RestApiHandler(tornado.web.RequestHandler):
def head(self, version, symbol, resource):
self._process_request(version, symbol, resource)
def get(self, version, symbol, res... | gpl-3.0 |
redhat-cip/tempest | tempest/tests/common/test_cred_provider.py | 22 | 5191 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
nuxleus/cherokee-webserver | admin/wizards/static.py | 3 | 4262 | # -*- coding: utf-8 -*-
#
# Cherokee-admin's Common Static wizard
#
# Authors:
# Taher Shihadeh <taher@octality.com>
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2010 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 o... | gpl-2.0 |
ScottehMax/pyMon | chathandler.py | 1 | 10364 | from threading import Thread
from Queue import Queue
from itertools import groupby
import time
import os
import imp
import inspect
import logging
import redis
import concurrent.futures as futures
from utils import condense
class ChatHandler:
"""Deals with most of the chat messages."""
def __init__(self, cb... | mit |
lulandco/SickRage | lib/hachoir_parser/audio/midi.py | 84 | 9168 | """
Musical Instrument Digital Interface (MIDI) audio file parser.
Documentation:
- Standard MIDI File Format, Dustin Caldwell (downloaded on wotsit.org)
Author: Victor Stinner
Creation: 27 december 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, Bits, ParserError,
String, U... | gpl-3.0 |
rapidpro/tracpro | tracpro/orgs_ext/views.py | 1 | 4725 | from __future__ import absolute_import, unicode_literals
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from dash.orgs.views import OrgCRUDL, InferOrgMixin,... | bsd-3-clause |
asimonet/website | reveal.js/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | cc0-1.0 |
kisna72/django | tests/fixtures/models.py | 128 | 3287 | """
Fixtures.
Fixtures are a way of loading data into the database in bulk. Fixure data
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, or in one of the directories named in the
``FIX... | bsd-3-clause |
Debian/openjfx | modules/web/src/main/native/Tools/Scripts/webkitpy/replay/main.py | 2 | 5264 | # Copyright (C) 2011 Google Inc. All rights reserved.
# Copyright (C) 2014 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:
#
# 1. Redistributions of source code must retain the above c... | gpl-2.0 |
yujikato/DIRAC | src/DIRAC/RequestManagementSystem/Service/test/OperationHandlerBaseTests.py | 2 | 2636 | ########################################################################
# $HeadURL $
# File: OperationHandlerBaseTests.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/03/25 08:09:08
########################################################################
""" :mod: OperationHandlerBaseTests
==============... | gpl-3.0 |
StackStorm/mistral | mistral/tests/unit/utils/test_inspect_utils.py | 1 | 2068 | # Copyright 2014 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
wangxinxi/litecoin | test/functional/import-rescan.py | 10 | 8952 | #!/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.
"""Test wallet import RPCs.
Test rescan behavior of importaddress, importpubkey, importprivkey, and
impor... | mit |
roxyboy/scikit-learn | sklearn/linear_model/stochastic_gradient.py | 130 | 50966 | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import scipy.sparse as sp
from abc import ABCMeta, abstractmethod
from ... | bsd-3-clause |
drawks/ansible | lib/ansible/modules/network/avi/avi_webhook.py | 28 | 3928 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
DIRACGrid/DIRAC | src/DIRAC/ResourceStatusSystem/Utilities/RssConfiguration.py | 2 | 3285 | """
:mod: RssConfiguration
Module that collects utility functions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = '$Id$'
from DIRAC import S_OK
from DIRAC.Core.Utilities import List
from DIRAC.ConfigurationSystem.Client.Helpers.Operations... | gpl-3.0 |
miipl-naveen/optibizz | addons/account_analytic_default/account_analytic_default.py | 57 | 9022 | # -*- 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 GN... | agpl-3.0 |
cloudspaces/eyeos-u1db | APISync/APISync.py | 1 | 12160 | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from settings import settings
from mongodb import mongoDb
import time
from urlparse import urlparse
import json
import sys, os
class RequestHandler(BaseHTTPRequestHandler):
def __init__(self, *args, **kwargs):
self.comments = mongoDb("localhost"... | agpl-3.0 |
rowemoore/odoo | addons/sale_crm/__openerp__.py | 260 | 2036 | # -*- 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 |
x303597316/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/admindocs/tests/test_fields.py | 111 | 1192 | from __future__ import absolute_import, unicode_literals
from django.contrib.admindocs import views
from django.db import models
from django.db.models import fields
from django.utils import unittest
from django.utils.translation import ugettext as _
class CustomField(models.Field):
description = "A custom field ... | apache-2.0 |
Open365/Open365 | lib/EyeosApps/EyeosApps.py | 1 | 4242 | import json
import re
from lib.EyeosApps.EyeosAppsStorage import EyeosAppsStorage
from lib.EyeosApps.EyeosAppsJsonValidator import EyeosAppsJsonValidator
from lib.EyeosApi.Application import Application
from lib.Settings import Settings
from lib.Wrappers.Logger import Logger
from lib.Errors.EyeosAPIError import EyeosA... | agpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Demo/classes/Rev.py | 47 | 2052 | '''
A class which presents the reverse of a sequence without duplicating it.
From: "Steven D. Majewski" <sdm7g@elvis.med.virginia.edu>
It works on mutable or inmutable sequences.
>>> chars = list(Rev('Hello World!'))
>>> print ''.join(chars)
!dlroW olleH
The .forw is so you can use anonymous sequences in __init__, a... | mit |
c7zero/chipsec | chipsec/helper/efi/__init__.py | 9 | 1143 | #CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#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; Version 2.
#
#This program is distributed in the hope... | gpl-2.0 |
piem/aubio | python/demos/demo_bench_yin.py | 4 | 1767 | #! /usr/bin/env python
import numpy as np
from aubio import pitch
import pylab as plt
buf_size = 2048 * 1
hop_size = buf_size // 4
samplerate = 44100
minfreq = 40
maxfreq = 6000
def sinewave(freq, duration, samplerate = samplerate):
""" generate a sinewave """
length = hop_size
while length < duration *... | gpl-3.0 |
salivatears/ansible | contrib/inventory/windows_azure.py | 119 | 11306 | #!/usr/bin/env python
'''
Windows Azure external inventory script
=======================================
Generates inventory that Ansible can understand by making API request to
Windows Azure using the azure python library.
NOTE: This script assumes Ansible is being executed where azure is already
installed.
p... | gpl-3.0 |
interactiveinstitute/watthappened | python_modules/http_parser/pyparser.py | 1 | 14254 | # -*- coding: utf-8 -
#
# This file is part of http-parser released under the MIT license.
# See the NOTICE for more information.
import os
import re
import sys
if sys.version_info >= (3,):
import urllib.parse as urlparse
else:
import urlparse
import zlib
from http_parser.util import (b, bytes_to_str, IOrde... | mit |
emmuchira/kps_erp | erpnext/setup/install.py | 9 | 2238 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe import _
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
from frappe.custom.doctype.c... | gpl-3.0 |
aszlig/LastWatch | lastwatch.py | 1 | 19341 | #!/usr/bin/env python
# This is LastWatch, a last.fm scrobbler which uses inotify to detect
# the songs played by the audio player of your choice :-)
#
# Copyright (c) 2008 aszlig <"^[0-9]+$"@redmoonstudios.de>
#
# LastWatch is free software: you can redistribute it and/or modify
# it under the terms of the GNU General... | gpl-3.0 |
lakshmi-kannan/st2 | st2common/st2common/transport/reactor.py | 9 | 4006 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
redhat-openstack/cinder | cinder/tests/utils.py | 6 | 4261 | # Copyright 2011 OpenStack Foundation
#
# 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 l... | apache-2.0 |
RalfJung/dudel | dudel/__init__.py | 1 | 1320 | from raven.contrib.flask import Sentry
from flask import Flask
from flask.ext.babel import Babel
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.markdown import Markdown
from flask.ext.login import LoginManager
from flask.ext.gravatar import Gravatar
from flask.ext.migrate import Migrate, MigrateCommand
from... | gpl-3.0 |
hectord/lettuce | tests/integration/lib/Django-1.2.5/django/conf/locale/sr_Latn/formats.py | 136 | 1702 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.m.Y.'
SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'
FIRST_DAY_OF_WEEK = 1
D... | gpl-3.0 |
CedricVallee/pythonFinancialAnalyst | FinancialAnalystV3/4.fitModels/Fitter.py | 1 | 1447 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 12 2016
Author: Cedric Vallee
"""
import pandas as pd
from sklearn.cross_validation import train_test_split
from sklearn.metrics import classification_report
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import... | mit |
gvpeek/django_football | django_football/django_football/urls.py | 1 | 1148 | from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
import core.views
import leagues.views
import teams.views
import stats.views
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpat... | mit |
fedora-conary/conary | conary_test/cvctest/usergrouptest.py | 2 | 19583 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 |
patriciolobos/desa8 | openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py | 384 | 8450 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
denkab/FrameworkBenchmarks | frameworks/Python/AsyncIO/yocto_http/hello/endpoints/world.py | 53 | 1234 | import logging
import asyncio
import ujson
from ..services import queries_number
from ..services.world import get_random_record, get_random_records, update_random_records, get_fortunes
from ..services import redis
LOG = logging.getLogger(__name__)
@asyncio.coroutine
def db(request):
"""Test type 2: Single databa... | bsd-3-clause |
kawamon/hue | desktop/libs/libzookeeper/src/libzookeeper/conf.py | 2 | 2261 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
wzhfy/spark | examples/src/main/python/mllib/gradient_boosting_regression_example.py | 27 | 2404 | #
# 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 |
Manojkumar91/odoo_inresto | addons/website_mail/models/mail_message.py | 7 | 4677 | # -*- 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 |
ftzm/muscleup | django/muscleup/urls.py | 1 | 4708 | """muscleup URL Configuration
The `urlpatterns` list routes URLs to api_views. For more info please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function api_views
1. Add an import: from my_app import api_views
2. Add a URL to urlpatterns: url(r'^$', api_views.home, name='home')... | gpl-3.0 |
jumpstarter-io/nova | nova/keymgr/key.py | 156 | 2587 | # Copyright (c) 2013 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/... | apache-2.0 |
OpenDroneMap/WebODM | app/tests/test_api_admin.py | 1 | 8467 | from django.contrib.auth.models import User, Group
from rest_framework import status
from rest_framework.test import APIClient
from rest_framework_jwt.settings import api_settings
from django.contrib.auth.hashers import check_password
from .classes import BootTestCase
from app.api.admin import UserSerializer, GroupSer... | mpl-2.0 |
fighterlyt/bite-project | server/models/storage.py | 17 | 8299 | # Copyright 2011 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 |
sumpfgottheit/pdu1800_data_provider | pygame32/pygame/tests/_dummymovietest.py | 11 | 4007 | #################################### IMPORTS ###################################
from __future__ import generators
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests... | mit |
dpyro/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_treeadapters.py | 451 | 1852 | from __future__ import absolute_import, division, unicode_literals
from . import support # flake8: noqa
import html5lib
from html5lib.treeadapters import sax
from html5lib.treewalkers import getTreeWalker
def test_to_sax():
handler = support.TracingSaxHandler()
tree = html5lib.parse("""<html xml:lang="en">... | mpl-2.0 |
romain-li/edx-platform | lms/djangoapps/instructor/features/data_download.py | 17 | 3724 | """
Define steps for instructor dashboard - data download tab
acceptance tests.
"""
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from nose.tools import assert_in, assert_regexp_matches
from terrain.steps import reload_the_page
from django.utils import http... | agpl-3.0 |
luisitobarcito/mini-DNN | Solvers.py | 1 | 7066 | """
DNN is a little python module to demonstrate
the basic elements of a deep neural network
in action.
"""
import numpy as np
import matplotlib.pyplot as plt
from pointwise_activations import func_list
from loss_functions import loss_list
class Solver(object):
"""
Solver object contains the method employ... | mit |
QianBIG/odoo | addons/account_analytic_plans/wizard/__init__.py | 445 | 1117 | # -*- 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 |
facaiy/spark | examples/src/main/python/mllib/naive_bayes_example.py | 106 | 2285 | #
# 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 |
mozilla/rna | rna/utils.py | 2 | 1891 | import json
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from .models import Note, Release
def get_last_modified_date(*args, **kwargs):
"""Returns the date of the last modified Note or Release.
For use with Django's last_modified decorator.
"""
try:
... | mpl-2.0 |
dhruv13J/scikit-learn | benchmarks/bench_plot_nmf.py | 206 | 5890 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... | bsd-3-clause |
omni5cience/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/query.py | 32 | 4938 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.constants import ALL_TERMS
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion ... | mit |
Unow/edx-platform | lms/djangoapps/courseware/management/commands/clean_xml.py | 30 | 4219 | import lxml.etree
import os
import sys
import traceback
from fs.osfs import OSFS
from path import path
from django.core.management.base import BaseCommand
from xmodule.modulestore.xml import XMLModuleStore
def traverse_tree(course):
'''Load every descriptor in course. Return bool success value.'''
queue =... | agpl-3.0 |
kingvuplus/test | lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py | 98 | 3312 | from Plugins.Extensions.CutListEditor.ui import CutListEditor
from Components.ServiceEventTracker import ServiceEventTracker
from enigma import iPlayableService, iServiceInformation
from Tools.Directories import fileExists
class TitleCutter(CutListEditor):
def __init__(self, session, t):
CutListEditor.__init__(self... | gpl-2.0 |
wschwa/Mr-Orange-Sick-Beard | lib/guessit/transfo/post_process.py | 2 | 2416 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt 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 ... | gpl-3.0 |
johnfrenchxyz/508-checklist | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
TheApacheCats/yum | yum/sqlutils.py | 10 | 6422 | #!/usr/bin/python -tt
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License
# as published by the Free Software Foundation
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | gpl-2.0 |
keisuke-umezawa/chainer | chainerx_cc/examples/imagenet_py/train_imagenet.py | 7 | 5221 | #!/usr/bin/env python
"""Example code of learning a large scale convnet from ILSVRC2012 dataset.
Prerequisite: To run this example, crop the center of ILSVRC2012 training and
validation images, scale them to 256x256 and convert them to RGB, and make
two lists of space-separated CSV whose first column is full path to i... | mit |
ragnarstroberg/imsrg | src/pybind11/tests/test_pytypes.py | 4 | 5777 | import pytest
import sys
from pybind11_tests import pytypes as m
from pybind11_tests import debug_enabled
def test_list(capture, doc):
with capture:
l = m.get_list()
assert l == ["overwritten"]
l.append("value2")
m.print_list(l)
assert capture.unordered == """
Entry a... | gpl-2.0 |
flavour/Turkey | modules/unit_tests/s3/s3navigation.py | 17 | 6912 | # -*- coding: utf-8 -*-
#
# S3Navigation Unit Tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3navigation.py
#
import unittest
from s3 import S3NavigationItem as M
class SelectTests(unittest.TestCase):
""" Tests for S3NavigationItem selection/deselection... | mit |
jiivan/genoomy | genoome/genoome/settings/production.py | 1 | 3466 | """Production settings and globals."""
from __future__ import absolute_import
from os import environ
from .base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
def get_en... | mit |
HeinleinSupport/check_mk | netifaces/web/plugins/wato/check_parameters_netifaces_rbl.py | 1 | 1118 | #!/usr/bin/env python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
register_check_parameters(
subgroup_applications,
"netifaces_rbl",
_("RBL"),
Dictionary(
title = _("List of RBLs to check against"),
help = _('The check <tt>netifaces.rbl</tt> monitors IP addresses of the host against ... | gpl-2.0 |
smartforceplus/SmartForceplus | addons/board/board.py | 70 | 6623 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
sarantapichos/faircoop-market | addons/website_hr_recruitment/controllers/main.py | 170 | 5916 | # -*- coding: utf-8 -*-
import base64
from openerp import SUPERUSER_ID
from openerp import http
from openerp.tools.translate import _
from openerp.http import request
from openerp.addons.website.models.website import slug
class website_hr_recruitment(http.Controller):
@http.route([
'/jobs',
'/job... | agpl-3.0 |
chyyuu/distorm | python/distorm3/sample.py | 36 | 1845 | # Mario Vilas, http://breakingcode.wordpress.com
# Licensed Under GPLv3
# Example code
import distorm3
import sys
import optparse
# Parse the command line arguments
usage = 'Usage: %prog [--b16 | --b32 | --b64] filename [offset]'
parser = optparse.OptionParser(usage=usage)
parser.add_option( '--b16', h... | gpl-3.0 |
coto/beecoss | bp_includes/external/pytz/gae.py | 74 | 3068 | """
A pytz version that runs smoothly on Google App Engine.
Based on http://appengine-cookbook.appspot.com/recipe/caching-pytz-helper/
To use, add pytz to your path normally, but import it from the gae module:
from pytz.gae import pytz
Applied patches:
- The zoneinfo dir is removed fr... | lgpl-3.0 |
farjump/gnu-binutils | gdb/testsuite/gdb.perf/disassemble.py | 46 | 1514 | # Copyright (C) 2013-2015 Free Software Foundation, Inc.
# 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
# (at your option) any later version.
#
# This progr... | gpl-2.0 |
pratapvardhan/pandas | pandas/core/base.py | 1 | 41615 | """
Base and utility classes for pandas objects.
"""
import warnings
import textwrap
from pandas import compat
from pandas.compat import builtins
import numpy as np
from pandas.core.dtypes.missing import isna
from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries, ABCIndexClass
from pandas.core.dtypes.common i... | bsd-3-clause |
MIPS/external-chromium_org | third_party/closure_linter/closure_linter/requireprovidesorter.py | 137 | 9826 | #!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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
#... | bsd-3-clause |
wainersm/buildbot | worker/buildbot_worker/test/unit/test_scripts_runner.py | 9 | 14700 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
jhaux/tensorflow | tensorflow/contrib/keras/python/keras/layers/core.py | 14 | 27677 | # 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 |
lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_ds.py | 109 | 11098 | import os
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
from django.utils import unittest
from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, O... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.