repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
fjbatresv/odoo
refs/heads/8.0
openerp/addons/test_inherit/__init__.py
2074
# -*- coding: utf-8 -*- import models # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
jperon/musite
refs/heads/master
deps/abc2xml/abc2xml.py
2
#!/usr/bin/env python # coding=latin-1 ''' Copyright (C) 2012: Willem G. Vree Contributions: Nils Liberg, Nicolas Froment, Norman Schmidt, Reinier Maliepaard, Martin Tarenskeen, Paul Villiger, Alexander Scheutzow This program is free software; you can redistribute it and/or modify it under the terms of ...
evilpie/servo
refs/heads/master
tests/wpt/web-platform-tests/common/large.py
238
def main(request, response): """Code for generating large responses where the actual response data isn't very important. Two request parameters: size (required): An integer number of bytes (no suffix) or kilobytes ("kb" suffix) or megabytes ("Mb" suffix). string (optional): The...
JimDennis/pymssql
refs/heads/master
tests/test_utils.py
4
from .helpers import eq_ from _mssql import substitute_params def test_single_param(): res = substitute_params( 'SELECT * FROM employees WHERE id = %s', 13) eq_(res, b'SELECT * FROM employees WHERE id = 13') res = substitute_params( 'SELECT * FROM empl WHERE name = %s', b...
vishdha/erpnext
refs/heads/develop
erpnext/buying/doctype/supplier_quotation/__init__.py
37694
from __future__ import unicode_literals
saurabh6790/pow-app
refs/heads/master
manufacturing/doctype/workstation/__init__.py
37694
from __future__ import unicode_literals
ntb-ch/linux
refs/heads/master
tools/perf/scripts/python/futex-contention.py
1997
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
puckipedia/youtube-dl
refs/heads/master
youtube_dl/extractor/airmozilla.py
71
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, parse_iso8601, ) class AirMozillaIE(InfoExtractor): _VALID_URL = r'https?://air\.mozilla\.org/(?P<id>[0-9a-z-]+)/?' _TEST = { 'url': 'htt...
duramato/CouchPotatoServer
refs/heads/develop
libs/html5lib/treewalkers/lxmletree.py
618
from __future__ import absolute_import, division, unicode_literals from six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isin...
rolandovillca/python_basis
refs/heads/master
context_manager/context_manager.py
4
''' Context Managers: Context managers allow setup and cleanup actions to be taken for objects when their creation is wrapped with a with statement. The behavior of the context manager is determined by two magic methods: __enter__(self): Defines what the context manager should do at the beginning of the block created...
Ichag/odoo
refs/heads/8.0
openerp/service/db.py
230
# -*- coding: utf-8 -*- import json import logging import os import shutil import tempfile import threading import traceback import zipfile from functools import wraps from contextlib import closing import psycopg2 import openerp from openerp import SUPERUSER_ID from openerp.exceptions import Warning import openerp...
kenny-goh/vrpsolver
refs/heads/master
vrpsolver/mysite/mysite/wsgi.py
160
""" WSGI config for mysite project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") from django.core.wsg...
haoranzeus/googletest
refs/heads/master
scripts/pump.py
603
#!/usr/bin/env python # # Copyright 2008, 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...
stackforge/senlin
refs/heads/master
senlin/tests/unit/test_common_scaleutils.py
1
# 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 unde...
meyersj/geotweet
refs/heads/master
geotweet/geomongo/mongo.py
1
import os import json import pymongo from pymongo import MongoClient import logging MONGODB_URI = os.getenv('GEOTWEET_MONGODB_URI', 'mongodb://127.0.0.1:27017') DB = "test" COLLECTION = "test" PORTLAND = [-122.675983, 45.524764] DEFAULT_TIMEOUT = 5 * 1000 class Mongo(object): """ Base wrapper class to connect...
sopier/django
refs/heads/master
tests/proxy_models/urls.py
405
from django.conf.urls import url from .admin import site urlpatterns = [ url(r'^admin/', site.urls), ]
aminorex/icsisumm
refs/heads/master
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/parse/chart.py
9
# Natural Language Toolkit: A Chart Parser # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@csse.unimelb.edu.au> # Jean Mark Gawron <gawron@mail.sdsu.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TX...
nomedeusuariodesconhecido/info3180-lab4
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/__init__.py
316
""" HTML parsing library based on the WHATWG "HTML5" specification. The parser is designed to be compatible with existing HTML found in the wild and implements well-defined error recovery that is largely compatible with modern desktop web browsers. Example usage: import html5lib f = open("my_document.html") tree = ht...
gnmiller/craig-bot
refs/heads/master
craig-bot/lib/python3.6/site-packages/discord/guild.py
1
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2019 Rapptz 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 u...
2014c2g2/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/configparser.py
692
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
swinghu/zulip
refs/heads/master
zerver/test_bugdown.py
103
# -*- coding: utf-8 -*- from django.conf import settings from django.test import TestCase from zerver.lib import bugdown from zerver.lib.actions import ( do_add_realm_emoji, do_remove_realm_emoji, get_realm, ) from zerver.models import ( get_user_profile_by_email, Message, RealmFilter, ) impo...
harimfl/CocosBuilder
refs/heads/master
CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py
124
#!/usr/bin/env python # Copyright (c) 2012 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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner: "...
clu8/SoilCarbon
refs/heads/master
data.py
1
import pandas as pd import config def load_data(exclude_profiles_cols=True, exclude_layers_cols=True): attributes = pd.read_table(config.attributes_file) profiles = pd.read_csv(config.profiles_file_labeled, low_memory=False, usecols=config.profiles_cols if exclude_profiles_cols else None) layers = pd.rea...
getzze/python-ivi
refs/heads/master
ivi/jdsu/jdsuTB9.py
6
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2014 Alex Forencich 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 righ...
aninternetof/bremen
refs/heads/master
bremenenv/lib/python3.5/site-packages/django/db/migrations/operations/models.py
48
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property cl...
Jumpscale/play8
refs/heads/master
sockettest.py
1
# import nnpy # import time # s=nnpy.Socket(nnpy.AF_SP,nnpy.REP) # # # s.bind('tcp://127.0.0.1:5555') # # # s.setsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET,value=1024*1024) # # s.getsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET) # # counter=0 # while True: # try: # res=s.recv(flags=nnpy.DONTWAIT) ...
gramps-project/addons-source
refs/heads/master
DownloadMedia/DownloadMedia.gpr.py
1
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2015 Tim G L Lyons # # 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 opti...
oceanobservatories/mi-dataset
refs/heads/master
mi/dataset/parser/test/test_presf_abc.py
3
#!/usr/bin/env python """ @package mi.dataset.parser.test.test_presf_abc @file marine-integrations/mi/dataset/parser/test/test_presf_abc.py @author Christopher Fortin, Jeff Roy, Rene Gelinas @brief Test code for a presf_abc data parser """ import os from nose.plugins.attrib import attr from mi.core.exceptions impo...
xsleonard/flask-pystmark
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # Flask-Pystmark documentation build configuration file, created by # sphinx-quickstart on Tue Oct 8 18:07:35 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
kamcpp/tensorflow
refs/heads/master
tensorflow/contrib/__init__.py
3
# 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...
djvoleur/V_92X_BOFE
refs/heads/master
tools/perf/scripts/python/net_dropmonitor.py
2669
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
tyagiarpit/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/dom.py
1229
from __future__ import absolute_import, division, unicode_literals from xml.dom import Node import gettext _ = gettext.gettext from . import _base class TreeWalker(_base.NonRecursiveTreeWalker): def getNodeDetails(self, node): if node.nodeType == Node.DOCUMENT_TYPE_NODE: return _base.DOCTYP...
danlangridge/galah
refs/heads/master
setup.py
1
from setuptools import setup, find_packages setup( name = "galah", version = "0.1.3", packages = find_packages( exclude = [ "galah.sheep*", "galah.shepherd*" ] ), include_package_data = True, zip_safe = False, entry_points = { "console...
lindamar/ecclesi
refs/heads/master
env/lib/python2.7/site-packages/wheel/test/complex-dist/setup.py
345
from setuptools import setup try: unicode def u8(s): return s.decode('unicode-escape') except NameError: def u8(s): return s setup(name='complex-dist', version='0.1', description=u8('Another testing distribution \N{SNOWMAN}'), long_description=u8('Another testing distribu...
SerialShadow/SickRage
refs/heads/master
lib/hachoir_parser/misc/word_2.py
74
""" Documents: * "Microsoft Word for Windows 2.0 Binary Format" http://www.wotsit.org/download.asp?f=word2&sc=275927573 """ from hachoir_core.field import (FieldSet, Enum, Bit, Bits, UInt8, Int16, UInt16, UInt32, Int32, NullBytes, Bytes, RawBytes, PascalString16, DateTimeMSDOS32, TimeDateMSDOS32) f...
chkohn/linux-xlnx
refs/heads/ev/4.6
tools/perf/scripts/python/futex-contention.py
1997
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
antoinecarme/pyaf
refs/heads/master
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_BestCycle_LSTM.py
1
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Integration'] , ['PolyTrend'] , ['BestCycle'] , ['LSTM'] );
bsmr-eve/Pyfa
refs/heads/master
eos/effects/ewgrouprsdmaxrangebonus.py
2
# ewGroupRsdMaxRangeBonus # # Used by: # Implants named like: grade Centurion (10 of 12) type = "passive" def handler(fit, implant, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Sensor Dampener", "maxRange", implant.getModifiedItemAttr("rangeSkillBon...
dbbhattacharya/kitsune
refs/heads/master
migrations/218-create-new-topics.py
2
# -*- coding: utf-8 -*- from django.conf import settings from kitsune.products.models import Product, Topic from kitsune.wiki.models import Document from migrations.models import Topic as OldTopic def run(): # Get all the old topics. old_topics = OldTopic.objects.all().order_by('parent') # For each of t...
rickerc/glance_audit
refs/heads/cis-havana-staging
glance/tests/functional/v1/test_ssl.py
4
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack, LLC # 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/...
azumimuo/family-xbmc-addon
refs/heads/master
plugin.audio.soundcloud/resources/lib/content/items.py
2
__author__ = 'bromix' import re from resources.lib import nightcrawler from resources.lib.nightcrawler.exception import ProviderException def _get_hires_image(url): return re.sub('(.*)(-large.jpg\.*)(\?.*)?', r'\1-t300x300.jpg', url) def _get_thumbnail(json_data): image_url = json_data.get('artwork_url', ...
mikewiebe-ansible/ansible
refs/heads/devel
lib/ansible/modules/cloud/docker/docker_container_info.py
16
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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': ['prev...
MIPS/external-chromium_org
refs/heads/dev-mips-jb-kitkat
build/android/gyp/util/md5_check_test.py
63
# Copyright 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. import tempfile import unittest import md5_check class TestMd5Check(unittest.TestCase): def testCallAndRecordIfStale(self): input_strings = ['string...
darkdukey/sdkbox-facebook-sample-v2
refs/heads/master
external/emscripten/tools/fix_closure.py
15
#!/usr/bin/env python2 ''' With very very large projects, closure compiler can translate FUNCTION_TABLE into something like J = [0, 0, func, 0, f(), 0, function() { ... }, 0, ..] where f() returns a new empty function, and after it is an inlined function. This inlining can be of very very large functions, in which...
SpiritBlood/kernel_lge_hammerhead
refs/heads/lollipop
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
DucQuang1/youtube-dl
refs/heads/master
youtube_dl/extractor/teachingchannel.py
145
from __future__ import unicode_literals import re from .common import InfoExtractor from .ooyala import OoyalaIE class TeachingChannelIE(InfoExtractor): _VALID_URL = r'https?://www\.teachingchannel\.org/videos/(?P<title>.+)' _TEST = { 'url': 'https://www.teachingchannel.org/videos/teacher-teaming-e...
msabramo/ansible
refs/heads/devel
lib/ansible/modules/network/lenovo/cnos_backup.py
19
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
hydratk/hydratk
refs/heads/master
tests/yodalib/hydratk/lib/__init__.py
242
from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
freeflightsim/ffs-app-engine
refs/heads/master
google_appengine/lib/django/django/core/paginator.py
33
class InvalidPage(Exception): pass class ObjectPaginator(object): """ This class makes pagination easy. Feed it a QuerySet or list, plus the number of objects you want on each page. Then read the hits and pages properties to see how many pages it involves. Call get_page with a page number (starting...
heke123/chromium-crosswalk
refs/heads/master
tools/grit/grit/format/policy_templates/writers/android_policy_writer.py
21
#!/usr/bin/env python # Copyright (c) 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. from grit.format.policy_templates.writers import xml_formatted_writer from xml.dom import minidom from xml.sax import saxutils as ...
koobs/dj-stripe
refs/heads/master
tests/test_event_processing_exception.py
9
""" .. module:: dj-stripe.tests.test_event_processing_exception :synopsis: dj-stripe EventProcessingException Model Tests. .. moduleauthor:: Alex Kavanaugh (@kavdev) """ from copy import deepcopy from django.test import TestCase from djstripe.models import EventProcessingException, Event class TestEventProces...
vizual54/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/doc/howtofind.py
100
""" ================= How to Find Stuff ================= How to find things in NumPy. """
paulfitz/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_parser.py
135
#!/usr/bin/env python # Copyright (C) 2013 Adobe Systems Incorporated. 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 n...
burzillibus/RobHome
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py
713
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
srjoglekar246/sympy
refs/heads/master
sympy/utilities/pytest.py
2
"""py.test hacks to support XFAIL/XPASS""" import sys import functools try: import py from py.test import skip, raises USE_PYTEST = getattr(sys, '_running_pytest', False) except ImportError: USE_PYTEST = False if not USE_PYTEST: def raises(expectedException, code=None): """ Tests ...
saurabh6790/test_final_med_app
refs/heads/master
selling/doctype/sales_order_item/__init__.py
37694
from __future__ import unicode_literals
fintech-circle/edx-platform
refs/heads/master
cms/__init__.py
54
""" Celery needs to be loaded when the cms modules are so that task registration and discovery can work correctly. """ from __future__ import absolute_import # We monkey patch Kombu's entrypoints listing because scanning through this # accounts for the majority of LMS/Studio startup time for tests, and we don't # use ...
pkats15/hdt_analyzer
refs/heads/master
django_test/django_venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2935
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
danielneis/osf.io
refs/heads/develop
website/conferences/utils.py
7
# -*- coding: utf-8 -*- import uuid import requests from modularodm import Q from modularodm.exceptions import ModularOdmException from framework.auth import Auth, signals from framework.auth.core import get_user from website import util from website import security from website import settings from website.project...
PowerShellEmpire/Empire
refs/heads/master
lib/modules/python/persistence/osx/RemoveDaemon.py
10
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'RemoveLaunchDaemon', # list of one...
saintdragon2/python-3-lecture-2015
refs/heads/master
civil_mid_final/2johack/source/Vector2.py
4
# Uma classe que representa um vetor com duas dimensoes class Vector2: def __init__(self, x, y): # eixo x do vector2 self.x = x # eixo y do vector2 self.y = y # Soma este Vector2 com um outro # param: vector2 - um Vector2 para ser somado def add(self, vector2): ...
peteruhnak/pharo-vm
refs/heads/master
opensmalltalk-vm/build.linux64x64/third-party/alsa-lib-1.0.17a/modules/mixer/simple/python/common.py
24
#!/usr/bin/python # -*- coding: utf-8 -*- # -*- Python -*- from pyalsa.alsahcontrol import HControl, Element as HElement, \ Info as HInfo, Value as HValue, InterfaceId, \ EventMask, EventMaskRemove MIXER = InterfaceId['Mixer'] MIXERS = str(MIXER) clas...
mgaitan/scipy
refs/heads/master
scipy/sparse/csgraph/tests/test_connected_components.py
144
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_array_almost_equal from scipy.sparse import csgraph def test_weak_connections(): Xde = np.array([[0, 1, 0], [0, 0, 0], [0, 0, 0]]) Xsp = ...
jourdy345/pmtk3
refs/heads/master
python/demos/ch01/fisheririsDemo.py
7
#!/usr/bin/env python from sklearn.datasets import load_iris from matplotlib import pylab as pl from itertools import permutations data = load_iris() features = data['data'] feature_names = data['feature_names'] target = data['target'] feature_combinations = list(permutations(range(4), 2)) for i in range(16): i...
petecummings/django
refs/heads/master
django/conf/locale/ca/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
ephes/scikit-learn
refs/heads/master
sklearn/tree/tests/test_export.py
76
""" Testing for export functions of decision trees (sklearn.tree.export). """ from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.tree import export_graphviz from sklearn.externals.six import StringIO # toy sa...
lmorchard/gitshipped
refs/heads/master
vendor-local/lib/python/requests/packages/urllib3/response.py
54
# urllib3/response.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import zlib import io from .exceptions import DecodeError from .packages.six ...
sloria/wtfhack
refs/heads/master
wtfhack/functional_tests/webtest_tests.py
1
'''Functional tests using WebTest''' from django.core.urlresolvers import reverse from django_webtest import WebTest from nose.tools import * from wtfhack.base.models import Repo, Language from wtfhack.base.views import get_repo class TestAUser(WebTest): def setUp(self): self.python = Language.objects.c...
dmort27/pylid
refs/heads/master
pylid/langs/hmn.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import pylid from collections import Counter hmn = pylid.PyLID(3) hmn.total_ngrams = 159771623 hmn.lang = 'hmn' hmn.ngrams = Counter({ u' ts': 1396157, u'ab ': 1298229, u'as ': 1253541, u'is ': 1205135, u's t': 1203015, u'aj ': 1159263, u'og ':...
greatmazinger/or-tools
refs/heads/master
examples/python/place_number_puzzle.py
32
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
talishte/ctigre
refs/heads/master
env/lib/python2.7/site-packages/requests/packages/chardet/latin1prober.py
1777
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
snamstorm/rockstor-core
refs/heads/master
src/rockstor/storageadmin/views/oauth_app.py
2
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
chris48s/mapit
refs/heads/master
mapit_gb/controls/2011-05.py
3
# A control file for importing Boundary-Line. # CEDs don't have ONS codes, so we have to have something manual # to e.g. tell us if some county council wards have changed. # # This edition of Boundary-Line uses the new SNAC codes from areas.models import Area, Generation def code_version(): return 'gss' # Rena...
epssy/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/core/management/commands/sqlcustom.py
242
from __future__ import unicode_literals from optparse import make_option from django.core.management.base import AppCommand from django.core.management.sql import sql_custom from django.db import connections, DEFAULT_DB_ALIAS class Command(AppCommand): help = "Prints the custom table modifying SQL statements for...
garyjyao1/ansible
refs/heads/devel
lib/ansible/modules/extras/packaging/language/bower.py
40
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Michael Warkentin <mwarkentin@gmail.com> # # 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 ...
ez-p/madness
refs/heads/master
tournament/management/commands/_printer.py
1
import sys import tournament.engine.region as region import tournament.engine.data as data class Printer: def __init__(self, tournament, print_to_file): self.results = tournament.results self.to_file = print_to_file def make_file_name(self): team1 = self.results['finalist'][0].name ...
aviciimaxwell/odoo
refs/heads/8.0
addons/payment_ogone/controllers/__init__.py
4497
# -*- coding: utf-8 -*- import main
drodri/common
refs/heads/develop
test/serialize/serialization_test.py
5
#!/usr/bin/python # -*- coding: utf-8 -*- from biicode.common.utils.serializer import ClassTypedSerializer, Deserializer, serialize from biicode.common.model.cells import SimpleCell, CellDeserializer, VirtualCell from biicode.common.model.id import ID, UserID from biicode.common.model.bii_type import BiiType, SOUND fro...
tkaitchuck/nupic
refs/heads/master
external/linux64/lib/python2.6/site-packages/numpy/distutils/command/config.py
89
# Added Fortran compiler support to config. Currently useful only for # try_compile call. try_run works but is untested for most of Fortran # compilers (they must define linker_exe first). # Pearu Peterson import os, signal import warnings import sys from distutils.command.config import config as old_config from dist...
kawasaki2013/python-for-android-x86
refs/heads/master
python3-alpha/python3-src/Lib/pipes.py
46
"""Conversion pipeline templates. The problem: ------------ Suppose you have some data that you want to convert to another format, such as from GIF image format to PPM image format. Maybe the conversion involves several steps (e.g. piping it through compress or uuencode). Some of the conversion steps may require th...
Andrey-Pavlov/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/watchlist/watchlist_mock.py
130
# 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 f...
takaaptech/sky_engine
refs/heads/master
third_party/binutils/download.py
93
#!/usr/bin/env python # 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. # vim: set ts=2 sw=2 et sts=2 ai: """Minimal tool to download binutils from Google storage. TODO(mithro): Replace with generic downloa...
JioCloud/oslo-incubator
refs/heads/master
openstack/common/notifier/test_notifier.py
129
# Copyright 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.apache.org/licenses/LICENSE-2.0 # # Unless req...
Sonicbids/django
refs/heads/master
tests/migrations/test_migrations_squashed_erroneous/3_squashed_5.py
770
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): replaces = [ ("migrations", "3_auto"), ("migrations", "4_auto"), ("migrations", "5_auto"), ] dependencies = [("migrations", "2_auto")] ope...
Gillu13/scipy
refs/heads/master
scipy/interpolate/setup.py
106
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info lapack_opt = get_info('lapack_opt', not...
zhuwei05/ml-basic
refs/heads/master
BuildMLSyswithPy/ch06/install.py
23
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License # # Sanders-Twitter Sentiment Corpus Install Script # Version 0.1 # # Pulls tweet data from Twitter bec...
tinyms/TanYue
refs/heads/master
tinyms/test/cache_test.py
1
__author__ = 'i@tinyms.com' from tinyms.core.cache import CacheFactory CacheFactory.STORAGE_PATH = "d:/temp/flask/demo2" c = CacheFactory.simple() c.set('cc', 'ddddddddddd') print(c.get('cc')) f = CacheFactory.file() # f.set("user3", {"Name": "Jhone"}) print(f.get("user3"))
kmaglione/amo-validator
refs/heads/master
validator/testcases/javascript/security.py
1
"""Tests which relate to the overall security of the browser.""" from __future__ import absolute_import, print_function, unicode_literals import os.path import re from validator.errorbundler import merge_description from ..regex.javascript import STRING_REGEXPS from .bootstrapped import if_jetpack from .jstypes impor...
msebire/intellij-community
refs/heads/master
python/lib/Lib/compiler/future.py
93
"""Parser for future statements """ from compiler import ast, walk def is_future(stmt): """Return true if statement is a well-formed future statement""" if not isinstance(stmt, ast.From): return 0 if stmt.modname == "__future__": return 1 else: return 0 class FutureParser: ...
wendbv/pluvo-python
refs/heads/master
setup.py
1
from setuptools import setup setup( name='pluvo', packages=['pluvo'], package_data={}, version='0.2.17', description='Python library to access the Pluvo REST API.', author='Wend BV', author_email='info@wend.nl', license='MIT', url='https://github.com/wendbv/pluvo-python', keywo...
florentx/OpenUpgrade
refs/heads/8.0
addons/l10n_vn/__init__.py
425
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved. # # This program is free software: you can redistribute it and/or...
tryolabs/luminoth
refs/heads/master
luminoth/utils/hooks/var_vis_hook.py
1
import tensorflow as tf from tensorflow.python.training.summary_io import SummaryWriterCache class VarVisHook(tf.train.SessionRunHook): def __init__(self, every_n_steps=None, every_n_secs=None, mode=None, output_dir=None, vars_summary=None): super(VarVisHook, self).__init__() i...
Jgarcia-IAS/localizacion
refs/heads/master
openerp/addons/edi/__init__.py
437
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
vijayendrabvs/ssl-neutron
refs/heads/master
neutron/tests/unit/ryu/fake_ryu.py
45
# Copyright (c) 2013 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
crossbario/autobahn-testsuite
refs/heads/master
autobahntestsuite/autobahntestsuite/case/case9_6_2.py
2
############################################################################### ## ## Copyright (c) Crossbar.io Technologies GmbH ## ## 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...
moyogo/dancingshoes-1
refs/heads/master
Lib/dancingshoes/opentypenames.py
3
#!/usr/bin/python ### OT specs, from http://www.microsoft.com/typography/otspec/ttoreg.htm OTfeatures = { "aalt": "Access All Alternates", "abvf": "Above-base Forms", "abvm": "Above-base Mark Positioning", "abvs": "Above-base Substitutions", "afrc": "Alternative Fractions", "akhn": "Akhands", "blwf"...
nicolargo/intellij-community
refs/heads/master
python/testData/formatter/spaceAfterCommaWrappedLine.py
166
import contextlib,\ math,decimal
MotorolaMobilityLLC/external-chromium_org
refs/heads/kitkat-mr1-release-falcon-gpe
build/android/gyp/get_device_configuration.py
52
#!/usr/bin/env python # # Copyright 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. """Gets and writes the configurations of the attached devices. This configuration is used by later build steps to determine which de...
jn2840/bitcoin
refs/heads/master
qa/rpc-tests/httpbasics.py
1
#!/usr/bin/env python2 # Copyright (c) 2014 The Beardcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test rpc http basics # from test_framework.test_framework import BitcoinTestFramework from test_framewo...
lym/allura-git
refs/heads/master
Allura/allura/config/middleware.py
1
# -*- 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 Apach...