repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
brianwoo/django-tutorial
refs/heads/master
build/Django/django/contrib/contenttypes/checks.py
456
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps from django.utils import six def check_generic_foreign_keys(**kwargs): from .fields import GenericForeignKey errors = [] fields = (obj for cls in apps.get_models() for obj in six.itervalues(vars(...
Thraxis/SickRage
refs/heads/master
lib/imdb/parser/http/searchKeywordParser.py
128
""" parser.http.searchKeywordParser module (imdb package). This module provides the HTMLSearchKeywordParser class (and the search_company_parser instance), used to parse the results of a search for a given keyword. E.g., when searching for the keyword "alabama", the parsed page would be: http://akas.imdb.com/find?...
tailorian/Sick-Beard
refs/heads/ThePirateBay
SickBeard.py
6
#!/usr/bin/env python2 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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, eithe...
gvalentine/pyqtgraph
refs/heads/develop
pyqtgraph/SRTTransform.py
34
# -*- coding: utf-8 -*- from .Qt import QtCore, QtGui from .Point import Point import numpy as np class SRTTransform(QtGui.QTransform): """Transform that can always be represented as a combination of 3 matrices: scale * rotate * translate This transform has no shear; angles are always preserved. """ de...
Charlotte-Morgan/inasafe
refs/heads/develop
safe_extras/raven/processors.py
11
""" raven.core.processors ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import re import warnings from raven.utils.compat import string_types, text_type, PY3 from raven.utils im...
smartczm/python-learn
refs/heads/master
Old-day01-10/s13-day12/day12/homework/rpc/demo2/conf/__init__.py
16
#!/usr/bin/env python3.5 # -*- coding: utf-8 -*- # Author: Lang
varunagrawal/azure-services
refs/heads/master
varunagrawal/VarunWeb/env/Lib/site-packages/django/views/decorators/debug.py
173
import functools from django.http import HttpRequest def sensitive_variables(*variables): """ Indicates which variables used in the decorated function are sensitive, so that those variables can later be treated in a special way, for example by hiding them when logging unhandled exceptions. Two f...
DHLabs/keep
refs/heads/master
keep_backend/backend/urls.py
1
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView from api.data import DataResource from ...
huntxu/fuel-web
refs/heads/master
nailgun/nailgun/test/integration/test_node_nic_handler.py
2
# -*- coding: utf-8 -*- # Copyright 2013 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 requi...
Vishluck/sympy
refs/heads/master
sympy/physics/unitsystems/systems/mksa.py
77
# -*- coding: utf-8 -*- """ MKS unit system. MKS stands for "meter, kilogram, second, ampere". """ from __future__ import division from sympy import pi from sympy.physics.unitsystems.dimensions import Dimension from sympy.physics.unitsystems.units import Unit, Constant from sympy.physics.unitsystems.prefixes import...
davidbkemp/node-gyp
refs/heads/master
gyp/test/copies/gyptest-all.py
264
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies file copies using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('copies.gyp', ...
gauravsitlani/programming
refs/heads/master
machine_learning/linear_regression/linear_regression.py
1
# manual algebrical method import numpy as np import sys print(sys.version) x = np.array([[1, 2, 1], [2, 3, 1], [3, 4, 1], [6, 8, 1], [14, 6, 1]]) y = [4, 7, 11, 21, 25] x_tr = np.array(x).T b = np.dot(np.dot(np.linalg.inv(np.dot(x_tr,x)), x_tr) ,y) print(b) # sklearn method from sklearn.linear_model import LinearR...
andrew-aladev/samba-talloc-debug
refs/heads/master
source4/scripting/bin/w32err_code.py
56
#!/usr/bin/env python # Unix SMB/CIFS implementation. # Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009 # # 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...
KaranToor/MA450
refs/heads/master
google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/integration/s3/test_cert_verification.py
126
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software withou...
shenyy/lily2-gem5
refs/heads/master
src/arch/x86/isa/insts/simd128/floating_point/logical/exclusive_or.py
91
# Copyright (c) 2007 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 implemen...
moyeah/wpc
refs/heads/master
windcells.py
1
#!/usr/bin/env python import pygtk pygtk.require('2.0') import gobject import gtk from math import * import wpcutils as wpc # columns ( COLUMN_SPEED, COLUMN_WIND, COLUMN_EDITABLE ) = range(3) # data winds = [["0.0", "0.0", True]] class WindButtonBox(gtk.HButtonBox): def __init__(self, box, wc): gtk.HB...
mcr/ietfdb
refs/heads/master
ietf/doc/migrations/0008_auto__add_deletedevent.py
1
# 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 model 'DeletedEvent' db.create_table('doc_deletedevent', ( ('id', self.gf('django.db....
ftCommunity/ft-TXT
refs/heads/master
board/knobloch/TXT/board-support/ti-linux/tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
SlimRoms/android_external_chromium_org
refs/heads/lp5.0
tools/perf/benchmarks/start_with_url.py
8
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry import test from measurements import startup import page_sets @test.Disabled('snowleopard') # crbug.com/336913 class StartWithUrlCold(test.T...
Plain-Andy-legacy/android_external_chromium_org
refs/heads/lp-5.1r1
tools/perf/page_sets/tough_filters_cases.py
27
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughFiltersCasesPage(page_module.Page): def ...
HIIT/hybra-core
refs/heads/master
hybra/loaders/mediacloud.py
1
from . import common def load( file = '' ): ## TODO: implement here hybra-core like caching and API management for e in json.load( open( file ) ): try: d = {} d['text_content'] = e['full_text_bow'] d['timestamp'] = common._text_to_datetime( e['publish_date'] ) ...
ygenc/onlineLDA
refs/heads/master
onlineldavb_new/build/scipy/build/lib.macosx-10.6-intel-2.7/scipy/signal/windows.py
5
"""The suite of window functions.""" import numpy as np from scipy import special, linalg from scipy.fftpack import fft __all__ = ['boxcar', 'triang', 'parzen', 'bohman', 'blackman', 'nuttall', 'blackmanharris', 'flattop', 'bartlett', 'hanning', 'barthann', 'hamming', 'kaiser', 'gaussian', 'gene...
palfrey/coherence
refs/heads/master
coherence/upnp/devices/binary_light_client.py
1
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2008, Frank Scholz <coherence@beebits.net> from coherence.upnp.services.clients.switch_power_client import SwitchPowerClient from coherence import log import coherence.extern.louie as louie class BinaryLightClient(log.Log...
EliotBerriot/django
refs/heads/master
tests/admin_utils/tests.py
107
from __future__ import unicode_literals from datetime import datetime from decimal import Decimal from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.utils import ( NestedObjects, display_for_field, flatten, ...
quantopian/zipline
refs/heads/master
zipline/utils/math_utils.py
1
# # Copyright 2013 Quantopian, 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 wr...
HiroIshikawa/21playground
refs/heads/master
thumblelog/myproject/lib/python3.5/site-packages/werkzeug/utils.py
345
# -*- coding: utf-8 -*- """ werkzeug.utils ~~~~~~~~~~~~~~ This module implements various utilities for WSGI applications. Most of them are used by the request and response wrappers but especially for middleware development it makes sense to use them without the wrappers. :copyright: (c) 2014 ...
aymara/verbenet-editor
refs/heads/master
syntacticframes_project/syntacticframes/management/commands/vinf.py
1
import sys import traceback import logging from time import gmtime, strftime from django.core.management.base import BaseCommand from django.db import transaction from syntacticframes.models import VerbNetClass, VerbTranslation, VerbNetMember class Command(BaseCommand): def handle(self, *args, **options): ...
ray-project/ray
refs/heads/master
doc/kubernetes/example_scripts/run_on_head.py
1
from collections import Counter import sys import time import ray # Run this script on the Ray head node using kubectl exec. @ray.remote def gethostname(x): import platform import time time.sleep(0.01) return x + (platform.node(), ) def wait_for_nodes(expected): # Wait for all nodes to join the...
40223114/w16
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/this.py
948
s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpg...
lmorchard/django
refs/heads/master
tests/template_tests/filter_tests/test_dictsort.py
342
from django.template.defaultfilters import dictsort from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_sort(self): sorted_dicts = dictsort( [{'age': 23, 'name': 'Barbara-Ann'}, {'age': 63, 'name': 'Ra Ra Rasputin'}, {'name': 'Jonny B...
mskvortsov/coreclr
refs/heads/master
src/scripts/genXplatEventing.py
25
# ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. ## See the LICENSE file in the project root for more information. # # #USAGE: #Add Events: modify <root>src/vm/ClrEtwAll.man #Look at the Code in <root>/src/scripts/genXplatLttng....
gpoulter/pydedupe
refs/heads/master
dedupe/linkcsv.py
1
"""Helpers for record linkage with CSV files for input and output""" import contextlib as ctx import logging import os from os.path import join import dedupe.csv as csv import dedupe.group as group import dedupe.sim as sim LOG = logging.getLogger('dedupe.linkcsv') def write_indices(indices, outdir, prefix): ""...
psycofdj/xtdpy
refs/heads/master
xtd/core/logger/tools.py
2
# -*- coding: utf-8 #------------------------------------------------------------------# __author__ = "Xavier MARCELET <xavier@marcelet.com>" #------------------------------------------------------------------# import logging #------------------------------------------------------------------# def get(p_module ...
coderbone/SickRage
refs/heads/master
sickbeard/providers/hdspace.py
3
# Author: Idan Gutman # Modified by jkaberg, https://github.com/jkaberg for SceneAccess # Modified by 7ca for HDSpace # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
dichenko/kpk2016
refs/heads/master
OOP/02_Vector2d.py
1
class Vector2D(): def __init__(self,x=0,y=0): self._x = x self._y = y def __add__(self,other): ''' #Переопределяем стандартный метод, чтобы сложение векторов давало нам именно то что мы хотим :return: метод отвечает за операнд "+", складывая координаты. ''...
Rademade/taiga-back
refs/heads/master
tests/integration/test_attachments.py
3
import pytest from django.core.urlresolvers import reverse from django.core.files.uploadedfile import SimpleUploadedFile from .. import factories as f pytestmark = pytest.mark.django_db def test_create_user_story_attachment_without_file(client): """ Bug test "Don't create attachments without attached_file"...
proycon/anavec
refs/heads/master
anavec/icdar_process.py
1
#!/usr/bin/env python3 #------------------------------------------------------------------- # Processing script for ICDAR 2017 Post-OCR Text Correction challenge # Uses anavec #------------------------------------------------------------------- # by Maarten van Gompel # Radboud University Nijmegen # ...
savoirfairelinux/django
refs/heads/master
django/contrib/postgres/forms/ranges.py
43
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import gettext_lazy as _ __all__ = [ 'BaseRangeField', 'IntegerRangeField', 'FloatRangeField', 'DateTimeRa...
olivierdalang/stdm
refs/heads/master
ui/helpers/__init__.py
1
from .dirtytracker import ControlDirtyTracker,ControlDirtyTrackerCollection, \ ControlReaderMapper from .valuehandlers import ( CheckBoxValueHandler, ControlValueHandler, LineEditValueHandler, ComboBoxValueHandler, TextEditValueHandl...
ZLLab-Mooc/edx-platform
refs/heads/named-release/dogwood.rc
openedx/core/djangoapps/programs/__init__.py
40
""" Platform support for Programs. This package is a thin wrapper around interactions with the Programs service, supporting learner- and author-facing features involving that service if and only if the service is deployed in the Open edX installation. To ensure maximum separation of concerns, and a minimum of interde...
soasme/wikisensei
refs/heads/master
wikisensei/stream/admin.py
469
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin # Register your models here.
ArcticCore/arcticcoin
refs/heads/master
qa/rpc-tests/rpcbind_test.py
69
#!/usr/bin/env python2 # Copyright (c) 2014-2015 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 for -rpcbind, as well as -rpcallowip and -rpcconnect # TODO extend this test from the test framew...
nimasmi/wagtail
refs/heads/master
wagtail/images/tests/urls.py
9
from django.conf.urls import url from wagtail.images.views.serve import SendFileView, ServeView from wagtail.tests import dummy_sendfile_backend urlpatterns = [ url(r'^actions/serve/(.*)/(\d*)/(.*)/[^/]*', ServeView.as_view(action='serve'), name='wagtailimages_serve_action_serve'), url(r'^actions/redirect/(.*...
Nick-OpusVL/odoo
refs/heads/8.0
addons/l10n_cl/__openerp__.py
260
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
hryamzik/ansible
refs/heads/devel
test/units/modules/network/netscaler/test_netscaler_cs_action.py
18
# Copyright (c) 2017 Citrix Systems # # 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. # # ...
MobinRanjbar/hue
refs/heads/master
desktop/core/ext-py/python-ldap-2.3.13/Demo/reconnect.py
40
import sys,time,ldap,ldap.ldapobject,ldapurl from ldap.ldapobject import * ldap_url = ldapurl.LDAPUrl(sys.argv[1]) ldap_url.applyDefaults({ 'who':'', 'cred':'', 'filterstr':'(objectClass=*)', 'scope':ldap.SCOPE_BASE }) ldap.trace_level=1 l = ldap.ldapobject.ReconnectLDAPObject( ldap_url.initializeUrl(),tr...
adityahase/frappe
refs/heads/develop
frappe/patches/v12_0/delete_duplicate_indexes.py
3
import frappe from pymysql import InternalError # This patch deletes all the duplicate indexes created for same column # The patch only checks for indexes with UNIQUE constraints def execute(): if frappe.db.db_type != 'mariadb': return all_tables = frappe.db.get_tables() final_deletion_map = frappe._dict() fo...
bjko/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/applypatch.py
128
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
awduda/awduda.github.io
refs/heads/master
venv/lib/python2.7/copy_reg.py
4
/usr/lib/python2.7/copy_reg.py
gennad/Django-nonrel-stub-for-Google-App-Engine
refs/heads/master
django/db/models/base.py
1
import types import sys from itertools import izip import django.db.models.manager # Imported to register signal handler. from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS from django.core import validators from django.db.models.fields imp...
davecranwell/wagtail
refs/heads/master
wagtail/tests/snippets/models.py
5
from django.db import models from django.utils.encoding import python_2_unicode_compatible from wagtail.wagtailsearch import index from wagtail.wagtailsnippets.models import register_snippet # AlphaSnippet and ZuluSnippet are for testing ordering of # snippets when registering. They are named as such to ensure # t...
alexlo03/ansible
refs/heads/devel
lib/ansible/modules/cloud/scaleway/scaleway_security_group.py
21
#!/usr/bin/python # # Scaleway Security Group management module # # Copyright (C) 2018 Antoine Barbare (antoinebarbare@gmail.com). # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIB...
manics/openmicroscopy
refs/heads/develop
components/tools/OmeroPy/test/integration/tablestest/test_backwards_compatibility.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2012-2014 University of Dundee & Open Microscopy Environment. # All rights reserved. # # 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 Foundati...
hugobuddel/orange3
refs/heads/master
Orange/widgets/visualize/owmosaic.py
1
import os import sys from collections import defaultdict from functools import reduce from itertools import product from math import sqrt import numpy from PyQt4.QtCore import QPoint, Qt, QRectF from PyQt4.QtGui import (QGraphicsRectItem, QGraphicsView, QColor, QGraphicsScene, QPainter, QIcon,...
af1rst/bite-project
refs/heads/master
deps/mrtaskman/server/third_party/prodeagle/counter.py
16
#!/usr/bin/env python # # Copyright 2011 MiuMeet AG. # # 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...
mith1979/ansible_automation
refs/heads/master
applied_python/applied_python/lib/python2.7/site-packages/pylint/test/functional/anomalous_unicode_escape_py3.py
13
# pylint:disable=W0105, W0511 """Test for backslash escapes in byte vs unicode strings""" # Would be valid in Unicode, but probably not what you want otherwise BAD_UNICODE = b'\u0042' # [anomalous-unicode-escape-in-string] BAD_LONG_UNICODE = b'\U00000042' # [anomalous-unicode-escape-in-string] # +1:[anomalous-unicod...
sanyaade-teachings/oppia
refs/heads/master
main_cron.py
30
# 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 required by applicable ...
ianyh/heroku-buildpack-python-opencv
refs/heads/master
vendor/.heroku/lib/python2.7/distutils/version.py
259
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVe...
inares/edx-platform
refs/heads/inares_sass
lms/djangoapps/lti_provider/startup.py
63
"""Code run at server start up to initialize the lti_provider app.""" # Import the tasks module to ensure that signal handlers are registered. import lms.djangoapps.lti_provider.tasks # pylint: disable=unused-import
dstroppa/openstack-smartos-nova-grizzly
refs/heads/master
nova/api/openstack/compute/views/limits.py
9
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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....
cobalys/django
refs/heads/master
tests/modeltests/lookup/tests.py
57
from __future__ import absolute_import, unicode_literals from datetime import datetime from operator import attrgetter from django.core.exceptions import FieldError from django.test import TestCase, skipUnlessDBFeature from .models import Author, Article, Tag, Game, Season, Player class LookupTests(TestCase): ...
quxiaolong1504/django
refs/heads/master
tests/ordering/models.py
66
""" Specifying ordering Specify default ordering for a model using the ``ordering`` attribute, which should be a list or tuple of field names. This tells Django how to order ``QuerySet`` results. If a field name in ``ordering`` starts with a hyphen, that field will be ordered in descending order. Otherwise, it'll be ...
iku000888/Wordprocessing-100-Knoks
refs/heads/master
prob002/python/prob002.py
1
import sys line1 = str(sys.argv[1]); line2 = str(sys.argv[2]); newline=""; i = 0; while i<len(line1): newline=newline+line1[i]+line2[i]; i = i + 1; print newline;
michalkurka/h2o-3
refs/heads/master
h2o-py/GLRM_performance_tests/pyunit_milsong_performance_profile.py
6
from __future__ import print_function import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator # This test is just to take a large dataset, perform GLRM on it and figure # out the performance time. This test should not be run ...
pongem/python-bot-project
refs/heads/master
appengine/standard/botapp/lib/django/contrib/gis/gdal/geometries.py
33
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" unlik...
pol51/pjsip-winphone
refs/heads/master
tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py
42
# $Id$ import inc_sip as sip import inc_sdp as sdp # In this test we simulate broken server, where it always sends # stale=true with all 401 responses. We should expect pjsip to # retry the authentication until PJSIP_MAX_STALE_COUNT is # exceeded. When pjsip retries the authentication, it should # use the new nonce fr...
MoRgUiJu/morguiju.repo
refs/heads/master
plugin.video.adryanlist/pyaesnew/__init__.py
68
# The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
aspose-pdf/Aspose.Pdf-for-Java
refs/heads/master
Plugins/Aspose-Pdf-Java-for-Jython/asposepdf/WorkingWithPages/InsertEmptyPageAtEndOfFile.py
1
from asposepdf import Settings from com.aspose.pdf import Document from java.util import Date class InsertEmptyPageAtEndOfFile: def __init__(self): dataDir = Settings.dataDir + 'WorkingWithPages/InsertEmptyPageAtEndOfFile/' # Open the target document pdf = Do...
delanoister-Andro-ID/GT-I9300-ICS-3.0.y
refs/heads/master
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
le9i0nx/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_project.py
49
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
fedspendingtransparency/data-act-broker-backend
refs/heads/development
tests/unit/dataactvalidator/test_fabs32_detached_award_financial_assistance_1.py
1
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'fabs32_detached_award_financial_assistance_1' def test_column_headers(database): expected_subset = {'row_number', 'period_of_performa...
fsb4000/bitcoin
refs/heads/master
share/rpcuser/rpcuser.py
9
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import hashlib import sys import os from random import SystemRandom import base64 import hmac if len(sys.ar...
alexrao/YouCompleteMe
refs/heads/master
third_party/ycmd/third_party/requests/requests/packages/urllib3/contrib/ntlmpool.py
1009
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from ntlm import ntlm from urllib3 import HTT...
JCROM-Android/jcrom_external_chromium_org
refs/heads/kitkat
third_party/jinja2/loaders.py
108
# -*- coding: utf-8 -*- """ jinja2.loaders ~~~~~~~~~~~~~~ Jinja loader classes. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import weakref from types import ModuleType from os import path try: from hashlib import sha1 except Imp...
youngking/protobuf
refs/heads/master
python/google/protobuf/message_factory.py
228
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
tsufiev/horizon
refs/heads/master
openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py
2
# Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay 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...
charukiewicz/beer-manager
refs/heads/master
venv/lib/python3.4/site-packages/pip/_vendor/distlib/resources.py
191
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import bisect import io import logging import os import pkgutil import shutil import sys import types...
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/lib/cherrypy/cherrypy/test/test_conn.py
53
"""Tests for TCP connection handling, including proper and timely close.""" import socket import sys import time timeout = 1 import cherrypy from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, NotConnected, BadStatusLine from cherrypy._cpcompat import ntob, urlopen, unicodestr from cherrypy.test import w...
2014c2g2/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/xml/dom/__init__.py
873
"""W3C Document Object Model implementation for Python. The Python mapping of the Document Object Model is documented in the Python Library Reference in the section on the xml.dom package. This package contains the following modules: minidom -- A simple implementation of the Level 1 DOM with namespace sup...
shsingh/ansible
refs/heads/devel
lib/ansible/modules/network/aireos/aireos_config.py
6
#!/usr/bin/python # # Copyright: Ansible Team # 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', 'status': ['preview'], ...
FreeAgent/djangoappengine-starter
refs/heads/master
django/contrib/admin/filterspecs.py
148
""" FilterSpec encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ from django.db import models from djan...
agrimaldi/metaseq
refs/heads/master
metaseq/tableprinter.py
2
def print_2x2_table(table, row_labels, col_labels, fmt="%d"): """ Prints a table used for Fisher's exact test. Adds row, column, and grand totals. :param table: The four cells of a 2x2 table: [r1c1, r1c2, r2c1, r2c2] :param row_labels: A length-2 list of row names :param col_labels: A length-2 ...
nguyenquach/pychess
refs/heads/master
lib/pychess/System/protoopen.py
22
import os from pychess.compat import open, urlopen, url2pathname PGN_ENCODING = "latin_1" def splitUri (uri): uri = url2pathname(uri) # escape special chars uri = uri.strip('\r\n\x00') # remove \r\n and NULL return uri.split("://") def protoopen (uri): """ Function for opening many things """ ...
lizardsystem/lizard-reportgenerator
refs/heads/master
lizard_reportgenerator/admin.py
1
from django.contrib import admin from lizard_reportgenerator.models import GeneratedReport from lizard_reportgenerator.models import ReportTemplate from lizard_security.admin import SecurityFilteredAdmin class GeneratedReportInline(admin.TabularInline): model = GeneratedReport class ReportTemplateAdmin(admin.Mo...
adampresley/sublime-debugkiller
refs/heads/master
DebugKillerCommand.py
1
# # History: # # 2013-03-09: # - # # 2013-03-08: # - Initial release # import os import re import sublime import sublime_plugin OUTPUT_VIEW_NAME = "debugkiller_result_view" class DebugKillerCommand(sublime_plugin.WindowCommand): def run(self): self.view = self.window.active_view() self.filePath = self.vi...
peak6/st2
refs/heads/master
st2common/st2common/models/db/runner.py
5
# 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...
ajose01/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/test/actions/gyptest-errors.py
351
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies behavior for different action configuration errors: exit status of 1, and the expected error message must be in stderr. """ im...
makinacorpus/formhub
refs/heads/master
odk_viewer/migrations/0004_auto__add_field_datadictionary_shared.py
7
# 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 'DataDictionary.shared' db.add_column('odk_viewer_datadictionary', 'shared', self.gf('djang...
numerical-mathematics/extrapolation
refs/heads/master
compare_test_dense.py
1
''' Runs a dense output performance test comparing ParEx with DOPRI5 and DOP853 integrators from scipy.integrate.ode Result graphs are saved in the folder ./images In this file only, we use a version of scipy.integrate.ode due to James D. D. Martin (2015) that exposes the dense output option from the Fortran code ...
hubert667/AIR
refs/heads/master
build/kombu/kombu/async/__init__.py
39
# -*- coding: utf-8 -*- """ kombu.async =========== Event loop implementation. """ from __future__ import absolute_import from .hub import Hub, get_event_loop, set_event_loop from kombu.utils.eventio import READ, WRITE, ERR __all__ = ['READ', 'WRITE', 'ERR', 'Hub', 'get_event_loop', 'set_event_loop']
mattesno1/Sick-Beard
refs/heads/master
lib/hachoir_parser/container/asn1.py
90
""" Abstract Syntax Notation One (ASN.1) parser. Technical informations: * PER standard http://www.tu.int/ITU-T/studygroups/com17/languages/X.691-0207.pdf * Python library http://pyasn1.sourceforge.net/ * Specification of Abstract Syntax Notation One (ASN.1) ISO/IEC 8824:1990 Information Technology * Specificati...
dandanvidi/catalytic-rates
refs/heads/master
scripts/get_data_cache_pFVA_results.py
1
from rcat import RCAT import pandas as pd import numpy as np from cobra.core import Metabolite, Reaction from cobra.io.sbml import create_cobra_model_from_sbml_file from cobra.manipulation.modify import convert_to_irreversible from copy import deepcopy from cobra.flux_analysis.variability import flux_variability_analys...
daniel-hou0/horizon
refs/heads/master
django-openstack/django_openstack/tests/broken/keypair_tests.py
21
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
gdementen/larray
refs/heads/master
larray/inout/session.py
2
from __future__ import absolute_import, division, print_function from larray.util.compat import basestring handler_classes = {} ext_default_engine = {} def register_file_handler(engine, extensions=None): r"""Class decorator to register new file handler class Parameters ---------- engine : str ...
motion2015/a3
refs/heads/a3
openedx/core/djangoapps/user_api/accounts/serializers.py
8
from rest_framework import serializers from django.contrib.auth.models import User from student.models import UserProfile from openedx.core.djangoapps.user_api.accounts import NAME_MIN_LENGTH class AccountUserSerializer(serializers.HyperlinkedModelSerializer): """ Class that serializes the portion of User mod...
Drooids/odoo
refs/heads/8.0
addons/l10n_co/__openerp__.py
256
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Ivan ...
ryano144/intellij-community
refs/heads/master
python/testData/mover/with.py
83
def temp(filepath): a = 1 with open(filepath) as f: l = <caret>f.readlines() for line in l: a = 1
nortd/bomfu
refs/heads/master
main.py
1
#!/usr/bin/env python ## # 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, softwa...
neumerance/cloudloon2
refs/heads/master
openstack_dashboard/dashboards/admin/resource_rates/tables.py
2
import logging from django.core.urlresolvers import reverse # noqa from django.template import defaultfilters as filters from django.utils.http import urlencode # noqa from django.utils.translation import ugettext_lazy as _ # noqa from horizon import exceptions from horizon import tables from openstack_dashboar...
xhook/asterisk-v11
refs/heads/master
res/pjproject/tests/automated/configure.py
2
#!/usr/bin/python import optparse import os import platform import socket import subprocess import sys PROG = "r" + "$Rev$".strip("$ ").replace("Rev: ", "") PYTHON = os.path.basename(sys.executable) build_type = "" vs_target = "" s60_target = "" no_test = False no_pjsua_test = False # # Get gcc version # def gcc_ver...