repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
yamt/neutron | refs/heads/master | quantum/scheduler/l3_agent_scheduler.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.... |
mfraezz/osf.io | refs/heads/develop | tests/test_addons.py | 2 | # -*- coding: utf-8 -*-
import os
import datetime
from rest_framework import status as http_status
import time
import functools
import furl
import itsdangerous
import jwe
import jwt
import mock
import pytest
from django.utils import timezone
from django.contrib.auth.models import Permission
from framework.auth import... |
KatsuraKKKK/linux | refs/heads/master | tools/perf/scripts/python/sctop.py | 1996 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
gundalow/ansible | refs/heads/devel | hacking/build_library/build_ansible/command_plugins/update_intersphinx.py | 51 | # -*- coding: utf-8 -*-
# (c) 2020, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import argparse
import importlib
import os
import pat... |
2013Commons/hue | refs/heads/master | desktop/core/ext-py/Django-1.4.5/django/db/models/fields/files.py | 88 | import datetime
import os
from django import forms
from django.db.models.fields import Field
from django.core.files.base import File
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
from django.utils.encoding import force_unicode,... |
cryptobanana/ansible | refs/heads/devel | lib/ansible/modules/network/junos/junos_l3_interface.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
pascalchevrel/bedrock | refs/heads/master | tests/functional/newsletter/test_newsletter_embed.py | 4 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from pages.home import HomePage
from pages.about import AboutPage
from pages.contribute.contribute import... |
ujjvala-addsol/addsol_hr | refs/heads/master | openerp/addons/account/report/account_partner_ledger.py | 63 | # -*- 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... |
firerszd/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_unpack_ex.py | 183 | # Tests for extended unpacking, starred expressions.
doctests = """
Unpack tuple
>>> t = (1, 2, 3)
>>> a, *b, c = t
>>> a == 1 and b == [2] and c == 3
True
Unpack list
>>> l = [4, 5, 6]
>>> a, *b = l
>>> a == 4 and b == [5, 6]
True
Unpack implied tuple
>>> *a, = 7, 8, 9
>>... |
vmax-feihu/hue | refs/heads/master | desktop/core/ext-py/thrift-0.9.1/src/server/TNonblockingServer.py | 111 | #
# 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 u... |
kemalakyol48/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_uu.py | 58 | """
Tests for uu module.
Nick Mathewson
"""
import unittest
from test import support
import sys, os
import uu
from io import BytesIO
import io
plaintext = b"The smooth-scaled python crept over the sleeping dog\n"
encodedtext = b"""\
M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
(:6YG(&1O9PH """
# ... |
madan96/sympy | refs/heads/master | sympy/physics/quantum/tests/test_qft.py | 98 | from sympy import exp, I, Matrix, pi, sqrt, Symbol
from sympy.core.compatibility import range
from sympy.physics.quantum.qft import QFT, IQFT, RkGate
from sympy.physics.quantum.gate import (ZGate, SwapGate, HadamardGate, CGate,
PhaseGate, TGate)
from sympy.physics.quantum.qubit ... |
sourtin/igem15-sw | refs/heads/master | gui/webshell/mjpgstreamer.py | 1 | import io
import os
import threading
import subprocess
import picamera
import time, datetime
import traceback
import re
import uuid
import fnmatch
import urllib
import json
from PIL import Image, ImageDraw, ImageFont
class MjpgStreamer:
iso = "400"
@staticmethod
def touch(fname, times=None):
with ... |
moto-timo/ironpython3 | refs/heads/master | Src/Scripts/test_parrot.py | 3 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... |
Colonel-Top/Line-Bot-Python | refs/heads/master | python/oauth2client/contrib/gce.py | 39 | # 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 by applicable law or ... |
suncycheng/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/MethodContext.after.py | 71 | class C:
def foo(self):
self.bar()
def bar(self):
for x in [1, 2]:
print x |
t794104/ansible | refs/heads/devel | lib/ansible/module_utils/facts/virtual/sysctl.py | 31 | # 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 distributed in the hope that ... |
dannysellers/rapidsms_service-locator | refs/heads/master | locator/urls.py | 1 | from django.conf.urls import patterns, url
urlpatterns = patterns('locator.views',
url(r'^$', 'dashboard', name = 'dashboard'),
url(r'^entities/$', 'entity_overview', name = 'entity_overview'),
url(r'^add_entity/$', 'add_entity', name = 'add_entity'),
url(r'^map_entities/', 'graph_entities', name = 'map_en... |
browndeer/lammps-ocl | refs/heads/current | tools/eff/lmp2xyz.py | 5 | Info="""
Module name: lmp2xyz.py
Author: (c) Andres Jaramillo-Botero
California Institute of Technology
ajaramil@caltech.edu
Project: pEFF
Version: August 2009
Extracts the xyz from a lammps trajectory dump of style custom:
dump 1 all custom period dump_file id type x y z spin radius ...
Usage: python lmp2xyz.py... |
HelixEducation/intg-getting-started | refs/heads/master | application-integration/python/tail-queue.py | 1 | #!/usr/bin/env python3
# Helper script to publish sample message to SQS queue
import yaml
import boto3
import sys
if len(sys.argv) < 1:
print ('usage: tail-queue.py')
sys.exit(1)
# Load config file
config = None
with open("config.yml", "r") as stream:
try:
config = list(yaml.load_all(stream))[0]
except yaml.YAM... |
bdysvik/three.js | refs/heads/dev | utils/exporters/blender/addons/io_three/exporter/api/object.py | 33 | import math
import mathutils
import bpy
from bpy import data, context, types
from bpy_extras.io_utils import axis_conversion
from .. import constants, logger, utilities, exceptions
from .constants import (
MESH,
EMPTY,
ARMATURE,
LAMP,
AREA,
SPOT,
SUN,
POINT,
HEMI,
CAMERA,
PER... |
ssssam/rdflib | refs/heads/master | rdflib/plugins/sparql/evalutils.py | 23 | import collections
from rdflib.term import Variable, Literal, BNode, URIRef
from rdflib.plugins.sparql.operators import EBV
from rdflib.plugins.sparql.parserutils import Expr, CompValue
from rdflib.plugins.sparql.sparql import SPARQLError, NotBoundError
def _diff(a, b, expr):
res = set()
for x in a:
... |
aeischeid/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/example/abort_wsh.py | 465 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
the-zebulan/CodeWars | refs/heads/master | katas/beta/sort_deck_of_cards.py | 1 | def sort_cards(cards):
return sorted(cards, key='A23456789TJQK'.index)
|
takis/odoo | refs/heads/8.0 | openerp/tools/safe_eval.py | 250 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2004-2014 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 GNU Affero General Public License as
# ... |
ryannathans/micropython | refs/heads/master | tests/basics/gen_yield_from_throw3.py | 23 | # yield-from a user-defined generator with a throw() method
class Iter:
def __iter__(self):
return self
def __next__(self):
return 1
def throw(self, x):
print('throw', x)
return 456
def gen():
yield from Iter()
# calling close() should not call throw()
g = gen()
prin... |
ivan-fedorov/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/unresolvedTopLevelInit.py | 83 | <error descr="Unresolved reference '__init__'">__init__</error>
|
boronine/discipline | refs/heads/master | testing/testapp/admin.py | 1 | # -*- coding: utf-8 -*-
from django.contrib import admin
from discipline.admin import DisciplinedModelAdmin
from testing.testapp.models import *
admin.site.register(Concept, DisciplinedModelAdmin)
admin.site.register(Word, DisciplinedModelAdmin)
admin.site.register(WordConceptConnection, DisciplinedModelAdmin)
admin.... |
brain-tec/partner-contact | refs/heads/11.0 | base_location_nuts/wizard/nuts_import.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2017 David Vidal <jairo.llopis@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, models
from odoo... |
vefimova/rally | refs/heads/master | rally/plugins/openstack/scenario.py | 3 | # Copyright 2015: Mirantis 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... |
arhik/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/pkg_resources.py | 245 | """Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipula... |
dracos/QGIS | refs/heads/master | python/plugins/processing/algs/gdal/ogrsql.py | 4 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ogrsql.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************************... |
richstoner/incf_engine | refs/heads/master | engine/routes/run_bet.py | 1 | #!/usr/bin/env python
"""Run FreeSurfer on a T1 image and capture all output as NIDM
"""
import os
import urllib
import urlparse
from StringIO import StringIO
from nipype.interfaces.base import CommandLine
CommandLine.set_default_terminal_output('allatonce')
from nipype import config
config.enable_provenance()
impo... |
vincecr0ft/hhntup | refs/heads/master | etc/eventview.py | 4 | from rootpy.plotting import Hist2D, Canvas
from rootpy.plotting.shapes import Ellipse
import math
import ROOT
ROOT.gStyle.SetOptStat(0)
def draw(event, vects, radii=None, colors=None, etamin=-5, etamax=5, phimin=-math.pi, phimax=math.pi):
"""
This function creates a 2D view of an event over eta and phi
"... |
PatSunter/pyOTPA | refs/heads/master | TrainStations-OD-Matrix/make_od_matrix.py | 1 | #!/usr/bin/env python
import csv
import os
sfile = open('/Users/pds_phd/Dropbox/PhD-TechnicalProjectWork/OSSTIP_Common/GIS-Network-Data-Melb/GTFS-ExtractedData-201307/melb-train-gtfs/stops.txt', 'rb')
sreader = csv.reader(sfile, delimiter=',', quotechar="'")
#First we'll just assemble the list of dirnames.
dirnames ... |
StephenKing/ryu | refs/heads/master | ryu/services/protocols/bgp/operator/ssh.py | 12 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
Metaswitch/calico-nova | refs/heads/calico-readme | nova/tests/unit/api/openstack/test_common.py | 8 | # Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
MartinSavc/scikit-learn | refs/heads/master | examples/semi_supervised/plot_label_propagation_structure.py | 247 | """
==============================================
Label Propagation learning a complex structure
==============================================
Example of LabelPropagation learning a complex internal structure
to demonstrate "manifold learning". The outer circle should be
labeled "red" and the inner circle "blue". Be... |
kubaszostak/gdal-dragndrop | refs/heads/master | osgeo/apps/Python27/Lib/site-packages/numpy/lib/nanfunctions.py | 5 | """
Functions that ignore NaN.
Functions
---------
- `nanmin` -- minimum non-NaN value
- `nanmax` -- maximum non-NaN value
- `nanargmin` -- index of minimum non-NaN value
- `nanargmax` -- index of maximum non-NaN value
- `nansum` -- sum of non-NaN values
- `nanprod` -- product of non-NaN values
- `nancumsum` -- cumul... |
sekikn/ambari | refs/heads/trunk | ambari-agent/src/main/python/ambari_agent/CommandHooksOrchestrator.py | 2 | """
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 use this ... |
ebar0n/django | refs/heads/master | tests/servers/models.py | 112 | from django.db import models
class Person(models.Model):
name = models.CharField(max_length=255)
|
alyptik/dotfiles | refs/heads/master | scripts/get.py | 1 | #! /usr/bin/env python3
import json, sys
import re
data = list(map(lambda x:json.loads(x)["d"].split("je.api(", 2)[2].rsplit(');</script>', 1)[0], filter(lambda x:"data-async-context" in x, sys.stdin.read().split("/*\"\"*/"))))
data = data[0]
data = data.replace(r'\x22', r'\"')
data = re.sub(r'\\x(?P<code>[0-9a-f][0-... |
tompecina/legal | refs/heads/master | legal/dir/glob.py | 1 | # -*- coding: utf-8 -*-
#
# dir/glob.py
#
# Copyright (C) 2011-19 Tomáš Pecina <tomas@pecina.cz>
#
# This file is part of legal.pecina.cz, a web-based toolbox for lawyers.
#
# This application is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published b... |
linkslice/graphite-tools | refs/heads/master | cisco-airespace.py | 1 | #!/bin/env python
# Needs Net-SNMP Python bindings
from optparse import OptionParser
import sys
import os
import netsnmp
import pickle
import socket
import struct
import time
os.environ['MIBS'] = 'all' # install Cisco/airespace mibs in net-snmp mibs directory
# usually /usr/share/snmp/mibs... |
simartin/servo | refs/heads/master | tests/wpt/webgl/tests/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py | 51 | #!/usr/bin/env python
# Copyright (c) 2016 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use... |
shacker/django | refs/heads/master | django/conf/locale/ru/formats.py | 65 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j E Y г. G:i'
YEAR_MONTH_FORMAT = 'F Y г.'
MONTH_DA... |
jmhsi/justin_tinker | refs/heads/master | data_science/courses/learning_dl_packages/models/research/differential_privacy/privacy_accountant/tf/accountant.py | 16 | # 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... |
thnee/ansible | refs/heads/devel | lib/ansible/modules/network/aos/_aos_device.py | 348 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['removed'],
'supported_by': 'community'}
from ansible.module... |
Mixser/django | refs/heads/master | django/db/backends/postgresql/base.py | 165 | """
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... |
pepeportela/edx-platform | refs/heads/master | openedx/core/djangoapps/user_api/tests/test_views.py | 1 | """Tests for the user API at the HTTP request level. """
import datetime
import json
from unittest import skipUnless, SkipTest
import ddt
import httpretty
import mock
from django.conf import settings
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse
... |
nadley/Sick-Beard | refs/heads/development | bs4/tests/test_htmlparser.py | 433 | """Tests to ensure that the html.parser tree builder generates good
trees."""
from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest
from bs4.builder import HTMLParserTreeBuilder
class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest):
@property
def default_builder(self):
return ... |
michicoin/michicoin | refs/heads/master | share/qt/make_spinner.py | 4415 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... |
5t111111/markdown-preview.vim | refs/heads/master | markdownpreview_lib/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 ... |
ipfans/tornado-quickstart | refs/heads/master | app/exts/session/session_handler.py | 1 | #!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
from tornado.web import RequestHandler
from .session import SessionMixin
class SessionBaseHandler(RequestHandler, SessionMixin):
"""
This is a tornado web request handler which is base on torndsession.
Generally, user must persi... |
ESOedX/edx-platform | refs/heads/master | openedx/core/djangoapps/util/log_utils.py | 2 | """
Django-based logging utilities
UserIdFilter: A logging.Filter that adds userid to the logging context
"""
from __future__ import absolute_import
from logging import Filter
from crum import get_current_user
class UserIdFilter(Filter):
def filter(self, record):
user = get_current_user()
if us... |
kkdd/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_complex_args.py | 73 |
import unittest
from test import test_support
class ComplexArgsTestCase(unittest.TestCase):
def check(self, func, expected, *args):
self.assertEqual(func(*args), expected)
# These functions are tested below as lambdas too. If you add a function test,
# also add a similar lambda test.
def t... |
40223135/40223135w17 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/warnings.py | 752 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_warnings"]
def... |
briankostar/WebFundamentals | refs/heads/master | tools/shows/generate-shows.py | 46 | # /usr/bin/python
from apiclient.discovery import build
from apiclient.errors import HttpError
import logging
import httplib2
import argparse
import sys
from string import Template
def read_file(file_name):
with open(file_name, "r") as f:
return f.read()
class YouTube():
YOUTUBE_API_SERVICE_NAME = "youtube"
Y... |
guannaifu/omaha | refs/heads/master | installers/build_metainstaller.py | 61 | #!/usr/bin/python2.4
#
# Copyright 2009-2010 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 ... |
dezynetechnologies/odoo | refs/heads/8.0 | addons/payment_adyen/__init__.py | 1574 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
groovecoder/kuma | refs/heads/master | vendor/packages/nose/plugins/base.py | 83 | import os
import textwrap
from optparse import OptionConflictError
from warnings import warn
from nose.util import tolist
class Plugin(object):
"""Base class for nose plugins. It's recommended but not *necessary* to
subclass this class to create a plugin, but all plugins *must* implement
`options(self, par... |
CaesarTjalbo/musictagger | refs/heads/master | mp3names/rules_module.py | 2 | # -*- coding: utf-8 -*-
import sys
import os
import logging
import random
import re
import imp
import inspect
IMPORTED_MODULE = 'rules1'
import rules1 as rules
class Rules(object):
def __init__(self):
'''
'''
self.log = logging.getLogger('Rules')
#self.log.debug('__init__ start'... |
wdv4758h/ZipPy | refs/heads/master | edu.uci.python.benchmark/src/benchmarks/sympy/sympy/physics/tests/test_pring.py | 17 | from sympy.physics.pring import wavefunction, energy
from sympy import Symbol, pi, integrate, sqrt, exp, simplify, I
from sympy.abc import m, x, r
from sympy.physics.quantum.constants import hbar
def test_wavefunction():
Psi = {
0: (1/sqrt(2 * pi)),
1: (1/sqrt(2 * pi)) * exp(I * x),
2: (1/... |
zdary/intellij-community | refs/heads/master | python/testData/override/returnValue_after.py | 83 | class A:
def doStuff(self, foo=True): return True
class B(A):
def doStuff(self, foo=True):
<selection>return A.doStuff(self, foo)</selection>
def otherMethod(self, foo, bar):
print foo, bar
|
gaurav38/QosRouting | refs/heads/master | tests/unit/lib/addresses_test.py | 40 | # Copyright 2012 Colin Scott
# Copyright 2012,2013 James McCauley
#
# 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 ap... |
zchking/odoo | refs/heads/8.0 | addons/account_bank_statement_extensions/res_partner_bank.py | 381 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... |
jtopjian/st2 | refs/heads/master | st2reactor/tests/unit/test_rule_engine.py | 2 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... |
mcbor/adventofcode | refs/heads/master | 2016/day14/day14.py | 1 | #!/usr/bin/env python3
# Advent of Code 2016 - Day 14, Part One
# salt: ngcjuoqr
# part one: 18626
# part two: 20092
import sys
from hashlib import md5
from itertools import islice, chain
from collections import defaultdict
def window(seq, n=2):
"Returns a sliding window (of width n) over data from the iterable"... |
ritashugisha/OmniTube | refs/heads/master | selenium/common/__init__.py | 55 | # Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 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 requ... |
hall-lab/lumpy-merge | refs/heads/master | l_bp.py | 4 | import sys
from sets import Set
import re
def find_all(a_str, sub):
start = 0
while True:
start = a_str.find(sub, start)
if start == -1: return
yield start
start += len(sub) # use start += 1 to find overlapping matches
def parse_vcf(vcf_file_name, vcf_lines, vcf_headers, add_sn... |
QubesOS/qubes-core-admin | refs/heads/master | qubes/ext/audio.py | 3 | #
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2019 Frédéric Pierret <frederic.pierret@qubes-os.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# vers... |
bobcyw/django | refs/heads/master | tests/generic_views/test_forms.py | 453 | from __future__ import unicode_literals
from django import forms
from .models import Author
class AuthorForm(forms.ModelForm):
name = forms.CharField()
slug = forms.SlugField()
class Meta:
model = Author
fields = ['name', 'slug']
class ContactForm(forms.Form):
name = forms.CharFie... |
raphaelmerx/django | refs/heads/master | django/contrib/gis/maps/google/overlays.py | 151 | from __future__ import unicode_literals
from functools import total_ordering
from django.contrib.gis.geos import (
LinearRing, LineString, Point, Polygon, fromstr,
)
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import html_safe
@html_safe
@pyt... |
mensler/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_cluster.py | 39 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... |
dlenski/tapiriik | refs/heads/master | tapiriik/web/views/privacy.py | 9 | from django.shortcuts import render
from tapiriik.services import Service
from tapiriik.settings import WITHDRAWN_SERVICES, SOFT_LAUNCH_SERVICES
from tapiriik.auth import User
def privacy(request):
OPTIN = "<span class=\"optin policy\">Opt-in</span>"
NO = "<span class=\"no policy\">No</span>"
YES = "<span ... |
benslice/ggplot | refs/heads/master | ggplot/themes/__init__.py | 12 | from .theme import theme
from .theme_538 import theme_538
from .theme_bw import theme_bw
from .theme_gray import theme_gray
from .theme_xkcd import theme_xkcd
from .theme_matplotlib import theme_matplotlib
from .theme_seaborn import theme_seaborn
from .element_text import element_text
__all__ = ["theme", "theme_538", ... |
danielharbor/openerp | refs/heads/master | addons/payment_buckaroo/controllers/__init__.py | 4497 | # -*- coding: utf-8 -*-
import main
|
sve-odoo/odoo | refs/heads/master | addons/payment_paypal/tests/test_paypal.py | 378 | # -*- coding: utf-8 -*-
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_paypal.controllers.main import PaypalController
from openerp.tools import mute_logger
from lxml import objectify
import u... |
yeulucay/python_bite_example | refs/heads/master | bite/auth.py | 1 | """
Python Bite Rest Framework 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.
Python Bite Rest Framework is distributed in the hope that it... |
pombredanne/erpnext | refs/heads/develop | erpnext/patches/v4_2/reset_bom_costs.py | 120 | # 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
def execute():
frappe.reload_doc('manufacturing', 'doctype', 'bom_operation')
for d in frappe.db.sql("""select name from `tabBOM` where... |
b4oshany/Memory-Game | refs/heads/master | server/lib/werkzeug/contrib/iterio.py | 318 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.iterio
~~~~~~~~~~~~~~~~~~~~~~~
This module implements a :class:`IterIO` that converts an iterator into
a stream object and the other way round. Converting streams into
iterators requires the `greenlet`_ module.
To convert an iterator into a stream... |
don-github/edx-platform | refs/heads/master | common/test/acceptance/tests/studio/test_studio_settings_details.py | 19 | """
Acceptance tests for Studio's Settings Details pages
"""
from unittest import skip
from .base_studio_test import StudioCourseTest
from ...fixtures.course import CourseFixture
from ...pages.studio.settings import SettingsPage
from ...pages.studio.overview import CourseOutlinePage
from ...tests.studio.base_studio_te... |
sam-m888/gprime | refs/heads/master | gprime/plug/menu/_option.py | 1 | #
# gPrime - A web-based genealogy program
#
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Gary Burton
#
# 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 ... |
Nu3001/external_chromium_org | refs/heads/master | tools/android/memdump/memreport.py | 23 | #!/usr/bin/env python
#
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import sys
from sets import Set
_ENTRIES = [
('Total', '.* r... .*'),
('Read-only', '.* r--. .*'),
('Rea... |
flyingfish007/tempest | refs/heads/master | tempest/api/volume/admin/test_volume_types_negative.py | 28 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
gudcjfdldu/volatility | refs/heads/master | volatility/plugins/vboxinfo.py | 45 | # Volatility
# Copyright (C) 2009-2012 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... |
hynekcer/django | refs/heads/master | django/core/serializers/python.py | 153 | """
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from django.apps import apps
from django.conf impor... |
martinbuc/missionplanner | refs/heads/master | Lib/mailcap.py | 65 | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corre... |
eacg91/WhosApp | refs/heads/master | src/Yowsup/Registration/v1/existsrequest.py | 19 | '''
Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com>
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, modify,
m... |
fenginx/django | refs/heads/master | django/db/backends/sqlite3/features.py | 15 | from django.db.backends.base.features import BaseDatabaseFeatures
from .base import Database
class DatabaseFeatures(BaseDatabaseFeatures):
# SQLite can read from a cursor since SQLite 3.6.5, subject to the caveat
# that statements within a connection aren't isolated from each other. See
# https://sqlite.... |
morissette/devopsdays-hackathon-2016 | refs/heads/master | venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py | 147 | from __future__ import absolute_import
import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
try: # Python 3
from queue import LifoQueue, Empty, Full
except ImportError:
from Queue import LifoQueue, Empty, Full
# Queue is im... |
wwitzel3/awx | refs/heads/devel | awx/main/notifications/hipchat_backend.py | 2 | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import logging
import requests
from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from awx.main.notifications.base import AWXBaseEmailBackend
logger = logging.getLogger('awx.main.notifications.hipchat_backend... |
Interoute/API-fun-and-education | refs/heads/master | vdc_api_signer.py | 1 | #! /usr/bin/env python
# Python program to generate a VDC API authentication signature and runnable URL, and optionally execute the call
#
# For download and information: https://github.com/Interoute/API-fun-and-education
# This program is configured for Python version 2.6/2.7
#
# Copyright (C) Interoute Communicati... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/dates/tests.py | 37 | import datetime
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, override_settings
from .models import Article, Category, Comment
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Articl... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/260_test_dbm.py | 2 | from test import test_support
import unittest
import os
import random
import dbm
from dbm import error
class DbmTestCase(unittest.TestCase):
def setUp(self):
self.filename = test_support.TESTFN
self.d = dbm.open(self.filename, 'c')
self.d.close()
def tearDown(self):
for suffix... |
GoogleCloudPlatform/training-data-analyst | refs/heads/master | courses/machine_learning/deepdive2/structured/labs/serving/application/lib/pyasn1/codec/cer/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
rismalrv/edx-platform | refs/heads/master | lms/envs/dev.py | 50 | """
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We intentionally define lot... |
jgoclawski/django | refs/heads/master | tests/template_tests/filter_tests/test_chaining.py | 345 | from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class ChainingTests(SimpleTestCase):
"""
Chaining safeness-preserving filters should not alter the safe status.
"""
@setup({'chaining01': '{{ a|capfirst|center:"7" }}.{{ b|capfirst|center:"... |
tedye/leetcode | refs/heads/master | tools/leetcode.094.Binary Tree Inorder Traversal/leetcode.094.Binary Tree Inorder Traversal.submission3.py | 1 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param {TreeNode} root
# @return {integer[]}
def inorderTraversal(self, root):
if not root: return []
... |
cfelton/rhea | refs/heads/master | rhea/cores/uart/uartbase.py | 2 |
from __future__ import print_function, division
from fractions import gcd
import myhdl
from myhdl import Signal, intbv, modbv, enum, always_seq, always
@myhdl.block
def uartbaud(glbl, baudce, baudce16, baudrate=115200):
""" Generate the UART baudrate strobe
Three separate strobes are create: baudce, baudce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.