repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jhd/spunout | refs/heads/master | venv/lib/python2.7/site-packages/pip/commands/help.py | 401 | from pip.basecommand import Command, SUCCESS
from pip.exceptions import CommandError
class HelpCommand(Command):
"""Show help for commands"""
name = 'help'
usage = """
%prog <command>"""
summary = 'Show help for commands.'
def run(self, options, args):
from pip.commands import comma... |
AOSPA-L/android_external_skia | refs/heads/lollipop-mr1 | gm/rebaseline_server/compare_rendered_pictures.py | 66 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Compare results of two render_pictures runs.
"""
# System-level imports
import logging
import os
import re
import time
# Imports from within Skia
import fix_pythonpath ... |
dmoliveira/networkx | refs/heads/master | examples/pygraphviz/pygraphviz_draw.py | 27 | #!/usr/bin/env python
"""
An example showing how to use the interface to the pygraphviz
AGraph class to draw a graph.
Also see the pygraphviz documentation and examples at
http://pygraphviz.github.io/
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2006 by
# Aric Hagberg <hagberg@lanl.g... |
horance-liu/tensorflow | refs/heads/master | tensorflow/tools/test/system_info_lib.py | 101 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
evernym/plenum | refs/heads/master | plenum/test/primary_selection/test_add_node_with_f_changed.py | 2 | import pytest
from stp_core.common.log import getlogger
from plenum.test.node_catchup.helper import waitNodeDataEquality
from plenum.common.util import randomString
from plenum.test.test_node import checkNodesConnected
from plenum.test.pool_transactions.helper import sdk_add_new_steward_and_node
from plenum.test import... |
xchenum/quantum | refs/heads/master | quantum/openstack/common/rpc/__init__.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... |
vitiral/micropython | refs/heads/master | tests/basics/class_contains.py | 117 | # A contains everything
class A:
def __contains__(self, key):
return True
a = A()
print(True in a)
print(1 in a)
print(() in a)
# B contains given things
class B:
def __init__(self, items):
self.items = items
def __contains__(self, key):
return key in self.items
b = B([])
print(1 ... |
teosz/servo | refs/heads/master | tests/wpt/web-platform-tests/fetch/api/resources/method.py | 161 | def main(request, response):
headers = []
if "cors" in request.GET:
headers.append(("Access-Control-Allow-Origin", "*"))
headers.append(("Access-Control-Allow-Credentials", "true"))
headers.append(("Access-Control-Allow-Methods", "GET, POST, PUT, FOO"))
headers.append(("Access-Co... |
cppisfun/GameEngine | refs/heads/master | foreign/boost/tools/build/v2/example/python_modules/python_helpers.py | 12 | # Copyright 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Declare a couple of functions called from Boost.Build
#
# Each function will receive as many arguments as there ":"-separated
# argument... |
sekikn/incubator-airflow | refs/heads/master | airflow/operators/generic_transfer.py | 5 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
rruebner/odoo | refs/heads/master | addons/account/wizard/account_reconcile_partner_process.py | 385 | # -*- 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... |
ow2-proactive/agent-linux | refs/heads/master | palinagent/daemon/tests/testEventGenerator.py | 1 | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
#################################################################
#
# ProActive Parallel Suite(TM): The Java(TM) library for
# Parallel, Distributed, Multi-Core Computing for
# Enterprise Grids & Clouds
#
# Copyright (C) 1997-2011 INRIA/University of
# ... |
sid-kap/pants | refs/heads/master | src/python/pants/backend/jvm/ossrh_publication_metadata.py | 31 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import six
from pan... |
gdub/python-archive | refs/heads/master | archive/compat.py | 2 | """
A module for providing backwards compatibility for Python versions.
"""
import sys
IS_PY2 = sys.version_info[0] == 2
if IS_PY2:
def is_string(obj):
return isinstance(obj, basestring)
else:
def is_string(obj):
return isinstance(obj, str)
|
ssarangi/numba | refs/heads/master | numba/looplifting.py | 6 | from __future__ import print_function, division, absolute_import
from numba import utils
from numba.bytecode import ByteCodeInst, CustomByteCode
from collections import defaultdict
def lift_loop(bytecode, dispatcher_factory):
"""Lift the top-level loops.
Returns (outer, loops)
------------------------
... |
Gallopsled/pwntools-write-ups | refs/heads/master | 2013/pctf/ropasaurus2/doit.py | 3 | #!/usr/bin/env python
from pwn import *
binary = './ropasaurusrex-85a84f36f81e11f720b1cf5ea0d1fb0d5a603c0d'
# Remote version
l = listen(0)
l.spawn_process([binary])
r = remote('localhost', l.lport)
# Uncomment for local version
# r = process(binary)
#
# If we run with a cyclic pattern, we end up with the following ... |
ayan-usgs/sci-wms | refs/heads/master | wms/models/datasets/ugrid.py | 1 | # -*- coding: utf-8 -*-
import os
import time
import bisect
import shutil
import tempfile
import itertools
from math import sqrt
from datetime import datetime
import pytz
from pyugrid import UGrid
from pyaxiom.netcdf import EnhancedDataset, EnhancedMFDataset
import numpy as np
import netCDF4
import pandas as pd
imp... |
ebmdatalab/openprescribing | refs/heads/dependabot/pip/google-auth-1.32.1 | deploy/clear_cache.py | 1 | import json
import os
import requests
import dotenv
# This zone ID may change if/when our account changes
# Run `list_cloudflare_zones` (below) to get a full list
ZONE_ID = "198bb61a3679d0e1545e838a8f0c25b9"
def list_cloudflare_zones():
url = "https://api.cloudflare.com/client/v4/zones"
headers = {
... |
morphgnt/morphgnt-api | refs/heads/master | morphgnt_api/models.py | 1 | from django.core.urlresolvers import reverse
from django.db import models
from .ref import verse_from_bcv, verse_range_title
def parse_as_dict(parse):
return {
label: parse[i]
for i, label in enumerate([
"person", "tense", "voice", "mood", "case", "number", "gender", "degree"
... |
dencold/blt | refs/heads/master | blt/test/importedtest.py | 1 | from blt.environment import Commander
class TestCommands(Commander):
def imported_command():
pass
def imported_default():
pass
def imported_alias():
pass
|
bruteforce1/cryptopals | refs/heads/master | set1/ch2/fixedxor.py | 1 | #!/usr/bin/python3
"""
Write a function that takes two equal-length buffers and produces their
XOR combination.
If your function works properly, then when you feed it the string:
1c0111001f010100061a024b53535009181c
... after hex decoding, and when XOR'd against:
686974207468652062756c6c277320657965
... shoul... |
erikge/watch_gyp | refs/heads/master | test/win/gyptest-link-debug-info.py | 344 | #!/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.
"""
Make sure debug info setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGy... |
shinglyu/ns3-h264-svc | refs/heads/master | src/config-store/bindings/modulegen__gcc_ILP32.py | 72 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
sanjeevtripurari/hue | refs/heads/master | desktop/core/ext-py/pytz-2015.2/setup.py | 61 | '''
pytz setup script
'''
import pytz, sys, os, os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
me = 'Stuart Bishop'
memail = 'stuart@stuartbishop.net'
packages = ['pytz']
resources = ['zone.tab', 'locales/pytz.pot']
for dirpath, dirnames, filenames in os.walk(o... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/building/poi/shared_tatooine_burning_sandcrawler.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_burning_sandcrawler.iff"
result.attribute_templ... |
Hakuba/youtube-dl | refs/heads/master | youtube_dl/extractor/rts.py | 32 | # coding: utf-8
from __future__ import unicode_literals
import re
from .srgssr import SRGSSRIE
from ..compat import (
compat_str,
compat_urllib_parse_urlparse,
)
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
unescapeHTML,
xpath_text,
)
class RTSIE(SRGSSRIE):
IE_DE... |
SMALLplayer/smallplayer-image-creator | refs/heads/master | storage/.xbmc/addons/script.artwork.downloader/default.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2013 Martijn Kaijser
#
# 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 ... |
ybellavance/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/tabnanny.py | 47 | #! /usr/bin/env python3
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The... |
tom-heimbrodt/oeplatform | refs/heads/develop | dataedit/metadata/error.py | 1 | class MetadataException(Exception):
def __init__(self, metadata, error):
self.metadata = metadata
self.error = error |
romankagan/DDBWorkbench | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/lsprofcalltree.py | 100 | """
lsprofcalltree.py - lsprof output which is readable by kcachegrind
Authors:
* David Allouche <david <at> allouche.net>
* Jp Calderone & Itamar Shtull-Trauring
* Johan Dahlin
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by refer... |
khchine5/lino | refs/heads/master | lino/utils/config.py | 1 | # -*- coding: UTF-8 -*-
# Copyright 2009-2017 Luc Saffre
# License: BSD (see file COPYING for details)
"""This defines the :class:`ConfigDirCache` which Lino instantiates
and installs as :attr:`SITE.confdirs
<lino.core.site.Site.confdirs>`.
It creates a list `config_dirs` of all configuration directories by
looping t... |
riteshshrv/django | refs/heads/master | django/contrib/sessions/exceptions.py | 931 | from django.core.exceptions import SuspiciousOperation
class InvalidSessionKey(SuspiciousOperation):
"""Invalid characters in session key"""
pass
class SuspiciousSession(SuspiciousOperation):
"""The session may be tampered with"""
pass
|
j5shi/Thruster | refs/heads/master | pylibs/test/test_xml_etree_c.py | 12 | # xml.etree test for cElementTree
from test import test_support
from test.test_support import precisionbigmemtest, _2G
import unittest
cET = test_support.import_module('xml.etree.cElementTree')
# cElementTree specific tests
def sanity():
"""
Import sanity.
>>> from xml.etree import cEle... |
realriot/KinderThek.bundle | refs/heads/master | Contents/Code/mod_helper.py | 1 | debug = True
def getURL(url):
if debug == True: Log("Fetching content from url: " + url)
try:
content = HTTP.Request(url, cacheTime = CACHE_1HOUR).content
except Exception as e:
if debug == True: Log(str(e))
return content
|
rlsharpton/Introduction-Programming-Python | refs/heads/master | Solutions/Module7TaxesChallengeSolution.py | 19 | #Declare and initialize your variables
country = ""
province = ""
orderTotal = 0
totalWithTax = 0
#I am declaring variables to hold the tax values used in the calculations
#That way if a tax rate changes, I only have to change it in one place instead
#of searching through my code to see where I had a specific numeric ... |
hickford/youtube-dl | refs/heads/master | youtube_dl/postprocessor/execafterdownload.py | 115 | from __future__ import unicode_literals
import subprocess
from .common import PostProcessor
from ..compat import shlex_quote
from ..utils import PostProcessingError
class ExecAfterDownloadPP(PostProcessor):
def __init__(self, downloader, exec_cmd):
super(ExecAfterDownloadPP, self).__init__(downloader)
... |
nsharma283/PCF-php-buildpack | refs/heads/master | lib/yaml/representer.py | 360 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
d... |
zhlinh/leetcode | refs/heads/master | 0108.Convert Sorted Array to Binary Search Tree/test.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Solution
from solution import TreeNode
def constructOne(s):
s = s.strip()
if s == '#':
return None
else:
return TreeNode(int(s))
def createTree(tree):
q = []
tree = tree.split(",")
root = constructOne(tree[0]);... |
aayushchugh07/qbo-browser | refs/heads/master | btp3/cgi/test4.py | 3 | #!/usr/bin/env python
print "Content-type: text/html"
print
# print "<html><head><title>Situation snapshot</title></head>"
# print "<body><pre>"
# print "fff"
# objects=['Book_copy','Book_'];
# for object in objects:
# print object;
# print "</pre></body></html>"
print '''<!DOCTYPE html>
<html lang="en">
<head>
... |
joegesualdo/dotfiles | refs/heads/master | config/yarn/global/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... |
ecolitan/fatics | refs/heads/master | venv/lib/python2.7/site-packages/twisted/internet/_baseprocess.py | 38 | # -*- test-case-name: twisted.test.test_process -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Cross-platform process-related functionality used by different
L{IReactorProcess} implementations.
"""
from twisted.python.reflect import qual
from twisted.python.deprecate import getWarning... |
wskplho/sl4a | refs/heads/master | python/src/Lib/test/test_codeop.py | 84 | """
Test cases for codeop.py
Nick Mathewson
"""
import unittest
from test.test_support import run_unittest, is_jython
from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
if is_jython:
import sys
import cStringIO
def unify_callables(d):
for n,v in d.items():
if callable(v)... |
wskplho/sl4a | refs/heads/master | python/src/Lib/test/mapping_tests.py | 56 | # tests common to dict and UserDict
import unittest
import UserDict
class BasicTestMappingProtocol(unittest.TestCase):
# This base class can be used to check that an object conforms to the
# mapping protocol
# Functions that can be useful to override to adapt to dictionary
# semantics
type2test =... |
bassosimone/neubot-server | refs/heads/master | neubot/negotiate_server_module.py | 2 | # neubot/negotiate/server.py
#
# Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... |
ktok07b6/polyphony | refs/heads/master | tests/module/nesting01.py | 1 | from polyphony import module
from polyphony import testbench
from polyphony import is_worker_running
from polyphony.io import Port
from polyphony.typing import int8
from polyphony.timing import clksleep
@module
class Submodule:
def __init__(self, param):
self.i = Port(int8, 'in')
self.o = Port(int... |
ehirt/odoo | refs/heads/8.0 | addons/mrp_repair/wizard/cancel_repair.py | 384 | # -*- 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... |
lucychambers/lucychambers.github.io | refs/heads/master | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.0/vendor/pygments-main/tests/test_latex_formatter.py | 32 | # -*- coding: utf-8 -*-
"""
Pygments LaTeX formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import os
import unittest
import tempfile
from pygments.forma... |
Avinash-Raj/appengine-django-skeleton | refs/heads/master | lib/django/views/decorators/cache.py | 586 | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import (
available_attrs, decorator_from_middleware_with_args,
)
def cache_page(*args, **kwargs):
"""
Decorator for view... |
makerbot/ReplicatorG | refs/heads/master | skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/profile_plugins/winding.py | 6 | """
This page is in the table of contents.
Winding is a script to set the winding profile for the skeinforge chain.
The displayed craft sequence is the sequence in which the tools craft the model and export the output.
On the winding dialog, clicking the 'Add Profile' button will duplicate the selected profile and gi... |
dex4er/django | refs/heads/1.6.x | tests/urlpatterns_reverse/erroneous_views_module.py | 157 | import non_existent
def erroneous_view(request):
pass
|
jdelight/django | refs/heads/master | django/forms/widgets.py | 18 | """
HTML Widget classes
"""
from __future__ import unicode_literals
import copy
import datetime
import re
from itertools import chain
from django.conf import settings
from django.forms.utils import flatatt, to_current_timezone
from django.utils import datetime_safe, formats, six
from django.utils.datastructures impo... |
citrix-openstack-build/glance | refs/heads/master | glance/tests/functional/store/test_cinder.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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/... |
GoogleCloudPlatform/python-docs-samples | refs/heads/master | appengine/standard/ndb/overview/main.py | 4 | # Copyright 2015 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... |
albzan/attribra | refs/heads/master | site_scons/site_tools/gettexttool/__init__.py | 22 | """ This tool allows generation of gettext .mo compiled files, pot files from source code files
and pot files for merging.
Three new builders are added into the constructed environment:
- gettextMoFile: generates .mo file from .pot file using msgfmt.
- gettextPotFile: Generates .pot file from source code files.
- get... |
pv/scikit-learn | refs/heads/master | sklearn/tests/test_lda.py | 77 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert... |
s-t-e-a-l-t-h/Eclipsing-binaries-library | refs/heads/master | objects/SelfTest.py | 1 | #!/usr/bin/python
""" SelfTest trieda
-------------------
Trieda na vnutorne testovanie funkcii celeho balika
Inicializacne parametre:
------------------------
Staticka trieda, ziadne inicializacne parametre
Metody a strucny popis (blizsi popis funkcnosti v komentaroch k jednotlivym riadkom kodu v funkciach):
--... |
seksan2538/schedule-generator | refs/heads/master | mechanize/_sockettimeout.py | 149 | import socket
try:
_GLOBAL_DEFAULT_TIMEOUT = socket._GLOBAL_DEFAULT_TIMEOUT
except AttributeError:
_GLOBAL_DEFAULT_TIMEOUT = object()
|
ralph-mikera/RouteFlow-1 | refs/heads/master | pox/pox/lib/recoco/examples.py | 26 | # Copyright 2011 Colin Scott
# Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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 lat... |
CingHu/neutron-ustack | refs/heads/master | neutron/tests/unit/plumgrid/extensions/test_securitygroups.py | 12 | # Copyright 2014 PLUMgrid, 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 ... |
zasdfgbnm/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/gather_nd_op_test.py | 18 | # 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... |
CDSherrill/psi4 | refs/heads/master | psi4/driver/qcdb/basislistother.py | 1 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... |
gangadhar-kadam/helpdesk-erpnext | refs/heads/master | erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py | 121 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.controllers.trends import get_columns,get_data
def execute(filters=None):
if not filters: filters ={}
data = []
condition... |
harshita-gupta/Harvard-FRSEM-Catalog-2016-17 | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/util/cache.py | 95 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
vlachoudis/sl4a | refs/heads/master | python/src/Lib/xml/sax/xmlreader.py | 60 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
import handler
from _exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReader is the... |
pombreda/pyamg | refs/heads/master | pyamg/classical/tests/test_classical.py | 1 | from pyamg.testing import *
import numpy
from numpy import ravel, ones, concatenate, cumsum, zeros
from scipy import rand
from scipy.sparse import csr_matrix, lil_matrix, coo_matrix
from pyamg.gallery import poisson, load_example
from pyamg.strength import classical_strength_of_connection
from pyamg.classical import... |
morphis/home-assistant | refs/heads/snap-support | homeassistant/scripts/influxdb_migrator.py | 12 | """Script to convert an old-structure influxdb to a new one."""
import argparse
import sys
from typing import List
# Based on code at
# http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console
def print_progress(iteration: int, total: int, prefix: str='', suffix: str='',
decima... |
oogles/djem | refs/heads/master | djem/tests/test_middleware.py | 2 | from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import messages
from django.contrib.messages import constants
from django.http import HttpRequest, HttpResponse
from django.test import Client, TestCase, override_settings
from djem.middleware import MemoryStorage
def add_m... |
hujiajie/pa-chromium | refs/heads/master | third_party/tlslite/tlslite/utils/RC4.py | 359 | """Abstract class for RC4."""
from compat import * #For False
class RC4:
def __init__(self, keyBytes, implementation):
if len(keyBytes) < 16 or len(keyBytes) > 256:
raise ValueError()
self.isBlockCipher = False
self.name = "rc4"
self.implementation = implementation
... |
EliteTK/PyBot | refs/heads/master | Modules/requests/cookies.py | 413 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
# grr, pyflakes... |
hellomotor/ahocorasick | refs/heads/master | test_memleak2.py | 3 | from distutils.util import get_platform
import sys
sys.path.insert(0, "build/lib.%s-%s" % (get_platform(), sys.version[0:3]))
import ahocorasick
"""We just want to exercise the code and monitor its memory usage."""
def getZerostate():
tree = ahocorasick.KeywordTree()
tree.add("foobar")
tree.make()
r... |
allotria/intellij-community | refs/heads/master | python/testData/intentions/PyConvertMethodToPropertyIntentionTest/simple_after.py | 167 | class MyClass(object):
"""
My class to show intention.
"""
def __init__(self):
self._x = None
@property
def x(self):
return self._x
x = MyClass().x |
Idematica/django-oscar | refs/heads/master | oscar/apps/partner/views.py | 6027 | # Create your views here.
|
scrollback/kuma | refs/heads/master | vendor/lib/python/south/introspection_plugins/__init__.py | 129 | # This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_audit_log
import south.introspection_plugins.django_tagging
import south.introspection_plugins.djang... |
chenzhiwo/linux-sunxi | refs/heads/lemaker-3.4 | Documentation/target/tcm_mod_builder.py | 4981 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
wikimedia/pywikibot-core | refs/heads/master | scripts/upload.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to upload images to wikipedia.
The following parameters are supported:
-keep Keep the filename as is
-filename: Target filename without the namespace prefix
-prefix: Add specified prefix to every filename.
-noverify Do not ask for verifi... |
lz1988/django-web | refs/heads/master | build/lib/django/contrib/auth/management/__init__.py | 70 | """
Creates permissions for all installed apps that need permissions.
"""
from __future__ import unicode_literals
import getpass
import locale
import unicodedata
from django.contrib.auth import models as auth_app, get_user_model
from django.core import exceptions
from django.core.management.base import CommandError
f... |
unaizalakain/django | refs/heads/master | django/test/__init__.py | 341 | """
Django Unit Test and Doctest framework.
"""
from django.test.client import Client, RequestFactory
from django.test.testcases import (
LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase,
skipIfDBFeature, skipUnlessAnyDBFeature, skipUnlessDBFeature,
)
from django.test.utils import (
ignore... |
466152112/scikit-learn | refs/heads/master | sklearn/manifold/t_sne.py | 106 | # Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de>
# License: BSD 3 clause (C) 2014
# This is the standard t-SNE implementation. There are faster modifications of
# the algorithm:
# * Barnes-Hut-SNE: reduces the complexity of the gradient computation from
# N^2 to N log N (http://arxiv.org/abs/1301.... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/google/appengine/_internal/django/utils/translation/__init__.py | 23 | """
Internationalization support.
"""
from google.appengine._internal.django.utils.encoding import force_unicode
from google.appengine._internal.django.utils.functional import lazy, curry
__all__ = ['gettext', 'gettext_noop', 'gettext_lazy', 'ngettext',
'ngettext_lazy', 'string_concat', 'activate', 'deactivat... |
GammaC0de/pyload | refs/heads/master | src/pyload/plugins/containers/DLC.py | 1 | # -*- coding: utf-8 -*-
import base64
import os
import re
import xml.dom.minidom
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from pyload.core.utils.old import decode
from ..base.container... |
jodal/pyspotify | refs/heads/v2.x/develop | tests/test_session.py | 3 | # encoding: utf-8
from __future__ import unicode_literals
import unittest
import spotify
from spotify.session import _SessionCallbacks
import tests
from tests import mock
@mock.patch('spotify.session.lib', spec=spotify.lib)
class SessionTest(unittest.TestCase):
def tearDown(self):
spotify._session_in... |
jmptrader/rethinkdb | refs/heads/next | drivers/python/rethinkdb/backports/ssl_match_hostname/__init__.py | 134 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, hostname, max_wildcards=1):
"""Matching according to RFC 6125, section 6.4.3
http://tools.ietf.org/html/rfc6125#section-6.4... |
vivsh/kaya | refs/heads/master | src/kaya/env.py | 1 |
from collections import Sequence
import os
import six
from six.moves.urllib import parse
import threading
from .assets import AssetManager
from .exceptions import TemplateNotFound, InvalidTag
try:
from lxml import etree as ET
except ImportError:
try:
from xml.etree import cElementTree as ET
exce... |
Labas-Vakaras/Smart_City | refs/heads/master | rfid-arduino/ComArduino.py | 1 | #======================================
import serial
import time
import webbrowser
print
print
# NOTE the user must ensure that the serial port and baudrate are correct
serPort = "/dev/ttyAMC0"
baudRate = 9600
ser = serial.Serial("/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_64032373933351B070D0-if00", baud... |
srowen/spark | refs/heads/master | examples/src/main/python/mllib/decision_tree_regression_example.py | 27 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
antonve/s4-project-mooc | refs/heads/master | common/lib/capa/capa/responsetypes.py | 17 | #
# File: courseware/capa/responsetypes.py
#
"""
Problem response evaluation. Handles checking of student responses,
of a variety of types.
Used by capa_problem.py
"""
# standard library imports
import abc
import cgi
import inspect
import json
import logging
import html5lib
import numbers
import numpy
import os
fr... |
biospi/seamass-windeps | refs/heads/master | src/boost_1_57_0/tools/build/test/core_d12.py | 45 | #!/usr/bin/python
# Copyright 2002, 2003 Vladimir Prus
# 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)
# This tests correct handling of "-d1" and "-d2" options.
import BoostBuild
t = BoostBuild.Tester(["-ffile.j... |
samdsmx/omegaup | refs/heads/master | stuff/cron/assign_badges.py | 2 | #!/usr/bin/python3
''' Assigns users badges and creates the notifications.'''
import argparse
import datetime
import json
import logging
import os
import sys
from typing import Optional, Set
import MySQLdb
sys.path.insert(
0,
os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__)))... |
pschmitt/home-assistant | refs/heads/dev | homeassistant/components/lirc/__init__.py | 18 | """Support for LIRC devices."""
# pylint: disable=no-member, import-error
import logging
import threading
import time
import lirc
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
_LOGGER = logging.getLogger(__name__)
BUTTON_NAME = "button_name"
DOMAIN = "... |
Work4Labs/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/core/management/commands/loaddata.py | 44 | import sys
import os
import gzip
import zipfile
from optparse import make_option
from django.conf import settings
from django.core import serializers
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.db import connections, router, transaction, DEFAULT_DB_... |
jboes/CatKit | refs/heads/master | catkit/enumeration.py | 1 | from .gen.surface import get_unique_indices, SlabGenerator
from .gen.symmetry import get_standardized_cell
import numpy as np
def surfaces(
bulk,
width,
miller_indices=(1, 1, 1),
terminations=None,
sizes=None,
vacuum=10,
fixed=0,
layer_type='angs',
... |
crasker/scrapy | refs/heads/master | scrapy/core/__init__.py | 216 | """
Scrapy core library classes and functions.
"""
|
luzheqi1987/nova-annotation | refs/heads/master | nova/openstack/common/report/views/__init__.py | 82 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
choderalab/yank | refs/heads/master | Yank/tests/test_cli.py | 1 | #!/usr/bin/python
# =============================================================================================
# MODULE DOCSTRING
# =============================================================================================
"""
Test command-line interface.
"""
# ================================================... |
lepistone/odoo | refs/heads/master | addons/account/wizard/account_report_print_journal.py | 378 | # -*- 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... |
ol-loginov/intellij-community | refs/heads/master | python/testData/mover/continueBreak.py | 83 | test()
for item in range(10):
co<caret>ntinue
test1()
|
duyetdev/openerp-6.1.1 | refs/heads/master | openerp/test/test_translate.py | 460 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
cherokee/webserver | refs/heads/master | qa/239-utf8-file1.py | 8 | # -*- coding: utf-8 -*-
from base import *
DIR = "utf8file1"
FILENAME = "¡ĤĒĹĻŎ!"
MAGIC = "So, Cherokee does support UTF8"
class Test (TestBase):
def __init__ (self):
TestBase.__init__ (self, __file__)
self.name = "UTF8 file download"
self.request = "GET /%s/%s HTTP/1.0... |
guijomatos/SickRage | refs/heads/master | lib/unidecode/x010.py | 252 | data = (
'k', # 0x00
'kh', # 0x01
'g', # 0x02
'gh', # 0x03
'ng', # 0x04
'c', # 0x05
'ch', # 0x06
'j', # 0x07
'jh', # 0x08
'ny', # 0x09
'nny', # 0x0a
'tt', # 0x0b
'tth', # 0x0c
'dd', # 0x0d
'ddh', # 0x0e
'nn', # 0x0f
'tt', # 0x10
'th', # 0x11
'd', # 0x12
'dh', ... |
veger/ansible | refs/heads/devel | lib/ansible/plugins/lookup/together.py | 100 | # (c) 2013, Bradley Young <young.bradley@gmail.com>
# (c) 2012-17 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
DOCUMENTATION = """
lookup: together
author: Br... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.