repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
yuanagain/seniorthesis
refs/heads/master
venv/lib/python2.7/site-packages/scipy/optimize/tests/test_lsq_linear.py
59
import numpy as np from numpy.linalg import lstsq from numpy.testing import (assert_allclose, assert_equal, assert_, run_module_suite, assert_raises) from scipy.sparse import rand from scipy.sparse.linalg import aslinearoperator from scipy.optimize import lsq_linear A = np.array([ [0.17...
axsauze/eventsfinder
refs/heads/master
django/template/defaultfilters.py
105
"""Default variable filters.""" from __future__ import unicode_literals import re import random as random_module import unicodedata from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP from functools import wraps from pprint import pformat from django.template.base import Variable, Library, VariableD...
garbas/mozilla-releng-services
refs/heads/master
src/releng_archiver/releng_archiver/api.py
6
# -*- coding: utf-8 -*- # 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/. from __future__ import absolute_import def example(): return {}
Yukarumya/Yukarum-Redfoxes
refs/heads/master
testing/web-platform/tests/tools/pywebsocket/src/test/test_http_header_util.py
496
#!/usr/bin/env python # # Copyright 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...
hunterhu/linux-sunxi
refs/heads/sunxi-3.4
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
alexhenrie/poedit
refs/heads/master
deps/boost/libs/python/test/wrapper_held_type.py
20
# Copyright David Abrahams 2005. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' >>> from wrapper_held_type_ext import * >>> d = data() >>> print(d.id()) 42 >>> do_nothing( d ) >>> print(d.id()) 42 >>> d = create_...
dpetzold/django
refs/heads/master
tests/forms_tests/widget_tests/test_textarea.py
331
from django.forms import Textarea from django.utils.safestring import mark_safe from .base import WidgetTest class TextareaTest(WidgetTest): widget = Textarea() def test_render(self): self.check_html(self.widget, 'msg', 'value', html=( '<textarea rows="10" cols="40" name="msg">value</tex...
alex-march/micropython
refs/heads/master
tests/import/pkg6/x/y.py
99
print('y')
MatzeB/libfirm
refs/heads/master
scripts/jinja2/bccache.py
346
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
felixfontein/ansible
refs/heads/devel
test/integration/targets/module_utils/module_utils/baz2/one.py
298
data = 'baz2'
sherifzain/mongrel2
refs/heads/master
examples/python/mongrel2/handler.py
57
import zmq import time from mongrel2.request import Request try: import json except: import simplejson as json CTX = zmq.Context() HTTP_FORMAT = "HTTP/1.1 %(code)s %(status)s\r\n%(headers)s\r\n\r\n%(body)s" MAX_IDENTS = 100 def http_response(body, code, status, headers): payload = {'code': code, 'status'...
6112/servo
refs/heads/master
tests/wpt/harness/wptrunner/update/metadata.py
118
# 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, products from base import Step, StepRunner class GetUpdatePropertyList(Step): ...
santisiri/popego
refs/heads/master
popego/popserver/build/lib/popserver/lib/cache/persistence.py
3
import api from zope.interface import implements from datetime import datetime class MemoryCachePersistence(object): implements(api.ICachePersistence) def __init__(self): self.cache = dict() def invalidate(self, resource, newTag): self.cache[resource] = newTag def getLastValue(self,...
darkfeline/wmii
refs/heads/master
alternative_wmiircs/python/pygmi/fs.py
9
import collections from datetime import datetime, timedelta import re from pyxp import * from pyxp.client import * from pygmi import * from pygmi.util import prop __all__ = ('wmii', 'Tags', 'Tag', 'Area', 'Frame', 'Client', 'Button', 'Colors', 'Color', 'Toggle', 'Always', 'Never') spacere = re.compile(r'\...
xfournet/intellij-community
refs/heads/master
python/testData/intentions/PyStringConcatenationToFormatIntentionTest/py3_after.py
83
string = "string" some_string = "some {0}".format(string)
charukiewicz/beer-manager
refs/heads/master
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
551
# urllib3/filepost.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 codecs import mimetypes from uuid import uuid4 from io import BytesIO from .packages ...
GoelDeepak/dcos
refs/heads/master
release/storage/http.py
17
import os import requests from release.storage import AbstractStorageProvider class HttpStorageProvider(AbstractStorageProvider): name = 'http' def __init__(self, url): self.__url = url.rstrip('/') + '/' def _get_absolute(self, path): assert not path.startswith('/') return self...
msarahan/bokeh
refs/heads/master
sphinx/source/docs/user_guide/source_examples/plotting_segments.py
50
from bokeh.plotting import figure, show p = figure(width=400, height=400) p.segment(x0=[1, 2, 3], y0=[1, 2, 3], x1=[1.2, 2.4, 3.1], y1=[1.2, 2.5, 3.7], color="#F4A582", line_width=3) show(p)
JCROM-Android/jcrom_external_chromium_org
refs/heads/kitkat
chrome/common/extensions/docs/server2/subversion_file_system.py
23
# Copyright (c) 2012 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 logging import posixpath import traceback import xml.dom.minidom as xml from xml.parsers.expat import ExpatError from appengine_url_fetcher impor...
HybridF5/nova
refs/heads/master
nova/tests/functional/api_sample_tests/test_used_limits.py
9
# Copyright 2012 Nebula, Inc. # Copyright 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...
alexkogon/ansible
refs/heads/devel
lib/ansible/plugins/action/add_host.py
28
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright 2012, Seth Vidal <skvidal@fedoraproject.org> # # 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, ...
EricCline/CEM_inc
refs/heads/master
env/lib/python2.7/site-packages/django/contrib/gis/geoip/__init__.py
225
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geolocation, t...
thomaskuestner/MRIQA
refs/heads/master
components/condition.py
1
""" Condition GUI-DESCRIPTION { "description": "Condition helps to create a feedback loop", "url": "https://github.com/thomaskuestner/MRIQA/wiki/Components#condition", "settings": [ { "counter": { "property": [ { ...
yfpeng/pengyifan-leetcode
refs/heads/master
src/main/python/pyleetcode/find_disappeared_numbers.py
1
""" Given an array of integers where 1 <= a[i] <= n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this array. Could you do it without extra space and in O(n) runtime? You may assume the returned list does not count as extra spac...
nicolargo/intellij-community
refs/heads/master
python/testData/inspections/PyArgumentListInspection/tuples.py
83
ab = ((1, 2), (3, 4)) def f(*args): return args f(*ab) # pass
creasyw/IMTAphy
refs/heads/master
wnsbase/playground/builtins/Cleanup/Cleanup.py
3
############################################################################### # This file is part of openWNS (open Wireless Network Simulator) # _____________________________________________________________________________ # # Copyright (C) 2004-2007 # Chair of Communication Networks (ComNets) # Kopernikusstr. 16, D-...
kenglishhi/gae-django-sandbox
refs/heads/master
django/contrib/gis/geos/prototypes/misc.py
69
""" This module is for the miscellaneous GEOS routines, particularly the ones that return the area, distance, and length. """ from ctypes import c_int, c_double, POINTER from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_dbl from django.contrib.gis.geos....
jolevq/odoopub
refs/heads/master
addons/point_of_sale/__openerp__.py
26
# -*- 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...
ThiagoGarciaAlves/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/conf/global_settings.py
73
# Default Django settings. Override these with settings in the module # pointed-to by the DJANGO_SETTINGS_MODULE environment variable. # This is defined here as a do-nothing function because we can't import # django.utils.translation -- that module depends on the settings. gettext_noop = lambda s: s #################...
factorlibre/OCB
refs/heads/8.0
addons/share/__openerp__.py
250
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP SA (<http://www.openerp.com>). # # This program is free software: you ...
sumanthha/fundafriend
refs/heads/master
django/core/mail/utils.py
1315
""" Email message and email sending related helper functions. """ import socket # Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of # seconds, which slows down the restart of the server. class CachedDnsName(object): def __str__(self): return self.get_fqdn() def get_fqdn(sel...
weaver-viii/subuser
refs/heads/master
logic/subuserlib/installedImages.py
2
#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. """ This is used for deep inspection of which images are installed in Docker and what their dependencies are. """ #external imports #import ... #internal imports #import ... def getImageLineageI...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-3.2/Lib/test/test_codecmaps_cn.py
57
#!/usr/bin/env python3 # # test_codecmaps_cn.py # Codec mapping tests for PRC encodings # from test import support from test import test_multibytecodec_support import unittest class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gb2312' mapfile...
saimn/astropy
refs/heads/main
astropy/io/ascii/ecsv.py
2
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Define the Enhanced Character-Separated-Values (ECSV) which allows for reading and writing all the meta data associated with an astropy Table object. """ import re from collections import OrderedDict import warnings from . import core, basic from ast...
matthewoliver/swift
refs/heads/master
test/__init__.py
7
# Copyright (c) 2010-2012 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 agree...
macobo/documentation
refs/heads/master
code_snippets/api-search.py
3
from datadog import initialize, api options = { 'api_key': '9775a026f1ca7d1c6c5af9d94d9595a4', 'app_key': '87ce4a24b5553d2e482ea8a8500e71b8ad4554ff' } initialize(**options) # Search by `host` facet. api.Infrastructure.search(q="hosts:database") # Search by `metric` facet. api.Infrastructure.search(q="metric...
hieukypc/ERP
refs/heads/master
openerp/addons/pos_mercury/models/__init__.py
70
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import pos_mercury import pos_mercury_transaction
bpilania/SDNGini
refs/heads/master
backend/src/gloader/xml/dom/html/HTMLDirectoryElement.py
10
######################################################################## # # File Name: HTMLDirectoryElement # # ### This file is automatically generated by GenerateHtml.py. ### DO NOT EDIT! """ WWW: http://4suite.com/4DOM e-mail: support@4suite.com Copyright (c) 2000 Fourthought Inc, USA. All R...
habnabit/divmod-sine
refs/heads/master
sine/test/historic/stub_voicemaildispatcher1to2.py
2
from axiom.test.historic.stubloader import saveStub from axiom.userbase import LoginSystem from sine.sipserver import SIPServer from sine.voicemail import VoicemailDispatcher def createDatabase(s): loginSystem = LoginSystem(store=s) loginSystem.installOn(s) sip = SIPServer(store=s) sip.startService() ...
jonnor/FreeCAD
refs/heads/master
src/Tools/wiki2chm.py
27
#! python # -*- coding: utf-8 -*- # (c) 2007 Juergen Riegel LGPL Usage = """wiki2chm - connect to a wiki and spider the docu Usage: wiki2chm [Options] WikiBaseUrl TocPageName Options: -p, --proxy=ProxyUrl specify a proxy -o --out-path=BASEPATH use this base path to the HTML project -h, --h...
coffenbacher/askbot-devel
refs/heads/master
askbot/migrations/0093_auto__del_field_vote_content_type__del_field_vote_object_id__chg_field.py
10
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Vote', fields ['object_id', 'content_type', 'user'] db.delete_unique(u'vo...
afandria/mojo
refs/heads/master
build/ios/clean_env.py
208
#!/usr/bin/python # Copyright (c) 2012 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 import sys def Main(argv): """This is like 'env -i', but it uses a whitelist of env variables to allow through to the co...
Shrhawk/edx-platform
refs/heads/master
cms/djangoapps/contentstore/features/courses.py
171
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # pylint: disable=unused-argument from lettuce import world, step from common import * ############### ACTIONS #################### @step('There are no courses$') def no_courses(step): world.clear_courses() create_studio_user() @st...
wetneb/django
refs/heads/master
django/core/management/utils.py
36
from __future__ import unicode_literals import os import sys from subprocess import PIPE, Popen from django.utils import six from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text from .base import CommandError def popen_wrapper(args, os_err_exc_type=CommandError): """ Friendly wrapper aroun...
Jgarcia-IAS/localizacion
refs/heads/master
openerp/addons/website_mail_group/controllers/__init__.py
3646
import main # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
tbeadle/django
refs/heads/master
django/core/management/commands/compilemessages.py
115
from __future__ import unicode_literals import codecs import glob import os from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import find_command, popen_wrapper from django.utils._os import npath, upath def has_bom(fn): with open(fn, 'rb') as f: sample =...
kristoforcarlson/nest-simulator-fork
refs/heads/master
topology/examples/conncomp.py
13
# -*- coding: utf-8 -*- # # conncomp.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 # ...
loop1024/pymo-global
refs/heads/master
android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_sys_settrace.py
19
# Testing the line trace facility. from test import test_support import unittest import sys import difflib import gc # A very basic example. If this fails, we're in deep trouble. def basic(): return 1 basic.events = [(0, 'call'), (1, 'line'), (1, 'return')] # Many of the tests b...
hvnsweeting/GitPython
refs/heads/master
git/test/test_actor.py
20
# test_actor.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from git.test.lib import assert_equal from git import Actor class TestActor(object): def t...
TridevGuha/django
refs/heads/master
tests/template_tests/syntax_tests/test_i18n.py
245
# coding: utf-8 from __future__ import unicode_literals from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import translation from django.utils.safestring import mark_safe from ..utils import setup class I18nTagTests(SimpleTestCase): libraries = { 'c...
xiami9916057/volatility
refs/heads/master
volatility/plugins/overlays/windows/win2003_sp12_x64_syscalls.py
45
# Volatility # Copyright (c) 2008-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
ericdill/pyqtgraph
refs/heads/develop
pyqtgraph/GraphicsScene/exportDialog.py
31
from ..Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT5 from .. import exporters as exporters from .. import functions as fn from ..graphicsItems.ViewBox import ViewBox from ..graphicsItems.PlotItem import PlotItem if USE_PYSIDE: from . import exportDialogTemplate_pyside as exportDialogTemplate elif USE_PYQT5: f...
marwoodandrew/superdesk-core
refs/heads/master
apps/highlights/resource.py
7
from superdesk.resource import Resource TODAY_DATE = 'now/d' WEEK_DATE = 'now/w' allowed_times = ['now-{0}h'.format(hour) for hour in range(1, 25)] allowed_times.append(TODAY_DATE) allowed_times.append(WEEK_DATE) class HighlightsResource(Resource): """Highlights schema""" schema = { 'name': { ...
coala/coala-bears
refs/heads/master
tests/python/PEP8NotebookBearTest.py
2
from coalib.testing.LocalBearTestHelper import verify_local_bear from bears.python.PEP8NotebookBear import PEP8NotebookBear # metadata field deleted manually good_file = r"""{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [...
catmanjan/fireman
refs/heads/master
src/rte/iptables_exception.py
1
from subprocess import CalledProcessError class AddingRuleException(CalledProcessError): def __init__(self, returncode, cmd, output, msg, rule): self.returncode = returncode self.cmd = cmd self.output = output self.msg = msg self.rule = rule def __str__(self): re...
LuckycoinFoundation/LuckycoinCore
refs/heads/master
contrib/spendfrom/spendfrom.py
680
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
pando85/gourmet
refs/heads/master
gourmet/plugins/web_plugin/gourmetweb/recview/views.py
7
from gettext import gettext as _ from django.http import HttpResponse, HttpResponseRedirect from django import forms from django.shortcuts import render_to_response from django.template import Context, loader import sys import re import gourmet.backends.db import gourmet.shopping import gourmet.recipeManager from djang...
ogenstad/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/route53_facts.py
39
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
Talvalin/server-client-python
refs/heads/development
tableauserverclient/models/workbook_item.py
1
import xml.etree.ElementTree as ET from .exceptions import UnpopulatedPropertyError from .property_decorators import property_not_nullable, property_is_boolean from .tag_item import TagItem from .view_item import ViewItem from .. import NAMESPACE from ..datetime_helpers import parse_datetime import copy class Workboo...
h2oai/h2o-3
refs/heads/master
h2o-py/tests/testdir_misc/pyunit_export_time_large.py
2
from __future__ import print_function from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import string import random import pandas as pd import numpy as np import os ''' The below function will test if the exporting of a file in H2O is NOT asynchronous. Meanin...
mozilla/popcorn_maker
refs/heads/master
vendor-local/lib/python/pyasn1/codec/cer/encoder.py
226
# CER encoder from pyasn1.type import univ from pyasn1.codec.ber import encoder from pyasn1.compat.octets import int2oct, null class BooleanEncoder(encoder.IntegerEncoder): def encodeValue(self, encodeFun, client, defMode, maxChunkSize): if client == 0: substrate = int2oct(0) else: ...
Mlieou/lXXtcode
refs/heads/master
leetcode/python/ex_648.py
3
class Solution(object): def replaceWords(self, roots, sentence): """ :type roots: List[str] :type sentence: str :rtype: str """ sentence = sentence.split() shortest_root = len(min(roots, key=len)) roots = set(roots) for i in range(len(sentence)...
parthea/pydatalab
refs/heads/master
solutionbox/structured_data/mltoolbox/regression/linear/__init__.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 a...
sinkuri256/python-for-android
refs/heads/master
python3-alpha/extra_modules/atom/http_interface.py
46
#!/usr/bin/python # # Copyright (C) 2008 Google 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 ...
rommelfs/viper
refs/heads/master
viper/core/ui/console.py
1
# This file is part of Viper - https://github.com/botherder/viper # See the file 'LICENSE' for copying permission. import os import glob import atexit import readline import traceback from viper.common.out import * from viper.core.session import __sessions__ from viper.core.plugins import __modules__ from viper.core....
sane4ka/data_collector
refs/heads/master
src/exceptions.py
1
""" Exception and warning classes. """ class DuplicateFieldNameError(Exception): """Provided field can't be added to survey because other field with same name exists in the scheme """ pass class FieldDoesNotExist(Exception): """The requested field can't be found in survey struct""" pass ...
vvv1559/intellij-community
refs/heads/master
python/testData/console/indent15.after.py
160
def foo(): print '4' print '8'
sandvine/horizon
refs/heads/master
horizon/conf/panel_template/views.py
35
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
silgon/rlpy
refs/heads/master
rlpy/Agents/LSPI_SARSA.py
4
"""Least-Squares Policy Iteration but with SARSA""" from .LSPI import LSPI from .TDControlAgent import SARSA __copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy" __credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann", "William Dabney", "Jonathan P. How"] __license__ = "BSD 3-C...
NavyaJayaram/MyRepository
refs/heads/master
SoundCloudUsingAJS/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py
26
# urllib3/connection.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 socket from socket import timeout as SocketTimeout try: # Python 3 from http.cli...
TOCyna/tabelinha
refs/heads/master
flask/lib/python2.7/site-packages/wtforms/fields/simple.py
139
import warnings from .. import widgets from .core import StringField, BooleanField __all__ = ( 'BooleanField', 'TextAreaField', 'PasswordField', 'FileField', 'HiddenField', 'SubmitField', 'TextField' ) class TextField(StringField): """ Legacy alias for StringField .. deprecated:: 2.0 """ ...
coreos/depot_tools
refs/heads/master
third_party/logilab/astng/exceptions.py
21
# This program 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, or (at your option) any later # version. # # This program is distributed in the hope that it will be usefu...
srickardti/openthread
refs/heads/master
tests/scripts/thread-cert/Cert_5_1_10_RouterAttachLinkQuality.py
1
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
krafczyk/spack
refs/heads/develop
var/spack/repos/builtin/packages/r-geomorph/package.py
5
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Therp/odoo
refs/heads/8.0
addons/point_of_sale/wizard/pos_confirm.py
343
# -*- 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...
sparkslabs/kamaelia
refs/heads/master
Sketches/MPS/Axon.DSL/Axon/DSL/Carousel.py
9
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
meigrafd/httpie
refs/heads/master
httpie/output/formatters/xml.py
51
from __future__ import absolute_import import re from xml.etree import ElementTree from httpie.plugins import FormatterPlugin DECLARATION_RE = re.compile('<\?xml[^\n]+?\?>', flags=re.I) DOCTYPE_RE = re.compile('<!DOCTYPE[^\n]+?>', flags=re.I) DEFAULT_INDENT = 4 def indent(elem, indent_text=' ' * DEFAULT_INDENT):...
ekaputra07/py-bmkg
refs/heads/master
setup.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = "py-bmkg", version = "0.1.0", url = 'https://github.com/ekaputra07/py-bmkg', description = 'A Python wrapper for accessing earth quake, climate data of Indonesia based on BMKG (http://bmkg.go.id).',...
brendandburns/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/pooling_ops_test.py
5
"""Functional tests for pooling operations.""" from __future__ import print_function import tensorflow.python.platform import numpy as np import tensorflow as tf from tensorflow.python.kernel_tests import gradient_checker as gc from tensorflow.python.ops import gen_nn_ops def GetInceptionMaxPoolShapes(): """Itera...
okfish/django-oscar
refs/heads/master
src/oscar/models/fields/__init__.py
46
from django.core.exceptions import ImproperlyConfigured from django.db.models.fields import CharField, DecimalField from django.db.models import SubfieldBase from django.utils import six from django.utils.translation import ugettext_lazy as _ from oscar.core import validators from oscar.forms import fields import osc...
TaskEvolution/Task-Coach-Evolution
refs/heads/master
taskcoach/taskcoachlib/gui/status.py
1
''' Task Coach - Your friendly task manager Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org> Task Coach 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 ...
Aearsis/economy-game
refs/heads/master
tokens/views.py
1
import random from django import forms from django.contrib import messages from django.contrib.auth.decorators import permission_required from django.shortcuts import render, redirect from core.models import InvalidTransaction from ekonomicka.utils import team_required, game_running_required from tokens.models import ...
saratang/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/invalid-utf8-html.py
253
def main(request, response): headers = [("Content-type", "text/html;charset=utf-8")] content = chr(0xff) return headers, content
barseghyanartur/python-social-auth
refs/heads/master
social/backends/trello.py
76
""" Trello OAuth1 backend, docs at: http://psa.matiasaguirre.net/docs/backends/trello.html """ from social.backends.oauth import BaseOAuth1 class TrelloOAuth(BaseOAuth1): """Trello OAuth authentication backend""" name = 'trello' ID_KEY = 'username' AUTHORIZATION_URL = 'https://trello.com/1/OAuthA...
s40523238/2016fallcp_hw
refs/heads/gh-pages
plugin/liquid_tags/giphy.py
273
""" Giphy Tag --------- This implements a Liquid-style Giphy tag for Pelican. IMPORTANT: You have to request a production API key from giphy `here <https://api.giphy.com/submit>`. For the first runs you could also use the public beta key you can get `here <https://github.com/giphy/GiphyAPI>`. Syntax ------ {% giphy ...
zseashell/python_koans
refs/heads/master
python2/_runner_tests.py
211
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import unittest from runner.runner_tests.test_mountain import TestMountain from runner.runner_tests.test_sensei import TestSensei from runner.runner_tests.test_helper import TestHelper def suite(): suite = unittest.TestSuite() suite.addTests(unittest.T...
dangemstar/mezzaninesource
refs/heads/master
build/lib/mezzanine/project_template/project_name/wsgi.py
44
""" WSGI config for {{ project_name }} 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/{{ docs_version }}/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from mezza...
txemi/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_guest_facts.py
16
#!/usr/bin/python # -*- coding: utf-8 -*- # # This module is also sponsored by E.T.A.I. (www.etai.fr) # # 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...
seanli9jan/tensorflow
refs/heads/master
tensorflow/contrib/boosted_trees/python/ops/boosted_trees_ops_loader.py
79
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
palaniyappanBala/thug
refs/heads/master
src/ActiveX/modules/Move.py
8
# Move Networks Upgrade Manager 1.x # CVE-NOMATCH import logging log = logging.getLogger("Thug") def Upgrade(self, arg0, arg1, arg2, arg3): if len(arg0) > 6000: log.ThugLogging.log_exploit_event(self._window.url, "Move Networks Upgrade Manager ActiveX", ...
sztankatt/queues
refs/heads/master
queues/backends/memcached.py
6
""" Backend for queues that implement the memcache protocol, including starling. This backend requires either the memcache or cmemcache libraries to be installed. """ from queues.backends.base import BaseQueue from queues import InvalidBackend, QueueException import os, re try: import memcache except: raise ...
Joannacodes/RNA-Seq-pipeline-SGE-cluster
refs/heads/master
htseq-2-R.py
2
# A script that processes HTSeq-count output for easy input into R. # Fetches the sample name from the cluster output # Saves the six lines of basic statistics generated by HTSeq at the bottom of the file in a .txt file import re import os import glob import argparse import sys def create_parser(): """Return the...
Jionglun/622Q1
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/xml/sax/handler.py
925
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id$ """ version ...
fivejjs/pyspider
refs/heads/master
pyspider/database/mysql/resultdb.py
72
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-10-13 22:02:57 import re import six import time import json import mysql.connector from pyspider.libs import utils from pyspider.database.base.result...
donniexyz/calligra
refs/heads/master
3rdparty/google-breakpad/src/tools/gyp/test/mac/gyptest-non-strs-flattened-to-env.py
303
#!/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. """ Verifies that list xcode_settings are flattened before being exported to the environment. """ import TestGyp import sys if sys.platfo...
akash1808/nova_test_latest
refs/heads/master
nova/tests/functional/test_extensions.py
35
# Copyright 2011 Justin Santa Barbara # 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 requ...
bigmlcom/python
refs/heads/master
bigml/api_handlers/externalconnectorhandler.py
2
# -*- coding: utf-8 -*- # # Copyright 2020-2021 BigML # # 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 ...
John-Boik/Principled-Societies-Project
refs/heads/master
leddaApp/static/brython/src/Lib/encodings/iso8859_11.py
37
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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...
40223119/2015w13
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/pkgdata.py
603
"""pkgdata is a simple, extensible way for a package to acquire data file resources. The getResource function is equivalent to the standard idioms, such as the following minimal implementation:: import sys, os def getResource(identifier, pkgname=__name__): pkgpath = os.path.dirname(sys.modules[p...
empty23/mackup
refs/heads/master
mackup/constants.py
11
"""Constants used in Mackup.""" # Current version VERSION = '0.8.11' # Support platforms PLATFORM_DARWIN = 'Darwin' PLATFORM_LINUX = 'Linux' # Directory containing the application configs APPS_DIR = 'applications' # Mackup application name MACKUP_APP_NAME = 'mackup' # Default Mackup backup path where it stores its ...