repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tangyiyong/odoo | refs/heads/8.0 | addons/account/account_invoice.py | 93 | # -*- 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... |
winks/mongrel2 | refs/heads/trunk | examples/http_0mq/xml.py | 96 | from mongrel2 import handler
try:
import json
except:
import simplejson as json
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D481"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9995",
"tcp://127.0.0.1:9994")
COUNT = 0
while True:
print "WAITING FOR REQUEST", COUNT
... |
rahul67/hue | refs/heads/master | desktop/core/ext-py/pysqlite/doc/includes/sqlite3/rowclass.py | 49 | from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
con.row_factory = sqlite3.Row
cur = con.cursor()
cur.execute("select name_last, age from people")
for row in cur:
assert row[0] == row["name_last"]
assert row["name_last"] == row["nAmE_lAsT"]
assert row[1] == row["age"]
assert row[1... |
hesam-setareh/nest-simulator | refs/heads/master | pynest/nest/__init__.py | 8 | # -*- coding: utf-8 -*-
#
# __init__.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
# ... |
MarkWh1te/xueqiu_predict | refs/heads/master | python3_env/lib/python3.4/site-packages/wheel/test/complex-dist/complexdist/__init__.py | 566 | def main():
return
|
YueLinHo/Subversion | refs/heads/master | subversion/tests/cmdline/update_tests.py | 1 | #!/usr/bin/env python
#
# update_tests.py: testing update cases.
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or mo... |
dentaku65/plugin.video.sod | refs/heads/master | lib/mechanize/_auth.py | 137 | """HTTP Authentication and Proxy support.
Copyright 2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included with the distribution).
"""
from _urllib2_fork import HTTPPasswordMgr
# TODO:... |
akrherz/idep | refs/heads/main | scripts/RT/proctor_sweep.py | 1 | """Proctor script for running the SWEEP model.
See dailyerosion/dep#36 for generally more details.
I looked at the measured data again, and realized that a better date would
be June 1 or June 2, 2018; or potentially June 10, 2018.
The lat-long for the site is:
Latitude: 46.78
Longitude: -100.95
Output fields (kg/m2... |
amperser/proselint | refs/heads/pytest_clear_cache | tests/test_config_flag.py | 1 | """Test user option overrides using --config and load_options"""
import subprocess
from proselint.tools import load_options
def test_load_options_function():
"""Test load_options by specifying a user options path"""
overrides = load_options("tests/test_config_flag_proselintrc")
assert load_options()["chec... |
nojhan/weboob-devel | refs/heads/master | modules/bnporc/pp/browser.py | 2 | # -*- coding: utf-8 -*-
# Copyright(C) 2009-2013 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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, or
# (at you... |
bradfordboyle/pyglpk | refs/heads/master | examples/maxflow.py | 1 | import glpk
def maxflow(capgraph, s, t):
node2rnum = {} # Map non-source/sink nodes to row num.
for nfrom, nto, cap in capgraph:
if nfrom!=s and nfrom!=t:
node2rnum.setdefault(nfrom, len(node2rnum))
if nto!=s and nto!=t:
node2rnum.setdefault(nto, len... |
bubenkoff/Arkestra | refs/heads/develop | contacts_and_people/tests/contactsandpeople.py | 1 | from django.test import TestCase
from django.core.urlresolvers import reverse, resolve
from django.test.client import RequestFactory
from django.http import Http404
from contacts_and_people.models import (
Site, Person, Building, Entity, Membership
)
from contacts_and_people.views import contacts_and_people
fr... |
tebeka/pythonwise | refs/heads/master | noise-reduction.py | 1 | # View notebook at http://bit.ly/191MRIN
from matplotlib import pyplot as plt
import numpy as np
values = np.random.binomial(1000, 0.5, 1000)
plt.hist(values, bins=20) # We'll get the below before the chart
# (array([ 3., 3., 7., 23., 39., 46., 75., 94., 94.,
# 118., 121., 104., 82., ... |
ChenglongChen/topical_word_embeddings | refs/heads/master | TWE-3/gensim/test/test_miislita.py | 83 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module replicates the miislita vector spaces from
"A Linear Algebra Approach to the Vector Space Model -- A Fast Track Tutorial"
by Dr. E. Garcia, admin@miislita.com
See http://www.miisl... |
shiora/The-Perfect-Pokemon-Team-Balancer | refs/heads/master | libs/env/Lib/site-packages/pip/_vendor/requests/packages/charade/sbcsgroupprober.py | 2935 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
Shiroy/servo | refs/heads/master | tests/wpt/web-platform-tests/serve.py | 162 | from tools.serve import serve
def main():
serve.main()
|
jrichte43/hangman | refs/heads/master | alembic/env.py | 1 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
Smart-Torvy/torvy-home-assistant | refs/heads/torvy | homeassistant/components/garage_door/zwave.py | 4 | """
Support for Zwave garage door components.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/garagedoor.zwave/
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
import logging
from homeassistant.components.garage_door import DOM... |
mdclyburn/ardupilot | refs/heads/master | Tools/autotest/pysim/rotmat.py | 154 | #!/usr/bin/env python
#
# vector3 and rotation matrix classes
# This follows the conventions in the ArduPilot code,
# and is essentially a python version of the AP_Math library
#
# Andrew Tridgell, March 2012
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser... |
dpshelio/sunpy | refs/heads/master | sunpy/visualization/animator/__init__.py | 2 | from sunpy.visualization.animator.base import *
from sunpy.visualization.animator.image import *
from sunpy.visualization.animator.line import *
from sunpy.visualization.animator.mapsequenceanimator import *
|
darinbunker/HomePiSecurity | refs/heads/master | engine/configSettings.py | 1 | #!/usr/bin/python
# Database Settings
HOST_NAME = "localhost"
DB_USER = "ReplaceDBUser"
DB_PASSWORD = "ReplaceDBPassword"
DB_DATABASE = "HomeSecuritySystem"
# SMS Settings - Only Twilio is supported with this version
# The following values are examples of what is expected
ACCOUNT_SID = "ReplaceSMSAccountID"
AUTH_TOK... |
modulexcite/catapult | refs/heads/master | tracing/third_party/tvcm/third_party/rcssmin/_setup/py3/term/__init__.py | 24 | # -*- coding: ascii -*-
#
# Copyright 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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... |
bdeloeste/unnamed-sxsw-hack | refs/heads/master | musicstreaming/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
mrshelly/openerp71313 | refs/heads/master | openerp/addons/crm_partner_assign/wizard/__init__.py | 62 | # -*- 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... |
tommybobbins/minecraft_flashcards | refs/heads/master | scripts/tower_lava.py | 1 | import mcpi.minecraft as minecraft
import mcpi.block as block
mc = minecraft.Minecraft.create()
radius = 4
height = radius + 16
pos = mc.player.getPos()
#mc.setBlocks(pos.x + height, pos.y, pos.z, pos.x + radius, pos.y + height, pos.z + radius , block.STONE_BRICK.id, 18)
mc.setBlocks(pos.x + height, pos.y, pos.z, pos.x... |
matthewbauer/unipkg-pacman | refs/heads/master | test/pacman/tests/sync041.py | 13 | self.description = "Install two conflicting targets"
sp1 = pmpkg("pkg1")
sp1.conflicts = ["pkg2"]
sp2 = pmpkg("pkg2")
sp2.conflicts = ["pkg1"]
for p in sp1, sp2:
self.addpkg2db("sync", p);
self.args = "-S %s" % " ".join([p.name for p in sp1, sp2])
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
s... |
zsulocal/pycoin | refs/heads/master | tests/tx_utils_test.py | 1 | import hashlib
import struct
import unittest
from pycoin.ecdsa import generator_secp256k1, public_pair_for_secret_exponent
from pycoin.encoding import public_pair_to_bitcoin_address, secret_exponent_to_wif
from pycoin.tx.exceptions import BadSpendableError
from pycoin.tx.tx_utils import create_signed_tx
from pycoin.t... |
jxta/cc | refs/heads/master | vendor/boto/boto/sqs/__init__.py | 3 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
DavidLP/home-assistant | refs/heads/dev | homeassistant/components/logger/__init__.py | 10 | """Support for settting the level of logging for components."""
import logging
from collections import OrderedDict
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
DOMAIN = 'logger'
DATA_LOGGER = 'logger'
SERVICE_SET_DEFAULT_LEVEL = 'set_default_level'
SERVICE_SET_LEVEL = 'set_level'
... |
SUNET/SATOSA | refs/heads/master | setup.py | 2 | """
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('s... |
EasyRPG/Player | refs/heads/master | resources/wenquanyi/gen_wqy_font_cpp.py | 4 | #! /usr/bin/env python3
bdf = 'wenquanyi_cjk_basic_9pt.bdf'
cpp = '../../src/bitmapfont_wqy.h'
##cpp = 'bitmapfont_wqy.h'
# FONTBOUNDINGBOX 12 14 0 -3
control_point = 14 - 3
h = 12
w = 12
w_half = 12 // 2
chars = 0
glyphs = []
def getKey(item):
return item[0]
if __name__ == '__main__':
with open(bdf) as f:... |
joyhchen/zulip | refs/heads/master | zerver/tests/webhooks/test_librato.py | 15 | # -*- coding: utf-8 -*-
from six.moves import urllib
from typing import Optional, Text
from zerver.lib.test_classes import WebhookTestCase
class LibratoHookTests(WebhookTestCase):
STREAM_NAME = 'librato'
URL_TEMPLATE = u"/api/v1/external/librato?api_key={api_key}&stream=librato"
FIXTURE_DIR_NAME = 'librato... |
inirudebwoy/pytest | refs/heads/master | doc/en/check_sphinx.py | 233 | import py
import subprocess
def test_build_docs(tmpdir):
doctrees = tmpdir.join("doctrees")
htmldir = tmpdir.join("html")
subprocess.check_call([
"sphinx-build", "-W", "-bhtml",
"-d", str(doctrees), ".", str(htmldir)])
def test_linkcheck(tmpdir):
doctrees = tmpdir.join("doctrees")
... |
fredericlepied/ansible | refs/heads/devel | test/units/modules/system/test_parted.py | 42 | # (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/twisted/mail/interfaces.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Interfaces for L{twisted.mail}.
@since: 16.5
"""
from __future__ import absolute_import, division
from zope.interface import Interface
class IClientAuthentication(Interface):
def getName():
"""
Return an identifier as... |
sanmik/brain_network_viz | refs/heads/master | source/main.py | 1 | """
Main driver program to render a neuronal connection data.
Developed for use with Python 2.7
"""
# Library Imports
import sys
import bisect
import argparse
import csv
import os
# Local module imports
import config
from graph import Graph
from graph_renderer import GraphRenderer
from metadata import NodeMetada... |
aristotle-tek/cuny-bdif | refs/heads/master | AWS/ec2/lib/boto-2.34.0/boto/dynamodb/__init__.py | 145 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without ... |
optimizers/nlpy | refs/heads/master | nlpy/setup.py | 3 | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('nlpy', parent_package, top_path)
config.add_subpackage('model')
config.add_subpackage('linalg')
config.add_subpackage('krylov')
... |
apechimp/servo | refs/heads/master | tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py | 253 | import time
import re
def main(request, response):
key = request.GET['id']
action = request.GET['action']
if action == 'put':
# We want the raw input for 'q'
q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0]
request.server.stash.put(key, q)
return [("Content-T... |
cmjatai/cmj | refs/heads/master | sapl/protocoloadm/migrations/0013_auto_20190106_1336.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-01-06 15:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('protocoloadm', '0012_auto_20190104_1021'),
]
opera... |
drewtalati/talaticoin | refs/heads/master | qa/rpc-tests/rpcbind_test.py | 166 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test for -rpcbind, as well as -rpcallowip and -rpcconnect
# Add python-bitcoinrpc to module search path:
im... |
Big-B702/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/iso8859_16.py | 272 | """ Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
sabi0/intellij-community | refs/heads/master | python/testData/inspections/AddCallSuperPass.py | 83 | class A:
def __init__(self, c, a = 5):
pass
class B(A):
def <caret><warning descr="Call to __init__ of super class is missed">__init__</warning>(self, r, b = 6):
pass
|
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/meatlump/event/meatlump_food_palette_01_06.py | 85615 | import sys
def setup(core, object):
return |
catapult-project/catapult-csm | refs/heads/master | telemetry/third_party/altgraph/altgraph/Dot.py | 27 | '''
altgraph.Dot - Interface to the dot language
============================================
The :py:mod:`~altgraph.Dot` module provides a simple interface to the
file format used in the `graphviz <http://www.research.att.com/sw/tools/graphviz/>`_
program. The module is intended to offload the most tedious part of th... |
sarthakmeh03/django | refs/heads/master | django/db/backends/postgresql/base.py | 7 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends.base.base import BaseDatabaseWrapper
from djan... |
chandolia/python-social-auth | refs/heads/master | social/apps/django_app/me/__init__.py | 70 | """
Mongoengine backend support.
To enable this app:
* Add 'social.apps.django_app.me' to INSTALLED_APPS
* In urls.py include url('', include('social.apps.django_app.urls'))
"""
default_app_config = \
'social.apps.django_app.me.config.PythonSocialAuthConfig'
|
erjohnso/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/kinesis_stream.py | 7 | #!/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'],
... |
vikkyrk/incubator-beam | refs/heads/master | sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes_test.py | 9 | #
# 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... |
donkirkby/django | refs/heads/master | django/contrib/gis/geos/__init__.py | 231 | """
The GeoDjango GEOS module. Please consult the GeoDjango documentation
for more details: https://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/
"""
from .collections import ( # NOQA
GeometryCollection, MultiLineString, MultiPoint, MultiPolygon,
)
from .error import GEOSException # NOQA
from .factory impo... |
rwooster/Cadebot | refs/heads/master | util.py | 1 | # Contains utility functions
import random
def roll_dice(dice):
# Make a dice roll of the form "1d6"
roll = dice.split('d')
random.seed()
total = 0
for i in range(int(roll[0])):
total += random.randint(1, int(roll[1]))
return total
|
FuzzyHobbit/scrapy | refs/heads/master | scrapy/squeues.py | 133 | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... |
guileschool/BEAGLEBONE-tutorials | refs/heads/master | BBB-firmware/u-boot-v2018.05-rc2/tools/binman/etype/u_boot_spl.py | 2 | # Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# SPDX-License-Identifier: GPL-2.0+
#
# Entry-type module for spl/u-boot-spl.bin
#
import elf
from entry import Entry
from blob import Entry_blob
class Entry_u_boot_spl(Entry_blob):
def __init__(self, image, etype, node):
... |
shabda/pychart | refs/heads/master | pychart/afm/Courier_BoldOblique.py | 12 | # AFM font Courier-BoldOblique (path: /usr/share/fonts/afms/adobe/pcrbo8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["Courier-BoldOblique"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500... |
ravwojdyla/incubator-beam | refs/heads/master | sdks/python/apache_beam/transforms/util.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 us... |
ivmech/iviny-scope | refs/heads/master | lib/xlsxwriter/test/comparison/test_chart_gridlines01.py | 1 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... |
eLRuLL/scrapy | refs/heads/master | tests/test_spidermiddleware_referer.py | 1 | from urllib.parse import urlparse
from unittest import TestCase
import warnings
from scrapy.http import Response, Request
from scrapy.settings import Settings
from scrapy.spiders import Spider
from scrapy.downloadermiddlewares.redirect import RedirectMiddleware
from scrapy.spidermiddlewares.referer import RefererMiddl... |
sudheesh001/oh-mainline | refs/heads/master | vendor/packages/whoosh/src/whoosh/spelling.py | 17 | # 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... |
jtilander/niftyplugins | refs/heads/master | bin/build.py | 2 | #
# Creates 2010 archive for NiftyPlugins.
#
import zipfile
import os
import sys
import logging
import re
import shutil
QUIET = 0
DEVENV = ''
if 'VS140COMNTOOLS' in os.environ.keys():
DEVENV = os.path.abspath(os.path.join(os.environ['VS140COMNTOOLS'], '..', 'IDE', 'devenv.com'))
else:
print "No visu... |
cpanelli/-git-clone-https-chromium.googlesource.com-chromium-tools-depot_tools | refs/heads/master | third_party/coverage/execfile.py | 209 | """Execute files of Python code."""
import imp, marshal, os, sys
from coverage.backward import exec_code_object, open_source
from coverage.misc import ExceptionDuringRun, NoCode, NoSource
try:
# In Py 2.x, the builtins were in __builtin__
BUILTINS = sys.modules['__builtin__']
except KeyError:
# In Py 3.... |
99cloud/keystone_register | refs/heads/master | horizon/__init__.py | 9 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
dsajkl/reqiop | refs/heads/master | lms/djangoapps/Parentengagment/Parentengagment/urls.py | 2 | from django.conf.urls import patterns, include, url
from ParerntApp import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'Parentengagment.views.home', name='home'),
# url(r'^Parenteng... |
pschmitt/home-assistant | refs/heads/dev | homeassistant/components/switch/__init__.py | 16 | """Component to interface with switches that can be controlled remotely."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.const import (
SERVICE_TOGGLE,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_ON,
)
from homeassistant.helpers.config_validation import ( # n... |
pandaproject/panda | refs/heads/master | panda/migrations/0019_auto__add_searchsubscription.py | 6 | # -*- coding: 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):
# Adding model 'SearchSubscription'
db.create_table('panda_searchsubscription', (
('id', self.gf... |
AndrewChubatiuk/ssm-diff | refs/heads/master | states/states.py | 1 | from __future__ import print_function
from helpers import flatten, merge, add, search
import sys
import os
import yaml
import boto3
import termcolor
def str_presenter(dumper, data):
if len(data.splitlines()) == 1 and data[-1] == '\n':
return dumper.represent_scalar(
'tag:yaml.org,2002:str', dat... |
willingc/vms | refs/heads/develop | vms/pom/locators/volunteerRegistrationPageLocators.py | 2 |
class VolunteerRegistrationPageLocators(object):
USERNAME = 'id_username'
PASSWORD = 'id_password'
FIRST_NAME = 'id_first_name'
LAST_NAME = 'id_last_name'
EMAIL = 'id_email'
ADDRESS = 'id_address'
CITY = 'id_city'
STATE = 'id_state'
COUNTRY = 'id_country'
PHONE = 'id_phone_number'
ORGANIZATION = 'id_unlist... |
nelmiux/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/email/quoprimime.py | 246 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It... |
awkspace/ansible | refs/heads/devel | test/units/modules/network/onyx/test_onyx_config.py | 52 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
mastizada/kuma | refs/heads/master | vendor/packages/Werkzeug/examples/cupoftee/utils.py | 50 | # -*- coding: utf-8 -*-
"""
cupoftee.utils
~~~~~~~~~~~~~~
Various utilities.
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
_sort_re = re.compile(r'\w+(?u)')
def unicodecmp(a, b):
x, y = map(_sort_re.searc... |
legacysurvey/pipeline | refs/heads/master | py/legacyanalysis/cosmos-6x.py | 2 | from __future__ import print_function
from astrometry.util.fits import *
import pylab as plt
import numpy as np
from glob import glob
from astrometry.util.plotutils import *
from astrometry.libkd.spherematch import *
from astrometry.util.resample import *
from astrometry.util.util import *
ps = PlotSequence('cosmos')
... |
phalax4/CarnotKE | refs/heads/master | jyhton/bugtests/test384.py | 13 | """
test for patch [ 1153003 ]
"""
import support
import jarray
import java
from org.python.core import ArgParser, PyObject
try:
# test(1, arg1=2)
args = jarray.array([1,2], PyObject)
kwds = jarray.array(['arg1'], java.lang.String)
ArgParser('test', args, kwds, 'arg1', 'arg2')
except TypeError:
pa... |
google/flax | refs/heads/master | examples/wmt/decode.py | 2 | # Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
ArneBab/pypyjs | refs/heads/master | website/demo/home/rfk/repos/pypy/lib-python/2.7/idlelib/HyperParser.py | 89 | """
HyperParser
===========
This module defines the HyperParser class, which provides advanced parsing
abilities for the ParenMatch and other extensions.
The HyperParser uses PyParser. PyParser is intended mostly to give information
on the proper indentation of code. HyperParser gives some information on the
structure ... |
dpo/nlpy | refs/heads/master | nlpy/tools/utils.py | 3 | # Various utilities.
import numpy as np
from math import copysign, sqrt
# Helper functions.
def identical(a,b):
"""
Check that two arrays or lists are identical. Must be cautious because
of Numpy's strange behavior:
>>> a = np.array([]) ; b = np.array([0])
>>> np.all(a==b)
True
"""
if ... |
semonte/intellij-community | refs/heads/master | python/testData/refactoring/rename/renameAugAssigned_after.py | 83 | def cover(bar=1):
bar += 1
return bar
|
jallohm/django | refs/heads/master | django/contrib/messages/api.py | 512 | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
'MessageFailure',
)
class MessageFailure(E... |
0Chencc/CTFCrackTools | refs/heads/master | Lib/abc.py | 488 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import types
from _weakrefset import WeakSet
# Instance of old-style class
class _C: pass
_InstanceType = type(_C())
def abstractmethod(funcobj):
"""A d... |
mmarchini/python-mingus | refs/heads/master | unittest/test_lilypond.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path += ['../']
import unittest
import mingus.extra.lilypond as LilyPond
import mingus.core.value as value
from mingus.containers.note import Note
from mingus.containers.note_container import NoteContainer
from mingus.containers.bar import Bar
from mingus.contain... |
lukecwik/incubator-beam | refs/heads/master | sdks/python/apache_beam/io/gcp/bigquery_read_perf_test.py | 3 | #
# 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... |
ArthurGarnier/SickRage | refs/heads/master | lib/js2py/prototypes/jsboolean.py | 105 |
class BooleanPrototype:
def toString():
if this.Class!='Boolean':
raise this.Js(TypeError)('this must be a boolean')
return 'true' if this.value else 'false'
def valueOf():
if this.Class!='Boolean':
raise this.Js(TypeError)('this must be a boolean')
ret... |
Nikoala/CouchPotatoServer | refs/heads/develop | libs/dateutil/tz.py | 217 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
from six import string_types, PY3
import datetime
import struct
import time
import sys
import os
relativedelta = None
parser = None
rrule = No... |
entropy1337/infernal-twin | refs/heads/master | Modules/build/pip/build/lib.linux-i686-2.7/pip/_vendor/html5lib/tokenizer.py | 1710 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... |
wasade/networkx | refs/heads/master | setup.py | 26 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup script for networkx
You can install networkx with
python setup.py install
"""
from glob import glob
import os
import sys
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
from setuptools import setup
if sys.argv[-1] == 'setup.py':
print("To install,... |
fitermay/intellij-community | refs/heads/master | python/testData/mover/multiLineSelection7.py | 83 | class Test(object):
def q(self):
c = 3
<caret><selection>a = 1
b = 2
</selection> |
commaai/openpilot | refs/heads/master | tools/lib/tests/test_caching.py | 1 | #!/usr/bin/env python3
import os
import shutil
import unittest
os.environ["COMMA_CACHE"] = "/tmp/__test_cache__"
from tools.lib.url_file import URLFile, CACHE_DIR
class TestFileDownload(unittest.TestCase):
def compare_loads(self, url, start=0, length=None):
"""Compares range between cached and non cached vers... |
credativ/pulp | refs/heads/master | bindings/pulp/bindings/actions.py | 15 | from pulp.bindings.base import PulpAPI
class ActionsAPI(PulpAPI):
"""
Connection class to access repo specific calls
"""
def __init__(self, pulp_connection):
super(ActionsAPI, self).__init__(pulp_connection)
def login(self, username, password):
path = '/v2/actions/login/'
... |
seanfisk/buzzword-bingo-server | refs/heads/master | django/core/cache/backends/memcached.py | 151 | "Memcached cache backend"
import time
from threading import local
from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError
from django.utils import importlib
class BaseMemcachedCache(BaseCache):
def __init__(self, server, params, library, value_not_found_exception):
super(BaseMemca... |
Honry/crosswalk-test-suite | refs/heads/master | misc/sampleapp-android-tests/sampleapp/hexgl.py | 14 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
zhjunlang/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/commands/list.py | 393 | from pip.basecommand import Command
from pip.exceptions import DistributionNotFound, BestVersionAlreadyInstalled
from pip.index import PackageFinder
from pip.log import logger
from pip.req import InstallRequirement
from pip.util import get_installed_distributions, dist_is_editable
from pip.cmdoptions import make_option... |
thomast74/oinkbrew_webapp | refs/heads/master | api/views/BrewPiDetail.py | 1 | import logging
import time
from django.shortcuts import get_object_or_404
from django.views.generic import View
from api.helpers.Core import prepare_brewpi_dic
from api.helpers.Responses import ApiResponse
from api.models import BrewPi, Device
from api.services.BrewPiSerializer import BrewPiSerializer
from api.servic... |
bfirsh/django-old | refs/heads/master | django/db/backends/mysql/compiler.py | 410 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def resolve_columns(self, row, fields=()):
values = []
index_extra_select = len(self.query.extra_select.keys())
for value, field in map(None, row[index_extra_select:], fields):
if (field and field... |
docusign/docusign-python-client | refs/heads/master | docusign_esign/models/power_forms_form_data_response.py | 1 | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... |
raycarnes/hr | refs/heads/8.0 | __unported__/hr_employee_seniority/__init__.py | 93 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# 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, eit... |
dev-ops-de/catalog | refs/heads/master | images/mesos/build.py | 2 | #!/usr/bin/env python
from jinja2 import Template, Environment, FileSystemLoader
from subprocess import call
from os import remove
user='llparse'
versions=['0.24.1-centos-7', '0.24.1-ubuntu-14.04']
types=['master', 'slave']
env = Environment(
loader=FileSystemLoader('./templates'),
trim_blocks=True)
for version ... |
jungle90/Openstack-Swift-I-O-throttler | refs/heads/master | build/lib.linux-x86_64-2.7/swift/account/backend.py | 11 | # 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... |
sarantapichos/faircoop-market | refs/heads/master | addons/email_template/email_template.py | 196 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.0/Lib/stringprep.py | 205 | # This file is generated by mkstringprep.py. DO NOT EDIT.
"""Library that exposes various tables found in the StringPrep RFC 3454.
There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
"""
from unicodedata import ucd_3_2_0 as unicodedata
ass... |
dietrichc/streamline-ppc-reports | refs/heads/master | examples/dfp/v201403/order_service/approve_orders.py | 1 | #!/usr/bin/python
#
# Copyright 2014 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 b... |
amadev/rater | refs/heads/master | rater/settings.py | 1 | # -*- coding: utf-8 -*-
"""
rater.settings
~~~~~~~~~~~~~~~
This module just stores the rater settings.
:copyright: (c) 2009 by Rater Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
del with_statement
# propagate early. Th... |
idlead/scikit-learn | refs/heads/master | sklearn/datasets/lfw.py | 141 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.