repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
chshu/openthread
tests/scripts/thread-cert/Cert_5_1_06_RemoveRouterId.py
3
7704
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
aleixq/python3-brisa
brisa/upnp/base_service_builder.py
1
5143
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2007-2008 Brisa Team <brisa-develop@garage.maemo.org> """ Builder module for services. """ from xml.etree import cElementTree as ElementTree from brisa.core import log from brisa.upnp.base_action import BaseArgument, BaseA...
mit
a2ultimate/ultimate-league-app
src/ultimate/user/views.py
2
4712
from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.db.models import Q from django.db.transaction import atomic from django.http import HttpResponseRedirect from django.shortcuts import render from django.template import ...
bsd-3-clause
Trixter69/BookMarka
lib/unidecode/x063.py
252
4656
data = ( 'Bo ', # 0x00 'Chi ', # 0x01 'Gua ', # 0x02 'Zhi ', # 0x03 'Kuo ', # 0x04 'Duo ', # 0x05 'Duo ', # 0x06 'Zhi ', # 0x07 'Qie ', # 0x08 'An ', # 0x09 'Nong ', # 0x0a 'Zhen ', # 0x0b 'Ge ', # 0x0c 'Jiao ', # 0x0d 'Ku ', # 0x0e 'Dong ', # 0x0f 'Ru ', # 0x10 'Tiao ...
gpl-3.0
216software/Profiles
communityprofiles/profiles/oldmigrations/0061_auto__add_field_geolevel_year.py
2
20569
# encoding: 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 'GeoLevel.year' db.add_column(u'profiles_geolevel', 'year', self.gf('django.db.models.field...
mit
yk5/incubator-airflow
tests/contrib/operators/test_slack_webhook_operator.py
15
2477
# -*- 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
jenalgit/django
django/contrib/staticfiles/utils.py
248
1977
import fnmatch import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured def matches_patterns(path, patterns=None): """ Return True or False depending on whether the ``path`` should be ignored (if it matches any pattern in ``ignore_patterns``). """ if patt...
bsd-3-clause
poettering/systemd
hwdb.d/ids_parser.py
33
13441
#!/usr/bin/env python3 import re import sys from pyparsing import (Word, White, Literal, Regex, LineEnd, SkipTo, ZeroOrMore, OneOrMore, Combine, Optional, Suppress, Group, stringEnd, pythonStyleComment) EOL = LineEnd().suppres...
gpl-2.0
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/django/contrib/admin/filters.py
95
17367
""" This encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ import datetime from django.contrib.admin.op...
gpl-2.0
zstyblik/infernal-twin
build/reportlab/src/reportlab/pdfbase/rl_codecs.py
40
54211
#codecs support __all__=['RL_Codecs'] from collections import namedtuple StdCodecData=namedtuple('StdCodecData','exceptions rexceptions') ExtCodecData=namedtuple('ExtCodecData','baseName exceptions rexceptions') class RL_Codecs: __rl_codecs_data = { 'winansi':StdCodecData({ 0x007f: 0x2022, # BUL...
gpl-3.0
OriHoch/Open-Knesset
laws/migrations/0017_auto__del_field_law_popular_name__add_field_bill_popular_name.py
14
27151
# encoding: 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): # Deleting field 'Law.popular_name' db.delete_column('laws_law', 'popular_name') # Adding field '...
bsd-3-clause
napsternxg/SentimentSocialNets
data.py
1
1454
from facepy import GraphAPI import json """ Uses facebook graph api. Use the console at: https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=540171036091887%2Ffeed%3Ffields%3Dfrom%2Cmessage%2Ccaption%2Clikes%2Ccomments%7Bfrom%2Cmessage%2Ccreated_time%2Clike_count%2Ccomment_count%7D%2Ccreate...
apache-2.0
Lilykos/invenio
invenio/legacy/websubmit/functions/Print_Success.py
13
3321
# This file is part of Invenio. # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your o...
gpl-2.0
prakxys/flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/werkzeug/testsuite/__init__.py
146
7756
# -*- coding: utf-8 -*- """ werkzeug.testsuite ~~~~~~~~~~~~~~~~~~ Contains all test Werkzeug tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import re import sys import unittest import shutil import tempfile im...
apache-2.0
anilmuthineni/tensorflow
tensorflow/contrib/layers/python/layers/optimizers_test.py
2
19130
# Copyright 2015 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
DiptoDas8/Biponi
lib/python2.7/site-packages/django/contrib/admin/actions.py
395
3316
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
mit
aviarypl/mozilla-l10n-addons-server
src/olympia/devhub/tests/test_views_versions.py
2
43469
# -*- coding: utf-8 -*- import datetime import os import re import zipfile from django.core.files import temp from django.core.files.base import File as DjangoFile import mock import six from pyquery import PyQuery as pq from waffle.testutils import override_switch from olympia import amo from olympia.accounts.view...
bsd-3-clause
chrish42/pylearn
pylearn2/expr/tests/test_normalize.py
44
3322
from __future__ import print_function __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2013, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import numpy as np import warnings from theano.compat.six.move...
bsd-3-clause
sudovijay/youtube-dl
youtube_dl/extractor/radiofrance.py
163
2089
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class RadioFranceIE(InfoExtractor): _VALID_URL = r'^https?://maison\.radiofrance\.fr/radiovisions/(?P<id>[^?#]+)' IE_NAME = 'radiofrance' _TEST = { 'url': 'http://maison.radiofrance.fr/radiovisio...
unlicense
donce/django-cms
cms/south_migrations/0043_auto__add_field_usersettings_clipboard.py
48
16360
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
guorendong/iridium-browser-ubuntu
third_party/trace-viewer/third_party/tvcm/third_party/rcssmin/_setup/py3/term/_term.py
18
3406
# -*- coding: ascii -*- # # Copyright 2007, 2008, 2009, 2010, 2011 # Andr\xe9 Malo or his licensors, as applicable # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
bsd-3-clause
michellemorales/OpenMM
kaldi/egs/babel/s5d/local/lexicon/make_unicode_lexicon.py
1
27095
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Johns Hopkins University (Author: Matthew Wiesner) # Apache 2.0 # ============ Make unicode-based graphemic lexicon ============= # # This script takes a list of either words or words and corresponding # morphemes and returns a graphemic lexicon in the ...
gpl-2.0
sandvine/horizon
horizon/themes.py
4
5546
# Copyright 2016 Hewlett Packard Enterprise Software, LLC # 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
kspviswa/personfinder
tests/test_importer.py
11
18621
# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
DR08/mxnet
example/fcn-xs/solver.py
37
7190
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
roselleebarle04/django
tests/generic_views/test_base.py
269
19854
from __future__ import unicode_literals import time import unittest from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import resolve from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import require_...
bsd-3-clause
openstack/networking-bagpipe-l2
networking_bagpipe/bagpipe_bgp/engine/tracker_worker.py
3
20967
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding: utf-8 # Copyright 2014 Orange # # 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 # # Un...
apache-2.0
cloudant/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Scanner/Fortran.py
61
14347
"""SCons.Scanner.Fortran This module implements the dependency scanner for Fortran code. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentati...
apache-2.0
dchilds7/Deysha-Star-Formation
vispy/gloo/preprocessor.py
21
2298
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ------------------------------------------------------------------------...
bsd-3-clause
code4futuredotorg/reeborg_tw
src/libraries/brython/Lib/copy.py
628
8905
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
agpl-3.0
wilvk/ansible
lib/ansible/plugins/action/win_updates.py
8
10670
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from ansible.errors import AnsibleError from ansible.module_utils._text import to_text from ansible.module_utils.parsing.convert_bool import boolean from ansible.plugins.action import ActionBase try: from __main__...
gpl-3.0
R-Lefebvre/ardupilot
Tools/mavproxy_modules/lib/geodesic_grid.py
108
2058
# Copyright (C) 2016 Intel Corporation. All rights reserved. # # This file 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 fi...
gpl-3.0
MrSwiss/SpockBot
spock/plugins/helpers/physics.py
1
5513
""" A Physics module built from clean-rooming the Notchian Minecraft client Collision detection and resolution is done by a Separating Axis Theorem implementation for concave shapes decomposed into Axis-Aligned Bounding Boxes. This isn't totally equivalent to vanilla behavior, but it's faster and Close Enough^TM AKA ...
mit
nebril/fuel-web
fuel_agent_ci/fuel_agent_ci/tests/test_configdrive.py
3
6888
# Copyright 2014 Mirantis, 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 agreed to in writing...
apache-2.0
zaina/nova
nova/tests/unit/virt/vmwareapi/test_vmops.py
1
101690
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
jpautom/scikit-learn
sklearn/linear_model/tests/test_omp.py
272
7752
# Author: Vlad Niculae # Licence: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equa...
bsd-3-clause
bho008/ardupilot
Tools/autotest/common.py
13
9651
import util, pexpect, time, math from pymavlink import mavwp # a list of pexpect objects to read while waiting for # messages. This keeps the output to stdout flowing expect_list = [] def expect_list_clear(): '''clear the expect list''' global expect_list for p in expect_list[:]: expect_list.remov...
gpl-3.0
blaxter/samba
third_party/dnspython/dns/rdtypes/mxbase.py
100
3968
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/scipy/special/setup.py
17
6141
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import os import sys from os.path import join from distutils.sysconfig import get_python_inc import numpy from numpy.distutils.misc_util import get_numpy_include_dirs try: from numpy.distutils.misc_util import get_info except ...
apache-2.0
thaumos/ansible
lib/ansible/plugins/action/group_by.py
122
1914
# Copyright 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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 ve...
gpl-3.0
pedrovt/labi
guide_13_crypto/guide_13_d_cifraComAES.py
1
1311
# encoding=utf-8 from Crypto.Cipher import AES from Crypto.Hash import SHA # Reads key from user user_key = str(raw_input("Please enter your key: ")) key = "" # If given key has less than 16 bytes, new key is generated # based on the given one, using SHA-1 hash function if len(user_key) < 16: g = S...
gpl-3.0
joepler/centerparallax
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
304
41695
# 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...
mit
axbaretto/beam
sdks/python/.tox/docs/lib/python2.7/site-packages/docutils/writers/pep_html/__init__.py
124
3507
# $Id: __init__.py 7630 2013-03-15 22:27:04Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ PEP HTML Writer. """ __docformat__ = 'reStructuredText' import sys import os import os.path import codecs import docutils from docutils import frontend...
apache-2.0
adam-rabinowitz/ngs_analysis
structure/unittest/interactionMatrixTest.py
2
11872
import unittest import collections import tempfile import os import numpy as np from ngs_python.structure import interactionMatrix class InteractionTestCase(unittest.TestCase): def setUp(self): ''' Create data for unittest.''' # Create file names self.dirName = tempfile.mkdtemp() ...
gpl-2.0
payal97/portal
systers_portal/users/tests/test_models.py
2
11876
from cities_light.models import Country, City from django.contrib.auth.models import User, Group from django.test import TestCase from community.models import Community from community.utils import create_groups from community.permissions import groups_templates from membership.models import JoinRequest from users.mode...
gpl-2.0
themass/zulip
zproject/urls.py
108
15143
from django.conf import settings from django.conf.urls import patterns, url, include from django.views.generic import TemplateView, RedirectView import os.path import zerver.forms # NB: There are several other pieces of code which route requests by URL: # # - runtornado.py has its own URL list for Tornado views. Se...
apache-2.0
2014c2g8/c2g8
wsgi/static/Brython2.1.0-20140419-113919/Lib/os.py
93
35586
r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix', 'nt', 'os2' or 'ce'. - os.curdir is a string representing the current directory ('.' or...
gpl-2.0
BhupeshGupta/erpnext
erpnext/hr/doctype/appraisal/appraisal.py
35
2346
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.model.document ...
agpl-3.0
Azure/azure-sdk-for-python
sdk/purview/azure-purview-scanning/azure/purview/scanning/rest/scan_rulesets/_request_builders.py
1
8859
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
spthaolt/socorro
socorro/unittest/external/postgresql/test_bugs_service.py
10
5516
# 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/. from nose.plugins.attrib import attr from nose.tools import eq_, assert_raises from socorro.external.postgresql.bugs_se...
mpl-2.0
eelias/typepadapp
doc/exts/resolve_default_interpreted_role.py
1
5699
# Copyright (c) 2009-2010 Six Apart Ltd. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions an...
bsd-3-clause
lara-unb/ema_tao
scripts/stateMachine.py
1
11111
#!/usr/bin/env python # -*- coding: utf-8 -*- import rospy #import ros msgs from sensor_msgs.msg import Imu from std_msgs.msg import Float64 from std_msgs.msg import Int8 from ema_common_msgs.msg import Stimulator # import utilities from math import pi from tf import transformations import time ####### TO DO ######...
apache-2.0
datastory/ipr-praha-xml-rpc
priklad_automaty.py
1
1581
# -*- coding: utf-8 -*- # Python 3 #Priklad pouziti XML-RPC rozhrani IPR Praha. Po prihlaseni stahne a ulozi do csv informace z vrstvy parkovacich automatu. import xmlrpc.client import xml.etree.ElementTree as ET import csv proxy = xmlrpc.client.ServerProxy('http://app.urm.cz/ws/RPC2UTF8/') #ziska token pro uzivate...
mit
audaciouscode/Books-Mac-OS-X
Versions/Books_3.0b5/OPAC SBN.plugin/Contents/Resources/PyZ3950/z3950_2001.py
30
159770
#!/usr/bin/env python # Auto-generated from ../compiler/tests/z3950-2001.txt at Wed, 02 Jun 2004 15:30:47 +0000 from PyZ3950 import asn1 #module Module None KnownProximityUnit=asn1.INTEGER_class ([('character',1),('word',2),('sentence',3),('paragraph',4),('section',5),('chapter',6),('document',7),('element',8),('subele...
mit
impowski/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/__init__.py
1229
2323
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
mpl-2.0
wfxiang08/django190
django/middleware/csrf.py
155
8477
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ from __future__ import unicode_literals import logging import re from django.conf import settings from django.core.urlresolvers import get_callable from django.utils...
bsd-3-clause
scholer/cadnano2.5
cadnano/fileio/v2decode.py
2
14321
# -*- coding: utf-8 -*- from collections import defaultdict from cadnano.part.refresholigoscmd import RefreshOligosCommand from cadnano.proxies.cnenum import ( GridEnum, LatticeEnum, StrandEnum, OrthoViewEnum, EnumType ) from cadnano import ( setBatch, getReopen, setReopen ) from cadnan...
mit
code-google-com/cortex-vfx
test/IECore/AngleConversionTest.py
12
2202
########################################################################## # # Copyright (c) 2008, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
ibinti/intellij-community
python/lib/Lib/site-packages/django/core/xheaders.py
518
1157
""" Pages in Django can are served up with custom HTTP headers containing useful information about those pages -- namely, the content type and object ID. This module contains utility functions for retrieving and doing interesting things with these special "X-Headers" (so called because the HTTP spec demands that custo...
apache-2.0
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/mpl_toolkits/axes_grid1/anchored_artists.py
2
13214
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib import docstring from matplotlib.offsetbox import (AnchoredOffsetbox, AuxTransformBox, DrawingArea, TextArea, VPacker) from matplotlib.patches import...
mit
matutter/AirRocks-FlightController
webRelay/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
gpl-3.0
Eficent/odoomrp-wip
mrp_production_capacity/models/mrp.py
17
5937
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api, exceptions, _ c...
agpl-3.0
willprice/arduino-sphere-project
scripts/example_direction_finder/temboo/Library/Twitter/PlacesAndGeo/GeoSearch.py
5
7527
# -*- coding: utf-8 -*- ############################################################################### # # GeoSearch # Searches for places that can be attached to a status update using a latitude and a longitude pair, an IP address, or a name. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Lice...
gpl-2.0
ankanch/tieba-zhuaqu
DSV-user-application-plugin-dev-kit/default-plugins/singleword/lib/result_functions_file.py
1
1783
import os import datetime import lib.maglib as MSG import pymysql #这是一个对结果进行初步处理的库 #用来分离抓取结果,作者,发帖时间 #抓取结果应该储存在【用户端根目录】并以result命名 #在测试情况下,抓取结果文件为results.txt #重要全局变量 PATH_SUFFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) print(PATH_SUFFIX) PATH_SUFFIX = PATH_SUFFIX[::-1] PATH_SUFFIX...
gpl-3.0
fcolamar/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/base/struct/ParticleTHnSparse.py
41
4058
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
drussellmrichie/TATools
COGSTools/cohortModelPure.py
1
3783
""" Russell Richie https://github.com/drussellmrichie drussellmrichie@gmail.com A super quick and dirty implementation of the Cohort Model of word recognition, devised by William Marslen-Wilson. For example: http://psycholinguistics.wikifoundry.com/page/The+Cohort+Model+of+Word+Recognition This was written to be rea...
gpl-3.0
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/logging/__init__.py
45
64033
# Copyright 2001-2010 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 notice and this permissio...
apache-2.0
firebitsbr/infernal-twin
build/reportlab/docs/userguide/graph_widgets.py
15
13527
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__=''' $Id$ ''' from tools.docco.rl_doc_utils import * from reportlab.graphics.shapes import * from reportlab.graphics.widgets import signsandsymbols heading2("Widgets") disc(""" We now describe widgets and how they relate to sha...
gpl-3.0
wskplho/sl4a
python/src/Lib/encodings/zlib_codec.py
533
3015
""" Python 'zlib_codec' Codec - zlib compression encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import zlib # this codec needs the optional zlib modu...
apache-2.0
chrislyon/dj_ds1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_string.py
37
6255
import unittest, string from test import support class ModuleTest(unittest.TestCase): def test_attrs(self): string.whitespace string.ascii_lowercase string.ascii_uppercase string.ascii_letters string.digits string.hexdigits string.octdigits string.p...
gpl-2.0
mkukielka/oddt
oddt/spatial.py
2
9648
"""Spatial functions included in ODDT Mainly used by other modules, but can be accessed directly. """ from math import sin, cos import numpy as np from scipy.spatial.distance import cdist # for Hungarian algorithm, in future use scipy.optimize.linear_sum_assignment (in scipy 0.17+) try: from scipy.optimize import...
bsd-3-clause
chenjun0210/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/forest_to_data_then_nn_test.py
159
3275
# 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
timothycrosley/WebBot
instant_templates/create_webbot_appengine/pygments/lexers/sql.py
16
23617
# -*- coding: utf-8 -*- """ pygments.lexers.sql ~~~~~~~~~~~~~~~~~~~ Lexers for various SQL dialects and related interactive sessions. Postgres specific lexers: `PostgresLexer` A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL lexer are: - keywords and dat...
gpl-2.0
pyblish/pyblish-win
lib/Python27/Lib/test/test_importlib.py
136
5766
import contextlib import imp import importlib import sys import unittest @contextlib.contextmanager def uncache(*names): """Uncache a module from sys.modules. A basic sanity check is performed to prevent uncaching modules that either cannot/shouldn't be uncached. """ for name in names: i...
lgpl-3.0
rebolinho/liveit.repository
plugin.video.LiveitKodi/resources/lib/js2py/host/dom/interface.py
97
1302
from StringIO import StringIO from constants import * from bs4 import BeautifulSoup from js2py.base import * try: import lxml def parse(source): return BeautifulSoup(source, 'lxml') except: def parse(source): return BeautifulSoup(source) x = '''<table> <tbody> <tr> <td>Sha...
gpl-2.0
40223226/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/reprlib.py
923
5110
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr", "repr", "recursive_repr"] import builtins from itertools import islice try: from _thread import get_ident except ImportError: from _dummy_thread import get_ident def recursive_repr(fillvalue='...'): 'Decorato...
gpl-3.0
adrianholovaty/django
django/core/files/uploadhandler.py
5
6968
""" Base file upload handler classes, and the built-in concrete subclasses """ from io import BytesIO from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.uploadedfile import TemporaryUploadedFile, InMemoryUploadedFile from django.utils import importlib __al...
bsd-3-clause
johncosta/private-readthedocs.org
readthedocs/rtd_tests/tests/view_tests.py
2
2838
from django.test import TestCase class Testmaker(TestCase): fixtures = ["eric"] def setUp(self): self.client.login(username='eric', password='test') def test_local_built_test(self): "A basic smoke test of creating a RTD Built projects" r = self.client.get('/', {}) self.as...
mit
mozilla/make.mozilla.org
vendor-local/lib/python/celery/tests/test_events/test_events_cursesmon.py
14
2650
from __future__ import absolute_import from nose import SkipTest from celery.tests.utils import Case class MockWindow(object): def getmaxyx(self): return self.y, self.x class TestCursesDisplay(Case): def setUp(self): try: import curses # noqa except ImportError: ...
bsd-3-clause
mjuric/LSSTC-DSFP-Sessions
Session1/Day2/ImageProcessing/myTests.py
2
1392
#!/usr/bin/env ipython import sys, unittest import numpy as np #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- class DotTestCase(unittest.TestCase): """A test fixture for numpy's dot products""" def setUp(self): """Establish our fixture""" n = 4 self.x...
mit
adjustive/dapp
thirdparty/temoa/temoa_model/__main__.py
1
1050
""" Tools for Energy Model Optimization and Analysis (Temoa): An open source framework for energy systems optimization modeling Copyright (C) 2015, NC State University 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 S...
gpl-3.0
pdl30/pynoncode
pynoncode/samtoucsc.py
1
2220
#!/usr/bin/python ######################################################################## # 20 Oct 2014 # Patrick Lombard, Centre for Stem Stem Research # Core Bioinformatics Group # University of Cambridge # All right reserved. ######################################################################## import argparse...
gpl-2.0
zhumengyuan/kallithea
kallithea/tests/models/test_diff_parsers.py
2
9219
from __future__ import with_statement from kallithea.tests import * from kallithea.lib.diffs import DiffProcessor, NEW_FILENODE, DEL_FILENODE, \ MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE from kallithea.tests.fixture import Fixture fixture = Fixture() DIFF_FIXTURES = { 'hg_...
gpl-3.0
valentin-krasontovitsch/ansible
lib/ansible/modules/storage/netapp/netapp_e_lun_mapping.py
27
11978
#!/usr/bin/python # (c) 2016, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
craigschmidt/rpy2-2.3.9
rpy/rpy_classic.py
6
8208
""" Implementation of RPy 1.x (for compatibility) """ import rpy2.rinterface as ri import array # RPY_VERSION = '1.x' # --- options in 'rpy_options.py' rpy_options = { 'RHOME':None, # R Installation Directory 'RVERSION':None, # R Version *string* 'RVER':None, # R Version *number* 'RU...
gpl-2.0
andialbrecht/runsqlrun
rsr/worksheet/editor.py
1
10388
import uuid import cairo from gi.repository import Gtk, GtkSource, Pango, GObject, Gdk, GLib import sqlparse from rsr.worksheet.completion import SqlKeywordProvider, DbObjectProvider class BaseEditor(GtkSource.View): """Basic, language-agnostic editor.""" def __init__(self, app, language=None): su...
mit
overtherain/scriptfile
software/googleAppEngine/lib/django_1_4/django/contrib/localflavor/ru/forms.py
89
2204
""" Russian-specific forms helpers """ from __future__ import absolute_import import re from django.contrib.localflavor.ru.ru_regions import RU_COUNTY_CHOICES, RU_REGIONS_CHOICES from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ phone_digits_re = re.compile(r...
mit
sumitsourabh/opencog
tests/python/old/test_util.py
52
1105
import util # run doctests import doctest doctest.testmod(util) from unittest import TestCase from mock import patch from opencog.atomspace import AtomSpace, TruthValue, Atom, Handle from opencog.atomspace import types, is_a, get_type, get_type_name class MiscUtilTest(TestCase): # we only need to test supporti...
agpl-3.0
kdart/pycopia3
QA/pycopia/QA/controller_cli.py
1
3376
#!/usr/bin/python # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab """ Command Interface for interacting with controllers. """ from pycopia import CLI from pycopia import IO from pycopia import UI class ConfiguratorShellCLI(CLI.GenericCLI): def _setup(self, obj, name): # Obtain host name directly from ...
apache-2.0
wcevans/grpc
src/python/grpcio_tests/tests/unit/framework/interfaces/face/_future_invocation_asynchronous_event_service.py
23
25112
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
mrpau/kolibri
kolibri/core/views.py
1
6750
from django.contrib.auth import logout from django.core.urlresolvers import reverse from django.http import Http404 from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import redirect from django.urls import is_valid_path from django.urls import translate_url from dja...
mit
Hellowlol/HTPC-Manager
libs/cherrypy/test/test_bus.py
17
9028
import threading import time import unittest import cherrypy from cherrypy._cpcompat import get_daemon, set from cherrypy.process import wspbus msg = "Listener %d on channel %s: %s." class PublishSubscribeTests(unittest.TestCase): def get_listener(self, channel, index): def listener(arg=None): ...
mit
pigeonflight/strider-plone
docker/appengine/lib/django-1.3/tests/regressiontests/forms/localflavor/ie.py
89
1629
from django.contrib.localflavor.ie.forms import IECountySelect from utils import LocalFlavorTestCase class IELocalFlavorTests(LocalFlavorTestCase): def test_IECountySelect(self): f = IECountySelect() out = u'''<select name="counties"> <option value="antrim">Antrim</option> <option value="armagh">...
mit
pgoeser/gnuradio
gr-pager/apps/usrp_rx_flex.py
25
17008
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: USRP FLEX Pager Receiver (Single Channel) # Generated: Thu Oct 29 11:03:16 2009 ################################################## from gnuradio import blks2 from gnuradio import eng_notation from gnuradio im...
gpl-3.0
mrmen/scriptsMaths
mathscripts/algebra/multiplication-decimaux-un-seul.py
1
1174
__author__ = 'mrmen' from TemplateExercice import * import random from decimal import * getcontext().prec = 2 class MultiplicationDecimaux(TemplateExercice): def __init__(self): TemplateExercice.__init__(self) self.min = 10 self.max = 500 self.generate() def generate(self)...
gpl-2.0
michaelni/audacity
lib-src/lv2/lv2/plugins/eg02-midigate.lv2/waflib/Tools/ldc2.py
330
1029
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import sys from waflib.Tools import ar,d from waflib.Configure import conf @conf def find_ldc2(conf): conf.find_program(['ldc2'],var='D') out=conf.cmd_and_log([conf.env.D,'-...
gpl-2.0
dhimmel/networkx
networkx/algorithms/operators/binary.py
30
9944
""" Operations on graphs including union, intersection, difference. """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx from networkx.utils import is_string_lik...
bsd-3-clause
jrleeman/MetPy
metpy/tests/test_units.py
1
8001
# Copyright (c) 2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause r"""Tests the operation of MetPy's unit support code.""" import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytest from metpy.testing import ...
bsd-3-clause
jonparrott/gcloud-python
logging/tests/unit/handlers/test_app_engine.py
2
5050
# Copyright 2016 Google LLC 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 ag...
apache-2.0
zhuyue1314/Empire
lib/modules/privesc/bypassuac_wscript.py
13
4049
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-WScriptBypassUAC', 'Author': ['@enigma0x3', '@harmyj0y', 'Vozzie'], 'Description': ("Drops wscript.exe and a custom manifest into C:\Windows " ...
bsd-3-clause