repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
sudheesh001/oh-mainline | vendor/packages/unicodecsv/unicodecsv/test.py | 16 | 31759 | # -*- coding: UTF8 -*-
# Copyright (C) 2001,2002 Python Software Foundation
# csv package unit tests
import os
import unittest2 as unittest
from StringIO import StringIO
import tempfile
import unicodecsv as csv
class Test_Csv(unittest.TestCase):
"""
Test the underlying C csv parser in ways that are not approp... | agpl-3.0 |
perey/PySpiro | tests/test__cp.py | 1 | 5682 | #!/usr/bin/env python3
"""Unit tests for the PySpiro _cp module."""
# Copyright © 2015, 2016 Timothy Pederick.
# Based on libspiro:
# Copyright © 2007 Raph Levien
#
# This file is part of PySpiro.
#
# PySpiro is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public Li... | gpl-3.0 |
QuantiModo/QuantiModo-SDK-Python | swagger_client/models/variables_new.py | 1 | 2194 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | gpl-2.0 |
jonparrott/nox | docs/conf.py | 1 | 10231 | # -*- coding: utf-8 -*-
#
# nox documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 00:05:25 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | apache-2.0 |
0x90sled/catapult | third_party/mapreduce/mapreduce/api/map_job/mapper.py | 31 | 1923 | #!/usr/bin/env python
"""Interface for user defined mapper."""
from mapreduce import shard_life_cycle
# pylint: disable=protected-access
# pylint: disable=invalid-name
# TODO(user): Move common APIs to parent class.
class Mapper(shard_life_cycle._ShardLifeCycle):
"""Interface user's mapper should implement.
Ea... | bsd-3-clause |
ericfc/django | tests/humanize_tests/tests.py | 336 | 13163 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
from unittest import skipIf
from django.contrib.humanize.templatetags import humanize
from django.template import Context, Template, defaultfilters
from django.test import TestCase, modify_settings, override_settings
from django.utils... | bsd-3-clause |
davidam/python-examples | basics/lists.py | 1 | 1855 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | gpl-3.0 |
sdelements/django-multi-import | multi_import/fields.py | 1 | 2395 | from django.core.exceptions import (
FieldError,
MultipleObjectsReturned,
ObjectDoesNotExist,
ValidationError,
)
from django.utils.translation import ugettext_lazy as _
from rest_framework import relations
class LookupRelatedField(relations.RelatedField):
default_error_messages = {
"requir... | mit |
anish/phatch | phatch/actions/desaturate.py | 4 | 11665 | # Phatch - Photo Batch Processor
# Copyright (C) 2007-2008 www.stani.be
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | gpl-3.0 |
hemor/tursh | config/base_settings.py | 1 | 2916 | """
Django settings for TURSH project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | mit |
BrightSun95/cartograms4all | app/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | 4945 | # Copyright (c) 2011 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | mit |
SwissTPH/odk_planner | test/test_overview.py | 1 | 2777 |
import unittest, time, os.path, csv
from config import config
from odk_planner import PlannerDriver
from instance import driver, passwords
class TestOverview(unittest.TestCase):
@classmethod
def setUpClass(cls):
driver.logout()
driver.login('admin', passwords['admin'])
driver.overvie... | gpl-2.0 |
marshall007/rethinkdb | drivers/python/rethinkdb/_negative_zero_check.py | 14 | 7179 | #!/usr/bin/env python
from __future__ import print_function
import json, math, numbers, os, socket, time
import rethinkdb as r
from optparse import OptionParser
from ._backup import *
info = "'_negative_zero_check` finds and lists inaccessible rows with negative zero in their ID"
usage = " _negative_zero_check [-c H... | agpl-3.0 |
thjashin/tensorflow | tensorflow/python/ops/spectral_grad.py | 102 | 6990 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GLX/ARB/multisample.py | 8 | 2262 | '''OpenGL extension ARB.multisample
This module customises the behaviour of the
OpenGL.raw.GLX.ARB.multisample to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a mechanism to antialias all GL primitives:
points, lines, polygons, bitmaps, and images. The technique is to
sa... | gpl-3.0 |
MiltosD/CEF-ELRC | lib/python2.7/site-packages/haystack/templatetags/highlight.py | 28 | 4292 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django import template
try:
from django.utils import importlib
except ImportError:
from haystack.utils import importlib
register = template.Library()
class HighlightNode(template.Node):
def __init__(self, text_... | bsd-3-clause |
zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/UserString.py | 91 | 8186 | #!/usr/bin/env python
## vim:ts=4:et:nowrap
"""A user-defined wrapper around string objects
Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.
"""
import sys
__all__ = ["UserString","MutableString"]
class UserString:
def __init__(self, seq):
if isinstance(seq,... | epl-1.0 |
mattcaldwell/django-cms | cms/plugins/twitter/migrations/0002_auto__add_twittersearch.py | 8 | 3563 | # -*- 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):
"Write your backwards migration here"
def backwards(self, orm):
"Write your backwards migration her... | bsd-3-clause |
alfredodeza/pytest | testing/python/collect.py | 2 | 43069 | import os
import sys
import textwrap
import _pytest._code
import pytest
from _pytest.config import ExitCode
from _pytest.nodes import Collector
class TestModule:
def test_failing_import(self, testdir):
modcol = testdir.getmodulecol("import alksdjalskdjalkjals")
pytest.raises(Collector.CollectErro... | mit |
pelya/commandergenius | project/jni/python/src/Lib/email/errors.py | 468 | 1628 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""email package exception classes."""
class MessageError(Exception):
"""Base class for errors in the email package."""
class MessageParseError(MessageError):
"""Base class for message parsing erro... | lgpl-2.1 |
aronparsons/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/test/testConfig.py | 19 | 6911 | #!/usr/bin/python
import settestpath
# lots of useful util methods for building/tearing down
# test enviroments...
import testutils
from up2date_client import config
import unittest
test_up2date = "etc-sysconfig-rhn/up2date"
class TestConfig(unittest.TestCase):
def setUp(self):
# in this stuff, we get... | gpl-2.0 |
fintech-circle/edx-platform | lms/envs/static.py | 37 | 2465 | """
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... | agpl-3.0 |
x111ong/odoo | addons/project_issue_sheet/__init__.py | 442 | 1105 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
hubsaysnuaa/ardupilot | Tools/LogAnalyzer/tests/TestVCC.py | 218 | 1278 | from LogAnalyzer import Test,TestResult
import DataflashLog
import collections
class TestVCC(Test):
'''test for VCC within recommendations, or abrupt end to log in flight'''
def __init__(self):
Test.__init__(self)
self.name = "VCC"
def run(self, logdata, verbose):
self.result = ... | gpl-3.0 |
xisisu/RT-Xen | tools/python/xen/xend/xenstore/xswatch.py | 48 | 2418 | # Copyright (C) 2005 Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
# Copyright (C) 2005 XenSource Ltd
# This file is subject to the terms and conditions of the GNU General
# Public License. See the file "COPYING" in the main directory of
# this archive for more details.
import errno
import threading
from xen.xe... | gpl-2.0 |
rhndg/openedx | lms/djangoapps/shoppingcart/tests/test_payment_fake.py | 147 | 4130 | """
Tests for the fake payment page used in acceptance tests.
"""
from django.test import TestCase
from shoppingcart.processors.CyberSource2 import sign, verify_signatures
from shoppingcart.processors.exceptions import CCProcessorSignatureException
from shoppingcart.tests.payment_fake import PaymentFakeView
from colle... | agpl-3.0 |
egyp7/Subterfuge | urls.py | 2 | 1177 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
#Main
url(r'^$', 'main.views.index', name='home'),
url(r'^settings/', 'main.views.settings', name='settings'),
url(r'^network/', 'main.views.networkviews', name='network view'),
url(r'^notifications/', 'main.views.notifi... | gpl-3.0 |
yeahooii/blog-vim-proj | vimfiles/bundle/ultisnips/test/test_Mirror.py | 28 | 8827 | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
# Mirrors {{{#
class TextTabStopTextAfterTab_ExpectCorrectResult(_VimTest):
snippets = ('test', '$1 Hinten\n$1')
keys = 'test' + EX + 'hallo'
wanted = 'hallo Hinten\nhallo'
class TextTabStopTextBeforeTab_ExpectCorrectRe... | gpl-2.0 |
lordmuffin/aws-cfn-plex | functions/credstash/pip/_vendor/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## 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... | mit |
VioletRed/plugin.video.youtube | resources/lib/youtube/helper/url_to_item_converter.py | 26 | 6894 | __author__ = 'bromix'
import re
import urlparse
from resources.lib.kodion.items import VideoItem, DirectoryItem
from . import utils
class UrlToItemConverter(object):
RE_CHANNEL_ID = re.compile(r'^/channel/(?P<channel_id>.+)$')
def __init__(self, flatten=True):
self._flatten = flatten
self._... | gpl-2.0 |
xzturn/tensorflow | tensorflow/lite/testing/op_tests/mirror_pad.py | 2 | 3636 | # Copyright 2019 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... | apache-2.0 |
zaro0508/jenkinsapi | jenkinsapi_tests/unittests/test_executors.py | 8 | 9912 | import mock
import types
# To run unittests on python 2.6 please use unittest2 library
try:
import unittest2 as unittest
except ImportError:
import unittest
from jenkinsapi.custom_exceptions import JenkinsAPIException
from jenkinsapi.jenkins import Jenkins
from jenkinsapi.executors import Executors
from jenkin... | mit |
ravibhure/ansible | test/units/modules/network/onyx/test_onyx_mlag_ipl.py | 50 | 3352 | #
# Copyright: 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
from ansible.compat.tests.mock import patch
from ansible.modules.network.on... | gpl-3.0 |
Bysmyyr/chromium-crosswalk | tools/perf/benchmarks/start_with_ext.py | 9 | 1580 | # Copyright 2015 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.
from core import perf_benchmark
from measurements import startup
import page_sets
from telemetry import benchmark
class _StartWithExt(perf_benchmark.PerfBe... | bsd-3-clause |
zverevalexei/trex-http-proxy | trex_client/external_libs/pyyaml-3.11/python3/yaml/dumper.py | 277 | 2723 |
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']
from .emitter import *
from .serializer import *
from .representer import *
from .resolver import *
class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
def __init__(self, stream,
default_style=None, default_flow_style=None,
... | mit |
commial/miasm | miasm/loader/minidump.py | 5 | 19467 | """Constants and structures associated to Minidump format
Based on: http://amnesia.gtisc.gatech.edu/~moyix/minidump.py
"""
from future.utils import viewitems
from future.builtins import int as int_types
from miasm.loader.new_cstruct import CStruct
class Enumeration(object):
"""Stand for an enumeration type"""
... | gpl-2.0 |
kaarolch/ansible | lib/ansible/utils/module_docs_fragments/auth_basic.py | 39 | 1298 | # 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 ... | gpl-3.0 |
abdoosh00/edx-rtl-final | cms/djangoapps/course_creators/tests/test_admin.py | 4 | 8085 | """
Tests course_creators.admin.py.
"""
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.admin.sites import AdminSite
from django.http import HttpRequest
import mock
from course_creators.admin import CourseCreatorAdmin
from course_creators.models import CourseCreator
fr... | agpl-3.0 |
takeshineshiro/Django-facebook | docs/docs_env/Lib/encodings/iso2022_kr.py | 816 | 1053 | #
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... | bsd-3-clause |
terbolous/SickRage | lib/hachoir_parser/image/bmp.py | 95 | 6682 | """
Microsoft Bitmap picture parser.
- file extension: ".bmp"
Author: Victor Stinner
Creation: 16 december 2005
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt32, Bits,
String, RawBytes, Enum,
PaddingBytes, NullBytes, createPaddingField)
from hachoir_cor... | gpl-3.0 |
klen/python-mode | pymode/libs/logilab-common-1.4.1/logilab/common/debugger.py | 93 | 7094 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | lgpl-3.0 |
duyetdev/islab-portfolio-by-ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/plugin.py | 365 | 1862 | # -*- coding: utf-8 -*-
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments setuptools plugin interface. The methods defined
here also work if setuptools isn't installed but they just
return nothing.
lexer plugins::
[pygments.lexers]
yourlexer = yourmodule:YourLexer
formatter pl... | mit |
jorik041/scikit-learn | sklearn/tests/test_isotonic.py | 230 | 11087 | import numpy as np
import pickle
from sklearn.isotonic import (check_increasing, isotonic_regression,
IsotonicRegression)
from sklearn.utils.testing import (assert_raises, assert_array_equal,
assert_true, assert_false, assert_equal,
... | bsd-3-clause |
mhbu50/erpnext | erpnext/setup/doctype/customer_group/customer_group.py | 3 | 1118 | # 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 frappe import _
from frappe.utils.nestedset import NestedSet, get_root_of
class CustomerGroup(NestedSet):
nsm_parent_field = 'pare... | gpl-3.0 |
luceatnobis/youtube-dl | youtube_dl/extractor/ro220.py | 64 | 1452 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class Ro220IE(InfoExtractor):
IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
_TEST = {
'url': ... | unlicense |
analogdevicesinc/gnuradio | grc/gui/Preferences.py | 3 | 4473 | """
Copyright 2008 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 option) any later ... | gpl-3.0 |
peguin40/zulip | zerver/tests/test_messages.py | 1 | 68614 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.db.models import Q
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils import timezone
from zerver.lib import bugdown
from zerver.decorator import JsonableEr... | apache-2.0 |
aam-at/tensorflow | tensorflow/lite/g3doc/tools/build_py_api_docs.py | 14 | 2029 | # Lint as: python3
# Copyright 2020 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 ... | apache-2.0 |
yaoshengzhe/vitess | examples/demo/cgi-bin/data.py | 1 | 2992 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015, 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.
"""
This module allows you to bring up and tear down keyspaces.
"""
import cgi
import json
import subprocess
import sy... | bsd-3-clause |
byakuinss/spark | examples/src/main/python/streaming/kafka_wordcount.py | 83 | 2089 | #
# 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... | apache-2.0 |
nox/servo | components/script/dom/bindings/codegen/parser/tests/test_method.py | 83 | 7795 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestMethods {
void basic();
static void basicStatic();
void basicWithSimpleArgs(boolean arg1, byte arg2, unsigned long arg3);
boolean basicBoolean();
static boolean basicStaticBoolean... | mpl-2.0 |
rsvip/Django | tests/string_lookup/models.py | 107 | 1469 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def... | bsd-3-clause |
smandy/locke | scons-local-2.3.4/SCons/Tool/packaging/src_zip.py | 9 | 1669 | """SCons.Tool.Packaging.zip
The zip SRC packager.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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
# ... | apache-2.0 |
sodexis/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/actions.py | 382 | 3763 | ##########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | agpl-3.0 |
atlashealth/ansible | v1/ansible/runner/action_plugins/set_fact.py | 133 | 1754 | # Copyright 2013 Dag Wieers <dag@wieers.com>
#
# 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 versio... | gpl-3.0 |
sankhesh/VTK | ThirdParty/Twisted/twisted/conch/ssh/transport.py | 23 | 59707 | # -*- test-case-name: twisted.conch.test.test_transport -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The lowest level SSH protocol. This handles the key negotiation, the
encryption and the compression. The transport layer is described in
RFC 4253.
Maintainer: Paul Swartz
"""
# ba... | bsd-3-clause |
victorbergelin/scikit-learn | sklearn/ensemble/partial_dependence.py | 251 | 15097 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | bsd-3-clause |
ManyBodyPhysics/LectureNotesPhysics | Programs/Chapter10-programs/python/imsrg_pairing/plot_imsrg_flow.py | 2 | 4799 | #!/usr/bin/env python
#------------------------------------------------------------------------------
# plot_imsrg_flow.py
#
# author: H. Hergert
# version: 1.0.1
# date: Jul 6, 2020
#
# tested with Python v2.7 and v3.7
#
#------------------------------------------------------------------------------
from s... | cc0-1.0 |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/pinax/templatetags/templatetags/var_tag.py | 2 | 1234 | from django import template
register = template.Library()
class VarNode(template.Node):
def __init__(self, var_name, var_to_resolve):
self.var_name = var_name
self.var_to_resolve = var_to_resolve
def get_context(self, top_context):
for context in top_context.dicts:
... | mit |
mzha/HackPen | ml/cloudml-samples-master/reddit_tft/path_constants.py | 2 | 1253 | # Copyright 2016 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 ... | apache-2.0 |
blockstack/blockstack-server | integration_tests/blockstack_integration_tests/scenarios/name_pre_reg_up_stacks_altmagic.py | 1 | 4501 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Blockstack
~~~~~
copyright: (c) 2014-2015 by Halfmoon Labs, Inc.
copyright: (c) 2016 by Blockstack.org
This file is part of Blockstack
Blockstack is free software: you can redistribute it and/or modify
it under the terms of the GNU General... | gpl-3.0 |
Rhizomatica/rccn | rccn/extensions/ext_777.py | 2 | 3968 | ############################################################################
#
# Copyright (C) 2013 tele <tele@rhizomatica.org>
#
# Reseller Shortcode
# This file is part of RCCN
#
# RCCN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License as published by
# the ... | agpl-3.0 |
richardtran415/pymatgen | pymatgen/entries/computed_entries.py | 3 | 36654 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements equivalents of the basic ComputedEntry objects, which
is the basic entity that can be used to perform many analyses. ComputedEntries
contain calculated information, typically from VAS... | mit |
mdietrichc2c/OCB | addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
tjsavage/djangononrel-starter | django/templatetags/cache.py | 309 | 2406 | from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist
from django.template import resolve_variable
from django.core.cache import cache
from django.utils.encoding import force_unicode
from django.utils.http import urlquote
from django.utils.hashcompat import md5_constructor
regi... | bsd-3-clause |
2014c2g3/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/_weakrefset.py | 766 | 5570 | # Access WeakSet through the weakref module.
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.
from _weakref import ref
__all__ = ['WeakSet']
class _IterationGuard:
# This context manager registers itself in the current iterators of the
# weak container, such ... | gpl-3.0 |
timlinux/geonode | geonode/upload/upload_preprocessing.py | 7 | 3926 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2018 OSGeo
#
# 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 ... | gpl-3.0 |
SUSE/azure-sdk-for-python | azure-mgmt-network/azure_bdist_wheel.py | 241 | 21096 | """
"wheel" copyright (c) 2012-2017 Daniel Holth <dholth@fastmail.fm> and
contributors.
The MIT License
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 limi... | mit |
2014cdag10/2014cdag10 | wsgi/programs/cdag5/man2.py | 9 | 13287 |
import cherrypy
# 這是 MAN 類別的定義
'''
# 在 application 中導入子模組
import programs.cdag5.man as cdag5_man
# 加入 cdag5 模組下的 man.py 且以子模組 man 對應其 MAN() 類別
root.cdag5.man = cdag5_man.MAN()
# 完成設定後, 可以利用
/cdag5/man/assembly
# 呼叫 man.py 中 MAN 類別的 assembly 方法
'''
class MAN(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
... | gpl-2.0 |
jamespcole/home-assistant | homeassistant/components/recorder/models.py | 10 | 6917 | """Models for SQLAlchemy."""
import json
from datetime import datetime
import logging
from sqlalchemy import (
Boolean, Column, DateTime, ForeignKey, Index, Integer, String, Text,
distinct)
from sqlalchemy.ext.declarative import declarative_base
import homeassistant.util.dt as dt_util
from homeassistant.core ... | apache-2.0 |
jyotsna1820/django | django/conf/locale/el/formats.py | 120 | 1477 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd/m/Y'
TIME_FORMAT = 'P'
DATETIME... | bsd-3-clause |
glwu/python-for-android | python-modules/twisted/twisted/python/runtime.py | 56 | 2925 | # -*- test-case-name: twisted.python.test.test_runtime -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
# System imports
import os
import sys
import time
import imp
def shortPythonVersion():
hv = sys.hexversion
major = (hv & 0xff000000L) >> 24
minor = (hv & 0x00ff000... | apache-2.0 |
meteorcloudy/tensorflow | tensorflow/python/profiler/internal/model_analyzer_testlib.py | 46 | 4078 | # 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... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/django/contrib/gis/gdal/field.py | 112 | 6735 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as capi
from django.utils.encoding import force_text
# For more information, see the OG... | apache-2.0 |
crafty78/ansible | lib/ansible/modules/cloud/cloudstack/cs_securitygroup_rule.py | 12 | 14238 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, 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... | gpl-3.0 |
coinbox/coinbox-mod-sales | cbmod/sales/views/dialogs/payDialog.py | 1 | 10323 | from pydispatch import dispatcher
from PySide import QtGui, QtCore
import cbpos
import sys
logger = cbpos.get_logger(__name__)
class PayDialog(QtGui.QDialog):
def __init__(self, manager):
super(PayDialog, self).__init__()
self.manager = manager
assert self.manage... | mit |
jabez1314/youtube-dl | youtube_dl/extractor/atttechchannel.py | 155 | 1961 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unified_strdate
class ATTTechChannelIE(InfoExtractor):
_VALID_URL = r'https?://techchannel\.att\.com/play-video\.cfm/([^/]+/)*(?P<id>.+)'
_TEST = {
'url': 'http://techchannel.att.com/play-video.cfm/2014/1/27... | unlicense |
chicagohawk/infer_ns_eqn | test/navierstokes_debug_2.py | 1 | 24392 | import time
import sys
from pylab import *
sys.path.append('../..')
from numpad import *
from pdb import set_trace
from scipy.optimize import minimize
import re, string, os
def degrade(_adarray_):
if isinstance(_adarray_, adarray):
return _adarray_._value
return _adarray_
def upgrade(_ndarray_):
... | gpl-3.0 |
wezhang/vim-setup | bundle/python-mode/pymode/libs3/rope/base/stdmods.py | 32 | 1296 | import os
import sys
from rope.base import utils
def _stdlib_path():
import inspect
return os.path.dirname(inspect.getsourcefile(inspect))
@utils.cached(1)
def standard_modules():
return python_modules() | dynload_modules()
@utils.cached(1)
def python_modules():
result = set()
lib_path = _stdli... | apache-2.0 |
denisff/python-for-android | python-modules/twisted/twisted/enterprise/reflector.py | 61 | 5955 | # -*- test-case-name: twisted.test.test_reflector -*-
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
import weakref, warnings
from twisted.enterprise.util import DBError
class Reflector:
"""
DEPRECATED.
Base class for enterprise reflectors. This implements row caching... | apache-2.0 |
tux-00/ansible | lib/ansible/plugins/terminal/ce.py | 122 | 1841 | #
# (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... | gpl-3.0 |
jriegel/FreeCAD | src/Mod/Start/StartPage/LoadMRU1.py | 32 | 1836 | #***************************************************************************
#* *
#* Copyright (c) 2012 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 |
b-me/django | django/contrib/gis/gdal/prototypes/errcheck.py | 586 | 4229 | """
This module houses the error-checking routines used by the GDAL
ctypes prototypes.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.gdal.error import (
GDALException, SRSException, check_err,
)
from django.contrib.gis.gdal.libgdal import lgdal
from django.utils import six
# Helper routine... | bsd-3-clause |
shaunstanislaus/zulip | api/integrations/perforce/git_p4.py | 114 | 121246 | #!/usr/bin/env python
#
# git-p4.py -- A tool for bidirectional operation between a Perforce depot and git.
#
# Author: Simon Hausmann <simon@lst.de>
# Copyright: 2007 Simon Hausmann <simon@lst.de>
# 2007 Trolltech ASA
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
#
import sys
if sys.he... | apache-2.0 |
mtanski/samba | lib/subunit/runtests.py | 35 | 4231 | #!/usr/bin/env python
# -*- Mode: python -*-
#
# Copyright (C) 2004 Canonical.com
# Author: Robert Collins <robert.collins@canonical.com>
#
# 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 Foundat... | gpl-3.0 |
DayGitH/Python-Challenges | DailyProgrammer/DP20151007B.py | 1 | 3313 | """
[2015-10-07] Challenge #235 [Intermediate] Scoring a Bowling Game
https://www.reddit.com/r/dailyprogrammer/comments/3ntsni/20151007_challenge_235_intermediate_scoring_a/
# Description
The game of bowling is pretty simple: you have ten pins arranged in a triangle, and you roll a ball down a slick alley
towards the... | mit |
timami/PlaneSense | GoPositionalAudio/jsimplementation/node_modules/speaker/deps/mpg123/scripts/tag_lyrics.py | 43 | 2047 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# needs mutagen
# grabbed from: http://code.activestate.com/recipes/577138-embed-lyrics-into-mp3-files-using-mutagen-uslt-tag/
# simplified to only work on one file and get lyrics from stdin
# I suspect this is public domain code. Just a usage example of the mutagen lib.
... | bsd-3-clause |
pacificIT/linux_kernel | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
ahmed-mahran/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/validate.py | 32 | 12381 | import calendar
import urlparse
import re
import time_util
import struct
import base64
# Also defined in saml2.saml but can't import from there
XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'
XSI_NIL = '{%s}nil' % XSI_NAMESPACE
# ---------------------------------------------------------
class NotValid(Ex... | apache-2.0 |
TOCyna/tabelinha | flask/lib/python2.7/site-packages/babel/support.py | 137 | 21812 | # -*- coding: utf-8 -*-
"""
babel.support
~~~~~~~~~~~~~
Several classes and functions that help with integrating and using Babel
in applications.
.. note: the code in this module is not used by Babel itself
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more detail... | gpl-2.0 |
johnkit/vtk-dev | ThirdParty/Twisted/twisted/test/testutils.py | 56 | 5318 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I{Private} test utilities for use throughout Twisted's test suite. Unlike
C{proto_helpers}, this is no exception to the
don't-use-it-outside-Twisted-we-won't-maintain-compatibility rule!
@note: Maintainers be aware: things in this module sho... | bsd-3-clause |
deepmind/sonnet | sonnet/src/conformance/distribute_test.py | 1 | 3519 | # Copyright 2019 The Sonnet 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 applicable l... | apache-2.0 |
ucb-sejits/opentuner | examples/petabricks/import_old_result.py | 5 | 3257 | #!/usr/bin/env python
import adddeps # fix sys.path
import argparse
import json
import logging
import os
import re
import sys
import uuid
import subprocess
try:
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
import opentuner
from opentuner import resultsdb
from datetime import... | mit |
andreimacavei/coala | coalib/tests/parsing/StringProcessingTests/SearchForTest.py | 2 | 4165 | import sys
import unittest
sys.path.insert(0, ".")
from coalib.tests.parsing.StringProcessingTest import StringProcessingTest
from coalib.parsing.StringProcessing import search_for
class SearchForTest(StringProcessingTest):
# Match either "out1" or "out2".
test_basic_pattern = "out1|out2"
# These are the... | agpl-3.0 |
jrydberg/moto | tests/test_sns/test_publishing.py | 4 | 3034 | from __future__ import unicode_literals
from six.moves.urllib.parse import parse_qs
import boto
from freezegun import freeze_time
import httpretty
import sure # noqa
from moto import mock_sns, mock_sqs
@mock_sqs
@mock_sns
def test_publish_to_sqs():
conn = boto.connect_sns()
conn.create_topic("some-topic")
... | apache-2.0 |
renyi533/tensorflow | tensorflow/compiler/tests/slice_ops_test.py | 23 | 9455 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Bastian-Kass/android-quill | jni/libhpdf-2.3.0RC2/if/python/demo/png_demo.py | 32 | 4634 | ###
## * << Haru Free PDF Library 2.0.0 >> -- png_demo.c
## *
## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
## *
## * Permission to use, copy, modify, distribute and sell this software
## * and its documentation for any purpose is hereby granted without fee,
## * provided that the ab... | gpl-3.0 |
tmenjo/cinder-2015.1.0 | cinder/tests/test_dellsc.py | 2 | 49530 | # Copyright (c) 2014 Dell 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 a... | apache-2.0 |
julianprabhakar/eden_car | modules/s3cfg.py | 2 | 116673 | # -*- coding: utf-8 -*-
""" Deployment Settings
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: 2009-2014 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (t... | mit |
thaumos/ansible | lib/ansible/modules/windows/win_owner.py | 38 | 1169 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# 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': ['preview'],
'supported... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.