repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
cmheisel/presentation-python-threading
refs/heads/master
examples/async.py
1
""" Thanks to http://skipperkongen.dk/2016/09/09/easy-parallel-http-requests-with-python-and-asyncio/ for the pattern. """ import asyncio from timeit import default_timer as timer import requests URLS = [ "http://slowyourload.net/5/https://chrisheisel.com", "http://slowyourload.net/4/https://chrisheisel.com...
inovtec-solutions/OpenERP
refs/heads/branch_openerp
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tiny_socket.py
386
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
Sumith1896/sympy
refs/heads/master
sympy/integrals/meijerint.py
1
""" Integrate functions by rewriting them as Meijer G-functions. There are three user-visible functions that can be used by other parts of the sympy library to solve various integration problems: - meijerint_indefinite - meijerint_definite - meijerint_inversion They can be used to compute, respectively, indefinite i...
google-code/android-scripting
refs/heads/master
python/gdata/src/gdata/Crypto/Cipher/__init__.py
271
"""Secret-key encryption algorithms. Secret-key encryption algorithms transform plaintext in some way that is dependent on a key, producing ciphertext. This transformation can easily be reversed, if (and, hopefully, only if) one knows the key. The encryption modules here all support the interface described in PEP 272...
googleads/google-ads-python
refs/heads/master
google/ads/googleads/v7/services/types/bidding_strategy_simulation_service.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
jparyani/Mailpile
refs/heads/sandstorm
mailpile/__main__.py
3
import sys from mailpile.app import Main def main(): Main(sys.argv[1:]) if __name__ == "__main__": main()
blast-hardcheese/pvpgn
refs/heads/master
scripts/ladder.py
14
#!/usr/bin/env python # -*- Mode: Python; tab-width: 4 -*- # # Copyright (C) 2001 Gianluigi Tiesi <sherpya@netfarm.it> # # 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, or (at ...
abomyi/django
refs/heads/master
tests/indexes/tests.py
321
from unittest import skipUnless from django.db import connection from django.test import TestCase from .models import Article, ArticleTranslation, IndexTogetherSingleList class SchemaIndexesTests(TestCase): """ Test index handling by the db.backends.schema infrastructure. """ def test_index_name_ha...
Chris--A/Arduino
refs/heads/master
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/request.py
245
# urllib3/request.py # Copyright 2008-2012 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 try: from urllib.parse import urlencode except ImportError: from urllib import urlencod...
cheng10/M-ords
refs/heads/master
mords_backend/mords/views.py
1
from datetime import timedelta from django.db import IntegrityError from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.utils import timezone from django.urls import reverse from django.contrib.auth.decorators import login_required from django.vi...
JFriel/honours_project
refs/heads/master
networkx/networkx/drawing/tests/test_pylab.py
45
""" Unit tests for matplotlib drawing functions. """ import os from nose import SkipTest import networkx as nx class TestPylab(object): @classmethod def setupClass(cls): global plt try: import matplotlib as mpl mpl.use('PS',warn=False) import matplotli...
heke123/chromium-crosswalk
refs/heads/master
tools/ipc_fuzzer/scripts/play_testcase.py
40
#!/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. """Wrapper around chrome. Replaces all the child processes (renderer, GPU, plugins and utility) with the IPC fuzzer. The fuzzer will t...
smkr/pyclipse
refs/heads/master
plugins/org.python.pydev/tests/pysrc/extendable/dependencies/file4.py
11
from file2 import * #generates dependency only if the module itself is removed, because we use no other tokens
CeltonMcGrath/TACTIC
refs/heads/master
3rd_party/CherryPy/cherrypy/test/logtest.py
12
"""logtest, a unittest.TestCase helper for testing log output.""" import sys import time import cherrypy try: # On Windows, msvcrt.getch reads a single char without output. import msvcrt def getchar(): return msvcrt.getch() except ImportError: # Unix getchr import tty, termios def ge...
ltiao/project-euler
refs/heads/master
common/problem2.py
1
# # Fast doubling Fibonacci algorithm # # Copyright (c) 2013 Nayuki Minase # All rights reserved. Contact Nayuki for licensing. # http://nayuki.eigenstate.org/page/fast-fibonacci-algorithms # # Returns F(n) def fibonacci(n): if n < 0: raise ValueError("Negative arguments not implemented") return _f...
OTL/arucopy
refs/heads/master
setup.py
1
from distutils.core import setup, Extension # define the name of the extension to use extension_name = 'arucopy' extension_version = '1.0' # define the directories to search for include files # to get this to work, you may need to include the path # to your boost installation. Mine was in # '/usr/local/include'...
charukiewicz/beer-manager
refs/heads/master
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
Titulacion-Sistemas/PythonTitulacion-EV
refs/heads/master
Lib/site-packages/pip/commands/wheel.py
74
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import sys from pip.basecommand import Command from pip.index import PackageFinder from pip.log import logger from pip.exceptions import CommandError, PreviousBuildDirError from pip.req import InstallRequirement, RequirementSet, parse_requirement...
Zanzibar82/script.module.urlresolver
refs/heads/master
lib/urlresolver/plugins/cloudy.py
4
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
kakunbsc/enigma2.1
refs/heads/master
lib/python/Components/ActionMap.py
30
from enigma import eActionMap class ActionMap: def __init__(self, contexts = [ ], actions = { }, prio=0): self.actions = actions self.contexts = contexts self.prio = prio self.p = eActionMap.getInstance() self.bound = False self.exec_active = False self.enabled = True def setEnabled(self, enabled): ...
quheng/scikit-learn
refs/heads/master
sklearn/datasets/setup.py
306
import numpy import os def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('datasets', parent_package, top_path) config.add_data_dir('data') config.add_data_dir('descr') config.add_data_dir('images') config.add_data_d...
varunagrawal/azure-services
refs/heads/master
varunagrawal/site-packages/django/contrib/localflavor/mk/forms.py
89
from __future__ import absolute_import import datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.mk.mk_choices import MK_MUNICIPALI...
cloudtek/dynamodb-odm
refs/heads/master
docs/en/conf.py
1
# -*- coding: utf-8 -*- # # DynamoDM documentation build configuration file # # 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. # # All configuration values have a default; values that are commen...
dawnpower/nova
refs/heads/master
nova/api/openstack/compute/contrib/flavormanage.py
3
# 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 # d...
dfroger/myqueue
refs/heads/master
setup.py
1
from setuptools import setup from myqueue import __version__ setup( name = 'myqueue', version = __version__, url = 'https://github.com/dfroger/myqueue', description = 'A queue implemented with 2 stacks, for demo purpose', license = 'GPL2', author = 'David Froger', author_email = 'david.frog...
trankmichael/scikit-learn
refs/heads/master
sklearn/_build_utils.py
280
""" Utilities useful during the build. """ # author: Andy Mueller, Gael Varoquaux # license: BSD from numpy.distutils.system_info import get_info def get_blas_info(): def atlas_not_found(blas_info_): def_macros = blas_info.get('define_macros', []) for x in def_macros: if x[0] == "NO_...
xyuanmu/XX-Net
refs/heads/master
python3.8.2/Lib/encodings/euc_jisx0213.py
816
# # euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
TridevGuha/django
refs/heads/master
tests/sessions_tests/tests.py
24
import base64 import os import shutil import string import sys import tempfile import unittest from datetime import timedelta from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.sessions.backends.cached_db import \ SessionStore as Cac...
I-sektionen/i-portalen
refs/heads/master
wsgi/iportalen_django/thesis_portal/admin.py
1
from django.contrib import admin from .models import Thesis_Article from utils.admin import HiddenModelAdmin, iportalen_admin_site, iportalen_superadmin_site iportalen_admin_site.register(Thesis_Article) iportalen_superadmin_site.register(Thesis_Article)
tareqalayan/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_ssl_certificate.py
27
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 import os import json import sys from nose.plugins.skip import SkipTest i...
hubsaysnuaa/odoo
refs/heads/8.0
addons/sale/edi/__init__.py
454
# -*- 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...
jjmiranda/edx-platform
refs/heads/master
lms/djangoapps/notification_prefs/views.py
163
from base64 import urlsafe_b64encode, urlsafe_b64decode from hashlib import sha256 import json from Crypto.Cipher import AES from Crypto import Random from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied from django.http import Http404, HttpRe...
Sorsly/subtle
refs/heads/master
google-cloud-sdk/lib/surface/kms/cryptokeys/versions/list.py
1
# 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 ag...
filemakergarage/zeroclient
refs/heads/master
docs/conf.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # ZeroClient documentation build configuration file, created by # sphinx-quickstart on Thu Feb 9 20:21:11 2017. # # 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 #...
mozilla/make.mozilla.org
refs/heads/master
vendor-local/lib/python/requests/packages/urllib3/packages/mimetools_choose_boundary/__init__.py
55
"""The function mimetools.choose_boundary() from Python 2.7, which seems to have disappeared in Python 3 (although email.generator._make_boundary() might work as a replacement?). Tweaked to use lock from threading rather than thread. """ import os from threading import Lock _counter_lock = Lock() _counter = 0 def _ge...
gregdek/ansible
refs/heads/devel
lib/ansible/plugins/cache/base.py
232
# (c) 2017, ansible by Red Hat # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible...
EiSandi/greetingslack
refs/heads/master
greetingslack/lib/python2.7/site-packages/pip/_vendor/distro.py
330
# Copyright 2015,2016 Nir Cohen # # 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, s...
vFense/vFenseAgent-nix
refs/heads/development
agent/deps/rpm6/Python-2.7.5/lib/python2.7/urllib2.py
74
"""An extensible library for opening URLs using a variety of protocols The simplest way to use this module is to call the urlopen function, which accepts a string containing a URL or a Request object (described below). It opens the URL and returns the results as file-like object; the returned object has some extra me...
sephii/django
refs/heads/master
django/contrib/sites/__init__.py
808
default_app_config = 'django.contrib.sites.apps.SitesConfig'
maginatics/swift
refs/heads/master
test/__init__.py
21
# 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...
harvard-dce/dce_lti_py
refs/heads/master
setup.py
1
import os import re import sys import codecs from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options...
luipugs/kamatis
refs/heads/master
kamatis/tests.py
1
from kamatis import util import os import shutil import tempfile import unittest class TestMakedirs(unittest.TestCase): def test_create(self): tempdir = tempfile.gettempdir() parent = os.tempnam(tempdir) path = os.path.join(parent, 'testdir') isdir = util.makedirs(path) se...
googleapis/googleapis-gen
refs/heads/master
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/resources/types/feed_item.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
lukauskas/dgw
refs/heads/master
dgw/cluster/analysis.py
2
from collections import defaultdict from logging import debug from math import floor import scipy.cluster.hierarchy as hierarchy import pandas as pd import numpy as np from ..data.containers import AlignmentsData from ..dtw.distance import dtw_std, dtw_path_is_reversed, warping_conservation_vector from ..dtw import tra...
yaroslav-tarasov/avango
refs/heads/master
avango-blender/blender-addon/nodes/float_node.py
3
import bpy from bpy.types import Node from .. import node_tree from .. import export_utils class FloatNode(Node, node_tree.AvangoCustomTreeNode): bl_idname = "FloatInputNode" bl_label = "Float" def init(self, context): self.inputs.new("NodeSocketFloat", "Value") self.outputs.new("NodeSoc...
mhostetter/gnuradio
refs/heads/master
gr-wxgui/python/wxgui/waterfallsink_nongl.py
58
#!/usr/bin/env python # # Copyright 2003-2005,2007,2008,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or...
atchariya/django-angular
refs/heads/master
djangular/forms/widgets.py
9
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from django.forms import widgets from django.utils.safestring import mark_safe from django.utils.encoding import force_text from django.utils.html import format_html from django.forms.util import flatatt class ChoiceFieldRenderer(widgets.Choi...
fparrel/vigicrues_tools
refs/heads/master
arpal_scrap.py
1
#!/usr/bin/env python from arpal_get_stations import scrap def main(): scrap() if __name__=='__main__': main()
schets/scikit-learn
refs/heads/master
sklearn/decomposition/tests/test_dict_learning.py
40
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises ...
iRGBit/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
10
# -*- coding: utf-8 -*- """ *************************************************************************** DeleteDuplicateGeometries.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com ***********...
akshayka/projection-methods
refs/heads/master
projection_methods/oracles/utils.py
1
import numpy as np from projection_methods.projectables.halfspace import Halfspace def containing_halfspace(x_0, x_star, x): """Returns a halfspace containing a convex set Args: x_0 (array-like): query point x_star (array-like): projection of x_0 onto a convex set x (CVXPY Variable):...
AriZuu/micropython
refs/heads/master
tests/import/pkg3/subpkg1/__init__.py
118
print("subpkg1 __name__:", __name__)
shft117/SteckerApp
refs/heads/master
erpnext/patches/v6_4/repost_gle_for_journal_entries_where_reference_name_missing.py
50
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): je_list = frappe.db.sql_list("""select distinct parent from `tabJournal Entry Account` je where docstatus=1 and ifnu...
goodwillcoding/RIDE
refs/heads/master
src/robotide/validators/__init__.py
1
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
Endika/odoomrp-utils
refs/heads/8.0
l10n_eu_product_adr_report/__init__.py
379
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from . import models
jaumebonet/pynion
refs/heads/master
pynion/abstractclass/__init__.py
2
"""Abstract classes in **pynion** are designed in order to help users develop their classes by adding a set of default functions and properties. .. moduleauthor:: Jaume Bonet <jaume.bonet@gmail.com> """ from .jsoner import JSONer __all__ = ["JSONer"]
Kittima/kittima.github.io
refs/heads/master
code/python/IPython-notebook-extensions/nbextensions/usability/latex_envs/conversion/toc_and_cln.py
3
""" Created on Thu Nov 18 15:34:38 2014 @author: JF """ import glob import os import sys import time from stat import * def texheaders_filtering(input_file): import re st = os.stat(input_file) atime = st[ST_ATIME] #access time mtime = st[ST_MTIME] #modification time with open(input_...
Architektor/PySnip
refs/heads/master
venv/lib/python2.7/site-packages/twisted/words/xish/domish.py
48
# -*- test-case-name: twisted.words.test.test_domish -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ DOM-like XML processing support. This module provides support for parsing XML into DOM-like object structures and serializing such structures to an XML string representation, optimized ...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/cherrypy/cherrypy/test/logtest.py
36
"""logtest, a unittest.TestCase helper for testing log output.""" import sys import time import cherrypy from cherrypy._cpcompat import basestring, ntob, unicodestr try: # On Windows, msvcrt.getch reads a single char without output. import msvcrt def getchar(): return msvcrt.getch() except Impor...
lavish205/olympia
refs/heads/master
src/olympia/lib/es/tests/test_models.py
13
import mock from olympia.amo.tests import TestCase from olympia.lib.es.models import Reindexing class TestReindexManager(TestCase): def test_flag_reindexing(self): assert Reindexing.objects.filter(site='foo').count() == 0 # Flagging for the first time. res = Reindexing.objects._flag_rei...
izgzhen/servo
refs/heads/master
tests/wpt/harness/wptrunner/__init__.py
1447
# 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/.
BenignBeppe/common-desktop
refs/heads/master
common_desktop.py
1
#! /usr/bin/env python3 import urllib import json import sqlite3 import random import os import logging import datetime import argparse import subprocess import webbrowser import requests LOGS_PATH = "logs" IMAGES_PATH = "images" DB_PATH = "images.db" URL = "https://commons.wikimedia.org/w/api.php" GNOME_SET_BACKGRO...
marshall/titanium
refs/heads/master
site_scons/simplejson/tests/test_unicode.py
123
from unittest import TestCase import simplejson as json class TestUnicode(TestCase): def test_encoding1(self): encoder = json.JSONEncoder(encoding='utf-8') u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' s = u.encode('utf-8') ju = encoder.encode(u) js = en...
b-jesch/service.fritzbox.callmonitor
refs/heads/master
resources/lib/PhoneBooks/pyicloud/vendorlibs/click/globals.py
234
from threading import local _local = local() def get_current_context(silent=False): """Returns the current click context. This can be used as a way to access the current context object from anywhere. This is a more implicit alternative to the :func:`pass_context` decorator. This function is prima...
carolinux/QGIS
refs/heads/master
python/ext-libs/pygments/styles/emacs.py
364
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
swarna-k/MyDiary
refs/heads/master
flask/lib/python2.7/site-packages/babel/localedata.py
136
# -*- coding: utf-8 -*- """ babel.localedata ~~~~~~~~~~~~~~~~ Low-level locale data access. :note: The `Locale` class, which uses this module under the hood, provides a more convenient interface for accessing the locale data. :copyright: (c) 2013 by the Babel Team. :license: BSD, s...
MatthewWilkes/django-oscar
refs/heads/master
src/oscar/apps/basket/managers.py
57
from django.db import models class OpenBasketManager(models.Manager): """For searching/creating OPEN baskets only.""" status_filter = "Open" def get_queryset(self): return super(OpenBasketManager, self).get_queryset().filter( status=self.status_filter) def get_or_create(self, **k...
nan86150/ImageFusion
refs/heads/master
ENV2.7/lib/python2.7/site-packages/setuptools/py27compat.py
958
""" Compatibility Support for Python 2.7 and earlier """ import sys def get_all_headers(message, key): """ Given an HTTPMessage, return all headers matching a given key. """ return message.get_all(key) if sys.version_info < (3,): def get_all_headers(message, key): return message.getheaders(key)
eroicaleo/LearningPython
refs/heads/master
interview/leet/37_Sudoku_Solver.py
1
#!/usr/bin/env python3 import itertools from collections import Counter class Solution: def solveSudoku(self, board): self.d = {} self.empty_space = len([(i,j) for i, j in itertools.product(range(9), range(9)) if board[i][j] == '.']) def update(i, j, n, inc): for k in range(9)...
ndp-systemes/odoo-addons
refs/heads/8.0
report_aeroo_improved/__openerp__.py
1
# -*- coding: utf8 -*- # # Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License,...
osvalr/odoo
refs/heads/8.0
addons/account/project/__init__.py
427
# -*- 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...
mattvenn/Arduino
refs/heads/esp8266
arduino-core/src/processing/app/i18n/python/requests/api.py
637
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
cryptobanana/ansible
refs/heads/devel
lib/ansible/modules/files/iso_extract.py
101
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be> # Copyright: (c) 2016, Matt Robinson <git@nerdoftheherd.com> # Copyright: (c) 2017, Dag Wieers <dag@wieers.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.g...
Max00355/HTTPLang
refs/heads/master
setup.py
1
from setuptools import setup import sys setup(name='HTTPLang', version='2.0.0', author='Frankie Primerano', author_email='max00355@gmail.com', packages=['httplang'], entry_points={ 'console_scripts': ['httplang=httplang:console_main'], }, url='https://github.com/Max0...
ownport/jira-reports
refs/heads/master
jirareports/vendor/requests/packages/chardet/mbcharsetprober.py
2923
######################## 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...
simbha/mAngE-Gin
refs/heads/master
lib/django/core/files/uploadedfile.py
91
""" Classes representing uploaded files. """ import errno import os from io import BytesIO from django.conf import settings from django.core.files.base import File from django.core.files import temp as tempfile from django.utils.encoding import force_str __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU...
bdh1011/wau
refs/heads/master
venv/lib/python2.7/site-packages/twisted/trial/_dist/test/test_workerreporter.py
8
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.trial._dist.workerreporter}. """ from twisted.python.failure import Failure from twisted.trial.unittest import TestCase, Todo from twisted.trial._dist.workerreporter import WorkerReporter from twisted.trial._dist import ma...
rsalmaso/django-allauth
refs/heads/master
allauth/socialaccount/providers/box/provider.py
2
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class BoxOAuth2Account(ProviderAccount): pass class BoxOAuth2Provider(OAuth2Provider): id = "box" name = "Box" account_class = BoxOAuth2Account def extract...
wolfelee/zkdash
refs/heads/master
lib/utils/pyshell.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013,掌阅科技 All rights reserved. File Name: pyshell.py Author: WangLichao Created on: 2014-03-21 ''' import subprocess import time def wait_process_end(process, timeout): '''等待进程终止 Args: process: 进程句柄 timeout: 超时时间 Returns: ...
derDavidT/sympy
refs/heads/master
sympy/plotting/plot.py
55
"""Plotting module for Sympy. A plot is represented by the ``Plot`` class that contains a reference to the backend and a list of the data series to be plotted. The data series are instances of classes meant to simplify getting points and meshes from sympy expressions. ``plot_backends`` is a dictionary with all the bac...
mhbu50/erpnext
refs/heads/develop
erpnext/education/doctype/student_group/test_student_group.py
17
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest import erpnext.education def get_random_group(): doc = frappe.get_doc({ "doctype": "Student Group", "student_group_name": "_Test Student Group...
anirudhSK/chromium
refs/heads/master
third_party/tlslite/tlslite/integration/HTTPTLSConnection.py
87
"""TLS Lite + httplib.""" import socket import httplib from tlslite.TLSConnection import TLSConnection from tlslite.integration.ClientHelper import ClientHelper class HTTPBaseTLSConnection(httplib.HTTPConnection): """This abstract class provides a framework for adding TLS support to httplib.""" default_...
prakash-alpine/chorus
refs/heads/master
packaging/setup/config_lib/configure_ldap.py
4
import os import sys sys.path.append("..") def configure_ldap(options): os.system("${EDITOR:-vi} " + os.path.join(options.chorus_path, "shared/ldap.properties"))
JshWright/home-assistant
refs/heads/dev
tests/components/recorder/test_util.py
26
"""Test util methods.""" from unittest.mock import patch, MagicMock import pytest from homeassistant.components.recorder import util from homeassistant.components.recorder.const import DATA_INSTANCE from tests.common import get_test_home_assistant, init_recorder_component @pytest.fixture def hass_recorder(): ""...
weiting-chen/manila
refs/heads/master
manila/tests/api/openstack/test_wsgi.py
1
import ddt import inspect import webob from manila.api.openstack import wsgi from manila import exception from manila import test from manila.tests.api import fakes @ddt.ddt class RequestTest(test.TestCase): def test_content_type_missing(self): request = wsgi.Request.blank('/tests/123', method='POST') ...
futurepr0n/Books-solutions
refs/heads/master
Python-For-Everyone-Horstmann/Chapter6-Lists/R6.1E.py
1
# Given the list values = [] , write code that fills the list with each set of numbers below. # e.1 4 9 16 9 7 4 9 11 list = [] # there's no pattern list.append(1) list.append(4) list.append(9) list.append(16) list.append(9) list.append(7) list.append(4) list.append(9) list.append(11) print(list)
priyanshsaxena/techmeet
refs/heads/master
backup_stuff/text_classification/test.py
2
# -*- coding: utf-8 -*- import pysentiment as ps def sentiment(text): hiv4 = ps.HIV4() tokens = hiv4.tokenize(text.decode('utf-8')) score = hiv4.get_score(tokens) print (score) if __name__ == '__main__': string = "" sentiment(string)
osigaud/ArmModelPython
refs/heads/master
Cython/M2/ArmModel/ArmParameters.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Author: Thomas Beucher Module: ArmParameters Description: -We find here all arm parameters -we use a model of arm with two joints and six muscles ''' import numpy as np from GlobalVariables import pathWorkingDirectory class ArmParameters: ''' ...
shengqh/ngsperl
refs/heads/master
lib/SmallRNA/updateShortReadParentCount.py
1
import argparse import sys import logging import os import csv class ReadItem: def __init__(self, sequence, totalCount): self.Sequence = sequence self.TotalCount = totalCount self.SampleMap = {} class AnnotationItem: def __init__(self, sequence, totalCount, category, counts): self.Sequence = seque...
pooyapooya/rizpardazande
refs/heads/master
rizpar/lib/python2.7/site-packages/serial/urlhandler/protocol_socket.py
11
#! python # # This module implements a simple socket based client. # It does not support changing any port parameters and will silently ignore any # requests to do so. # # The purpose of this module is that applications using pySerial can connect to # TCP/IP to serial port converters that do not support RFC 2217. # # T...
c4all/c4all
refs/heads/master
comments/tests/site.py
1
from django.test import TestCase from comments.forms import SiteForm class SiteTestCase(TestCase): pass class SiteFormTestCase(TestCase): def test_form_validation_success(self): domain = 'www.google.com' form = SiteForm(data={'domain': domain}) if form.is_valid(): site =...
rec/DMXIS
refs/heads/master
Macros/Python/uu.py
10
#! /usr/bin/env python # Copyright 1994 by Lance Ellinghouse # Cathedral City, California Republic, United States of America. # All Rights Reserved # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # ...
psaux/huhamhire-hosts
refs/heads/master
gui/style_rc.py
24
# -*- coding: utf-8 -*- # Resource object code # # Created: 周三 1月 22 13:03:07 2014 # by: The Resource Compiler for PyQt (Qt v4.8.5) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x01\x57\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48...
monitoringartist/zabbix-xxl
refs/heads/master
Dockerfile/dockbix-xxl-3.4/container-files-dockbix-xxl/usr/local/src/zabbix/supervisord-listener.py
4
#! /usr/bin/python import sys import subprocess def write_stdout(s): sys.stdout.write(s) sys.stdout.flush() def write_stderr(s): sys.stderr.write(s) sys.stderr.flush() def main(args): while 1: write_stdout('READY\n') # transition from ACKNOWLEDGED to READY line = sys.stdin.readlin...
dmitriy0611/django
refs/heads/master
django/core/management/templates.py
34
import cgi import errno import mimetypes import os import posixpath import re import shutil import stat import sys import tempfile from os import path import django from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import handle_extensions from django.template import C...
pravsalam/clamav-antivirus
refs/heads/master
libclamav/c++/llvm/utils/lit/lit/ShUtil.py
28
import itertools import Util from ShCommands import Command, Pipeline, Seq class ShLexer: def __init__(self, data, win32Escapes = False): self.data = data self.pos = 0 self.end = len(data) self.win32Escapes = win32Escapes def eat(self): c = self.data[self.pos] ...
cwyark/micropython
refs/heads/master
esp8266/modules/onewire.py
12
# 1-Wire driver for MicroPython on ESP8266 # MIT license; Copyright (c) 2016 Damien P. George from micropython import const import _onewire as _ow class OneWireError(Exception): pass class OneWire: SEARCH_ROM = const(0xf0) MATCH_ROM = const(0x55) SKIP_ROM = const(0xcc) def __init__(self, pin): ...
ibinti/intellij-community
refs/heads/master
python/testData/mover/commentUp.py
83
def f(): if True: a = 1 else: a = 2 #comment<caret>
QuickSander/CouchPotatoServer
refs/heads/master
libs/requests/packages/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
iparanza/earthenterprise
refs/heads/master
earth_enterprise/src/support/parse_khhttpd_access_log.py
9
#! /usr/bin/python2.4 # # Copyright 2017 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 ...