repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
akosyakov/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_renames.py | 326 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... |
ericfc/django | refs/heads/master | tests/model_fields/test_durationfield.py | 296 | import datetime
import json
from django import forms
from django.core import exceptions, serializers
from django.db import models
from django.test import SimpleTestCase, TestCase
from .models import DurationModel, NullDurationModel
class TestSaveLoad(TestCase):
def test_simple_roundtrip(self):
duration... |
ishay2b/tensorflow | refs/heads/segnet | tensorflow/contrib/tensor_forest/hybrid/python/hybrid_model.py | 138 | # 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... |
mvaled/OpenUpgrade | refs/heads/8.0 | addons/website/models/ir_actions.py | 363 | # -*- coding: utf-8 -*-
import urlparse
from openerp.http import request
from openerp.osv import fields, osv
class actions_server(osv.Model):
""" Add website option in server actions. """
_name = 'ir.actions.server'
_inherit = ['ir.actions.server']
def _compute_website_url(self, cr, uid, id, websit... |
gxx/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/core/files/uploadedfile.py | 402 | """
Classes representing uploaded files.
"""
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import smart_str
__al... |
Rapportus/ansible-modules-extras | refs/heads/devel | cloud/amazon/sns_topic.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This is a 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 Ansible library is distri... |
phantomii/restalchemy | refs/heads/master | restalchemy/storage/sql/dialect/base.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2016 Eugene Frolov <eugene@frolov.net.ru>
#
# 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
#
# ... |
PisoMojado/ProjectEuler- | refs/heads/master | src/euler/problems/problem14.py | 1 | #This problem took more ad-hoc optimization than is suitable for placing in our commons, but we have a Collatz module
collatz_cycle_list = [0, 1]
largest_cycler_list = [0, 1]
trial_count = int(raw_input())
for i in range(trial_count):
current_num = int(raw_input())
if current_num < len(largest_cycler_list):
... |
IPVL/Tanvin-PythonWorks | refs/heads/master | chapter1/codes/arithmeticOperation.py | 1 | #! /usr/bin/env python
# Basic python
print "This program consists of basic arithmetic operations taking input from user"
print "Addition of two integer 100 & 300: ", 100 + 300
print "Subtraction of two integer 100 & 300: ", 100 - 300
print "Multiplication of two integer 100 & 300: ", 100 * 300
print "Division o... |
tuturto/pyherc | refs/heads/master | src/pyherc/generators/level/creatures.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# 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,... |
CatsAndDogsbvba/odoo | refs/heads/8.0 | addons/account_bank_statement_extensions/wizard/__init__.py | 442 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... |
Supersuuu/python | refs/heads/master | renzongxian/0013/0013.py | 40 | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-12-24
# Python 3.4
"""
第 0013 题: 用 Python 写一个爬图片的程序,爬 这个链接里的日本妹子图片 :-)
"""
import urllib.request
import re
import os
def fetch_pictures(url):
html_content = urllib.request.urlopen(url).read()
r = re.compile('<im... |
thanhphat11/Android_kernel_xiaomi_ALL | refs/heads/master | scripts/build-all.py | 1474 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... |
PopCap/GameIdea | refs/heads/master | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/upload_docs.py | 77 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
import os
import socket
import zipfile
import tempfile
import sys
import shutil
from base64 import standard_b64encode
from pkg_resources import iter_entry_points
from distuti... |
EunBongSong/TizenRT | refs/heads/master | os/drivers/sercomm/loadwriter.py | 13 | #!/usr/bin/python
###########################################################################
#
# Copyright 2016 Samsung Electronics 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 ... |
hurricup/intellij-community | refs/heads/master | python/lib/Lib/distutils/tests/support.py | 147 | """Support code for distutils test cases."""
import shutil
import tempfile
from distutils import log
class LoggingSilencer(object):
def setUp(self):
super(LoggingSilencer, self).setUp()
self.threshold = log.set_threshold(log.FATAL)
def tearDown(self):
log.set_threshold(self.thresho... |
hermes-jr/npui | refs/heads/master | netprofile_domains/netprofile_domains/views.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: Domains module - Views
# © Copyright 2013 Nikita Andriyanov
# © Copyright 2013 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the t... |
lyoniionly/django-cobra | refs/heads/master | src/cobra/apps/auditlog/__init__.py | 1 | default_app_config = 'cobra.apps.auditlog.config.AuditLogConfig'
|
SatoshiNXSimudrone/sl4a-damon-clone | refs/heads/master | python/src/Lib/xml/dom/NodeFilter.py | 455 | # This is the Python mapping for interface NodeFilter from
# DOM2-Traversal-Range. It contains only constants.
class NodeFilter:
"""
This is the DOM2 NodeFilter interface. It contains only constants.
"""
FILTER_ACCEPT = 1
FILTER_REJECT = 2
FILTER_SKIP = 3
SHOW_ALL = 0x... |
e1ven/Waymoot | refs/heads/master | libs/tornado-2.2/build/lib.linux-i686-3.1/tornado/web.py | 2 | #!/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... |
rouault/Quantum-GIS | refs/heads/master | tests/src/python/test_qgspanelwidget.py | 27 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPanelWidget.
.. note:: 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.
"""
__... |
wwj718/django-rest-framework | refs/heads/master | rest_framework/authtoken/serializers.py | 80 | from django.contrib.auth import authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import exceptions, serializers
class AuthTokenSerializer(serializers.Serializer):
username = serializers.CharField()
password = serializers.CharField(style={'input_type': 'password'})
... |
RackSec/ansible | refs/heads/devel | lib/ansible/plugins/action/iosxr.py | 24 | #
# (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 d... |
ChengyuSong/xen-arm | refs/heads/chromebook | tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py | 42 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
import re
from XmTestLib import *
from XmTestLib.block_utils import *
if ENABLE_HVM_SUPPORT:
SKIP("Block-attach not supported for HVM domains")
# Create a domain (default XmTestDomain, ... |
akosel/servo | refs/heads/master | tests/wpt/harness/wptrunner/update/metadata.py | 78 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
from .. import metadata
from base import Step, StepRunner
class UpdateExpected(Step):
"""Do the metadat... |
xxhank/namebench | refs/heads/master | nb_third_party/dns/entropy.py | 250 | # Copyright (C) 2009 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 "AS IS" AND NOMIN... |
cogeorg/BlackRhino | refs/heads/master | examples/degroot/networkx/classes/graph.py | 23 | """Base class for undirected graphs.
The Graph class allows any hashable object as a node
and can associate key/value attribute pairs with each undirected edge.
Self-loops are allowed but multiple edges are not (see MultiGraph).
For directed graphs see DiGraph and MultiDiGraph.
"""
# Copyright (C) 2004-2011 by
# ... |
mthh/geopy | refs/heads/master | geopy/geocoders/osm.py | 2 | """
OpenStreetMap geocoder, contributed by Alessandro Pasotti of ItOpen.
"""
from geopy.geocoders.base import (
Geocoder,
DEFAULT_FORMAT_STRING,
DEFAULT_TIMEOUT,
DEFAULT_SCHEME
)
from geopy.compat import urlencode
from geopy.location import Location
from geopy.util import logger
from geopy.exc import G... |
weimingtom/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_types.py | 164 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for removing uses of the types module.
These work for only the known names in the types module. The forms above
can include types. or not. ie, It is assumed the module is imported either as:
import type... |
arsenovic/clifford | refs/heads/master | clifford/_bit_helpers.py | 1 | """ Helpers for efficient bit operations
Bitmaps are used in clifford as representations of basis blades, hence the need
for these operations. These are only for internal use.
"""
from typing import Iterator
import numba
import numba.extending
import numba.types
from . import _numba_utils
def set_bit_indices(x: i... |
pitrou/conda-recipes | refs/heads/master | pythondbg-3.5.0/setup_misc.py | 4 | # used to build the tk interface on 64-bit darwin
import sys
from distutils.core import setup, Extension
setup(
ext_modules = [
Extension(
'_sqlite3', ['_sqlite/cache.c',
'_sqlite/connection.c',
'_sqlite/cursor.c',
'_sq... |
cbmoore/statsmodels | refs/heads/master | statsmodels/sandbox/datarich/__init__.py | 219 | '''
Econometrics for a Datarich Environment
=======================================
Introduction
------------
In many cases we are performing statistical analysis when many observed variables are
available, when we are in a data rich environment. Machine learning has a wide variety
of tools for dimension reduction an... |
aristanetworks/arista-ovs-nova | refs/heads/master | nova/virt/libvirt/utils.py | 1 | # 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.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyrig... |
davidjb/sqlalchemy | refs/heads/master | lib/sqlalchemy/orm/events.py | 1 | # orm/events.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
"""ORM event interfaces.
"""
from .. import event, exc, util
from .base import _mappe... |
SKA-ScienceDataProcessor/FastImaging-Python | refs/heads/master | src/fastimgproto/scripts/casa/compare_imagers.py | 1 | #!/usr/bin/env python
from __future__ import print_function
import logging
import os
import sys
import astropy.units as u
import click
import numpy as np
import fastimgproto.casa.io as casa_io
import fastimgproto.casa.reduction as casa_reduce
import fastimgproto.imager as imager
from fastimgproto.gridder.conv_funcs ... |
xiangke/pycopia | refs/heads/master | mibs/pycopia/mibs/IP_MIB.py | 1 | # python
# This file is generated by a program (mib2py). Any edits will be lost.
from pycopia.aid import Enum
import pycopia.SMI.Basetypes
Range = pycopia.SMI.Basetypes.Range
Ranges = pycopia.SMI.Basetypes.Ranges
from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, N... |
rzhxeo/youtube-dl | refs/heads/master | youtube_dl/extractor/imdb.py | 19 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
class ImdbIE(InfoExtractor):
IE_NAME = 'imdb'
IE_DESC = 'Internet Movie Database trailers'
_VALID_URL = r'http://(?:www|m)\.imdb\.com/video/imdb/vi(?P<id>\d+)'
... |
Fokko/incubator-airflow | refs/heads/master | tests/gcp/__init__.py | 1213 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
legoktm/pywikipedia-rewrite | refs/heads/master | scripts/i18n/isbn.py | 2 | # -*- coding: utf-8 -*-
msg = {
'en': {
'isbn-formatting': u'Robot: Formatting ISBN',
},
# Author: Csisc
# Author: Lloffiwr
# Author: Xqt
'qqq': {
'isbn-formatting': u'Edit summary when the bot fixes [http://en.wikipedia.org/wiki/International_Standard_Book_Number ISBN] number formatting.',
},
# Author: Csi... |
giruenf/GRIPy | refs/heads/master | templates/PluginTemplates/Example/core.py | 1 | # -*- coding: utf-8 -*-
def doinput(self):
dtuid = ('log', 9)
rhouid = ('log', 15)
parentuid = ('well', 0)
dtlog = self._OM.get(dtuid)
rholog = self._OM.get(rhouid)
dtdata = dtlog.data
rhodata = rholog.data
self.input = dict(dtdata=dtdata, rhodata=rhodata, parentuid=parentuid)
re... |
rbenjamin/namebench | refs/heads/master | libnamebench/benchmark_test.py | 175 | #!/usr/bin/env python
# Copyright 2009 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... |
devekko/plato_platform | refs/heads/master | profiles/plato/modules/proj4js/lib/proj4js/tools/jsmin.py | 513 | #!/usr/bin/python
# This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
# /* jsmin.c
# 2007-01-08
#
# Copyright (c) 2002 Douglas Crockford (www.crockford.com)
#
# Permission is hereby granted, free of ch... |
delighted/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py | 120 | # 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 ... |
daspots/dasapp | refs/heads/master | main/model/post.py | 1 | from google.appengine.ext import ndb
import model
from api import fields
import flask
import util
class Post(model.Base):
user_key = ndb.KeyProperty(kind=model.User, required=True)
title = ndb.StringProperty(required=True)
content = ndb.StringProperty(default='')
image_ids_string = ndb.StringProperty(default='... |
vijayanandnandam/youtube-dl | refs/heads/master | youtube_dl/extractor/tv4.py | 10 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class TV4IE(InfoExtractor):
IE_DESC = 'tv4.se and tv4play.se'
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:
tv4\.se/(?:[^/]+)/kli... |
openstack-infra/os-loganalyze | refs/heads/master | os_loganalyze/cmd/htmlify_log.py | 1 | #!/usr/bin/env python
#
# Copyright (c) 2013 IBM Corp.
#
# 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 ... |
Aloomaio/googleads-python-lib | refs/heads/master | examples/adwords/v201802/targeting/__init__.py | 4 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
larsks/cloud-init | refs/heads/master | cloudinit/sources/helpers/vmware/imc/guestcust_error.py | 2 | # Copyright (C) 2016 Canonical Ltd.
# Copyright (C) 2016 VMware Inc.
#
# Author: Sankar Tanguturi <stanguturi@vmware.com>
#
# This file is part of cloud-init. See LICENSE file for license information.
class GuestCustErrorEnum(object):
"""Specifies different errors of Guest Customization engine"""
GUESTCUST_E... |
atreyv/sympy | refs/heads/master | sympy/concrete/tests/test_gosper.py | 100 | """Tests for Gosper's algorithm for hypergeometric summation. """
from sympy import binomial, factorial, gamma, Poly, S, simplify, sqrt, exp, log, Symbol, pi
from sympy.abc import a, b, j, k, m, n, r, x
from sympy.concrete.gosper import gosper_normal, gosper_sum, gosper_term
def test_gosper_normal():
assert gosp... |
toooooper/oppia | refs/heads/master | integrations_dev/build_new_release.py | 13 | # 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 ... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | addons/mrp/wizard/__init__.py | 374 | # -*- 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... |
leafclick/intellij-community | refs/heads/master | python/testData/psi/DecoratedAsyncDef.py | 54 | @foo
async def bar():
await x
return 0
@baz(x, y)
async def quux():
return await x
|
mgedmin/ansible | refs/heads/devel | lib/ansible/modules/windows/win_file_version.py | 10 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Get DLL or EXE build version
# Copyright © 2015 Sam Liu <sam.liu@activenetwork.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... |
googledatalab/pydatalab | refs/heads/master | solutionbox/structured_data/mltoolbox/_structured_data/preprocess/cloud_preprocess.py | 6 | # Copyright 2017 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 ... |
cainmatt/django | refs/heads/master | tests/apps/default_config_app/__init__.py | 553 | default_app_config = 'apps.default_config_app.apps.CustomConfig'
|
ncdesouza/bookworm | refs/heads/master | env/lib/python2.7/site-packages/whoosh/analysis/analyzers.py | 93 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
south-coast-science/scs_core | refs/heads/develop | tests/position/gps_location_test.py | 1 | #!/usr/bin/env python3
"""
Created on 10 Jan 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_core.data.json import JSONify
from scs_core.position.gps_datum import GPSDatum
from scs_core.position.nmea.gpgga import GPGGA
from scs_core.position.nmea.nmea_report import NMEAReport
# -----... |
cmusatyalab/opendiamond | refs/heads/master | opendiamond/scopeserver/cocktail/admin.py | 1 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2018 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS S... |
sudheesh001/mediadrop | refs/heads/master | mediacore/controllers/admin/categories.py | 14 | from mediadrop.controllers.admin.categories import *
|
timopulkkinen/BubbleFish | refs/heads/master | tools/perf/perf_tools/startup_tests.py | 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page_benchmark
# TODO(jeremy): Discard results from first iteration of warm tests.
# Test how long Chrome takes to load when... |
viger/docker | refs/heads/master | proxy/proxy/code/default/python27/1.0/lib/darwin/cryptography/hazmat/bindings/__init__.py | 482 | # 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
|
khertan/BitPurse | refs/heads/master | bitpurse/PBKDF2.py | 1 | #!/usr/bin/python
# -*- coding: ascii -*-
###########################################################################
# pbkdf2 - PKCS#5 v2.0 Password-Based Key Derivation
#
# Copyright (C) 2007-2011 Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a co... |
sharoonthomas/trytond-payment-gateway-stripe | refs/heads/develop | transaction.py | 3 | # -*- coding: utf-8 -*-
"""
transaction.py
:copyright: (c) 2015 by Fulfil.IO Inc.
:license: see LICENSE for more details.
"""
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval, Bool, Not
from trytond.model import fields
from trytond.exceptions import UserError
import stripe
stripe.api... |
pwong-mapr/private-hue | refs/heads/HUE-1096-abe | desktop/core/ext-py/Django-1.4.5/tests/regressiontests/comment_tests/tests/comment_form_tests.py | 97 | from __future__ import absolute_import
import time
from django.conf import settings
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from . import CommentTestCase
from ..models import Article
class CommentFormTests(CommentTestCase):
def testInit(self):
... |
jamesbeebop/evennia | refs/heads/master | evennia/objects/manager.py | 1 | """
Custom manager for Objects.
"""
import re
from itertools import chain
from django.db.models import Q
from django.conf import settings
from django.db.models.fields import exceptions
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
from evennia.typeclasses.managers import returns_typeclas... |
shikhar413/openmc | refs/heads/develop | openmc/cell.py | 8 | from collections import OrderedDict
from collections.abc import Iterable
from copy import deepcopy
from math import cos, sin, pi
from numbers import Real
from xml.etree import ElementTree as ET
import numpy as np
from uncertainties import UFloat
import openmc
import openmc.checkvalue as cv
from ._xml import get_text
... |
kave/collab | refs/heads/master | core/__init__.py | 5 | from django.core.exceptions import ObjectDoesNotExist
|
jmcorgan/gnuradio | refs/heads/master | gr-qtgui/apps/usrp_display_qtgui.py | 91 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'usrp_display_qtgui.ui'
#
# Created: Thu Jul 16 22:06:24 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(sel... |
guaka/trust-metrics | refs/heads/master | trustlet/trustplot.py | 1 | from trustlet import *
def plotOverToe(toe, tmlist):
"""
This function plot a gnuplot graph, for more than one trustmetric
over the same toe.
Parameters:
toe = single string with type of error ('mae','rmse','coverage','percentage_wrong')
tmlist = list of trustmetric to plot
"""
... |
colejohnson66/idapython | refs/heads/master | Scripts/3rd/BboeVt.py | 16 | """
Original code by Bryce Boe: http://www.bryceboe.com/2010/09/01/submitting-binaries-to-virustotal/
Modified by Elias Bachaalany <elias at hex-rays.com>
"""
import hashlib, httplib, mimetypes, os, pprint, simplejson, sys, urlparse
# -----------------------------------------------------------------------
... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/__init__.py | 27 | __path__ = __import__("pkgutil").extend_path(__path__, __name__)
|
Benocs/core | refs/heads/master | src/topogen/coretopogen/topology_reader_dotout.py | 1 | #
# topology_reader_dotout - reads a layouted ndoes list
#
# Copyright (c) 2014 Benocs GmbH
#
# author: Robert Wuttke <robert@benocs.com>
#
# See the LICENSE file included in this distribution.
#
import subprocess
from coretopogen.topology_readwriter import TopologyReader
from coretopogen.topology_writer_dot import T... |
mlperf/training_results_v0.7 | refs/heads/master | Google/benchmarks/maskrcnn/implementations/maskrcnn-research-TF-tpu-v4-128/dataloader.py | 2 | # Copyright 2018 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... |
Affix/CouchPotatoServer | refs/heads/master | couchpotato/core/media/movie/providers/metadata/wmc.py | 78 | import os
from couchpotato.core.media.movie.providers.metadata.base import MovieMetaData
autoload = 'WindowsMediaCenter'
class WindowsMediaCenter(MovieMetaData):
def getThumbnailName(self, name, root, i):
return os.path.join(root, 'folder.jpg')
config = [{
'name': 'windowsmediacenter',
'grou... |
sportarchive/CloudProcessingEngine-Decider | refs/heads/master | pydecider/state_machine.py | 1 | from __future__ import (
absolute_import,
division,
print_function
)
import json
import logging
from .schema import ValidationError
from .state import State
from .step_results import (
ActivityStepResult,
TemplatedStepResult,
)
_LOGGER = logging.getLogger(__name__)
class StateMachine(object):
... |
polimediaupv/edx-platform | refs/heads/master | common/lib/capa/capa/tests/response_xml_factory.py | 30 | from lxml import etree
from abc import ABCMeta, abstractmethod
class ResponseXMLFactory(object):
""" Abstract base class for capa response XML factories.
Subclasses override create_response_element and
create_input_element to produce XML of particular response types"""
__metaclass__ = ABCMeta
@a... |
tripleee/melpa | refs/heads/master | scripts/process_log.py | 155 | #!/usr/bin/env python
import argparse
from datetime import datetime
import gzip
import json
import os
import re
import sys
import time
import tempfile
import sqlite3
from operator import or_
LOGFILE = "/home/melpa/log/melpa.access.log"
LOGREGEX = r'(?P<ip>[\d.]+) [ -]+ \[(?P<date>[\w/: +-]+)\] ' \
r'"GET ... |
ianjuma/octopus | refs/heads/master | app/api/__init__.py | 22 | import os
import glob
__all__ = [os.path.basename(
f)[:-3] for f in glob.glob(os.path.dirname(__file__) + "/*.py")]
|
dotKom/onlineweb4 | refs/heads/develop | apps/gallery/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ResponsiveImage',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False,... |
cntnboys/410Lab6 | refs/heads/master | build/django/build/lib.linux-x86_64-2.7/django/contrib/gis/measure.py | 93 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# 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,
#... |
nilbody/h2o-3 | refs/heads/master | py2/testdir_single_jvm/test_DL_mnist.py | 20 | import unittest, time, sys, random, string
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_jobs
from h2o_test import verboseprint, dump_json, OutputObj
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
... |
BenMotz/cubetoolkit | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toolkit.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
ee08b397/LeetCode-4 | refs/heads/master | 267 Palindrome Permutation II.py | 2 | """
Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form.
For example:
Given s = "aabb", return ["abba", "baab"].
Given s = "abc", return [].
"""
from collections import defaultdict
__author__ = 'Daniel'
class Solut... |
IronLanguages/ironpython2 | refs/heads/master | Tests/test_formatting.py | 1 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import os
import unittest
from iptest import IronPythonTestCase, is_cli, is_netcoreapp, is_netcoreapp21, run_te... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/account/wizard/account_use_model.py | 341 | # -*- 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... |
benfinkelcbt/CPD200 | refs/heads/master | CPD200-Lab13-Python/rsa/core.py | 96 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
tmimori/frappe | refs/heads/develop | frappe/website/context.py | 2 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, json
from frappe.website.doctype.website_settings.website_settings import get_website_settings
from frappe.website.router import get_page_context
from frappe.m... |
kmike/scikit-learn | refs/heads/master | examples/svm/plot_weighted_samples.py | 4 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import pylab as pl
from sklearn import svm
# we create 20 points
np.random.seed(0)
X = np.r_[np.random.rand... |
zedr/django | refs/heads/master | tests/modeladmin/models.py | 19 | # coding: utf-8
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateField()
... |
lhellebr/spacewalk | refs/heads/master | backend/server/importlib/errataCache.py | 14 | #
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
cloudbearings/vitess | refs/heads/master | third_party/py/bson-0.3.2/bson/codec.py | 26 | #!/usr/bin/python -OOOO
# vim: set fileencoding=utf8 shiftwidth=4 tabstop=4 textwidth=80 foldmethod=marker :
# Copyright (c) 2010, Kou Man Tong. All rights reserved.
# For licensing, see LICENSE file included in the package.
"""
Base codec functions for bson.
"""
import struct
import cStringIO
import calendar
from date... |
Johnzero/OE7 | refs/heads/master | openerp/addons-modules/sale_crm/report/__init__.py | 54 | # -*- 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... |
NicoVarg99/daf-recipes | refs/heads/master | ckan/ckan/ckan/ckan/lib/plugins.py | 1 | # encoding: utf-8
import logging
import os
import sys
from pylons import c
from ckan.lib import base
import ckan.lib.maintain as maintain
from ckan import logic
import logic.schema
from ckan import plugins
import ckan.authz
import ckan.plugins.toolkit as toolkit
log = logging.getLogger(__name__)
# Mapping from pack... |
fitzgen/servo | refs/heads/master | tests/wpt/web-platform-tests/mathml/tools/limits.py | 101 | #!/usr/bin/python
from utils import mathfont
import fontforge
nArySumCodePoint = 0x2211 # largeop operator
v = 3 * mathfont.em
f = mathfont.create("limits-lowerlimitbaselinedropmin%d" % v)
mathfont.createSquareGlyph(f, nArySumCodePoint)
f.math.LowerLimitBaselineDropMin = v
f.math.LowerLimitGapMin = 0
f.math.OverbarE... |
xtuml/pyxtuml | refs/heads/master | tests/__init__.py | 3 | # encoding: utf-8
# Copyright (C) 2014 John Törnblom
|
boada/astlib_dev | refs/heads/master | examples/rectangularClipTest/rectangularClipTest.py | 2 | #!/usr/bin/env python
#File: rectangularClipTest/rectangularClipTest.py
#Created: Sat Dec 15 17:26:52 2012
#Last Change: Sat Dec 15 17:29:07 2012
# -*- coding: utf-8 -*-
#
# Quick script to test out rotation, clipping - rectangles
import pyfits
from astLib import *
# Regular clipping rputines test
img = pyfits.open("... |
aduric/crossfit | refs/heads/master | nonrel/tests/regressiontests/forms/localflavor/us.py | 51 | from django.contrib.localflavor.us.forms import (USZipCodeField,
USPhoneNumberField, USStateField, USStateSelect, USSocialSecurityNumberField)
from utils import LocalFlavorTestCase
class USLocalFlavorTests(LocalFlavorTestCase):
def test_USStateSelect(self):
f = USStateSelect()
out = u'''<sele... |
dreamllq/node | refs/heads/master | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 304 | # 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... |
heyf/cloaked-octo-adventure | refs/heads/master | leetcode/0022_generate-parentheses.py | 1 | #
# @lc app=leetcode id=22 lang=python3
#
# [22] Generate Parentheses
#
from typing import List
# @lc code=start
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
ret = []
def helper(out, left, right):
if left == 0 and right == 0:
ret.append(out)
... |
QiJune/Paddle | refs/heads/master | doc/v2/getstarted/concepts/src/train.py | 7 | # Copyright (c) 2018 PaddlePaddle 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 app... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.