repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
Skytim/nccuTEG
test/test_jobs/test_send_mail.py
6
1426
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2014 SF Isle of Man Limited # # PyBossa 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...
agpl-3.0
wolfier/incubator-airflow
tests/contrib/operators/test_mysql_to_gcs_operator.py
8
1928
# -*- 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 #...
apache-2.0
YuhangGe/node-freetype
src/freetype-2.5.3/src/tools/glnames.py
360
105239
#!/usr/bin/env python # # # FreeType 2 glyph name builder # # Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LI...
apache-2.0
globau/servo
tests/wpt/css-tests/tools/pytest/_pytest/pytester.py
175
38600
""" (disabled by default) support for testing pytest and pytest plugins. """ import codecs import gc import os import platform import re import subprocess import sys import time import traceback from fnmatch import fnmatch from py.builtin import print_ from _pytest._code import Source import py import pytest from _py...
mpl-2.0
xinjiguaike/edx-platform
lms/djangoapps/shoppingcart/admin.py
102
5401
"""Django admin interface for the shopping cart models. """ from ratelimitbackend import admin from shoppingcart.models import ( PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration, Invoice, CourseRegistrationCodeInvoiceItem, InvoiceTransaction ) class SoftDeleteCouponAdmin(admin.M...
agpl-3.0
abhishekgahlot/youtube-dl
youtube_dl/extractor/krasview.py
85
1958
# encoding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( int_or_none, js_to_json, ) class KrasViewIE(InfoExtractor): IE_DESC = 'Красвью' _VALID_URL = r'https?://krasview\.ru/(?:video|embed)/(?P<id>\d+)' _TEST = { 'url'...
unlicense
rat4/bitcoin
qa/rpc-tests/test_framework/blockstore.py
98
4096
# BlockStore: a helper class that keeps a map of blocks and implements # helper functions for responding to getheaders and getdata, # and for constructing a getheaders message # from mininode import * import dbm class BlockStore(object): def __init__(self, datadir): self.blockDB = ...
mit
F-Secure/watchdog
src/watchdog/utils/__init__.py
4
4729
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 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 # # ...
apache-2.0
buildbot/buildbot
worker/buildbot_worker/test/unit/test_commands_utils.py
6
5327
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
glove747/liberty-neutron
neutron/tests/unit/test_auth.py
4
5064
# 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...
apache-2.0
romanz/python-ecdsa
ecdsa/ellipticcurve.py
55
8609
#! /usr/bin/env python # # Implementation of elliptic curves, for cryptographic applications. # # This module doesn't provide any way to choose a random elliptic # curve, nor to verify that an elliptic curve was chosen randomly, # because one can simply use NIST's standard curves. # # Notes from X9.62-1998 (draft): # ...
mit
typpo/shadowsocks
shadowsocks/crypto/table.py
1044
8108
# !/usr/bin/env python # # Copyright 2015 clowwindy # # 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
thiriel/maps
venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/creation.py
78
5863
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.creation import DatabaseCreation class SpatiaLiteCreation(DatabaseCreation): def cr...
bsd-3-clause
oxtopus/nupic
examples/opf/experiments/spatial_classification/category_0/description.py
17
1601
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
ufbmi/olass-client
olass/models/crud_mixin.py
2
1418
""" Goal: simplify the code when interacting with entities """ import sqlalchemy as db from olass.models.base import get_session class CRUDMixin(): """ Helper class sqlalchemy entities """ __table_args__ = {'extend_existing': True} id = db.Column(db.Integer, primary_key=True) @classmethod def ge...
mit
Scille/parsec-cloud
parsec/api/protocol/types.py
1
4779
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS import re from unicodedata import normalize from typing import Union, TypeVar, Type, NoReturn from uuid import uuid4 from collections import namedtuple from email.utils import parseaddr from parsec.serde import fields UserIDTypeVar = Ty...
agpl-3.0
quodlibet/quodlibet
quodlibet/ext/events/waveformseekbar.py
1
27104
# Copyright 2016 0x1777 # 2016-17 Nick Boultbee # 2017 Didier Villevalois # 2017 Muges # 2017 Eyenseo # 2018 Joschua Gandert # 2018 Blimmo # 2018 Olli Helin # # This program is free software; you can redistribute it and/or modify # it under the terms of...
gpl-2.0
prospwro/odoo
addons/website_certification/certification.py
385
1789
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
harshilasu/LinkurApp
y/google-cloud-sdk/platform/gcutil/lib/google_apputils/google/apputils/debug.py
24
1752
#!/usr/bin/env python # Copyright 2004 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...
gpl-3.0
Semi-global/edx-platform
common/lib/xmodule/xmodule/html_module.py
32
14609
import os import sys import re import copy import logging import textwrap from lxml import etree from path import Path as path from fs.errors import ResourceNotFoundError from pkg_resources import resource_string import dogstats_wrapper as dog_stats_api from xmodule.util.misc import escape_html_characters from xmodule...
agpl-3.0
doomsterinc/odoo
addons/sale_mrp/__openerp__.py
262
1912
# -*- 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...
agpl-3.0
chamakov/namebench
nb_third_party/graphy/backends/google_chart_api/__init__.py
205
2023
#!/usr/bin/python2.4 # # Copyright 2008 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 law o...
apache-2.0
mmcdermo/RedLeader
redleader/exceptions.py
1
1824
# MIT License # Copyright (c) 2016 Morgan McDermott & John Carlyle # 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, cop...
apache-2.0
bsmedberg/socorro
socorro/unittest/processor/test_registration_client.py
2
22049
# 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 mock from datetime import datetime, timedelta from configman import ConfigurationManager from nose.tools import...
mpl-2.0
3dfxmadscientist/CBSS
addons/document_page/document_page.py
51
5465
# -*- 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...
agpl-3.0
jayceyxc/hue
desktop/core/ext-py/Django-1.6.10/tests/modeladmin/models.py
55
1527
# coding: utf-8 from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Band(models.Model): name = models.CharField(max_length=100) bio = models.TextField() sign_date = models.DateField() ...
apache-2.0
jrleeman/MetPy
metpy/calc/tests/test_turbulence.py
5
15724
# Copyright (c) 2008,2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Test the `turbulence` module.""" import numpy as np from numpy.testing import assert_almost_equal, assert_array_equal import pytest from metpy.calc.turbulence import fricti...
bsd-3-clause
rahulbhalerao001/SparkNet
caffe/python/caffe/net_spec.py
8
7876
"""Python net specification. This module provides a way to write nets directly in Python, using a natural, functional style. See examples/pycaffe/caffenet.py for an example. Currently this works as a thin wrapper around the Python protobuf interface, with layers and parameters automatically generated for the "layers"...
mit
oblalex/django-xlivesettings
xlivesettings/functions.py
1
7450
import logging from django.utils.translation import ugettext from django.utils.translation import ugettext_lazy as _ from xlivesettings import values from xlivesettings.models import SettingNotSet from xlivesettings.utils import is_string_like log = logging.getLogger(__name__) _NOTSET = object() class Configuratio...
bsd-3-clause
mdietrichc2c/OCB
addons/l10n_cl/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
partofthething/home-assistant
homeassistant/components/rachio/device.py
4
9585
"""Adapter to wrap the rachiopy api for home assistant.""" import logging from typing import Optional import voluptuous as vol from homeassistant.const import EVENT_HOMEASSISTANT_STOP, HTTP_OK from homeassistant.helpers import config_validation as cv from .const import ( DOMAIN, KEY_DEVICES, KEY_ENABLED,...
mit
TomasDuro/paparazzi
sw/ground_segment/python/ivytoredis/ivy_to_redis.py
36
2399
#!/usr/bin/env python from __future__ import print_function import redis import time import signal import argparse import sys import os # if PAPARAZZI_SRC not set, then assume the tree containing this # file is a reasonable substitute PPRZ_SRC = os.getenv("PAPARAZZI_SRC", os.path.normpath(os.path.join(os.path.dirnam...
gpl-2.0
fizyk/matchbox
src/matchbox/matchbox.py
1
3244
# Copyright (C) 2015 by Clearcode <http://clearcode.cc> # and associates (see AUTHORS). # This file is part of matchbox. # matchbox 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 version 3 of ...
lgpl-3.0
jmarsik/mopidy
mopidy/core/actor.py
1
9428
from __future__ import absolute_import, unicode_literals import collections import itertools import logging import pykka from mopidy import audio, backend, mixer, service from mopidy.audio import PlaybackState from mopidy.core.service import ServiceController from mopidy.core.history import HistoryController from mo...
apache-2.0
mvo5/snapcraft
snapcraft/internal/steps.py
3
3949
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
mmechelke/bayesian_xfel
bxfel/core/structure_factor.py
1
18608
import numpy as np import scipy import re import os import hashlib import csb from csb.bio.io.wwpdb import StructureParser def chunks(l, n): """ Yield successive n-sized chunks from l. """ for i in xrange(0, len(l), n): yield l[i:i+n] class ScatteringFactor(object): """ Cacluates the ...
mit
spawnedc/MeCanBlog
django/utils/unittest/util.py
751
2821
"""Various utility functions.""" __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result return result[:_MAX_LENGTH] + ' [truncated]...'...
bsd-3-clause
getsentry/zeus
zeus/factories/build.py
1
3176
import factory from datetime import timedelta from faker import Factory from random import randint from zeus import models from zeus.config import db from zeus.constants import Result, Status from zeus.utils import timezone from .base import ModelFactory from .repository import RepositoryFactory from .types import G...
apache-2.0
orgito/ansible
lib/ansible/modules/network/cloudengine/ce_vrf.py
25
10789
#!/usr/bin/python # # 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 distribut...
gpl-3.0
Livefyre/django-cms
cms/test_utils/project/emailuserapp/forms.py
61
3574
# -*- coding: utf-8 -*- from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.forms import ReadOnlyPasswordHashField from .models import EmailUser class UserCreationForm(forms.ModelForm): """ A form for creating a new user, including the required email and passw...
bsd-3-clause
CEG-FYP-OpenStack/scheduler
nova/api/openstack/compute/legacy_v2/contrib/shelve.py
69
3988
# Copyright 2013 Rackspace Hosting # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
gusDuarte/software-center-5.2
test/test_ppa_iconfilename.py
3
1677
#!/usr/bin/python import unittest from testutils import setup_test_env setup_test_env() from softwarecenter.distro.Ubuntu import Ubuntu class MockCache(object): def __init__(self, mock_base_url): self._baseurl = mock_base_url self._cache = [] self.ready = True def __getitem__(self, k)...
lgpl-3.0
zhenzhai/edx-platform
common/djangoapps/auth_exchange/forms.py
29
4033
""" Forms to support third-party to first-party OAuth 2.0 access token exchange """ from django.contrib.auth.models import User from django.forms import CharField from edx_oauth2_provider.constants import SCOPE_NAMES import provider.constants from provider.forms import OAuthForm, OAuthValidationError from provider.oaut...
agpl-3.0
EduPepperPD/pepper2013
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
6
62611
import threading import datetime import logging import pymongo import re from importlib import import_module from path import path from xmodule.errortracker import null_error_tracker from xmodule.x_module import XModuleDescriptor from xmodule.modulestore.locator import BlockUsageLocator, DescriptionLocator, CourseLoca...
agpl-3.0
danakj/chromium
content/test/gpu/gpu_tests/gpu_rasterization.py
1
3218
# Copyright 2014 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 gpu_tests import cloud_storage_test_base from gpu_tests import gpu_rasterization_expectations import page_sets from telemetry.page import page_test fro...
bsd-3-clause
fossoult/odoo
addons/hr/res_users.py
303
3192
from openerp import api from openerp.osv import fields, osv class res_users(osv.Model): """ Update of res.users class - if adding groups to an user, check if base.group_user is in it (member of 'Employee'), create an employee form linked to it. """ _name = 'res.users' _inherit = ['res....
agpl-3.0
mationic/pyload
module/network/CookieJar.py
41
1550
# -*- coding: utf-8 -*- """ 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. This program is distributed in...
gpl-3.0
perezg/infoxchange
BASE/lib/python2.7/site-packages/django/utils/crypto.py
52
5567
""" Django's standard crypto functions and utilities. """ from __future__ import unicode_literals import hmac import struct import hashlib import binascii import operator import time from functools import reduce # Use the system PRNG if possible import random try: random = random.SystemRandom() using_sysrando...
apache-2.0
lsk112233/Clone-test-repo
events/models.py
1
9946
import datetime from dateutil.rrule import rrule, YEARLY, MONTHLY, WEEKLY, DAILY from operator import itemgetter from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.db.models import Q from django.template.defaultfilters import date from django.utils im...
apache-2.0
gmcastil/numpy
numpy/doc/structured_arrays.py
56
11442
""" ================= Structured Arrays ================= Introduction ============ NumPy provides powerful capabilities to create arrays of structured datatype. These arrays permit one to manipulate the data by named fields. A simple example will show what is meant.: :: >>> x = np.array([(1,2.,'Hello'), (2,3.,"Wo...
bsd-3-clause
westinedu/newertrends
django/core/cache/backends/base.py
232
7960
"Base Cache class." import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning from django.utils.encoding import smart_str from django.utils.importlib import import_module class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKe...
bsd-3-clause
Feverup/ansible-modules-extras
monitoring/circonus_annotation.py
76
4976
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2014-2015, Epic Games, 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 # ...
gpl-3.0
cg31/tensorflow
tensorflow/contrib/learn/python/learn/learn_runner.py
14
4997
# 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
40223101/w17test
static/Brython3.1.0-20150301-090019/Lib/errno.py
624
4096
""" This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value, e.g., on most systems, errno.ENOENT equals the integer 2. The dictionary errno.errorcode maps numeric codes to symbol names, e.g., errno.errorcode[2] could be the string 'ENOENT'. Symbols that ar...
gpl-3.0
itaymendel/taurus
tests/modules/test_cloudProvisioning.py
1
53218
import json import os import shutil import tempfile import time import yaml from bzt import TaurusConfigError, TaurusException from bzt.bza import Master, Test, MultiTest from bzt.engine import ScenarioExecutor, ManualShutdown, Service from bzt.modules.aggregator import ConsolidatingAggregator, DataPoint, KPISet from...
apache-2.0
waytai/odoo
openerp/addons/base/tests/test_ir_actions.py
291
20121
import unittest2 from openerp.osv.orm import except_orm import openerp.tests.common as common from openerp.tools import mute_logger class TestServerActionsBase(common.TransactionCase): def setUp(self): super(TestServerActionsBase, self).setUp() cr, uid = self.cr, self.uid # Models ...
agpl-3.0
boyuegame/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/commands/wheel.py
328
7320
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import sys from pip.basecommand import Command from pip.index import PackageFinder from pip.log import logger from pip.exceptions import CommandError, PreviousBuildDirError from pip.req import InstallRequirement, RequirementSet, parse_requirement...
lgpl-3.0
apache/incubator-airflow
tests/providers/amazon/aws/transfers/test_google_api_to_s3_system.py
10
2670
# # 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...
apache-2.0
odubno/microblog
flask/lib/python2.7/site-packages/openid/extensions/ax.py
166
26382
# -*- test-case-name: openid.test.test_ax -*- """Implements the OpenID Attribute Exchange specification, version 1.0. @since: 2.1.0 """ __all__ = [ 'AttributeRequest', 'FetchRequest', 'FetchResponse', 'StoreRequest', 'StoreResponse', ] from openid import extension from openid.server.trustroot...
bsd-3-clause
bioinformatics-centre/AsmVar
src/AsmvarVarScore/FeatureToScore2.py
2
12476
""" ======================================================== Statistic the SV Stat after AGE Process ======================================================== Author: Shujia Huang & Siyang Liu Date : 2014-03-07 0idx:54:15 """ import sys import re import os import string import numpy as np import matplotlib.pyplot as pl...
mit
rspavel/spack
var/spack/repos/builtin/packages/r-shinyfiles/package.py
5
1173
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RShinyfiles(RPackage): """Provides functionality for client-side navigation of the server ...
lgpl-2.1
40223151/2014c2g9
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/dom/minidom.py
727
66854
"""Simple implementation of the Level 1 DOM. Namespaces and other minor Level 2 features are also supported. parse("foo.xml") parseString("<foo><bar/></foo>") Todo: ===== * convenience methods for getting elements and text. * more testing * bring some of the writer and linearizer code into conformance with this ...
gpl-2.0
IljaGrebel/OpenWrt-SDK-imx6_HummingBoard
staging_dir/host/lib/scons-2.3.5/SCons/cpp.py
1
19694
# # Copyright (c) 2001 - 2015 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 # without limitation the rights to use, copy, modify, merge...
gpl-2.0
golismero/golismero-devel
thirdparty_libs/django/dispatch/dispatcher.py
105
9373
import weakref import threading from django.dispatch import saferef from django.utils.six.moves import xrange WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, '__func__'): return (id(target.__self__), id(target.__func__)) return id(target) ...
gpl-2.0
liuzheng712/Misago
misago/core/utils.py
7
3105
from datetime import timedelta from unidecode import unidecode from django.http import Http404 from django.core.urlresolvers import resolve, reverse from django.template.defaultfilters import slugify as django_slugify from django.utils import html, timezone from django.utils.translation import ugettext_lazy as _, ung...
gpl-2.0
naltatis/kryptonite
node_modules/grunt/node_modules/js-yaml/support/pyyaml-src/__init__.py
96
9607
from .error import * from .tokens import * from .events import * from .nodes import * from .loader import * from .dumper import * __version__ = '3.10' try: from .cyaml import * __with_libyaml__ = True except ImportError: __with_libyaml__ = False import io def scan(stream, Loader=Loader): """ S...
mit
yoer/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlwt3/ExcelFormulaLexer.py
46
4311
import sys from .antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException import struct from . import ExcelFormulaParser from re import compile as recompile, match, LOCALE, UNICODE, IGNORECASE, VERBOSE int_const_pattern = r"\d+\b" flt_const_pattern = r""" (?: (?: \d* \. \d+ ) # .1...
apache-2.0
JioCloud/tempest
tempest/api/identity/admin/v2/test_roles_negative.py
11
11459
# Copyright 2013 Huawei Technologies Co.,LTD. # 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 # # Unl...
apache-2.0
datacratic/mongo-cxx-driver
src/mongo/db/auth/generate_action_types.py
19
7459
#!/usr/bin/python # Copyright 2012 10gen 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 applicab...
apache-2.0
alokotosh/mm-master
mm/commands/metadata.py
3
24125
import sys import json import os import mm.util as util import mm.xmltodict as xmltodict import mm.config as config import shutil import urllib import re import threading from operator import itemgetter from xml.dom import minidom import webbrowser from mm.sfdc_client import MavensMateClient from mm.exceptions import *...
gpl-2.0
wilfeli/DMGameBasic
ExternalTools/Eigen/debug/gdb/printers.py
143
6360
# -*- coding: utf-8 -*- # This file is part of Eigen, a lightweight C++ template library # for linear algebra. # # Copyright (C) 2009 Benjamin Schindler <bschindler@inf.ethz.ch> # # 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 ...
mit
infoxchange/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/select_related_onetoone/models.py
144
1340
from django.db import models class User(models.Model): username = models.CharField(max_length=100) email = models.EmailField() def __unicode__(self): return self.username class UserProfile(models.Model): user = models.OneToOneField(User) city = models.CharField(max_length=100) state...
gpl-3.0
ool2016-seclab/quarantineSystem
ryu/tests/unit/ofproto/test_ofproto_v12.py
38
26177
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # 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 appli...
mit
yograterol/django
django/conf/locale/ru/formats.py
1059
1267
# -*- 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 = 'j E Y г.' TIME_FORMAT = 'G:i' DAT...
bsd-3-clause
robertmattmueller/sdac-compiler
sympy/physics/quantum/tests/test_spin.py
33
320428
from __future__ import division from sympy import cos, exp, expand, I, Matrix, pi, S, sin, sqrt, Sum, symbols from sympy.abc import alpha, beta, gamma, j, m from sympy.physics.quantum import hbar, represent, Commutator, InnerProduct from sympy.physics.quantum.qapply import qapply from sympy.physics.quantum.tensorproduc...
gpl-3.0
maxamillion/openshift-ansible
roles/lib_openshift/src/lib/serviceaccount.py
84
4113
# pylint: skip-file # flake8: noqa class ServiceAccountConfig(object): '''Service account config class This class stores the options and returns a default service account ''' # pylint: disable=too-many-arguments def __init__(self, sname, namespace, kubeconfig, secrets=None, image_pull_secrets=...
apache-2.0
podemos-info/odoo
addons/l10n_ch/invoice.py
8
9305
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
NeuroRoboticTech/Jetduino
Software/Python/grove_single_axis_analog_gyro.py
1
2819
#!/usr/bin/env python # # Jetduino Example for using the Grove Single Axis Analog Gyro (http://www.seeedstudio.com/wiki/Grove_-_Single_Axis_Analog_Gyro) # # The Jetduino connects the Jetson and Grove sensors. You can learn more about the Jetduino here: http://www.NeuroRoboticTech.com/Projects/Jetduino # # Have a ques...
mit
cpe/VAMDC-VALD
nodes/basecol/bastest/views.py
4
3565
# -*- coding: utf-8 -*- # Create your views here. from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.db.models import Q from DjBASECOL.bastest.models import RefsArticles,RefsGroups,ETables,Elements from DjNode.tapservice.sqlparse import where2q RETURNABLES={\ 'SourceID':'...
gpl-3.0
oconnorr/nixops
tests/unit/test_nix_expr.py
11
10994
import unittest from textwrap import dedent from nixops.nix_expr import py2nix, nix2py, nixmerge from nixops.nix_expr import RawValue, Function __all__ = ['Py2NixTest', 'Nix2PyTest', 'NixMergeTest'] class Py2NixTestBase(unittest.TestCase): def assert_nix(self, nix_expr, expected, maxwidth=80, inline=False): ...
lgpl-3.0
shaobozi/googletest
test/gtest_break_on_failure_unittest.py
2140
7339
#!/usr/bin/env python # # Copyright 2006, 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...
bsd-3-clause
hakujyo/chessplaying_robot
machintest.py
1
1166
# uArm Swift Pro - Python Library Example # Created by: Richard Garsthagen - the.anykey@gmail.com # V0.1 - June 2017 - Still under development import uArmRobot import time #Configure Serial Port serialport = "com5" # for windows #serialport = "/dev/ttyACM0" # for linux like system # Connect to u...
gpl-3.0
laiqiqi886/kbengine
kbe/res/scripts/common/Lib/test/test_minidom.py
60
64328
# test for xml.dom.minidom import pickle from test.support import run_unittest, findfile import unittest import xml.dom.minidom from xml.dom.minidom import parse, Node, Document, parseString from xml.dom.minidom import getDOMImplementation tstfile = findfile("test.xml", subdir="xmltestdata") # The tests of Docume...
lgpl-3.0
markcn/kernel_huawei_c8812
tools/perf/scripts/python/sctop.py
11180
1924
# 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,...
gpl-2.0
programadorjc/django
django/utils/numberformat.py
431
1944
from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.utils import six from django.utils.safestring import mark_safe def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Gets a number (...
bsd-3-clause
shannara/subuser
logic/subuserlib/builtInCommands/version.py
2
1274
#!/usr/bin/python3 # -*- coding: utf-8 -*- #external imports import json import sys import optparse #internal imports import subuserlib.version import subuserlib.commandLineArguments import subuserlib.profile from subuserlib.classes.user import User def parseCliArgs(realArgs): usage = "usage: subuser version" desc...
lgpl-3.0
Shelnutt2/android_kernel_lge_f180k
scripts/gcc-wrapper.py
501
3410
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, Code Aurora Forum. 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 a...
gpl-2.0
djurodrljaca/salamander-alm
server/rest_api/usermanagement/__init__.py
1
1336
""" Salamander ALM Copyright (c) 2016 Djuro Drljaca This Python module 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 version. This Python module ...
gpl-2.0
penelopy/luigi
test/contrib/spark_test.py
43
11040
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
bhargav2408/kivy
examples/canvas/circle.py
40
2154
''' Circle Example ============== This example exercises circle (ellipse) drawing. You should see sliders at the top of the screen with the Kivy logo below it. The sliders control the angle start and stop and the height and width scales. There is a button to reset the sliders. The logo used for the circle's background...
mit
MayOneUS/pledgeservice
testlib/bs4/tests/test_soup.py
272
17391
# -*- coding: utf-8 -*- """Tests of Beautiful Soup as a whole.""" import logging import unittest import sys import tempfile from bs4 import ( BeautifulSoup, BeautifulStoneSoup, ) from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, SoupStrainer, NamespacedAttribute, ...
apache-2.0
zestedesavoir/Python-ZMarkdown
setup.py
1
2587
#!/usr/bin/env python from __future__ import with_statement import os from distutils.core import setup import imp def get_version(): " Get version & version_info without importing markdown.__init__ " path = os.path.join(os.path.dirname(__file__), 'zmarkdown') fp, pathname, desc = imp.find_module('__versi...
bsd-3-clause
kumarkrishna/sympy
sympy/matrices/expressions/inverse.py
84
2258
from __future__ import print_function, division from sympy.core.sympify import _sympify from sympy.core import S, Basic from sympy.matrices.expressions.matexpr import ShapeError from sympy.matrices.expressions.matpow import MatPow class Inverse(MatPow): """ The multiplicative inverse of a matrix expression ...
bsd-3-clause
Eric89GXL/scipy
scipy/special/tests/test_nan_inputs.py
11
1775
"""Test how the ufuncs in special handle nan inputs. """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_array_equal, assert_ import pytest import scipy.special as sc from scipy._lib._numpy_compat import suppress_warnings KNOWNFAILURES = {} POST...
bsd-3-clause
gregdek/ansible
test/legacy/cleanup_rax.py
160
6547
#!/usr/bin/env python import os import re import yaml import argparse try: import pyrax HAS_PYRAX = True except ImportError: HAS_PYRAX = False from ansible.module_utils.six.moves import input def rax_list_iterator(svc, *args, **kwargs): method = kwargs.pop('method', 'list') items = getattr(svc,...
gpl-3.0
Zac-HD/home-assistant
tests/components/test_sun.py
12
3962
"""The tests for the Sun component.""" # pylint: disable=protected-access import unittest from unittest.mock import patch from datetime import timedelta, datetime from homeassistant.bootstrap import setup_component import homeassistant.core as ha import homeassistant.util.dt as dt_util import homeassistant.components....
apache-2.0
qwertyjune/BethSaidaBible
venv/lib/python2.7/site-packages/django/db/migrations/operations/special.py
44
5088
from __future__ import unicode_literals from .base import Operation class SeparateDatabaseAndState(Operation): """ Takes two lists of operations - ones that will be used for the database, and ones that will be used for the state change. This allows operations that don't support state change to have i...
gpl-3.0
tedi3231/openerp
openerp/addons/account_check_writing/wizard/account_check_batch_printing.py
54
3821
# -*- 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...
agpl-3.0
zorroz/microblog
flask/lib/python2.7/site-packages/setuptools/tests/test_resources.py
345
23973
#!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove import os import sys import tempfile import shutil from unittest import TestCase import pkg_resources from pkg_resources import (parse_requirements, VersionConflict, parse_version, Distribution...
bsd-3-clause
jawatech/elisp4js
js/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
1355
44604
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
apache-2.0