repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
dotKom/onlineweb4
refs/heads/develop
apps/webshop/migrations/0004_auto_20151118_2242.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('webshop', '0003_auto_20151118_2208'), ] operations = [ migrations.AlterField( model_name='orderline', ...
deepakselvaraj/federated-horizon
refs/heads/master
horizon/browsers/__init__.py
11
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
erc7as/cs3240-labdemo
refs/heads/master
hello.py
1
__author__ = 'erc7as' from helper import greeting from check import check greeting('hello') greeting('goodbye') check('yo')
OpenLD/enigma2-wetek
refs/heads/master
lib/python/Components/DiskInfo.py
45
from GUIComponent import GUIComponent from VariableText import VariableText from os import statvfs from enigma import eLabel # TODO: Harddisk.py has similiar functions, but only similiar. # fix this to use same code class DiskInfo(VariableText, GUIComponent): FREE = 0 USED = 1 SIZE = 2 def __init__(self, path, t...
microcom/hr
refs/heads/8.0
hr_expense_invoice/models/__init__.py
23
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from . import hr_expense_expense
bazingasheldon/tv
refs/heads/master
raspberry/p2pstreams scraper/glob.py
2
import xbmc, xbmcgui, xbmcaddon import urllib, urllib2 import os, stat addon = xbmcaddon.Addon('plugin.video.streams') def addon_log(string): DEBUG = addon.getSetting('debug') ADDON_VERSION = addon.getAddonInfo('version') if DEBUG == 'true': if isinstance(string, unicode): string = string.encode('utf-...
dorotapalicova/GoldDigger
refs/heads/Fixer.io
gold_digger/api_server/app.py
1
# -*- coding: utf-8 -*- from .api_server import API app = API()
yogesh2021/qds-sdk-py
refs/heads/master
qds_sdk/scheduler.py
8
import json from qds_sdk.qubole import Qubole from qds_sdk.resource import Resource from argparse import ArgumentParser from qds_sdk.commands import * from qds_sdk.actions import * class SchedulerCmdLine: """ qds_sdk.ScheduleCmdLine is the interface used by qds.py. """ @staticmethod def parsers()...
tiagoantao/bioinf-python
refs/heads/master
notebooks/08_Advanced/Spark.py
2
from __future__ import division, print_function from pyspark import SparkContext sc = SparkContext(appName='Processing PLINK frequencies') plink_freqs = sc.wholeTextFiles('tsi-*-*.frq') freqs = plink_freqs.mapValues(lambda content: [float([tok for tok in l.split(' ') ...
gorel/dli-reports
refs/heads/master
dli_app/mod_wiki/models.py
1
"""Models for the wiki module Author: Logan Gore This file is responsible for defining models that belong in the wiki module. """ import datetime from dli_app import db from flask_login import current_user class WikiPage(db.Model): """Model for a page on the wiki""" __tablename__ = 'wiki_page' id = db....
ampax/edx-platform-backup
refs/heads/live
common/djangoapps/student/tests/test_microsite.py
24
""" Test for User Creation from Micro-Sites """ from django.test import TestCase from student.models import UserSignupSource import mock import json from django.core.urlresolvers import reverse from django.contrib.auth.models import User FAKE_MICROSITE = { "SITE_NAME": "openedx.localhost", "university": "fakeu...
laosiaudi/tensorflow
refs/heads/master
tensorflow/python/training/adagrad_test.py
12
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mastizada/pontoon
refs/heads/master
pontoon/base/migrations/0096_add_rejected_option_to_translation.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-08-01 15:32 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
garbled1/ansible
refs/heads/devel
test/units/parsing/utils/test_jsonify.py
119
# -*- coding: utf-8 -*- # (c) 2016, James Cammarata <[email protected]> # # 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 o...
augustozuniga/arisgames
refs/heads/master
zxing-master/cpp/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_collections.py
34
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 li...
richardotis/scipy
refs/heads/master
scipy/optimize/tests/test_optimize.py
18
""" Unit tests for optimization routines from optimize.py Authors: Ed Schofield, Nov 2005 Andrew Straw, April 2008 To run it in its simplest form:: nosetests test_optimize.py """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.testing import (a...
nicko96/Chrome-Infra
refs/heads/master
appengine/findit/waterfall/test/extract_signal_pipeline_test.py
1
# Copyright 2015 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. import os from testing_utils import testing from model.wf_step import WfStep from pipeline_wrapper import pipeline_handlers from waterfall import buildbot ...
calamityman/ansible-modules-extras
refs/heads/devel
cloud/webfaction/webfaction_mailbox.py
102
#!/usr/bin/python # # Create webfaction mailbox using Ansible and the Webfaction API # # ------------------------------------------ # (c) Quentin Stafford-Fraser and Andy Baker 2015 # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
ehenneken/adsrex
refs/heads/master
v1_0/api/myads.py
1
from ..user_roles import anonymous_user, authenticated_user def test_anonymous_user(): for x in ['/vault/configuration', '/vault/user-data', '/vault/query/sfsfs-sfsdfsdf-sfsdf-sfsdf']: r = anonymous_user.get(x) assert r.status_code == 401 # this is wrong, it s...
Mortezaipo/cmd-test
refs/heads/master
src/lib.py
1
"""Extra library.""" import os import socket import re import json import const def is_file_exists(path: str): """Check file existance. :param path: file address :type path: str :return: Checking file existance :rtype: bool """ if os.path.exists(path): return True return Fal...
realfake/kubernetes
refs/heads/master
cluster/juju/layers/kubernetes-worker/lib/charms/kubernetes/common.py
366
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
jaden/2014-hour-of-code
refs/heads/master
python/guess2.py
1
from random import randint answer = randint(1,100) guess = 0 tries = 0 while guess != answer: guess = int(raw_input("Guess a number from 1 to 100: ")) tries += 1 if guess < answer: print "Too low" elif guess > answer: print "Too high" print "Correct, you guessed it in %d tries" ...
mgr0dzicki/python-neo
refs/heads/master
neo/test/iotest/test_brainwaresrcio.py
6
# -*- coding: utf-8 -*- """ Tests of neo.io.brainwaresrcio """ # needed for python 3 compatibility from __future__ import absolute_import, division, print_function import logging import os.path import sys try: import unittest2 as unittest except ImportError: import unittest import numpy as np import quantit...
CaoShuFeng/kubernetes
refs/heads/master
cluster/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py
169
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
bakhtout/odoo-educ
refs/heads/8.0
addons/website_sale_delivery/controllers/main.py
214
# -*- coding: utf-8 -*- import openerp from openerp import http from openerp.http import request import openerp.addons.website_sale.controllers.main class website_sale(openerp.addons.website_sale.controllers.main.website_sale): @http.route(['/shop/payment'], type='http', auth="public", website=True) def paym...
pierrebaque/DeepOcclusion
refs/heads/master
VGG/BGsubstract.py
2
#Compute the probability of each pixel in a tensor to be from background or foreground import os import pickle import numpy as np from PIL import Image, ImageDraw import theano import theano.tensor as T from theano.tensor.nnet.conv import conv2d from theano.tensor.shared_randomstreams import RandomStreams class BGsu...
cloudviz/agentless-system-crawler
refs/heads/master
tests/functional/test_functional_cos_emitter.py
1
import unittest import docker import os import subprocess class CrawlerCosEmitterTests(unittest.TestCase): def setUp(self): self.docker = docker.Client( base_url='unix://var/run/docker.sock', version='auto') os.mkdir('/etc/cos-secrets', 0755 ) f=open("/etc/cos-secrets/...
Stranger6667/django-hstore
refs/heads/master
runtests.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") sys.path.insert(0, "tests") if __name__ == "__main__": from django.core.management import execute_from_command_line args = sys.argv args.insert(1, "test") execute_from_comman...
lz1988/company-site
refs/heads/master
tests/modeltests/properties/tests.py
126
from __future__ import absolute_import from django.test import TestCase from .models import Person class PropertyTests(TestCase): def setUp(self): self.a = Person(first_name='John', last_name='Lennon') self.a.save() def test_getter(self): self.assertEqual(self.a.full_name, 'John Le...
hanlind/nova
refs/heads/master
nova/tests/unit/scheduler/test_rpcapi.py
16
# Copyright 2013 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 or agre...
manabu/linebot1
refs/heads/master
app.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask, request, abort from flask_apscheduler import APScheduler import pymongo import json import datetime import time import os import re # Line bot from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignat...
slumtrimpet/ctypesgen
refs/heads/master
ctypesgencore/printer_python/preamble.py
15
import ctypes, os, sys from ctypes import * _int_types = (c_int16, c_int32) if hasattr(ctypes, 'c_int64'): # Some builds of ctypes apparently do not have c_int64 # defined; it's a pretty good bet that these builds do not # have 64-bit pointers. _int_types += (c_int64,) for t in _int_types: if sizeo...
benspaulding/django
refs/heads/master
tests/regressiontests/urlpatterns_reverse/included_namespace_urls.py
92
from __future__ import absolute_import from django.conf.urls import patterns, url, include from .namespace_urls import URLObject from .views import view_class_instance testobj3 = URLObject('testapp', 'test-ns3') urlpatterns = patterns('regressiontests.urlpatterns_reverse.views', url(r'^normal/$', 'empty_view',...
drakipovic/deep-learning
refs/heads/master
lab2/train.py
1
import time import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import nn import layers DATA_DIR = '/home/dinek/datasets/MNIST/' SAVE_DIR = "/home/dinek/source/fer/out/" config = {} config['max_epochs'] = 8 config['batch_size'] = 50 config['save_dir'] = SAVE_DIR co...
GbalsaC/bitnamiP
refs/heads/master
venv/lib/python2.7/site-packages/PIL/TiffImagePlugin.py
18
# # The Python Imaging Library. # $Id$ # # TIFF file handling # # TIFF is a flexible, if somewhat aged, image file format originally # defined by Aldus. Although TIFF supports a wide variety of pixel # layouts and compression methods, the name doesn't really stand for # "thousands of incompatible file formats," it jus...
ctruchi/deluge-webui2
refs/heads/master
deluge/ui/gtkui/new_release_dialog.py
7
# # new_release_dialog.py # # Copyright (C) 2008 Andrew Resch <[email protected]> # # Deluge is free software. # # You may 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 ...
halfak/Deltas
refs/heads/master
deltas/algorithms/tests/test_segment_matcher.py
1
from nose.tools import eq_ from ...operations import Delete, Equal, Insert from ...tests.diff_and_replay import diff_and_replay from ...tests.diff_sequence import diff_sequence from ...tokenizers import wikitext_split from ..segment_matcher import diff, process def test_diff_and_replay(): return diff_and_replay(...
gonicus/gosa
refs/heads/master
backend/src/tests/backend/plugins/samba/test_domain.py
1
# This file is part of the GOsa framework. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. from unittest import TestCase, mock import pytest from gosa.backend.plugins.samba.domain import * c...
mdanielwork/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/localflavor/ch/ch_states.py
544
# -*- coding: utf-8 -* from django.utils.translation import ugettext_lazy as _ STATE_CHOICES = ( ('AG', _('Aargau')), ('AI', _('Appenzell Innerrhoden')), ('AR', _('Appenzell Ausserrhoden')), ('BS', _('Basel-Stadt')), ('BL', _('Basel-Land')), ('BE', _('Berne')), ('FR', _('Fribourg')), ('...
BehavioralInsightsTeam/edx-platform
refs/heads/release-bit
lms/djangoapps/edxnotes/api_urls.py
13
""" API URLs for EdxNotes """ from django.conf.urls import url from edxnotes import views urlpatterns = [ url(r"^retire_user/$", views.RetireUserView.as_view(), name="edxnotes_retire_user"), ]
louietsai/python-for-android
refs/heads/master
python3-alpha/python3-src/Tools/scripts/parseentities.py
46
#!/usr/bin/env python3 """ Utility for parsing HTML entity definitions available from: http://www.w3.org/ as e.g. http://www.w3.org/TR/REC-html40/HTMLlat1.ent Input is read from stdin, output is written to stdout in form of a Python snippet defining a dictionary "entitydefs" mapping literal en...
manuq/sugar-toolkit-gtk3
refs/heads/master
src/sugar3/presence/presenceservice.py
7
# Copyright (C) 2007, Red Hat, Inc. # Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, ...
heathseals/CouchPotatoServer
refs/heads/master
libs/pyutil/test/current/json_tests/test_pass2.py
106
from unittest import TestCase from pyutil import jsonutil as json # from http://json.org/JSON_checker/test/pass2.json JSON = r''' [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] ''' class TestPass2(TestCase): def test_parse(self): # test in/out equivalence and parsing res = json.loads(JSON) ...
slideclick/mal
refs/heads/master
python/step0_repl.py
54
import sys, traceback import mal_readline # read def READ(str): return str # eval def EVAL(ast, env): #print("EVAL %s" % printer._pr_str(ast)) return ast # print def PRINT(exp): return exp # repl def REP(str): return PRINT(EVAL(READ(str), {})) # repl loop while True: try: li...
dawran6/zulip
refs/heads/master
zerver/migrations/0043_realm_filter_validators.py
38
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators import zerver.models class Migration(migrations.Migration): dependencies = [ ('zerver', '0042_attachment_file_name_length'), ] operations = [ migrations...
claricen/website
refs/heads/master
publishconf.py
9
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = '//wics.uwaterloo.ca' RELATIVE_URLS = False F...
bnprk/django-oscar
refs/heads/master
runtests.py
25
#!/usr/bin/env python """ Custom test runner If args or options, we run the testsuite as quickly as possible. If args but no options, we default to using the spec plugin and aborting on first error/failure. If options, we ignore defaults and pass options onto pytest. Examples: Run all tests (as fast as possible) $...
jmankoff/data
refs/heads/master
Assignments/jmankoff-fusion/lib/werkzeug/contrib/lint.py
128
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
magfest/tabletop
refs/heads/master
tabletop/models.py
1
from tabletop import * @Session.model_mixin class SessionMixin: def entrants(self): return (self.query(TabletopEntrant) .options(joinedload(TabletopEntrant.reminder), joinedload(TabletopEntrant.attendee), subqueryload(TabletopEntr...
jsteemann/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/mac_greek.py
593
""" Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,err...
chrisng93/todo-app
refs/heads/master
server/manage.py
1
from flask_script import Manager from app.app import create_app from app.extensions import db manager = Manager(create_app) @manager.command def createdb(): app = create_app() with app.app_context(): db.drop_all() db.create_all() if __name__ == '__main__': manager.run()
zack3241/incubator-airflow
refs/heads/master
airflow/migrations/versions/f2ca10b85618_add_dag_stats_table.py
58
# # 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 the ...
sinkuri256/python-for-android
refs/heads/master
python-modules/twisted/twisted/python/hashlib.py
68
# -*- test-case-name: twisted.python.test.test_hashlib -*- # Copyright (c) 2008 Twisted Matrix Laboratories. # See LICENSE for details. """ L{twisted.python.hashlib} presents a subset of the interface provided by U{hashlib<http://docs.python.org/library/hashlib.html>}. The subset is the interface required by various ...
SUSE/azure-sdk-for-python
refs/heads/master
azure-mgmt-documentdb/azure/mgmt/documentdb/models/database_account_connection_string.py
5
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
jamespcole/home-assistant
refs/heads/master
homeassistant/components/honeywell/climate.py
2
""" Support for Honeywell Round Connected and Honeywell Evohome thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.honeywell/ """ import logging import socket import datetime import requests import voluptuous as vol import homeassistan...
CCPorg/MCR-MicroCash-Ver-1000gdf9d55a-Copy
refs/heads/master
share/qt/extract_strings_qt.py
1294
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
detiber/ansible
refs/heads/devel
lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py
27
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
delhivery/django
refs/heads/master
django/contrib/sessions/exceptions.py
931
from django.core.exceptions import SuspiciousOperation class InvalidSessionKey(SuspiciousOperation): """Invalid characters in session key""" pass class SuspiciousSession(SuspiciousOperation): """The session may be tampered with""" pass
csdms/pymt
refs/heads/master
tests/grids/test_grid_type.py
2
import unittest from pymt.grids.grid_type import ( GridType, GridTypeRectilinear, GridTypeStructured, GridTypeUnstructured, ) class TestGridType(unittest.TestCase): def test_rectilinear(self): type = GridTypeRectilinear() self.assertEqual(str(type), "rectilinear") self.ass...
rohitw1991/frappe
refs/heads/develop
frappe/core/__init__.py
107
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals
nsat/gnuradio
refs/heads/master
grc/gui/Platform.py
18
""" Copyright 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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 ...
Cinntax/home-assistant
refs/heads/dev
tests/components/ios/__init__.py
43
"""Tests for the iOS component."""
apdjustino/DRCOG_Urbansim
refs/heads/master
src/opus_gui/util/documentationbase.py
1
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE # PyQt4 includes for python bindings to QT from PyQt4.QtCore import QUrl, Qt, QString, QObject, SIGNAL from PyQt4.QtGui import QTextBrowser, QWidget, QIc...
elba7r/system
refs/heads/master
erpnext/patches/v5_0/taxes_and_totals_in_party_currency.py
103
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe from frappe.model.meta import get_field_precision from frappe.custom.doctype.property_setter.property_setter import make_property_setter def execute(): selling_doctypes = ["Qu...
sahildua2305/libcloud
refs/heads/trunk
libcloud/compute/drivers/vcloud.py
7
# 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 ...
VisTrails/VisTrails
refs/heads/v2.2
vistrails/gui/debug.py
2
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: [email protected] ## ## This file is part of VisTrails. ## ## ...
maas/maas
refs/heads/master
src/maascli/auth.py
1
# Copyright 2012-2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """MAAS CLI authentication.""" from getpass import getpass import http.client import sys from urllib.parse import urljoin from macaroonbakery import httpbakery from apicli...
chengjf/database-interface-doc-management
refs/heads/master
flask-demo/flask/Lib/encodings/gb18030.py
816
# # gb18030.py: Python Unicode Codec for GB18030 # # Written by Hye-Shik Chang <[email protected]> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb18030') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteInc...
ryfeus/lambda-packs
refs/heads/master
Selenium_Chromium/source/setuptools/command/py36compat.py
286
import os from glob import glob from distutils.util import convert_path from distutils.command import sdist from setuptools.extern.six.moves import filter class sdist_add_defaults: """ Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code ...
felixbade/ip
refs/heads/master
app/views.py
1
from flask import request, Response from app import app @app.route('/') def index(): resp = request.headers.environ['HTTP_X_REAL_IP'] + '\n' return Response(resp, mimetype='text/plain')
edx/edx-platform
refs/heads/master
lms/djangoapps/courseware/module_render.py
3
""" Module rendering """ import json import logging import textwrap from collections import OrderedDict from functools import partial from completion.waffle import ENABLE_COMPLETION_TRACKING_SWITCH from completion.models import BlockCompletion from django.conf import settings from django.contrib.auth.models import U...
Krossom/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/distutils/log.py
163
"""A simple log mechanism styled after PEP 282.""" # The class here is styled after PEP 282 so that it could later be # replaced with a standard Python logging implementation. DEBUG = 1 INFO = 2 WARN = 3 ERROR = 4 FATAL = 5 import sys class Log: def __init__(self, threshold=WARN): self.threshold = thre...
MariaPet/sqlparse
refs/heads/master
extras/buildbot/googlecode_atom.py
12
# GoogleCode Atom Feed Poller # Author: Srivats P. <pstavirs> # Based on Mozilla's HgPoller # http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/tools/buildbot/buildbot/changes/Attic/hgpoller.py&revision=1.1.4.2 # # Description: # Use this ChangeSource for projects hosted on http://code.google.com/ # # This C...
TheTimmy/spack
refs/heads/develop
var/spack/repos/builtin/packages/font-misc-cyrillic/package.py
3
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [email protected], All rights reserved. # LLNL-CODE-64...
yuanzhao/gpdb
refs/heads/master
src/test/tinc/ext/unittest2/runner.py
164
"""Running tests""" import sys import time import unittest from unittest2 import result try: from unittest2.signals import registerResult except ImportError: def registerResult(_): pass __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'w...
JioCloud/horizon
refs/heads/master
openstack_dashboard/dashboards/project/instances/tables.py
1
# Copyright 2012 Nebula, 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 agree...
zhongjingjogy/SmartQQBot
refs/heads/master
plugins/plugin_tuling.py
1
#coding=utf-8 import os import json import urllib2 import random from smartqq import ( on_all_message, on_group_message, on_private_message, on_from_uin_message ) from smartqq import GroupMsg, PrivateMsg class Chat(object): key = "" apiurl = "http://www.tuling123.com/openapi/api?" de...
newera912/WeatherTransportationProject
refs/heads/master
src/main/java/edu/albany/cs/transCorrelation/PICEvent.py
1
import numpy as np from math import * import numpy as np import random,time from sets import Set import itertools,sys from tqdm import * def calcDistance(Lat_A, Lng_A, Lat_B, Lng_B): ra = 6378.140 rb = 6356.755 flatten = (ra - rb) / ra # rad_lat_A = radians(Lat_A) rad_lng_A = radi...
roderickvd/nzbToMedia
refs/heads/master
libs/unidecode/x084.py
252
data = ( 'Hu ', # 0x00 'Qi ', # 0x01 'He ', # 0x02 'Cui ', # 0x03 'Tao ', # 0x04 'Chun ', # 0x05 'Bei ', # 0x06 'Chang ', # 0x07 'Huan ', # 0x08 'Fei ', # 0x09 'Lai ', # 0x0a 'Qi ', # 0x0b 'Meng ', # 0x0c 'Ping ', # 0x0d 'Wei ', # 0x0e 'Dan ', # 0x0f 'Sha ', # 0x10 'Hu...
liosha2007/temporary-groupdocs-python-sdk
refs/heads/master
groupdocs/models/GetJobResourcesResponse.py
1
#!/usr/bin/env python """ Copyright 2012 GroupDocs. 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...
Existed/kernel-2.6.35.14
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
802
# Core.py - Python extension for perf trace, core functions # # Copyright (C) 2010 by Tom Zanussi <[email protected]> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def auto...
YzPaul3/h2o-3
refs/heads/master
h2o-docs/src/booklets/v2_2015/source/DeepLearning_Vignette_code_examples/deeplearning_inspect_model.py
9
# View specified parameters of the Deep Learning model model.params # Examine the performance of the trained model model # display all performance metrics model.model_performance(train=True) # training metrics model.model_performance(valid=True) # validation metrics # Get MSE only model.mse(valid=True) # Cross-v...
redhat-openstack/django
refs/heads/epel7-patches
tests/signing/models.py
754
# models.py file for tests to run.
longjon/numpy
refs/heads/master
numpy/fft/tests/test_helper.py
45
#!/usr/bin/env python """Test functions for fftpack.helper module Copied from fftpack.helper by Pearu Peterson, October 2005 """ from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal from numpy import fft fr...
vismartltd/edx-platform
refs/heads/master
lms/djangoapps/instructor_task/tests/test_subtasks.py
146
""" Unit tests for instructor_task subtasks. """ from uuid import uuid4 from mock import Mock, patch from student.models import CourseEnrollment from instructor_task.subtasks import queue_subtasks_for_query from instructor_task.tests.factories import InstructorTaskFactory from instructor_task.tests.test_base import ...
mattiamaestrini/spotipy
refs/heads/master
examples/simple1.py
10
import spotipy birdy_uri = 'spotify:artist:2WX2uTcsvV5OnS0inACecP' spotify = spotipy.Spotify() results = spotify.artist_albums(birdy_uri, album_type='album') albums = results['items'] while results['next']: results = spotify.next(results) albums.extend(results['items']) for album in albums: print((albu...
varunagrawal/yowsup
refs/heads/master
yowsup/layers/protocol_media/protocolentities/test_message_media_location.py
69
from yowsup.layers.protocol_media.protocolentities.test_message_media import MediaMessageProtocolEntityTest from yowsup.layers.protocol_media.protocolentities import LocationMediaMessageProtocolEntity from yowsup.structs import ProtocolTreeNode class LocationMediaMessageProtocolEntityTest(MediaMessageProtocolEntityTest...
adelina-t/nova
refs/heads/master
nova/cmd/novncproxy.py
38
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
conorpp/napkis
refs/heads/master
napkis/deployment/python2.7/django/middleware/http.py
225
from django.utils.http import http_date, parse_http_date_safe class ConditionalGetMiddleware(object): """ Handles conditional GET operations. If the response has a ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, the response is replaced by an HttpNotModified. ...
KiChjang/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py
4
import base64 import hashlib import io import json import os import threading import traceback import socket import sys from abc import ABCMeta, abstractmethod from http.client import HTTPConnection from urllib.parse import urljoin, urlsplit, urlunsplit from .actions import actions from .protocol import Protocol, Base...
MFoster/breeze
refs/heads/master
django/core/mail/backends/console.py
137
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream', sys.stdout) self._loc...
wilebeast/FireFox-OS
refs/heads/master
B2G/gecko/xpcom/idl-parser/header.py
2
#!/usr/bin/env python # header.py - Generate C++ header files from IDL. # # 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/. """Print a C++ header file for the IDL files s...
flwh/KK_mt6589_iq451
refs/heads/master
prebuilts/python/darwin-x86/2.7.5/lib/python2.7/test/test_math.py
71
# Python test set -- math module # XXXX Should not do tests around zero only from test.test_support import run_unittest, verbose import unittest import math import os import sys import random import struct eps = 1E-05 NAN = float('nan') INF = float('inf') NINF = float('-inf') # decorator for skipping tests on non-IE...
tbinias/heekscnc
refs/heads/master
pycnc/wxNiceTextCtrl.py
25
import wx import HeeksCNC class DoubleCtrl(wx.TextCtrl): def __init__(self, parent, id = wx.ID_ANY, factor = 1.0): wx.TextCtrl.__init__(self, parent, id) self.factor = factor def GetValue(self): try: return float(wx.TextCtrl.GetValue(self))/self.factor excep...
jjhelmus/adventofcode
refs/heads/master
day09.py
1
from __future__ import print_function import itertools verbose = False # read in the locations and distances from the file #f = open('inputs/input09_test.txt') f = open('inputs/input09.txt') path = {} locations = [] for line in f: lline = line.split() city1 = lline[0] city2 = lline[2] distance = in...
dan-gittik/example
refs/heads/master
example/__main__.py
1
from .foo import Foo from .bar import Bar def main(*argv): if len(argv) == 1 and argv[0] == 'foo': foo = Foo() print(foo.run()) return 0 if len(argv) == 1 and argv[0] == 'bar': bar = Bar() print(bar.run()) return 0 print('USAGE: python -m example <foo|bar>') ...
xeddmc/PyBitmessage
refs/heads/master
src/bitmessagecurses/__init__.py
12
# Copyright (c) 2014 Luke Montalvo <[email protected]> # This file adds a alternative commandline interface, feel free to critique and fork # # This has only been tested on Arch Linux and Linux Mint # Dependencies: # * from python2-pip # * python2-pythondialog # * dialog import os import sys import StringI...
yakky/django-cms
refs/heads/develop
cms/tests/test_api.py
3
import sys from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.core.exceptions import PermissionDenied from django.template import TemplateDoesNotExist, Temp...
patriciolobos/desa8
refs/heads/master
openerp/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py
340
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
tonybaloney/st2
refs/heads/master
st2common/st2common/constants/api.py
10
# 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...