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
akintoey/django
tests/admin_inlines/admin.py
293
5354
from django import forms from django.contrib import admin from .models import ( Author, BinaryTree, CapoFamiglia, Chapter, ChildModel1, ChildModel2, Consigliere, EditablePKBook, ExtraTerrestrial, Fashionista, Holder, Holder2, Holder3, Holder4, Inner, Inner2, Inner3, Inner4Stacked, Inner4Tabular, NonAut...
bsd-3-clause
bowang/tensorflow
tensorflow/contrib/estimator/python/estimator/dnn_test.py
32
5283
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
atsolakid/edx-platform
common/djangoapps/enrollment/api.py
11
14766
""" Enrollment API for creating, updating, and deleting enrollments. Also provides access to enrollment information at a course level, such as available course modes. """ from django.utils import importlib import logging from django.conf import settings from django.core.cache import cache from enrollment import errors...
agpl-3.0
windyuuy/opera
chromium/src/third_party/python_26/Lib/encodings/cp1254.py
593
13758
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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,in...
bsd-3-clause
skyfromwell/paperwallet
encryption.py
1
1425
#remove all others only keep Bip38 here. Need to learn more about this. from bitcoin.bip38 import Bip38 from bitcoin.key import CKey from bitcoin.base58 import CBase58Data __b58chars = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" __b58base = len(__b58chars) def encode_pw(key, pw): key = CKey() ...
gpl-3.0
UltronAI/Deep-Learning
Pattern-Recognition/hw2-Feature-Selection/skfeature/example/test_JMI.py
1
1528
import scipy.io from sklearn.metrics import accuracy_score from sklearn import cross_validation from sklearn import svm from skfeature.function.information_theoretical_based import JMI def main(): # load data mat = scipy.io.loadmat('../data/colon.mat') X = mat['X'] # data X = X.astype(fl...
mit
scott-eddy/mavlink
pymavlink/examples/mavtester.py
43
1145
#!/usr/bin/env python ''' test mavlink messages ''' import sys, struct, time, os from curses import ascii from pymavlink import mavtest, mavutil from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--baudrate", type=int, help="master port baud rate...
lgpl-3.0
noba3/KoTos
addons/plugin.video.rtl2-now.de/resources/lib/kodion/utils/function_cache.py
4
3125
from functools import partial import hashlib import datetime from storage import Storage class FunctionCache(Storage): ONE_MINUTE = 60 ONE_HOUR = 60 * ONE_MINUTE ONE_DAY = 24 * ONE_HOUR ONE_WEEK = 7 * ONE_DAY ONE_MONTH = 4 * ONE_WEEK def __init__(self, filename, max_file_size_kb=-1): ...
gpl-2.0
naterh/chipsec
source/tool/chipsec/hal/cpuid.py
1
1845
#!/usr/local/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2015, Intel Corporation # #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; Version 2. # #This pr...
gpl-2.0
kevinastone/sentry
src/sentry/migrations/0152_auto__add_field_file_checksum__chg_field_file_name__add_unique_file_na.py
36
32982
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'File.checksum' db.add_column('sentry_file', 'checksum', ...
bsd-3-clause
chenss/ChatRoom
14.5 已经能运行(虽然有很多Warning)的Django-nonrel框架/django/core/files/base.py
235
3888
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.utils.encoding import smart_str, smart_unicode from django.core.files.utils import FileProxyMixin class File(FileProxyMixin): DEFAULT_CHUNK_SIZE = 64 * 2**10 def __init__(self, file, name=None)...
gpl-2.0
carrdelling/project_euler
problem17.py
1
1728
#!/usr/bin/env python ################################################################################ # # Project Euler - Problem 17 # # If the numbers 1 to 5 are written out in words: one, two, three, four, five, # then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. # # If all the numbers from 1 to 1000 (on...
gpl-2.0
2014c2g2/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/pkgdata.py
603
2146
"""pkgdata is a simple, extensible way for a package to acquire data file resources. The getResource function is equivalent to the standard idioms, such as the following minimal implementation:: import sys, os def getResource(identifier, pkgname=__name__): pkgpath = os.path.dirname(sys.modules[p...
gpl-3.0
azureplus/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/sessions/middleware.py
215
2031
import time from django.conf import settings from django.utils.cache import patch_vary_headers from django.utils.http import cookie_date from django.utils.importlib import import_module class SessionMiddleware(object): def process_request(self, request): engine = import_module(settings.SESSION_ENGINE) ...
apache-2.0
zhou533/shadowsocks
shadowsocks/shell.py
270
12676
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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 b...
apache-2.0
yetsky/extra
packages/my-application/python-all/files/usr/lib/python2.7/encodings/iso2022_jp_2.py
816
1061
# # iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
gpl-2.0
aceway/cppite
src/py/cppite.py
1
13042
#!/usr/bin/env python # -*- coding:utf-8 -*- ######################################################## # ITE command start with: #// # ITE command keywords:quit,exit,byebye,bye, begin, end, # verbose, concise, dump_project, dump_make_file, dump_cpp, # dump_fragment,load_fragment, compile, run, edit # ##################...
mit
jimmy-ren/RPN2T
external/_caffe/scripts/copy_notebook.py
75
1089
#!/usr/bin/env python """ Takes as arguments: 1. the path to a JSON file (such as an IPython notebook). 2. the path to output file If 'metadata' dict in the JSON file contains 'include_in_docs': true, then copies the file to output file, appending the 'metadata' property as YAML front-matter, adding the field 'categor...
mit
bussiere/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/json/tests/test_pass1.py
37
1967
from json.tests import PyTest, CTest # from http://json.org/JSON_checker/test/pass1.json JSON = r''' [ "JSON Test Pattern pass1", {"object with 1 member":["array with 1 element"]}, {}, [], -42, true, false, null, { "integer": 1234567890, "real": -9876.543210, ...
mit
bdh1011/wau
venv/lib/python2.7/site-packages/notebook/services/kernelspecs/handlers.py
1
2798
"""Tornado handlers for kernel specifications. Preliminary documentation at https://github.com/ipython/ipython/wiki/IPEP-25%3A-Registry-of-installed-kernels#rest-api """ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import glob import json import os pjoin = os.p...
mit
Ritsyy/fjord
vendor/packages/requests-2.7.0/requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
bsd-3-clause
stamhe/zulip
api/zulip/__init__.py
115
17705
# -*- coding: utf-8 -*- # Copyright © 2012-2014 Zulip, Inc. # # 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...
apache-2.0
hljyunxi/clearsilver
cdbi/ab_db.py
9
3105
import MySQLdb from hdfhelp import HdfRow, HdfItemList from odb import * class ABPeopleTable(Table): def _defineRows(self): self.d_addColumn("person_id", kInteger, primarykey = 1, autoincrement = 1) self.d_addColumn("fullname", kVarString, 255) self.d_addColumn("first_name", kVarString, 50) self.d_...
bsd-2-clause
tedder/ansible
lib/ansible/modules/storage/netapp/na_ontap_volume_clone.py
22
6867
#!/usr/bin/python # (c) 2018-2019, 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
Senseg/Py4A
python3-alpha/python3-src/Lib/unittest/util.py
794
4157
"""Various utility functions.""" from collections import namedtuple, OrderedDict __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 ...
apache-2.0
ShoRit/shipping-costs-sample
v2/lib/python2.7/site-packages/packaging/requirements.py
140
4271
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pyparsing import stringStart, stringEnd, ori...
apache-2.0
taliax/easybuild-easyblocks
easybuild/easyblocks/p/psi.py
12
7596
## # Copyright 2013-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
loongson-community/EFI-MIPS
ToolKit/cmds/python/Lib/encodings/iso8859_4.py
15
4105
""" Python Character Mapping Codec generated from '8859-4.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,erro...
bsd-3-clause
courtneypresto/googletest
test/gtest_xml_output_unittest.py
1815
14580
#!/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
GdZ/scriptfile
software/googleAppEngine/google/appengine/_internal/django/core/management/commands/startproject.py
23
1734
from google.appengine._internal.django.core.management.base import copy_helper, CommandError, LabelCommand from google.appengine._internal.django.utils.importlib import import_module import os import re from random import choice class Command(LabelCommand): help = "Creates a Django project directory structure for ...
mit
edcast-inc/edx-platform-edcast
openedx/core/djangoapps/user_api/migrations/0004_auto__add_userorgtag__add_unique_userorgtag_user_org_key__chg_field_us.py
114
7274
# -*- 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 model 'UserOrgTag' db.create_table('user_api_userorgtag', ( ('id', self.gf('django.db.m...
agpl-3.0
hmpf/nav
python/nav/metrics/data.py
2
8012
# # Copyright (C) 2013 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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 hope...
gpl-3.0
annarev/tensorflow
tensorflow/python/keras/layers/advanced_activations_test.py
2
5240
# 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
Lujeni/ansible
lib/ansible/modules/network/fortios/fortios_firewall_vip46.py
13
19391
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
aronsky/home-assistant
homeassistant/components/scene/__init__.py
2
3231
""" Allow users to set and activate scenes. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scene/ """ import asyncio import importlib import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_...
apache-2.0
horance-liu/tensorflow
tensorflow/python/keras/applications/xception/__init__.py
74
1142
# 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
ice9js/servo
tests/wpt/harness/wptrunner/executors/executorservo.py
6
9372
# 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 base64 import hashlib import json import os import subprocess import tempfile import threading import urlparse im...
mpl-2.0
javachengwc/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Signature/test_pkcs1_pss.py
113
20598
# -*- coding: utf-8 -*- # # SelfTest/Signature/test_pkcs1_pss.py: Self-test for PKCS#1 PSS signatures # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyon...
apache-2.0
girving/tensorflow
tensorflow/python/kernel_tests/edit_distance_op_test.py
139
8145
# 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
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/scons-2.3.1/SCons/Tool/rmic.py
8
4446
"""SCons.Tool.rmic Tool-specific initialization for rmic. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 ...
gpl-2.0
Dklotz-Circle/security_monkey
security_monkey/watchers/rds_security_group.py
14
4926
# Copyright 2014 Netflix, 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...
apache-2.0
pythondigest/pythondigest
digest/forms.py
1
3789
# -*- encoding: utf-8 -*- from ckeditor.widgets import CKEditorWidget, json_encode from django import forms from django.contrib import admin from django.contrib.admin import widgets from django.contrib.admin.options import get_ul_class from django.forms import ChoiceField, ModelForm from django.template.loader import r...
mit
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/django_extensions/management/commands/mail_debug.py
27
2924
import asyncore import sys from logging import getLogger from optparse import make_option from smtpd import SMTPServer from django.core.management.base import BaseCommand, CommandError from django_extensions.management.utils import setup_logger, signalcommand logger = getLogger(__name__) class ExtensionDebuggingSe...
agpl-3.0
rksaxena/hacker_ramp
find_overlap.py
1
8043
import tags import difflib import json vogue_data = {'foundation': ['Mousse Foundation'], 'chain': ['chain'], 'corset': ['closet'], 'tops': ['jersey top'], 'misc': ['everyday heavy duty makeup', 'minimum', 'gallery', 'place', 'heart-wrenching classic', 'blends', 'midway', 'high level', 'fashionista', 'heart-wrenching ...
apache-2.0
janocat/odoo
addons/account_asset/wizard/__init__.py
445
1122
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
Dzerard/cms
public/js/three/utils/exporters/blender/2.66/scripts/addons/io_mesh_threejs/export_threejs.py
5
74848
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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) any later version. # # This program is distrib...
bsd-3-clause
aio-libs/aiomysql
tests/test_cursor.py
1
9444
import asyncio import pytest from aiomysql import ProgrammingError, Cursor, InterfaceError async def _prepare(conn): cur = await conn.cursor() await cur.execute("DROP TABLE IF EXISTS tbl;") await cur.execute("""CREATE TABLE tbl ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name VARC...
mit
benthomasson/ansible
lib/ansible/utils/module_docs_fragments/backup.py
427
1071
# Copyright (c) 2015 Ansible, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansi...
gpl-3.0
davipeterlini/routeflow_tcc
rfserver/rfserver.py
2
21060
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import logging import binascii import threading import time import argparse from bson.binary import Binary import rflib.ipc.Ipc as Ipc import rflib.ipc.MongoIpc as MongoIpc from rflib.ipc.RFProtocol import * from rflib.defs import * from rflib.types.Match import...
apache-2.0
vipul-sharma20/oh-mainline
vendor/packages/gdata/tests/gdata_tests/apps_test.py
128
22040
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, 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 appli...
agpl-3.0
MDAnalysis/mdanalysis
package/MDAnalysis/analysis/__init__.py
1
1421
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
gpl-2.0
sjperkins/tensorflow
tensorflow/python/framework/errors_impl.py
59
14885
# 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
MphasisWyde/eWamSublimeAdaptor
src/third-party/requests/packages/chardet/sjisprober.py
1777
3764
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
redebian/documentation
django/conf/__init__.py
146
6707
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import os import re import time # Needed for Windows import...
bsd-3-clause
bootandy/sqlalchemy
examples/dogpile_caching/advanced.py
30
2950
"""advanced.py Illustrate usage of Query combined with the FromCache option, including front-end loading, cache invalidation and collection caching. """ from .environment import Session from .model import Person, cache_address_bits from .caching_query import FromCache, RelationshipCache def load_name_range(start, e...
mit
MrMinimal64/timezonefinder
build_n_install.py
1
1317
import os import sys PACKAGE = 'timezonefinder' VERSION_FILE = 'VERSION' VIRT_ENVS = ['APIenv'] VIRT_ENV_COMMAND = '. ~/miniconda3/etc/profile.d/conda.sh; conda activate {virt_env}; ' PY_VERSION_IDS = ['36', '37', '38'] # the supported python versions to create wheels for PYTHON_TAG = '.'.join([f'py{v}' for v in PY_...
mit
tchellomello/home-assistant
homeassistant/components/iota/__init__.py
10
1974
"""Support for IOTA wallets.""" from datetime import timedelta import logging from iota import Iota import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import load_platform from homeassistant.helpers.entity import Entity _LOGGER = logging.getLogger(__nam...
apache-2.0
Sendoushi/servo
tests/wpt/web-platform-tests/tools/py/testing/path/test_svnauth.py
163
16079
import py import svntestbase from py.path import SvnAuth import time import sys svnbin = py.path.local.sysfind('svn') def make_repo_auth(repo, userdata): """ write config to repo user information in userdata is used for auth userdata has user names as keys, and a tuple (password, readwrite) as ...
mpl-2.0
paweljasinski/ironpython3
Src/Scripts/test_parrot.py
3
2303
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of t...
apache-2.0
tow/sunburnt
sunburnt/strings.py
5
1655
from __future__ import absolute_import class SolrString(unicode): # The behaviour below is only really relevant for String fields rather # than Text fields - most queryparsers will strip these characters out # for a text field anyway. lucene_special_chars = '+-&|!(){}[]^"~*?: \t\v\\/' def escape_f...
mit
nuclearmistake/repo
git_config.py
3
21602
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
ligovirgo/seismon
RfPrediction/BLRMS_Prediction/condor_seismic_peaks.py
1
1969
import os, sys import glob import optparse import tables import pandas as pd import numpy as np import h5py def parse_commandline(): """ Parse the options given on the command-line. """ parser = optparse.OptionParser() parser.add_option('-i','--ifos', type=str, default='LHO,LLO', help='GW Obser...
gpl-3.0
promptworks/keystone
keystone/common/kvs/backends/inmemdb.py
26
1902
# Copyright 2013 Metacloud, 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 writ...
apache-2.0
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/cp863.py
593
34508
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.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_map) def decode(self,input,errors='strict'): ...
gpl-2.0
ptphp/PyLib
src/webpy1/src/fetchtel/fetch99tel.py
2
1894
# coding=utf-8 import sys,re import urllib2,urllib,sys,socket,re from PyQt4.QtCore import * import urllib,time from BeautifulSoup import BeautifulSoup reload(sys) sys.setdefaultencoding('utf-8') #@UndefinedVariable class baseSpider(QThread): def __init__(self,parent = None): super(baseSpider,self).__ini...
apache-2.0
TalShafir/ansible
test/units/modules/network/nxos/test_nxos_ospf.py
45
2043
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
procangroup/edx-platform
common/lib/xmodule/xmodule/tests/test_annotator_mixin.py
223
1932
""" This test will run for annotator_mixin.py """ import unittest from lxml import etree from xmodule.annotator_mixin import get_instructions, get_extension, html_to_text class HelperFunctionTest(unittest.TestCase): """ Tests to ensure that the following helper functions work for the annotation tool """...
agpl-3.0
lepinsk/pydub
setup.py
1
1425
__doc__ = """ Manipulate audio with an simple and easy high level interface. See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='pydub', version='0.9.0', author='James Robert', author_email='jiaaro@gmail.com', description='Manipulate a...
mit
Jeongseob/xen-coboost-sched
tools/python/xen/xend/XendBootloader.py
35
7321
# # XendBootloader.py - Framework to run a boot loader for picking the kernel # # Copyright 2005-2006 Red Hat, Inc. # Jeremy Katz <katzj@redhat.com> # # This software may be freely redistributed under the terms of the GNU # general public license. # # You should have received a copy of the GNU General Public License # ...
gpl-2.0
dennisss/sympy
sympy/mpmath/libmp/gammazeta.py
17
78631
""" ----------------------------------------------------------------------- This module implements gamma- and zeta-related functions: * Bernoulli numbers * Factorials * The gamma function * Polygamma functions * Harmonic numbers * The Riemann zeta function * Constants related to these functions ----------------------...
bsd-3-clause
jsma/django-cms
cms/models/permissionmodels.py
3
9908
# -*- coding: utf-8 -*- from django.apps import apps from django.db import models from django.conf import settings from django.contrib.auth.models import Group, UserManager from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured, ValidationError from django.utils.encoding im...
bsd-3-clause
raincoatrun/basemap
examples/testgdal.py
4
2655
""" example showing how to plot data from a DEM file and an ESRI shape file using gdal (http://pypi.python.org/pypi/GDAL). """ from osgeo import gdal, ogr from mpl_toolkits.basemap import Basemap, cm import numpy as np import matplotlib.pyplot as plt from numpy import ma # read 2.5 minute U.S. DEM file using gdal. # ...
gpl-2.0
jmartinm/invenio
modules/websubmit/lib/websubmitadmin_templates.py
34
182346
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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 ## ...
gpl-2.0
cucumber/cucumber
gherkin/python/gherkin/pickles/compiler.py
2
6970
import re from ..count_symbols import count_symbols from ..stream.id_generator import IdGenerator class Compiler(object): def __init__(self, id_generator=None): self.id_generator = id_generator if self.id_generator is None: self.id_generator = IdGenerator() def compile(self, gher...
mit
timsnyder/bokeh
bokeh/sampledata/unemployment.py
2
2473
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
sils1297/coala
tests/bearlib/languages/documentation/DocstyleDefinitionTest.py
2
6077
import os.path from tempfile import TemporaryDirectory import unittest from unittest.mock import patch from coalib.bearlib.languages.documentation.DocstyleDefinition import ( DocstyleDefinition) class DocstyleDefinitionTest(unittest.TestCase): Metadata = DocstyleDefinition.Metadata dummy_metadata = Meta...
agpl-3.0
Charlotte-Morgan/inasafe
safe/gui/tools/wizard/test/test_wizard_dialog_locale.py
6
10273
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **GUI Test Cases for Wizard in Local mode.** Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as ...
gpl-3.0
salguarnieri/intellij-community
python/testData/inspections/PyShadowingBuiltinsInspection/test.py
69
1483
def test_import_builtin_names(): import float from foo import float from bar import baz as <weak_warning descr="Shadows built-in name 'float'">float</weak_warning> def test_builtin_function_parameters(): def test1(x, _, <weak_warning descr="Shadows built-in name 'len'">len</weak_warning>, <weak_warnin...
apache-2.0
vicky2135/lucious
oscar/lib/python2.7/encodings/mac_croatian.py
593
13889
""" Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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,inp...
bsd-3-clause
maciekcc/tensorflow
tensorflow/contrib/remote_fused_graph/pylib/__init__.py
96
1290
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
d0ugal/django-rest-framework
rest_framework/urlpatterns.py
27
2421
from __future__ import unicode_literals from django.conf.urls import url, include from django.core.urlresolvers import RegexURLResolver from rest_framework.settings import api_settings def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required): ret = [] for urlpattern in urlpatterns: if i...
bsd-2-clause
big-pegasus/spark
examples/src/main/python/ml/gradient_boosted_tree_regressor_example.py
122
2693
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
szymex/xbmc-finnish-tv
plugin.video.yleareena/win32/Crypto/SelfTest/Protocol/test_chaffing.py
120
2972
# # Test script for Crypto.Protocol.Chaffing # # Part of the Python Cryptography Toolkit # # Written by Andrew Kuchling and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain...
gpl-3.0
faddat/linux
tools/perf/scripts/python/failed-syscalls-by-pid.py
1996
2233
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
IronLanguages/ironpython3
Src/StdLib/Lib/ctypes/test/test_objects.py
80
1682
r''' This tests the '_objects' attribute of ctypes instances. '_objects' holds references to objects that must be kept alive as long as the ctypes instance, to make sure that the memory buffer is valid. WARNING: The '_objects' attribute is exposed ONLY for debugging ctypes itself, it MUST NEVER BE MODIFIED! '_object...
apache-2.0
yamt/tempest
tempest/api/compute/servers/test_servers.py
5
5503
# 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
ROMFactory/android_external_chromium_org
tools/site_compare/scrapers/chrome/chrome01970.py
189
1181
# Copyright (c) 2011 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. """Does scraping for versions of Chrome up to 0.1.97.0.""" from drivers import windowing import chromebase # Default version version = "0.1.97.0" de...
bsd-3-clause
mitsuhiko/django
django/contrib/gis/utils/geoip.py
316
14811
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geolocation, t...
bsd-3-clause
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/reprlib.py
19
5267
"""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='...'): ...
gpl-2.0
keenondrums/sovrin-node
sovrin_client/agent/endpoint.py
1
2195
from typing import Callable from plenum import config from plenum.common.message_processor import MessageProcessor from stp_core.common.log import getlogger from stp_core.network.auth_mode import AuthMode from stp_raet.util import getHaFromLocalEstate from plenum.common.util import randomString from stp_core.crypto.u...
apache-2.0
scotthartbti/android_external_chromium_org
content/test/gpu/page_sets/PRESUBMIT.py
27
2657
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re import sys # Avoid leaking changes to global sys.path. _old_sys_path = sys.path try: telemetry_dir = os.path.abspath(os.path.join( ...
bsd-3-clause
almeidapaulopt/erpnext
erpnext/accounts/report/non_billed_report.py
40
1801
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from erpnext import get_default_currency from frappe.model.meta import get_field_precision def get_ordered_to_be_billed_data...
gpl-3.0
ltucker/radarpost
radarpost/commands/useradmin.py
1
4133
from couchdb import Server, ResourceNotFound from radarpost.cli import COMMANDLINE_PLUGIN, BasicCommand, get_basic_option_parser from radarpost import plugins from radarpost.user import User, ROLE_ADMIN from getpass import getpass class CreateUserCommand(BasicCommand): command_name = 'create_user' description...
gpl-2.0
cecep-edu/edx-platform
common/lib/xmodule/xmodule/tests/__init__.py
61
27865
""" unittests for xmodule Run like this: paver test_lib -l common/lib/xmodule """ import inspect import json import os import pprint import sys import traceback import unittest from contextlib import contextmanager, nested from functools import wraps from lazy import lazy from mock import Mock, patch from oper...
agpl-3.0
quarckster/cfme_tests
fixtures/datafile.py
5
4048
import os import pytest from fixtures.terminalreporter import reporter from cfme.utils.datafile import data_path_for_filename, load_data_file from cfme.utils.path import data_path, log_path # Collection for storing unique combinations of data file paths # and filenames for usage reporting after a completed test run ...
gpl-2.0
hvos234/raspberrypi.home.website
vendor/Adafruit_Python_DHT/Adafruit_DHT/Test.py
18
1571
# Copyright (c) 2014 Adafruit Industries # Author: Tony DiCola # 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, mo...
bsd-3-clause
claudio-idra/subterfuge
sslstrip/StrippingProxy.py
108
1244
# Copyright (c) 2004-2009 Moxie Marlinspike # # 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 distri...
gpl-3.0
dagwieers/ansible
lib/ansible/modules/network/a10/a10_virtual_server.py
18
11184
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Mischa Peters <mpeters@a10networks.com>, # Eric Chou <ericc@a10networks.com> # # 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__ = t...
gpl-3.0
redhat-openstack/django
tests/custom_pk/fields.py
115
1628
import random import string from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (sel...
bsd-3-clause
degs098/python-social-auth
social/tests/backends/test_xing.py
92
6199
import json from social.p3 import urlencode from social.tests.backends.oauth import OAuth1Test class XingOAuth1Test(OAuth1Test): backend_path = 'social.backends.xing.XingOAuth' user_data_url = 'https://api.xing.com/v1/users/me.json' expected_username = 'FooBar' access_token_body = json.dumps({ ...
bsd-3-clause