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
CoderBotOrg/coderbotsrv
server/lib/setuptools/__init__.py
114
5440
"""Extensions to the 'distutils' for large or complex distributions""" import os import functools import distutils.core import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path from fnmatch import fnmatchcase from setuptools.extern.six.moves import filterfalse, ...
gpl-3.0
hargup/sympy
sympy/physics/quantum/qft.py
6
6300
"""An implementation of qubits and gates acting on them. Todo: * Update docstrings. * Update tests. * Implement apply using decompose. * Implement represent using decompose or something smarter. For this to work we first have to implement represent for SWAP. * Decide if we want upper index to be inclusive in the co...
bsd-3-clause
dyn888/youtube-dl
youtube_dl/extractor/freespeech.py
165
1226
from __future__ import unicode_literals import re import json from .common import InfoExtractor class FreespeechIE(InfoExtractor): IE_NAME = 'freespeech.org' _VALID_URL = r'https://www\.freespeech\.org/video/(?P<title>.+)' _TEST = { 'add_ie': ['Youtube'], 'url': 'https://www.freespeech.o...
unlicense
chenjun0210/tensorflow
tensorflow/contrib/distributions/python/ops/normal_conjugate_posteriors.py
27
5551
# 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
dc3-plaso/plaso
tests/parsers/sqlite.py
1
4450
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the SQLite database parser.""" import sys import unittest from plaso.parsers import sqlite # Register all plugins. from plaso.parsers import sqlite_plugins # pylint: disable=unused-import from tests import test_lib as shared_test_lib from tests.parsers import t...
apache-2.0
andrewfu0325/gem5-aladdin
tests/configs/realview64-minor-dual.py
33
2393
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
zhxiaohe/starsea
cmdb-front/run.py
1
1344
from flask import Flask,jsonify,render_template,request app = Flask(__name__) class aa(object): def js(self,data='hellow'): return data @app.route('/login') def login(): return render_template('login.html') @app.route('/index') def index(): return render_template('index.html') @app.route('/',m...
mit
aas-integration/integration-test
inv_check/inv_check.py
1
2960
import sys, os import subprocess import traceback import urllib import zipfile WORKING_DIR = os.path.dirname(os.path.realpath(__file__)) daikon_jar = os.path.join(WORKING_DIR, '..', 'libs', "daikon.jar") DAIKON_SPLITTER = "=====================" sys.path.insert(0, os.path.abspath(os.path.join(WORKING_DIR, '..'))) im...
mit
RealP/Everpy
everpy_utilities.py
1
1132
"""Some generic utilties.""" import keyring import getpass import re UN = "everpy" def refresh_token(): """Set new token.""" print("Set a new a token") keyring.set_password(UN, UN, getpass.getpass("Password: ")) return keyring.get_password(UN, UN) def get_token(): """Get a token.""" dev_tok...
gpl-3.0
razvanphp/arangodb
3rdParty/V8-3.31.74.1/third_party/python_26/Lib/sre_compile.py
61
16507
# # Secret Labs' Regular Expression Engine # # convert template to internal format # # Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" import _sre, sys import sre_parse from sre_constants impo...
apache-2.0
tobymccann/flask-base
app/__init__.py
1
2570
import os from celery import Celery from flask import Flask from flask_assets import Environment from flask_compress import Compress from flask_login import LoginManager from flask_mail import Mail from flask_rq import RQ from flask_sqlalchemy import SQLAlchemy from flask_wtf import CSRFProtect from config import confi...
mit
gojira/tensorflow
tensorflow/contrib/training/python/training/resample.py
39
5844
# 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
destenson/bitcoin--bitcoin
test/functional/rpcbind_test.py
2
4806
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test running bitcoind with the -rpcbind and -rpcallowip options.""" import socket import sys from tes...
mit
buntyke/GPy
GPy/examples/regression.py
8
18746
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) """ Gaussian Processes regression examples """ try: from matplotlib import pyplot as pb except: pass import numpy as np import GPy def olympic_marathon_men(optimize=True, plot=True): """Ru...
mit
reinout/django
tests/forms_tests/field_tests/test_typedmultiplechoicefield.py
106
3520
import decimal from django.forms import TypedMultipleChoiceField, ValidationError from django.test import SimpleTestCase class TypedMultipleChoiceFieldTest(SimpleTestCase): def test_typedmultiplechoicefield_1(self): f = TypedMultipleChoiceField(choices=[(1, "+1"), (-1, "-1")], coerce=int) self.a...
bsd-3-clause
ESS-LLP/erpnext
erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py
6
5093
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json from frappe import _ from frappe.model.document import Document from frappe.utils import get_request_session f...
gpl-3.0
aayushkapoor206/whatshot
node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
1366
120842
# Copyright (c) 2012 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
apache-2.0
varunagrawal/azure-services
varunagrawal/site-packages/django/template/loader.py
83
7886
# Wrapper for loading templates from storage of some sort (e.g. filesystem, database). # # This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use. # Each loader is expected to have this interface: # # callable(name, dirs=[]) # # name is the template name. # dirs is an optional list of directories ...
gpl-2.0
skycucumber/restful
python/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library 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 # versio...
gpl-2.0
brianwoo/django-tutorial
ENV/lib/python2.7/site-packages/django/core/serializers/base.py
181
6813
""" Module for abstract serializer/unserializer base classes. """ import warnings from django.db import models from django.utils import six from django.utils.deprecation import RemovedInDjango19Warning class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class Serializ...
gpl-3.0
kenshinthebattosai/readthedocs.org
readthedocs/oauth/models.py
24
5108
from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from .managers import BitbucketTeamManager from .managers import BitbucketProjectManager from .managers import GithubOrganizationManager from .managers import GithubProjectManager class Gi...
mit
nikste/tensorflow
tensorflow/contrib/learn/python/learn/estimators/logistic_regressor_test.py
18
5128
# 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
hernad/erpnext
erpnext/setup/page/setup_wizard/fixtures/industry_type.py
32
1044
from frappe import _ items = [ _('Accounting'), _('Advertising'), _('Aerospace'), _('Agriculture'), _('Airline'), _('Apparel & Accessories'), _('Automotive'), _('Banking'), _('Biotechnology'), _('Broadcasting'), _('Brokerage'), _('Chemical'), _('Computer'), _('Consulting'), _('Consumer Products'), _('Cosmetics'), _('D...
agpl-3.0
BRD-CD/superset
superset/migrations/versions/27ae655e4247_make_creator_owners.py
9
1933
"""Make creator owners Revision ID: 27ae655e4247 Revises: d8bc074f7aad Create Date: 2016-06-27 08:43:52.592242 """ # revision identifiers, used by Alembic. revision = '27ae655e4247' down_revision = 'd8bc074f7aad' from alembic import op from superset import db from sqlalchemy.ext.declarative import declarative_base ...
apache-2.0
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/email/mime/image.py
573
1764
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing image/* type MIME documents.""" __all__ = ['MIMEImage'] import imghdr from email import encoders from email.mime.nonmultipart import MIMENonMultipart class MIMEImage(MIMENonMultipart...
gpl-2.0
rajendrant/bitsy_python
bitsy_python_bytecodegen/bitstring.py
1
166005
#!/usr/bin/env python """ Copied from https://github.com/scott-griffiths/bitstring Thanks to Scott Griffiths """ """ This package defines classes that simplify bit-wise creation, manipulation and interpretation of data. Classes: Bits -- An immutable container for binary data. BitArray -- A mutable container for binar...
gpl-3.0
JaviMerino/trappy
tests/test_base.py
2
8443
# Copyright 2015-2016 ARM Limited # # 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 w...
apache-2.0
betterclever/susi_hardware
main/renderer/configuration_window.py
2
8711
import os from pathlib import Path import gi import logging from gi.repository import Gtk import json_config from .login_window import LoginWindow TOP_DIR = os.path.dirname(os.path.abspath(__file__)) config = json_config.connect('config.json') gi.require_version('Gtk', '3.0') class WatsonCredentialsDialog(Gtk.Dia...
apache-2.0
realsaiko/odoo
addons/l10n_fr_rib/__openerp__.py
425
2754
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
orlammd/Sebkha-Chott_Setup
Mididings/pbtest.py
1
64206
# coding=utf8 from mididings import * from mididings.extra.osc import OSCInterface from mididings.extra.inotify import AutoRestart from mididings.extra.osc import SendOSC from customosc import OSCCustomInterface import liblo config( backend='alsa', client_name='PedalBoardsRoutes', out_ports=['PBseq24', 'PBAMSBass...
gpl-2.0
westurner/pbm
pbm/plugins/chromefolder.py
1
1239
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import pbm.plugins import pbm.utils class ChromeFolderPlugin(pbm.plugins.PromiumPlugin): folder_name = 'chrome' urls = [ "chrome://bookmarks", "chrome://history", "chrome://extensions", "chrome:...
bsd-3-clause
flinz/nest-simulator
doc/nest_by_example/scripts/brunel2000_rand_plastic.py
4
7508
# -*- coding: utf-8 -*- # # brunel2000_rand_plastic.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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
Yannig/ansible-modules-extras
system/zfs.py
67
14130
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Johan Wiren <johan.wiren.se@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of th...
gpl-3.0
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/tools/telemetry/telemetry/core/chrome/desktop_browser_finder_unittest.py
29
6927
# Copyright (c) 2012 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 unittest from telemetry.core import browser_options from telemetry.core.chrome import desktop_browser_finder from telemetry.unittest import system...
apache-2.0
BeiLuoShiMen/nupic
examples/opf/experiments/multistep/first_order_0/description.py
32
1659
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
sandeepgupta2k4/tensorflow
tensorflow/contrib/framework/python/ops/variables_test.py
62
53472
# 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
havard024/prego
crm/lib/python2.7/site-packages/django/contrib/comments/feeds.py
223
1037
from django.contrib.syndication.views import Feed from django.contrib.sites.models import get_current_site from django.contrib import comments from django.utils.translation import ugettext as _ class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def __call__(self, request, *args,...
mit
MonicaHsu/truvaluation
venv/lib/python2.7/xml/sax/expatreader.py
82
14675
""" SAX driver for the pyexpat C module. This driver works with pyexpat.__version__ == '2.22'. """ version = "0.20" from xml.sax._exceptions import * from xml.sax.handler import feature_validation, feature_namespaces from xml.sax.handler import feature_namespace_prefixes from xml.sax.handler import feature_external_...
mit
Stanford-Online/edx-platform
lms/djangoapps/grades/migrations/0012_computegradessetting.py
26
1184
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('grades',...
agpl-3.0
hsiaoyi0504/scikit-learn
examples/ensemble/plot_bias_variance.py
357
7324
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
bsd-3-clause
ubirch/aws-tools
virtual-env/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py
317
6189
import base64 import io import json import zlib from pip._vendor.requests.structures import CaseInsensitiveDict from .compat import HTTPResponse, pickle def _b64_encode_bytes(b): return base64.b64encode(b).decode("ascii") def _b64_encode_str(s): return _b64_encode_bytes(s.encode("utf8")) def _b64_decode...
apache-2.0
RyanNoelk/ClanLadder
MatchHistory/protocols/protocol27950.py
21
27047
# Copyright (c) 2013 Blizzard Entertainment # # 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, publi...
mit
diegoguimaraes/django
docs/_ext/djangodocs.py
37
12050
""" Sphinx plugins for Django documentation. """ import json import os import re from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes, __version__ as sphinx_ver from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.writers.html import SmartyPantsHTMLTranslato...
bsd-3-clause
domino-team/openwrt-cc
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/.ycm_extra_conf.py
18
5867
# Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Autocompletion config for YouCompleteMe in V8. # # USAGE: # # 1. Install YCM [https://github.com/Valloric/YouCompleteMe] # (Googlers should ch...
gpl-2.0
sparkslabs/kamaelia_
Sketches/RJL/bittorrent/BitTorrent/BitTorrent/__init__.py
4
2855
# -*- coding: UTF-8 -*- # The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/l...
apache-2.0
dgrant/brickowl2rebrickable
tests/test_brickowl.py
1
5780
import json import unittest from mock import Mock, MagicMock, patch, call import low_level import brickowl class TestBrickOwl(unittest.TestCase): @patch('rebrickable.Rebrickable') @patch('low_level.do_http_get') def test_fetch_order(self, do_http_get_mock, RebrickableMock): # Setup json =...
gpl-2.0
ntuecon/server
pyenv/Lib/site-packages/pythonwin/pywin/framework/app.py
4
14382
# App.py # Application stuff. # The application is responsible for managing the main frame window. # # We also grab the FileOpen command, to invoke our Python editor " The PythonWin application code. Manages most aspects of MDI, etc " import win32con import win32api import win32ui import sys import string im...
bsd-3-clause
t0mk/ansible
lib/ansible/constants.py
3
29560
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
elingg/tensorflow
tensorflow/python/framework/common_shapes_test.py
60
2551
# 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
gae123/sd2
src/lib/sd2/gen_ssh_config.py
1
4934
#!/usr/bin/env python ############################################################################# # Copyright (c) 2017 SiteWare Corp. All right reserved ############################################################################# from __future__ import absolute_import, print_function import os import sys import six...
apache-2.0
PythonProgramming/Pattern-Recognition-for-Forex-Trading
machFX7.py
1
5605
''' To compare patterns: use a % change calculation to calculate similarity between each %change movement in the pattern finder. From those numbers, subtract them from 100, to get a "how similar" #. From this point, take all 10 of the how similars, and average them. Whichever pattern is MOST similar, is the one we wi...
mit
npuichigo/ttsflow
third_party/tensorflow/tensorflow/contrib/rnn/python/kernel_tests/fused_rnn_cell_test.py
77
7404
# 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
PeterWangIntel/chromium-crosswalk
build/util/lib/common/unittest_util.py
138
4879
# 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. """Utilities for dealing with the python unittest module.""" import fnmatch import sys import unittest class _TextTestResult(unittest._TextTestResult): ...
bsd-3-clause
dankolbrs/zeroclickinfo-fathead
lib/fathead/apple_docs_watchos/parse.py
7
4035
# -*- coding: utf-8 -*- import sqlite3 import re import sys reload(sys) sys.setdefaultencoding('utf8') data = "download/watchOS.docset/Contents/Resources/docSet.dsidx" url = "https://developer.apple.com/library/content/" def generate_output(result): abstract_format = '{name}\tA\t\t\t\t\t\t\t\t\t\t<section class...
apache-2.0
rkmaddox/mne-python
examples/inverse/vector_mne_solution.py
14
3770
""" .. _ex-vector-mne-solution: ============================================ Plotting the full vector-valued MNE solution ============================================ The source space that is used for the inverse computation defines a set of dipoles, distributed across the cortex. When visualizing a source estimate,...
bsd-3-clause
xwolf12/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
Vixionar/django
tests/postgres_tests/test_array.py
70
19822
import decimal import json import unittest import uuid from django import forms from django.core import exceptions, serializers, validators from django.core.management import call_command from django.db import IntegrityError, connection, models from django.test import TransactionTestCase, override_settings from django...
bsd-3-clause
ruipgpinheiro/subuser
logic/subuserlib/classes/subuserSubmodules/run/runtime.py
1
12993
#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. """ Runtime environments which are prepared for subusers to run in. """ #external imports import sys import collections import os import time import binascii import struct import subprocess impor...
lgpl-3.0
gnuradio/gnuradio
docs/doxygen/doxyxml/generated/indexsuper.py
18
19240
#!/usr/bin/env python # # Generated Thu Jun 11 18:43:54 2009 by generateDS.py. # import sys from xml.dom import minidom from xml.dom import Node # # User methods # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class # in a...
gpl-3.0
shizhai/wprobe
build_dir/target-mips_r2_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.4/scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
DualSpark/ansible
lib/ansible/plugins/action/pause.py
57
5479
# Copyright 2012, Tim Bielawa <tbielawa@redhat.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
tta/gnuradio-tta
gnuradio-core/src/python/gnuradio/usrp_options.py
9
5631
# # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
gpl-3.0
jobiols/odoo-argentina
l10n_ar_afipws_fe/models/res_currency.py
1
3043
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, api, _ from openerp.ex...
agpl-3.0
dlazz/ansible
lib/ansible/module_utils/rabbitmq.py
9
8288
# -*- coding: utf-8 -*- # # Copyright: (c) 2016, Jorge Rodriguez <jorge.rodriguez@tiriel.eu> # Copyright: (c) 2018, John Imison <john+github@imison.net> # # 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 __meta...
gpl-3.0
UXE/local-edx
cms/djangoapps/course_creators/tests/test_views.py
51
4435
""" Tests course_creators.views.py. """ from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied from django.test import TestCase, RequestFactory from course_creators.views import add_user_with_status_unrequested, add_user_with_status_granted from course_creators.views import ge...
agpl-3.0
mahak/neutron
neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py
2
70486
# Copyright (c) 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 ...
apache-2.0
TRSasasusu/bond_html
bond_html.py
1
1543
# -*- coding: utf-8 -*- import sys import re if __name__ == '__main__': if len(sys.argv) < 4: print("Usage: python bond_html.py hoge.html -o hoge_out.html") sys.exit() target_file = open(sys.argv[1], 'r', encoding='utf-8') target_txt = target_file.read() target_file.close(...
gpl-3.0
tomhunter-gh/Lean
Algorithm.Python/CustomBenchmarkAlgorithm.py
1
1857
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Li...
apache-2.0
sursum/buckanjaren
buckanjaren/lib/python3.5/site-packages/psycopg2/tests/testutils.py
14
14556
# testutils.py - utility module for psycopg2 testing. # # Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 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 vers...
mit
jwhitlock/django-allauth
allauth/socialaccount/providers/facebook/views.py
8
4360
import logging import requests import hashlib import hmac from allauth.socialaccount.models import (SocialLogin, SocialToken) from allauth.socialaccount.helpers import complete_social_login from allauth.socialaccount.helpers import render_authentication_error from allauth.soc...
mit
ubic135/odoo-design
addons/l10n_bo/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
xxd3vin/spp-sdk-template-school
python/run_2_video.py
1
3443
# coding=utf-8 import os, sys, codecs import shutil import common import config import bucfg # import checkbuild # import run_100_log ######################################### # 处理校园介绍中的视频集 def process(): print '-------------------------------' print common.encodeChinese('>> 处理视频集') print '' # 前面已经检查过文件存在了,这里就...
mit
pymedusa/Medusa
ext/idna/codec.py
426
3299
from .core import encode, decode, alabel, ulabel, IDNAError import codecs import re _unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]') class Codec(codecs.Codec): def encode(self, data, errors='strict'): if errors != 'strict': raise IDNAError("Unsupported error handling \"{0}\"".for...
gpl-3.0
peterfpeterson/mantid
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionFWSTest.py
3
5411
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
diCaminha/pyechonest
pyechonest/track.py
21
13589
import urllib2 try: import json except ImportError: import simplejson as json import hashlib from proxies import TrackProxy import util import time # Seconds to wait for asynchronous track/upload or track/analyze jobs to complete. DEFAULT_ASYNC_TIMEOUT = 60 class Track(TrackProxy): """ Represents an ...
bsd-3-clause
hw20686832/simple_crawler
crawler/queue.py
1
1694
# coding:utf-8 import time import redis import settings from crawler.http import Request from crawler.exceptions import TrafficLimit, Empty class TrafficQueue(object): def __init__(self, num, ctime=60): self.num = num self.ctime = ctime self.tq = [] def t_in(self, req): sel...
mit
Nilzone-/PersonNr
personnr.py
1
1292
import re from calendar import monthrange def is_valid_date(d): if not re.match('^\d+$', d): raise ValueError('Not a valid date') dd, mm, yyyy = [int(i) for i in [d[:2], d[2:4], d[4:]]] if yyyy < 1855 or yyyy > 2039: return False if mm < 1 or mm > 12: return False if dd < 1 or dd > monthrange(yyyy, m...
mit
harmy/kbengine
kbe/src/lib/python/Lib/test/seq_tests.py
59
13597
""" Tests common to tuple, list and UserList.UserList """ import unittest import sys # Various iterables # This is used for checking the constructor (here and in test_deque.py) def iterfunc(seqn): 'Regular generator' for i in seqn: yield i class Sequence: 'Sequence using __getitem__' def __in...
lgpl-3.0
lmorchard/django
tests/many_to_many/models.py
279
1343
""" Many-to-many relationships To define a many-to-many relationship, use ``ManyToManyField()``. In this example, an ``Article`` can be published in multiple ``Publication`` objects, and a ``Publication`` has multiple ``Article`` objects. """ from __future__ import unicode_literals from django.db import models from ...
bsd-3-clause
pablobesada/tw
frontend/gnip/mongo.py
1
18834
#encoding: utf-8 from pymongo import MongoClient from bson import ObjectId import argparse from pprint import pprint import time import threading from datetime import datetime, timedelta from tweet import Tweet class Product(object): def __init__(self, id, mongoproduct): self.id = id self.o = ...
apache-2.0
crunchr/silk
project/tests/test_models.py
4
16386
# -*- coding: utf-8 -*- import datetime import uuid import pytz from django.test import TestCase from django.utils import timezone from freezegun import freeze_time from silk import models from silk.storage import ProfilerResultStorage from silk.config import SilkyConfig from .factories import RequestMinFactory, SQ...
mit
jaor/bigmler
bigmler/whizzml/dispatcher.py
1
1917
# -*- coding: utf-8 -*- # # Copyright 2016-2020 BigML # # 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
berendkleinhaneveld/VTK
ThirdParty/Twisted/twisted/persisted/crefutil.py
45
4496
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utility classes for dealing with circular references. """ import types from twisted.python import log, reflect class NotKnown: def __init__(self): self.dependants = [] ...
bsd-3-clause
ajayaa/keystone
keystone/tests/unit/test_versions.py
2
46170
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
youssef-emad/shogun
examples/undocumented/python_modular/features_io_modular.py
24
2388
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() data=lm.load_numbers('../data/fm_train_real.dat') label=lm.load_numbers('../data/label_train_twoclass.dat') parameter_list=[[data,label]] def features_io_modular (fm_train_real, label_train_twoclass): import numpy from modshogun import SparseRe...
gpl-3.0
linjoahow/W16_test1
static/Brython3.1.0-20150301-090019/Lib/_strptime.py
518
21683
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
gpl-3.0
rolando/scrapy
tests/test_utils_defer.py
121
3565
from twisted.trial import unittest from twisted.internet import reactor, defer from twisted.python.failure import Failure from scrapy.utils.defer import mustbe_deferred, process_chain, \ process_chain_both, process_parallel, iter_errback from six.moves import xrange class MustbeDeferredTest(unittest.TestCase): ...
bsd-3-clause
indictranstech/focal-erpnext
erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py
40
2268
# 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 def execute(filters=None): if not filters: filters = {} columns = get_columns() iwq_map = get_item_w...
agpl-3.0
htc-mirror/jewel-ics-crc-3.0.8-3fd0422
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
ahmedaljazzar/edx-platform
pavelib/paver_tests/test_paver_pytest_cmds.py
2
7652
""" Tests for the pytest paver commands themselves. Run just this test with: paver test_lib -t pavelib/paver_tests/test_paver_pytest_cmds.py """ import unittest import os import ddt from pavelib.utils.test.suites import SystemTestSuite, LibTestSuite from pavelib.utils.envs import Env XDIST_TESTING_IP_ADDRESS_LIST = ...
agpl-3.0
Changaco/oh-mainline
vendor/packages/docutils/docutils/parsers/rst/languages/da.py
120
3765
# -*- coding: utf-8 -*- # $Id: da.py 7678 2013-07-03 09:57:36Z milde $ # Author: E D # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each...
agpl-3.0
Codefans-fan/odoo
addons/l10n_ca/__openerp__.py
161
3167
# -*- 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 the G...
agpl-3.0
ennoborg/gramps
gramps/gen/lib/datebase.py
10
2773
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # # 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 you...
gpl-2.0
TeamExodus/external_chromium_org
gpu/gles2_conform_support/generate_gles2_conform_tests.py
139
1430
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """code generator for OpenGL ES 2.0 conformance tests.""" import os import re import sys def ReadFileAsLines(filename): """Read...
bsd-3-clause
juanalfonsopr/odoo
addons/sale_analytic_plans/__init__.py
443
1208
# -*- 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
ATIX-AG/ansible
lib/ansible/modules/cloud/google/gce_tag.py
66
7227
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # 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', ...
gpl-3.0
darren-wang/ks3
keystone/openstack/common/loopingcall.py
7
4763
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
mapmyfitness/django-facebookconnect
facebookconnect/management/commands/installfacebooktemplates.py
3
2621
# Copyright 2008-2009 Brian Boyer, Ryan Mark, Angela Nitzke, Joshua Pollock, # Stuart Tiffen, Kayla Webley and the Medill School of Journalism, Northwestern # University. # # This file is part of django-facebookconnect. # # django-facebookconnect is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
ric2b/Vivaldi-browser
chromium/third_party/blink/web_tests/external/wpt/tools/third_party/pytest/testing/test_terminal.py
30
40391
""" terminal reporting of the full testing process. """ from __future__ import absolute_import, division, print_function import collections import sys import pluggy import _pytest._code import py import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED from _pytest.terminal import TerminalReporter, repr_pythonvers...
bsd-3-clause
xuru/pyvisdk
pyvisdk/do/account_updated_event.py
1
1170
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def AccountUpdatedEvent(vim, *args, **kwargs): '''This event records that an account was ...
mit