repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
e1ven/Waymoot | refs/heads/master | libs/tornado-2.2/build/lib/tornado/test/runtests.py | 9 | #!/usr/bin/env python
import unittest
TEST_MODULES = [
'tornado.httputil.doctests',
'tornado.iostream.doctests',
'tornado.util.doctests',
'tornado.test.auth_test',
'tornado.test.curl_httpclient_test',
'tornado.test.escape_test',
'tornado.test.gen_test',
'tornado.test.httpclient_test',
... |
kidmaple/CoolWall | refs/heads/nios2 | user/python/Tools/scripts/cvsfiles.py | 3 | #! /usr/bin/env python
"""Print a list of files that are mentioned in CVS directories.
Usage: cvsfiles.py [-n file] [directory] ...
If the '-n file' option is given, only files under CVS that are newer
than the given file are printed; by default, all files under CVS are
printed. As a special case, if a file does no... |
mferenca/HMS-ecommerce | refs/heads/HMSecommerce | ecommerce/extensions/api/v2/tests/views/test_payments.py | 1 | import json
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.test import override_settings
from waffle.models import Switch
from ecommerce.core.models import SiteConfiguration
from ecommerce.extensions.payment.tests.processors import DummyPr... |
bakhtout/odoo-educ | refs/heads/8.0 | addons/website_hr/__init__.py | 3964 | import controllers
import models
|
Cojacfar/Maker | refs/heads/master | comm/lib/python2.7/site-packages/pip/commands/show.py | 344 | import os
from pip.basecommand import Command
from pip.log import logger
from pip._vendor import pkg_resources
class ShowCommand(Command):
"""Show information about one or more installed packages."""
name = 'show'
usage = """
%prog [options] <package> ..."""
summary = 'Show information about in... |
meabsence/python-for-android | refs/heads/master | python3-alpha/python3-src/android-scripts/say_chat.py | 46 | __author__ = "Brian Lenihan <brian.lenihan@gmail.com"
__copyright__ = "Copyright (c) 2012 Python for Android Project"
__license__ = "Apache License, Version 2.0"
import logging
import android
from pyxmpp2.jid import JID
from pyxmpp2.client import Client
from pyxmpp2.settings import XMPPSettings
from pyxmpp2.interface... |
kfwang/Glance-OVA-OVF | refs/heads/ovf | glance/tests/unit/common/test_wsgi.py | 3 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2014 IBM Corp.
# 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/license... |
julien-sobczak/sonarqube | refs/heads/master | it/it-projects/plugins/project/src/python/directory/file_in_directory.py | 12 | lst = []
|
softintouch/python-youtrack-api | refs/heads/master | sit_youtrack/googleCode/chromium.py | 1 | # mapping for chromium google code project
import googleCode
print "Use chromium mapping scheme"
#
#googleCode.STATES = {
# 'Assigned' : 'Open',
# 'Available' : 'Fixed',
# 'Fixed' : 'Fixed',
# 'ExternalDependency' : 'Open',
# 'Started' ... |
ywcui1990/nupic | refs/heads/master | src/nupic/data/aggregator.py | 10 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
dnozay/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/contenttypes/models.py | 307 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up ContentType objects all over the place.
# This cache is shared by all the get_for_* methods.
_cache ... |
ezequielfreire007/proyectoIonic | refs/heads/master | myqr/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | # Copyright (c) 2014 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... |
jhuapl-marti/marti | refs/heads/master | crits/samples/views.py | 1 | import json
from django import forms
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from crits.core import for... |
ostcar/OpenSlides | refs/heads/master | server/openslides/motions/migrations/0011_motion_version_4.py | 5 | # Generated by Django 2.1 on 2018-08-31 13:17
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
"""Cleanup 2"""
dependencies = [("motions", "0011_motion_version_3")]
operations = [
# Cleanup from last migration. Somehow cannot be do... |
SatoshiNXSimudrone/sl4a-damon-clone | refs/heads/master | python/src/Lib/idlelib/CallTips.py | 50 | """CallTips.py - An IDLE Extension to Jog Your Memory
Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import re
import sys
import types
import CallTipWindow
... |
supercollider-quarks/quarks-git-subtree | refs/heads/master | NB/console.py | 2 | from AppKit import NSApplication
from nodebox import graphics
from nodebox import util
class NodeBoxRunner(object):
def __init__(self):
# Force NSApp initialisation.
NSApplication.sharedApplication().activateIgnoringOtherApps_(0)
self.namespace = {}
self.canvas = graphics.Canv... |
fw1121/zulip | refs/heads/master | analytics/management/commands/client_activity.py | 115 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.models import UserActivity, UserProfile, Realm, \
get_realm, get_user_profile_by_email
import datetime
class Command(BaseCommand):
help = """Report rough client activity ... |
anitzkin/opencog | refs/heads/master | opencog/python/learning/incremental_learner/__init__.py | 34 | __author__ = 'raminbarati'
|
chiragjogi/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py | 293 | #########################################################################
#
# 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... |
Kubuxu/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/actions/generated-header/action.py | 258 | #!/usr/bin/env python
# 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 os
import sys
outfile = sys.argv[1]
open(outfile, 'w').write('const char kFoo[] = "%s";' % sys.argv[2])
|
t794104/ansible | refs/heads/devel | lib/ansible/modules/database/proxysql/proxysql_global_variables.py | 52 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = '''
---
module: proxysql_global_variables
... |
scsibug/sensor-event-log | refs/heads/master | sensor_publishers/record_smart_data.py | 1 | #!/usr/bin/python
# Read smart data from a disk, and publish data to server
import sys, os, re, time, argparse
import hmac, hashlib
import json, decimal
import urllib2
from subprocess import check_output
# Before running, create monitors for each of the following:
###disk.SERIAL_NUMBER.read_errors (count)
###disk.SE... |
coala/coala | refs/heads/master | coalib/bearlib/languages/definitions/Ruby.py | 14 | from coalib.bearlib.languages.Language import Language
@Language
class Ruby:
pass
|
EvaSDK/sqlalchemy | refs/heads/master | lib/sqlalchemy/testing/entities.py | 81 | # testing/entities.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sqlalchemy as sa
from sqlalchemy import exc as sa_exc
_repr_stack = set(... |
yanchen036/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/learn_io/generator_io_test.py | 47 | # 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... |
msgctl/netaidkit | refs/heads/trunk | scripts/change_rootpwd.py | 2 | #!/usr/bin/env python2
from getpass import *
from random import *
from string import *
from sys import *
from passlib.hash import md5_crypt
if len(argv) > 1:
password = argv[1]
else:
password = getpass('Enter a new root password: ')
passconf = getpass('Confirm password: ')
if password != passco... |
ilastikdev/ilastik | refs/heads/master | ilastik/workflows/examples/thresholdMasking/thresholdMaskingWorkflow.py | 4 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... |
codexns/sublime-coverage | refs/heads/master | st2_osx_x64/coverage/xmlreport.py | 16 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""XML reporting for coverage.py"""
import os
import sys
import time
import xml.dom.minidom
from coverage import __url__, __version__, files
from coverage.report ... |
nicememory/pie | refs/heads/master | pyglet/tests/extlibs/future/py2/socketserver/__init__.py | 54 | from __future__ import absolute_import
import sys
if sys.version_info[0] < 3:
from SocketServer import *
else:
raise ImportError('This package should not be accessible on Python 3. '
'Either you are trying to run from the python-future src folder '
'or your installat... |
saurabh6790/medsyn-app | refs/heads/master | patches/march_2013/p10_update_against_expense_account.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
def execute():
import webnotes
from webnotes import get_obj
pi_list = webnotes.conn.sql("""select name from `tabPurchase Invoice`
where docstatus = 1 and ifnull(against_expense_accoun... |
steveklabnik/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/mockParser.py | 452 | from __future__ import absolute_import, division, unicode_literals
import sys
import os
if __name__ == '__main__':
# Allow us to import from the src directory
os.chdir(os.path.split(os.path.abspath(__file__))[0])
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
from html5lib.tokenizer ... |
trudikampfschaf/flask-microblog | refs/heads/master | flask/lib/python2.7/site-packages/flup/server/ajp.py | 19 | # Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com>
# 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 lis... |
DepthDeluxe/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_vxlan_tunnel.py | 46 | #!/usr/bin/python
#
# 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 distribut... |
lordmos/blink | refs/heads/master | Tools/Scripts/webkitpy/common/editdistance.py | 138 | # Copyright (c) 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 ... |
diagramsoftware/sale-workflow | refs/heads/8.0 | sale_automatic_workflow/automatic_workflow_job.py | 24 | # -*- coding: utf-8 -*-
###############################################################################
#
# sale_automatic_workflow for OpenERP
# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
# Copyright 2013 Camptocamp SA (Guewen Baconnier)
#
# This program is free software: you ... |
beni55/networkx | refs/heads/master | networkx/algorithms/tests/test_triads.py | 59 | # test_triads.py - unit tests for the triads module
#
# Copyright 2015 NetworkX developers.
# Copyright 2009 Diederik van Liere <diederik.vanliere@rotman.utoronto.ca>.
#
# This file is part of NetworkX.
#
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
# information.
"""Unit tests for the :mod:`... |
romankagan/DDBWorkbench | refs/heads/master | python/testData/fillParagraph/comment_after.py | 83 | # my new string blah blah blah ;j;dsjv sd;fj;dsjf;ds js;djgf ;jsg s;dgj; sjd;gj sd;gj ;sjg;j asdl j;sjdg; jasdgl
# j;sldjg ;jsd;gj
# my new string blah blah blah ;j;dsjv sd;fj;dsjf;ds js;djgf ;jsg s;dgj; sjd;gj sd;gj ;sjg;j asdl j;sjdg; jasdgl j;sldjg ;jsd;gj |
philschatz/rhaptos2.repo | refs/heads/master | rhaptos2/repo/tests/check_dependencies.py | 1 | #!/usr/bin/env python
#! -*- coding: utf-8 -*-
###
# Copyright (c) Rice University 2012
# This software is subject to
# the provisions of the GNU Lesser General
# Public License Version 2.1 (LGPL).
# See LICENCE.txt for details.
###
import sys
# Simple python version test ... |
mzdaniel/pycon | refs/heads/2012 | pycon_project/apps/symposion/schedule/templatetags/schedule_tags.py | 5 | from __future__ import with_statement
from django import template
from symposion.schedule.cache import db, cache_key, cache_key_user
register = template.Library()
class ScheduleCacheNode(template.Node):
@classmethod
def handle_token(cls, parser, token):
nodelist = parser.parse(("endschedule_c... |
infoxchange/django-localflavor | refs/heads/master | localflavor/dk/dk_municipalities.py | 10 | # coding: utf-8
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
#: A list of municipalities in the Danish region Hovedstaden
#: as `choices` in a formfield.
REGION_HOVEDSTADEN = [
('albertslund', _('Albertslund')),
('alleroed', _('Allerød')),
('ballerup', _(... |
Eigenlabs/EigenD | refs/heads/1.4 | tools/packages/SCons/Tool/f95.py | 2 | """engine.SCons.Tool.f95
Tool-specific initialization for the generic Posix f95 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2... |
croscon/fleaker | refs/heads/master | tests/test_base.py | 1 | # ~*~ coding: utf-8 ~*~
"""
tests.test_base
~~~~~~~~~~~~~
Tests for the Fleaker :class:`BaseApplication`.
"""
import flask
import pytest
import fleaker
from fleaker.base import BaseApplication
from tests._compat import mock
def _create_app():
"""Create an app to aid in testing"""
return BaseApplication.c... |
ahmadia/bokeh | refs/heads/master | examples/compat/seaborn/violin.py | 13 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from bokeh import mpl
from bokeh.plotting import show
# We generated random data
data = 1 + np.random.randn(20, 6)
# And then just call the violinplot from Seaborn
sns.violinplot(data, color="Set3")
plt.title("Seaborn violin plot in bokeh.")
s... |
gameboy709494/shadowsocks | refs/heads/master | tests/graceful_cli.py | 977 | #!/usr/bin/python
import socks
import time
SERVER_IP = '127.0.0.1'
SERVER_PORT = 8001
if __name__ == '__main__':
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, SERVER_IP, 1081)
s.connect((SERVER_IP, SERVER_PORT))
s.send(b'test')
time.sleep(30)
s.close()
|
open-machine-learning/mldata | refs/heads/master | templatetags/get_version.py | 3 | from django import template
from django.conf import settings
register = template.Library()
@register.simple_tag
def get_version():
return settings.VERSION
|
vFense/vFenseAgent-nix | refs/heads/development | agent/deps/mac/Python-2.7.5/lib/python2.7/test/test_codecmaps_cn.py | 150 | #!/usr/bin/env python
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'gb2312'
map... |
idf/FaceReader | refs/heads/develop | facerec_py/apps/scripts/preprocessing_experiments.py | 1 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Philipp Wagner <bytefish[at]gmx[dot]de>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistrib... |
ndp-systemes/odoo-addons | refs/heads/8.0 | account_invoice_improved/__openerp__.py | 1 | # -*- coding: utf8 -*-
#
# Copyright (C) 2014 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# 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 the
# License,... |
Meriipu/quodlibet | refs/heads/master | quodlibet/session/gnome.py | 2 | # Copyright 2018 Christoph Reiter
#
# 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.
from gi.repository import Gio, GLib... |
will-Do/avocado | refs/heads/master | avocado/core/remote/result.py | 1 | # This rogram 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 distributed in the hope that it will be useful,
# but... |
RuudBurger/CouchPotatoServer | refs/heads/master | libs/tornado/options.py | 79 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... |
fcolamar/AliPhysics | refs/heads/master | PWGMM/MC/aligenqa/aligenqa/utils.py | 37 | import os
import random
import string
import subprocess
import re
from rootpy import asrootpy
from rootpy.plotting import Graph
def gen_random_name():
"""Generate a random name for temp hists"""
return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(25))
def get_est_dirs(sums, co... |
837468220/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_journal.py | 81 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Testing for twisted.persisted.journal."""
from twisted.trial import unittest
from twisted.persisted.journal.base import ICommand, MemoryJournal, serviceCommand, ServiceWrapperCommand, command, Wrappable
from twisted.persisted.journa... |
caioserra/apiAdwords | refs/heads/master | examples/adspygoogle/dfp/v201308/forecast_service/get_forecast.py | 2 | #!/usr/bin/python
#
# 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 b... |
wilsonssun/baseball-gamethread | refs/heads/master | build/lxml/build/lib.linux-i686-2.7/lxml/cssselect.py | 2 | """CSS Selectors based on XPath.
This module supports selecting XML/HTML tags based on CSS selectors.
See the `CSSSelector` class for details.
"""
import re
from lxml import etree
__all__ = ['SelectorSyntaxError', 'ExpressionError',
'CSSSelector']
try:
_basestring = basestring
except NameError:
_... |
nexlab/domotikad | refs/heads/master | domotika/mediasources/modules/generic/__init__.py | 1 | ###########################################################################
# Copyright (c) 2011-2014 Unixmedia S.r.l. <info@unixmedia.it>
# Copyright (c) 2011-2014 Franco (nextime) Lanza <franco@unixmedia.it>
#
# Domotika System Controller Daemon "domotikad" [http://trac.unixmedia.it]
#
# This file is part of domotik... |
pgleeson/TestArea | refs/heads/master | models/Parallel/pythonScripts/perf_P.py | 1 | import matplotlib.pyplot as plt
print "Going to plot performance of simulations on Legion"
times_l = {}
times_l[1] = 8.16
times_l[2] = 3.97
times_l[4] = 1.95
times_l[8] = 0.98
times_l[16] = 0.57
times_l[32] = 0.34
times_l[64] = 0.23
'''
times_s = {}
times_s[1] = 91.02
times_s[4] = 20.64
times_s[8] = 10.46
times_s... |
stackforge/python-openstacksdk | refs/heads/master | openstack/network/v2/address_scope.py | 3 | # 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... |
redhat-openstack/nova | refs/heads/f22-patches | nova/tests/virt/disk/vfs/test_localfs.py | 15 | # Copyright (C) 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
Nu3001/external_chromium_org | refs/heads/master | tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py | 176 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Dromaeo benchmark automation script.
Script runs dromaeo tests in browsers specified by --browser switch and saves
results to a... |
mattrobenolt/django | refs/heads/master | django/contrib/gis/db/models/manager.py | 101 | from django.contrib.gis.db.models.query import GeoQuerySet
from django.db.models.manager import Manager
class GeoManager(Manager.from_queryset(GeoQuerySet)):
"Overrides Manager to return Geographic QuerySets."
# This manager should be used for queries on related fields
# so that geometry columns on Oracl... |
wildjan/Flask | refs/heads/master | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py | 2923 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
justincassidy/scikit-learn | refs/heads/master | examples/linear_model/plot_polynomial_interpolation.py | 251 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... |
BowdoinOrient/bongo | refs/heads/develop | bongo/apps/api/endpoints/search.py | 1 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from haystack.query import SearchQuerySet
from bongo.apps.bongo.helpers import arbitrary_serialize
from django.conf import settings
@api_view(('POST',))
def search(request, version=settings.REST_FRAMEWORK['DEFAULT_VERSION'], f... |
srager13/ns3_qoi_symptotics | refs/heads/master | examples/error-model/examples-to-run.py | 199 | #! /usr/bin/env python
## -*- 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).
#
# See test.py for more i... |
BayanGroup/sentry | refs/heads/master | src/sentry/api/serializers/models/userreport.py | 12 | from __future__ import absolute_import
from sentry.api.serializers import Serializer, register
from sentry.models import UserReport
@register(UserReport)
class UserReportSerializer(Serializer):
def serialize(self, obj, attrs, user):
# TODO(dcramer): add in various context from the event
# context... |
Clinical3PO/Platform | refs/heads/master | dev/ML-Flex/Internals/Python/DemoDelimitedFeatureRanker.py | 2 | # THIS SOURCE CODE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND, AND ITS AUTHOR AND THE JOURNAL OF MACHINE LEARNING RESEARCH (JMLR) AND JMLR'S PUBLISHERS AND DISTRIBUTORS, DISCLAIM ANY AND ALL WARRANTIES, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AN... |
jchevrie/visp | refs/heads/master | platforms/ios/build_framework.py | 3 | #!/usr/bin/env python
"""
The script builds visp3.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator
or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with ViSP repository),
the output dir shoul... |
dongpf/hadoop-0.19.1 | refs/heads/rsc | src/contrib/hod/hodlib/Common/hodsvc.py | 182 | #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 thi... |
sephii/django | refs/heads/master | django/conf/locale/__init__.py | 32 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
"""
LANG_INFO is a dictionary structure to provide meta information about languages.
About name_local: capitalize it as if your language name was appearing
inside a sentence in your language.
The 'fallback' key can be used to specify a special fallback... |
alexthered/kienhoc-platform | refs/heads/master | lms/djangoapps/courseware/migrations/0009_add_field_default.py | 114 | # -*- 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):
# Changing field 'XModuleContentField.value'
db.alter_column('courseware_xmodulecontentfield', 'value', sel... |
ofanoyi/scrapy | refs/heads/master | scrapy/tests/test_utils_response.py | 13 | import os
import unittest
import urlparse
from scrapy.http import Response, TextResponse, HtmlResponse
from scrapy.utils.response import response_httprepr, open_in_browser, get_meta_refresh
__doctests__ = ['scrapy.utils.response']
class ResponseUtilsTest(unittest.TestCase):
dummy_response = TextResponse(url='htt... |
resmo/ansible | refs/heads/devel | test/units/modules/network/iosxr/test_iosxr_facts.py | 11 | # (c) 2016 Red Hat 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 dis... |
alephu5/Soundbyte | refs/heads/master | environment/lib/python3.3/site-packages/sympy/core/tests/test_containers.py | 1 | from sympy import Matrix, Tuple, symbols, sympify, Basic, Dict, S, FiniteSet, Integer
from sympy.core.containers import tuple_wrapper
from sympy.utilities.pytest import raises, XFAIL
from sympy.core.compatibility import is_sequence, iterable, u
def test_Tuple():
t = (1, 2, 3, 4)
st = Tuple(*t)
assert set(... |
erkanay/django | refs/heads/master | django/contrib/formtools/tests/wizard/namedwizardtests/forms.py | 95 | import os
import tempfile
from django import forms
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.http import HttpResponse
from django.template import Template, Context
from django.contrib.auth.models import User
from django.contrib.formtools.wiz... |
JSDemos/Mosquitto | refs/heads/master | test/broker/03-publish-b2c-timeout-qos2-helper.py | 25 | #!/usr/bin/env python
# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow.
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.j... |
Og192/Python | refs/heads/master | machine-learning-algorithms/mlalg/logisticRegression/logisticRegression.py | 2 | import numpy
import pylab as pl
def loadData(filename):
data = []
with open(filename, 'r') as f:
for line in f:
data.append(list(map(float, line.split(','))))
return numpy.array(data)
def plotData(X, Y):
x = X[::, 0:1]
y = X[::, 1:2]
for i in range(0, len(y)):
if Y[i... |
joseamaya/tambox | refs/heads/master | contabilidad/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2021-03-25 16:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencie... |
rishilification/phantomjs | refs/heads/master | src/breakpad/src/third_party/protobuf/protobuf/python/setup.py | 226 | #! /usr/bin/python
#
# See README for usage instructions.
# We must use setuptools, not distutils, because we need to use the
# namespace_packages option for the "google" package.
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension
from distutils.spawn import find_executable
i... |
Distrotech/qtwebkit | refs/heads/distrotech-qtwebkit | Tools/Scripts/webkitpy/thirdparty/__init__.py | 120 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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... |
JazzeYoung/VeryDeepAutoEncoder | refs/heads/master | theano/sandbox/multinomial.py | 1 | from __future__ import absolute_import, print_function, division
import numpy
import theano
from theano import Op, Apply
import theano.tensor as T
from theano.gof import local_optimizer
from theano.tensor import NotScalarConstantError, get_scalar_constant_value
from theano.scalar import as_scalar
import copy
from the... |
bq/bitbloq-offline | refs/heads/master | app/res/web2board/linux32/res/Scons/sconsFiles/SCons/Subst.py | 6 | """SCons.Subst
SCons string substitution.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# 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 ... |
TRESCLOUD/odoopub | refs/heads/master | openerp/addons/base/tests/test_db_cursor.py | 175 | # -*- coding: utf-8 -*-
import unittest2
import openerp
from openerp.tools.misc import mute_logger
from openerp.tests import common
DB = common.DB
ADMIN_USER_ID = common.ADMIN_USER_ID
def registry():
return openerp.modules.registry.RegistryManager.get(DB)
class test_cr_execute(unittest2.TestCase):
""" Try... |
seanrivera/rust | refs/heads/master | src/etc/latest-unix-snaps.py | 53 | #!/usr/bin/env python
#
# Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... |
samuto/UnityOpenCV | refs/heads/master | opencv/tests/swig_python/homography_tests.py | 5 | #!/usr/bin/env python
# 2009-01-16, Xavier Delacour <xavier.delacour@gmail.com>
import unittest
from numpy import *;
from numpy.linalg import *;
import sys;
import cvtestutils
from cv import *;
from adaptors import *;
def transform(H,x):
x1 = H * asmatrix(r_[x[0],x[1],1]).transpose()
x1 = asarray(x1).flatte... |
sourlows/rating-cruncher | refs/heads/master | src/lib/flask_wtf/recaptcha/validators.py | 32 | try:
import urllib2 as http
except ImportError:
# Python 3
from urllib import request as http
from flask import request, current_app
from wtforms import ValidationError
from werkzeug import url_encode
from .._compat import to_bytes, to_unicode
import json
RECAPTCHA_VERIFY_SERVER = 'https://www.google.com/... |
adedayo/intellij-community | refs/heads/master | python/testData/inspections/PyUnboundLocalVariableInspection/UnboundSwapStrUnicode.py | 83 | def f():
bytes, str = <warning descr="Local variable 'str' might be referenced before assignment">str</warning>, unicode #fail
class C(object):
bytes, str = str, unicode #pass
bytes, str = str, unicode #pass
|
flying-sheep/omnitool | refs/heads/master | plugingui.py | 1 | import os
import pygame
from pgu import gui
from tlib import get_name
from tinterface import get_worlds
def exit_prog(p):
pygame.quit()
import sys
sys.exit()
def run(worlds, Plugin, ptype):
# pygame.quit()
from omnitool import lang, Theme, themename
blue = Theme(themename)
class Qui... |
eduNEXT/edunext-platform | refs/heads/master | common/djangoapps/student/helpers.py | 4 | """
Helpers for the student app.
"""
import json
import logging
import mimetypes
import urllib.parse
from collections import OrderedDict
from datetime import datetime
from completion.exceptions import UnavailableCompletionData
from completion.utilities import get_key_to_last_completed_block
from django.conf import s... |
ehirt/odoo | refs/heads/8.0 | addons/stock_invoice_directly/__openerp__.py | 260 | # -*- 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... |
synasius/django | refs/heads/master | tests/generic_views/test_forms.py | 453 | from __future__ import unicode_literals
from django import forms
from .models import Author
class AuthorForm(forms.ModelForm):
name = forms.CharField()
slug = forms.SlugField()
class Meta:
model = Author
fields = ['name', 'slug']
class ContactForm(forms.Form):
name = forms.CharFie... |
ehdr/luigi | refs/heads/master | luigi/contrib/sge.py | 15 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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 required by applicable law... |
developerworks/horizon | refs/heads/master | horizon/dashboards/nova/containers/urls.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
prculley/gramps | refs/heads/master | gramps/plugins/rel/rel_fr.py | 10 | # -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2007 Donald N. Allingham
# Copyright (C) 2008-2010 Brian G. Matherly
# Copyright (C) 2007-2010 Jerome Rapinat
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gener... |
dgouldin/myspaceid-python-sdk | refs/heads/master | src/openid/consumer/html_parse.py | 167 | """
This module implements a VERY limited parser that finds <link> tags in
the head of HTML or XHTML documents and parses out their attributes
according to the OpenID spec. It is a liberal parser, but it requires
these things from the data in order to work:
- There must be an open <html> tag
- There must be an open... |
ratoaq2/Flexget | refs/heads/develop | tests/test_sort_by.py | 22 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestSortBy(FlexGetBase):
__yaml__ = """
tasks:
test1:
sort_by: title
mock:
- {title: 'B C D', url: 'http://localhost/1'}
- {title: 'A B C', ... |
schambers/civmarket | refs/heads/master | civmarket/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2926 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
chromium/chromium | refs/heads/master | third_party/wpt_tools/wpt/websockets/handlers/protocol_wsh.py | 18 | #!/usr/bin/python
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
request.ws_protocol = request.headers_in.get('sec-websocket-protocol')
#pass
def web_socket_transfer_data(request):
while True:
msgutil.send_message(request, request.ws_protocol)
return
|
JoeyCodinja/INFO3180LAB4 | refs/heads/master | lib/flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.py | 794 | from flask import Blueprint, render_template
admin = Blueprint('admin', __name__, url_prefix='/admin',
template_folder='templates',
static_folder='static')
@admin.route('/')
def index():
return render_template('admin/index.html')
@admin.route('/index2')
def index2():
ret... |
ryfeus/lambda-packs | refs/heads/master | Tensorflow/source/tensorflow/contrib/timeseries/python/__init__.py | 94 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.