repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
brabadu/Data-Structure-Zoo | refs/heads/master | 5-Stack and its applications/stack.py | 3 | """ Stack
thomas moll 2015
"""
class Stack(object):
def __init__(self):
self.size = 0
self.top = None
def __len__(self):
return self.size
def push(self, item):
if self.top is None:
self.top = StackNode(item)
else:
#sel... |
TeamExodus/external_skia | refs/heads/EXODUS-6.0 | PRESUBMIT.py | 22 | # 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.
"""Top-level presubmit script for Skia.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... |
fjxhkj/PTVS | refs/heads/master | Python/Product/Pyvot/Pyvot/xl/sheet.py | 18 | # Copyright (c) Microsoft Corporation.
#
# 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.txt file at the root of this distribution. If
# you cannot locate the Apache License, Version 2.0, please send an email to
# vsp... |
alshedivat/tensorflow | refs/heads/master | tensorflow/python/autograph/converters/decorators_test.py | 9 | # 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... |
ndchorley/scipy | refs/heads/master | scipy/sparse/linalg/isolve/tests/test_utils.py | 131 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_raises
from scipy.sparse.linalg import utils
def test_make_system_bad_shape():
assert_raises(ValueError, utils.make_system, np.zeros((5,3)), None, np.zeros(4), np.zeros(4))
|
anant-dev/django | refs/heads/master | tests/template_backends/test_django.py | 53 | from template_tests.test_response import test_processor_name
from django.template.backends.django import DjangoTemplates
from django.template.library import InvalidTemplateLibrary
from django.test import RequestFactory, override_settings
from .test_dummy import TemplateStringsTests
class DjangoTemplatesTests(Templa... |
blighli/SublimeHighlight | refs/heads/master | pygments/lexers/web.py | 197 | # -*- coding: utf-8 -*-
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Lexers for web-related languages and markup.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import copy
from pygments.lexer import RegexLexer, ExtendedReg... |
mark-ignacio/py-fakename | refs/heads/master | fakename/wrapper.py | 1 | from datetime import datetime
import requests
# noinspection PyUnresolvedReferences
from fakename.six.moves.html_parser import HTMLParser
# noinspection PyUnresolvedReferences
from fakename.six.moves.urllib.parse import urljoin
from fakename.six import PY3, PY2
from fakename import __version__
DOMAIN = 'https://fa... |
efiring/scipy | refs/heads/master | scipy/special/orthogonal.py | 5 | """
A collection of functions to find the weights and abscissas for
Gaussian Quadrature.
These calculations are done by finding the eigenvalues of a
tridiagonal matrix whose entries are dependent on the coefficients
in the recursion formula for the orthogonal polynomials with the
corresponding weighting function over ... |
wbond/oscrypto | refs/heads/master | dev/build.py | 7 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import imp
import os
import tarfile
import zipfile
import setuptools.sandbox
from . import package_root, package_name, has_tests_package
def _list_zip(filename):
"""
Prints all of the files in a .zip file
... |
19po/rtl102.5-playlist | refs/heads/master | Main.py | 1 | #!/usr/bin/env python
from PyQt4 import QtGui
from MainUI import MainUI
import sys
__author__ = 'postrowski'
# -*-coding: utf-8-*-
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
ui = MainUI()
ui.show()
app.exec_()
sys.exit()
|
Jeongseob/xen-coboost-sched | refs/heads/master | tools/python/logging/logging-0.4.9.2/test/logconf.py | 42 | #!/usr/bin/env python
#
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... |
yize/grunt-tps | refs/heads/master | tasks/lib/python/Lib/python2.7/encodings/cp500.py | 593 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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... |
openmv/micropython | refs/heads/master | tests/wipy/time.py | 14 | import time
DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def is_leap(year):
return (year % 4) == 0
def test():
seconds = 0
wday = 5 # Jan 1, 2000 was a Saturday
for year in range(2000, 2049):
print("Testing %d" % year)
yday = 1
for month in range(1, ... |
40223210/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/decimal.py | 623 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... |
kenglishhi/gae-django-sandbox | refs/heads/master | django/core/cache/backends/locmem.py | 19 | "Thread-safe in-memory cache backend."
import time
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.cache.backends.base import BaseCache
from django.utils.synch import RWLock
class CacheClass(BaseCache):
def __init__(self, _, params):
BaseCache.__init__(self, param... |
ernestj/pitft | refs/heads/pitft | tools/perf/scripts/python/sctop.py | 11180 | # 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,... |
sgerhart/ansible | refs/heads/maintenance_policy_module | lib/ansible/modules/packaging/os/swdepot.py | 64 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Raul Melo
# Written by Raul Melo <raulmelo@gmail.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, ... |
kevinmarks/mentiontech | refs/heads/master | requests/packages/urllib3/packages/ordered_dict.py | 2039 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... |
yhoshino11/pytest_example | refs/heads/master | .tox/py27/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3132 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
dkubiak789/odoo | refs/heads/8.0 | addons/mrp_byproduct/mrp_byproduct.py | 108 | # -*- 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... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/lib/Lib/site-packages/django/test/utils.py | 185 | import sys
import time
import os
import warnings
from django.conf import settings
from django.core import mail
from django.core.mail.backends import locmem
from django.test import signals
from django.template import Template
from django.utils.translation import deactivate
__all__ = ('Approximate', 'ContextList', 'setu... |
50wu/gpdb | refs/heads/master | gpMgmt/bin/gppylib/test/unit/test_unit_gplog.py | 7 | #!/usr/bin/env python3
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
import logging
import gplog
from test.unit.gp_unittest import GpTestCase, run_tests
class GplogTestCase(GpTestCase):
def test_basics(self):
logger = gplog.get_default_logger()
self.assertTrue(logger is not None)
... |
Team-T2-NMR/NMR-T2 | refs/heads/master | features_rdkit.py | 1 | from __future__ import print_function
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors
def example_mol():
mol = Chem.MolFromSmiles('CCC(=O)C(O)=O')
return mol
def hydrogen_from_carbon(mol, atom):
"""Return a proton bonded to atom"""
foundH = None
hCount = 0
... |
hkchenhongyi/django | refs/heads/master | django/db/models/expressions.py | 33 | import copy
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends import utils as backend_utils
from django.db.models import fields
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import Q, refs_aggregate
from django.u... |
claneys/shinken | refs/heads/master | shinken/objects/service.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... |
40123151ChengYu/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py | 858 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... |
sgerhart/ansible | refs/heads/maintenance_policy_module | test/units/plugins/filter/test_network.py | 41 | # 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 ... |
bravominski/PennApps2015-HeartMates | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/api.py | 361 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
Retur... |
greg-hellings/FrameworkBenchmarks | refs/heads/master | toolset/setup/linux/setup_util.py | 40 | import re
import os
import sys
import subprocess
import platform
from threading import Thread
from Queue import Queue, Empty
class NonBlockingStreamReader:
'''
Enables calling readline in a non-blocking manner with a blocking stream,
such as the ones returned from subprocess.Popen
Originally written by Eyal... |
alisaifee/AutobahnPython | refs/heads/master | examples/twisted/wamp1/rpc/symmetric/client.py | 17 | ###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... |
js0701/chromium-crosswalk | refs/heads/master | tools/telemetry/third_party/altgraph/altgraph_tests/test_graphstat.py | 25 | import unittest
from altgraph import GraphStat
from altgraph import Graph
import sys
class TestDegreesDist (unittest.TestCase):
def test_simple(self):
a = Graph.Graph()
self.assertEqual(GraphStat.degree_dist(a), [])
a.add_node(1)
a.add_node(2)
a.add_node(3)
self.... |
palerdot/calibre | refs/heads/master | src/calibre/gui2/actions/delete.py | 4 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
from functools import partial
from collections import Counter
from PyQt4.Qt import QObject, QTimer, QModelInd... |
dennybaa/st2 | refs/heads/master | st2common/tests/unit/test_datastore.py | 1 | # 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... |
spektom/incubator-airflow | refs/heads/master | airflow/sensors/__init__.py | 15 | #
# 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... |
luceatnobis/youtube-dl | refs/heads/master | youtube_dl/extractor/la7.py | 53 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
js_to_json,
smuggle_url,
)
class LA7IE(InfoExtractor):
IE_NAME = 'la7.it'
_VALID_URL = r'''(?x)(https?://)?(?:
(?:www\.)?la7\.it/([^/]+)/(?:rivedila7|video)/|
tg\.la7\.it/re... |
YihaoLu/statsmodels | refs/heads/master | statsmodels/sandbox/regression/tools.py | 33 | '''gradient/Jacobian of normal and t loglikelihood
use chain rule
normal derivative wrt mu, sigma and beta
new version: loc-scale distributions, derivative wrt loc, scale
also includes "standardized" t distribution (for use in GARCH)
TODO:
* use sympy for derivative of loglike wrt shape parameters
it works for d... |
chris-chris/tensorflow | refs/heads/master | tensorflow/contrib/tensor_forest/python/constants.py | 81 | # 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... |
sestrella/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_netapp_e_volume.py | 21 | # coding=utf-8
# (c) 2018, NetApp 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
try:
from unittest import mock
except ImportError:
import mock
from ansible.module_utils.net... |
civicresourcegroup/django-filer | refs/heads/develop | filer/migrations/0009_auto__add_field_folderpermission_can_edit_new__add_field_folderpermiss.py | 49 | # -*- 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 field 'FolderPermission.can_edit_new'
db.add_column('filer_folderpermission', 'can_edit_new',
... |
openstack/nova | refs/heads/master | nova/tests/unit/virt/zvm/test_driver.py | 3 | # Copyright 2017,2018 IBM Corp.
#
# 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 agr... |
aeroaks/httpProfiler | refs/heads/master | methods/tinycss2/tokenizer.py | 1 | from __future__ import unicode_literals
import re
import sys
from ..webencodings import ascii_lower
from .ast import (
AtKeywordToken, Comment, CurlyBracketsBlock, DimensionToken, FunctionBlock,
HashToken, IdentToken, LiteralToken, NumberToken, ParenthesesBlock,
ParseError, PercentageToken, SquareBracket... |
yangpeiyong/Sigil | refs/heads/master | src/Resource_Files/python_pkg/windows_python_gather.py | 3 | #!/usr/bin/env python3
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import sys, os, inspect, shutil, platform, textwrap, py_compile, site
from python_paths import py_ver, py_lib, sys_dlls, py_exe, py_inc... |
kikobr/projetoextintor | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_mapping.py | 94 | # -*- coding: utf-8 -*-
"""
pygments.lexers._mapping
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer mapping defintions. This file is generated by itself. Everytime
you change something on a builtin lexer defintion, run this script from
the lexers folder to update it.
Do not alter the LEXERS dictionary by hand... |
bear/ronkyuu | refs/heads/dependabot/pip/urllib3-1.26.5 | tests/test_tools.py | 1 | # -*- coding: utf-8 -*-
"""
:copyright: (c) 2013-2020 by Mike Taylor and Kartik Prabhu
:license: MIT, see LICENSE for more details.
"""
import unittest
from ronkyuu.tools import parse_link_header
class TestParseLinkRels(unittest.TestCase):
def runTest(self):
headers = [
'</test/1/webmention>... |
elitegreg/mudpy | refs/heads/master | mudpy/room.py | 1 | from .object import Object
from mudpy.database import ObjectCache
from mudpy.gameproperty import add_gameproperty
import yaml
class Room(Object, yaml.YAMLObject):
__slots__ = tuple()
yaml_loader = yaml.SafeLoader
yaml_tag = '!Room'
def __setstate__(self, newstate):
super().__setstate__(new... |
StackPointCloud/ansible-modules-extras | refs/heads/devel | windows/win_updates.py | 64 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Davis <mdavis_ansible@rolpdog.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 t... |
jsgf/xen | refs/heads/master | tools/python/logging/logging-0.4.9.2/test/log_test3.py | 42 | #!/usr/bin/env python
#
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... |
kapouer/mapnik | refs/heads/master | tests/python_tests/filter_test.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from utilities import run_all
import mapnik
if hasattr(mapnik,'Expression'):
mapnik.Filter = mapnik.Expression
map_ = '''<Map>
<Style name="s">
<Rule>
<Filter><![CDATA[(([region]>=0) and ([region]<=50))]]></Filter>
... |
timabbott/zulip | refs/heads/master | zerver/migrations/0110_stream_is_in_zephyr_realm.py | 4 | # Generated by Django 1.11.5 on 2017-10-08 18:37
from django.db import migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def populate_is_zephyr(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
Realm = apps.get_mo... |
gtoonstra/airflow | refs/heads/master | tests/dags/test_issue_1225.py | 15 | # -*- coding: utf-8 -*-
#
# 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
#... |
putinclassic/putic | refs/heads/master | qa/rpc-tests/mempool_coinbase_spends.py | 143 | #!/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 re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coin... |
jeremiahmarks/sl4a | refs/heads/master | python/src/Lib/distutils/msvccompiler.py | 53 | """distutils.msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""
# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
# finding DevStudio (through the registry)
# This module should be kept compatible with P... |
aminghadersohi/airflow | refs/heads/master | airflow/ti_deps/deps/dagrun_exists_dep.py | 58 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
ankurjimmy/catawampus | refs/heads/master | tr/vendor/bup/lib/tornado/ioloop.py | 8 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... |
ctmunwebmaster/huxley | refs/heads/master | fabfile/dependencies.py | 2 | # Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import json
from os.path import join
from fabric.api import abort, env, hide, lcd, local, task
from fabric.contrib.console import confirm
from .utils import ui
@task(... |
yanggg1133/amdeb-amazon | refs/heads/master | amdeb_amazon/models/product_operation.py | 2 | # -*- coding: utf-8 -*-
from openerp import models, fields
from ..model_names.product_operation import PRODUCT_OPERATION_TABLE
class ProductOperation(models.Model):
""" add a column to store synchronization status """
_inherit = [PRODUCT_OPERATION_TABLE]
# This is set by Sync process regardless the sy... |
pietroalbini/botogram | refs/heads/master | botogram/hooks.py | 1 | # Copyright (c) 2015-2019 The Botogram Authors (see AUTHORS)
#
# 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, mod... |
zbqf109/goodo | refs/heads/master | openerp/netsvc.py | 1 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import logging.handlers
import os
import platform
import pprint
import release
import sys
import threading
import psycopg2
import openerp
import sql_db
import tools
_logger = logging.getLogger(__name__)... |
pongem/python-bot-project | refs/heads/master | appengine/standard/botapp/env/lib/python2.7/site-packages/django/contrib/postgres/forms/hstore.py | 70 | import json
from django import forms
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStoreField']
class HStoreField(forms.CharField):
"""
A field for HStore data which accepts dictionary JSON input.
"""
... |
illume/numpy3k | refs/heads/master | numpy/matrixlib/tests/test_regression.py | 3 | from numpy.testing import *
import numpy as np
rlevel = 1
class TestRegression(TestCase):
def test_kron_matrix(self,level=rlevel):
"""Ticket #71"""
x = np.matrix('[1 0; 1 0]')
assert_equal(type(np.kron(x,x)),type(x))
def test_matrix_properties(self,level=rlevel):
"""Ticket #12... |
InakiZabala/odoomrp-wip | refs/heads/8.0 | product_pricelist_rules/models/product.py | 25 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... |
dgellis90/nipype | refs/heads/master | nipype/interfaces/fsl/tests/test_auto_Complex.py | 10 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..utils import Complex
def test_Complex_inputs():
input_map = dict(args=dict(argstr='%s',
),
complex_cartesian=dict(argstr='-complex',
position=1,
xor=['real_polar', 'real_cartesian', 'complex_cartesian... |
sujeet4github/MyLangUtils | refs/heads/master | LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/sqlalchemy/orm/loading.py | 24 | # orm/loading.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""private module containing functions used to convert database
rows into object inst... |
smi96/django-blog_website | refs/heads/master | lib/python2.7/site-packages/PIL/ImageDraw.py | 13 | #
# The Python Imaging Library
# $Id$
#
# drawing interface operations
#
# History:
# 1996-04-13 fl Created (experimental)
# 1996-08-07 fl Filled polygons, ellipses.
# 1996-08-13 fl Added text support
# 1998-06-28 fl Handle I and F images
# 1998-12-29 fl Added arc; use arc primitive to draw ellipses
# 1999-01... |
fengbaicanhe/intellij-community | refs/heads/master | python/helpers/docutils/writers/odf_odt/pygmentsformatter.py | 244 | # $Id: pygmentsformatter.py 5853 2009-01-19 21:02:02Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Additional support for Pygments formatter.
"""
import pygments
import pygments.formatter
class OdtPygmentsFormatter(pygments.formatter.For... |
matiaskotlik/1900-Titles-Reloaded | refs/heads/master | src/vector.py | 1 | import math
from collections import namedtuple
class vec2(namedtuple('vec2', ['x', 'y'])):
def length(self):
"""
Get length of a vector
"""
return math.sqrt(self.length_squared())
def length_squared(self):
"""
Get length squared of a vector
"""
... |
proversity-org/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_credit_eligibility.py | 25 | """
Unit tests for credit eligibility UI in Studio.
"""
import mock
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url
from openedx.core.djangoapps.credit.api import get_credit_requirements
from openedx.core.djangoapps.credit.models import CreditCourse
from openedx.c... |
learningequality/kolibri | refs/heads/develop | kolibri/core/auth/utils.py | 2 | import sys
from django.utils.six.moves import input
from kolibri.core.auth.models import AdHocGroup
from kolibri.core.auth.models import FacilityDataset
from kolibri.core.auth.models import FacilityUser
from kolibri.core.auth.models import Membership
from kolibri.core.logger.models import AttemptLog
from kolibri.core... |
laurent-george/weboob | refs/heads/master | modules/ehentai/pages.py | 3 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Roger Philibert
#
# 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 yo... |
lzw120/django | refs/heads/master | build/lib/django/contrib/sites/models.py | 387 | from django.db import models
from django.utils.translation import ugettext_lazy as _
SITE_CACHE = {}
class SiteManager(models.Manager):
def get_current(self):
"""
Returns the current ``Site`` based on the SITE_ID in the
project's settings. The ``Site`` object is cached the first
... |
ptitjes/quodlibet | refs/heads/master | quodlibet/formats/_audio.py | 1 | # Copyright 2004-2005 Joe Wreschnig, Michael Urman
# 2012-2017 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... |
macressler/parallella-linux | refs/heads/main | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
bravominski/PennApps2015-HeartMates | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.py | 185 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import logging
__version__ = '0.1.8'
class DistlibException(Exception):
pass
try:
from logging import NullHandler
except Impor... |
mahak/nova | refs/heads/master | nova/privsep/__init__.py | 7 | # Copyright 2016 Red Hat, Inc
# Copyright 2017 Rackspace Australia
#
# 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
#
# Unles... |
hurricanerix/swift | refs/heads/master | test/unit/common/middleware/test_tempauth.py | 5 | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2015 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... |
edgarli/proj8 | refs/heads/master | env/lib/python3.4/site-packages/wheel/test/test_basic.py | 472 | """
Basic wheel tests.
"""
import os
import pkg_resources
import json
import sys
from pkg_resources import resource_filename
import wheel.util
import wheel.tool
from wheel import egg2wheel
from wheel.install import WheelFile
from zipfile import ZipFile
from shutil import rmtree
test_distributions = ("complex-dist"... |
bowenliu16/deepchem | refs/heads/master | deepchem/feat/tests/test_fingerprints.py | 4 | """
Test topological fingerprints.
"""
import unittest
from rdkit import Chem
from deepchem.feat import fingerprints as fp
class TestCircularFingerprint(unittest.TestCase):
"""
Tests for CircularFingerprint.
"""
def setUp(self):
"""
Set up tests.
"""
smiles = 'CC(=O)O... |
r00tkid/mr_bot | refs/heads/master | mr_bot/sender.py | 1 | # -*- coding: utf-8 -*-
#!/usr/bin/python
import traceback
from mr_logger.logger import Logger
from telegram.error import BadRequest, Unauthorized
logger = Logger()
class Sender:
""" this class will send bot messages (photo, voice, video, audio, docs) """
""" bot is instance if Telegram bot """
""" retu... |
aaronfc/notipy | refs/heads/master | notipy/__main__.py | 1 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import sys
from notipy.cli import Notipy
def main(args=None):
if args is None:
args = sys.argv[1:]
if len(args) >= 1:
if len(args) == 1:
message = args[... |
bcarroll/authmgr | refs/heads/master | python-3.6.2-Win64/Lib/encodings/iso2022_jp_ext.py | 816 | #
# iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_ext')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incr... |
nojhan/weboob-devel | refs/heads/master | tools/boilerplate_data/layout.py | 11 | ${coding}
# Copyright(C) ${r.year} ${r.author}
#
# 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 your option) an... |
ol-loginov/intellij-community | refs/heads/master | python/testData/stubs/AugAssignDunderAll.py | 83 | __all__ = ['foo', 'bar']
for i in range(5):
__all__ += 'f' + str(i)
|
memtoko/django | refs/heads/master | tests/multiple_database/models.py | 99 | from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
clas... |
PanDAWMS/panda-harvester | refs/heads/master | pandaharvester/harvestermonitor/dummy_mcore_monitor.py | 2 | import os.path
from concurrent.futures import ProcessPoolExecutor as Pool
from pandaharvester.harvestercore.work_spec import WorkSpec
from pandaharvester.harvestercore.plugin_base import PluginBase
from pandaharvester.harvestercore import core_utils
# logger
baseLogger = core_utils.setup_logger('dummy_mcore_monitor')... |
mitar/django | refs/heads/master | tests/regressiontests/multiple_database/models.py | 43 | from __future__ import absolute_import
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
class Review(models.Model):
source = models.CharField(max_length=100)
content_type = model... |
dycodedev/taiga-back | refs/heads/master | tests/integration/test_custom_attributes_issues.py | 20 | # Copyright (C) 2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2015 David Barragán <bameda@dbarragan.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
# published by the F... |
pjryan126/solid-start-careers | refs/heads/master | store/api/zillow/venv/lib/python2.7/site-packages/sqlalchemy/sql/base.py | 42 | # sql/base.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Foundational utilities common to many sql modules.
"""
from .. import util, exc
im... |
Ivehui/DQN | refs/heads/master | trainMain.py | 1 | '''
@author Ivehui
@time 2016/06/05
@function: train the agent
'''
import logging
import os, sys
import dqn
import parameters as pms
import gym
import numpy as np
import caffe
from skimage.transform import resize
from transition import Transition as Tran
def transfer(rgbImage, new_dims):
im = np.dot(rgbImage[...,... |
viacoin/viacoin | refs/heads/master | test/functional/rpc_fundrawtransaction.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 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 the fundrawtransaction RPC."""
from test_framework.test_framework import BitcoinTestFramework
fro... |
wpensar/cnab240 | refs/heads/master | tests/test_registro.py | 1 | # -*- coding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
from decimal import Decimal
from cnab240 import errors
from cnab240.bancos import itau
from tests.data import get_itau_data_from_file
class TestRegistro(unittest.TestCase):
def setUp(self):
itau_data =... |
kisna72/django | refs/heads/master | tests/gis_tests/inspectapp/models.py | 302 | from ..models import models
class AllOGRFields(models.Model):
f_decimal = models.FloatField()
f_float = models.FloatField()
f_int = models.IntegerField()
f_char = models.CharField(max_length=10)
f_date = models.DateField()
f_datetime = models.DateTimeField()
f_time = models.TimeField()
... |
throwable-one/lettuce | refs/heads/master | tests/integration/django/celeries/leaves/features/foobar-steps.py | 19 | from lettuce import step
@step(r'Given I say foo bar')
def given_i_say_foo_bar(step):
pass
@step(r'Then it works')
def then_it_works(step):
pass
@step(r'Then it fails')
def then_it_fails(step):
assert False
|
SteerSuite/steersuite-rutgers | refs/heads/master | steerstats/tests/SteerStats_Tester.py | 8 | from optparse import OptionParser
import inspect
import sys
sys.path.append("../")
import SteerStats as SteerStats
ss = SteerStats.SteerStats(None)
methods = inspect.getmembers(ss, predicate=inspect.ismethod)
# print methods
objective = 'agentFlowMetricGlobal'
for method in methods:
print method[0]
if method[... |
erinn/ansible | refs/heads/devel | lib/ansible/plugins/action/template.py | 3 | # (c) 2015, Michael DeHaan <michael.dehaan@gmail.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 lat... |
nghia-huynh/gem5-stable | refs/heads/master | src/arch/x86/isa/insts/general_purpose/input_output/general_io.py | 89 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... |
swent10/support-tools | refs/heads/master | wiki_to_md/impl/constants.py | 151 | # 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 a... |
2ndQuadrant/ansible | refs/heads/master | lib/ansible/modules/cloud/google/gcp_storage_object.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
ghtmtt/QGIS | refs/heads/master | python/plugins/db_manager/sqledit.py | 34 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptEdit.py
---------------------
Date : February 2014
Copyright : (C) 2014 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... |
emd/mitpci | refs/heads/master | mitpci/interferometer/__init__.py | 1 | from demodulated import Lissajous, Phase
from toroidal_correlation import ToroidalCorrelation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.