repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
MER-GROUP/intellij-community
python/helpers/py2only/docutils/languages/en.py
246
1848
# $Id: en.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # 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...
apache-2.0
yasserglez/tagfs
packages/tagfs/contrib/django/utils/datastructures.py
4
14127
class MergeDict(object): """ A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. If a key appears in more than one of the given dictionaries, only the first occurrence will be used. """ def __init__(self...
mit
verse/verse-entities
vrsent/verse_node.py
1
21666
# ##### 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...
gpl-2.0
chongtianfeiyu/kbengine
kbe/res/scripts/common/Lib/sched.py
88
6354
"""A generally useful event scheduler class. Each instance of this class manages its own queue. No multi-threading is implied; you are supposed to hack that yourself, or use a single instance per application. Each instance is parametrized with two functions, one that is supposed to return the current time, one that i...
lgpl-3.0
miabbott/UATFramework
steps/vagrant.py
7
5287
'''test methods related to vagrant''' from behave import * import ConfigParser config = ConfigParser.ConfigParser() config.read('config/uat.cfg') remote_user = config.get("vagrant", "user") vagrant_build_dependencies = "ruby,ruby-devel,ruby-libvirt,rubygem-ruby-libvirt,libvirt,libvirt-devel,rubygem-bundler,rubygem-bu...
gpl-2.0
danigonza/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/stubout.py
671
4940
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
hanlind/nova
nova/virt/ironic/patcher.py
5
4163
# coding=utf-8 # # Copyright 2014 Hewlett-Packard Development Company, L.P. # Copyright 2014 Red Hat, 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 # # ...
apache-2.0
adam111316/SickGear
lib/sqlalchemy/engine/interfaces.py
75
26652
# engine/interfaces.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Define core interfaces used by the engine system.""" from .. import util, eve...
gpl-3.0
cogeorg/BlackRhino
examples/Georg2012/networkx/generators/social.py
41
11395
""" Famous social networks. """ import networkx as nx __author__ = """\n""".join(['Jordi Torrents <jtorrents@milnou.net>', 'Katy Bold <kbold@princeton.edu>', 'Aric Hagberg <aric.hagberg@gmail.com)']) __all__ = ['karate_club_graph','davis_southern_women_graph', ...
gpl-3.0
flyfei/python-for-android
python-build/python-libs/gdata/build/lib/gdata/alt/appengine.py
133
10734
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
Sony-Kitakami/android_kernel_sony
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
willingc/oh-mainline
vendor/packages/Django/django/conf/locale/pt_BR/formats.py
107
1315
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
agpl-3.0
vinegret/youtube-dl
youtube_dl/extractor/odnoklassniki.py
12
9492
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_etree_fromstring, compat_parse_qs, compat_urllib_parse_unquote, compat_urllib_parse_urlparse, ) from ..utils import ( ExtractorError, unified_strdate, int_or_no...
unlicense
syhost/android_kernel_pantech_ef50l
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
gauribhoite/personfinder
env/google_appengine/lib/jinja2-2.6/jinja2/bccache.py
117
10623
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
apache-2.0
gammalib/gammalib
test/dev/test_model_spatial_const.py
1
1836
#! /usr/bin/env python # ========================================================================== # This script tests the GModelSpatialDiffuseConst model. # # Copyright (C) 2015 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public ...
gpl-3.0
mahak/neutron
neutron/tests/functional/agent/l3/test_ha_router.py
2
23197
# Copyright (c) 2014 Red Hat, 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 require...
apache-2.0
terinjokes/stgit
t/test.py
5
5836
# Run the test suite in parallel. import glob import itertools as it import math import optparse import os import os.path import random import shutil import subprocess import sys import threading import time import traceback # Number of jobs to run in parallel. def default_num_jobs(): try: # One job per p...
gpl-2.0
taichatha/youtube-dl
youtube_dl/extractor/rtlnl.py
102
5637
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, ) class RtlNlIE(InfoExtractor): IE_NAME = 'rtl.nl' IE_DESC = 'rtl.nl and rtlxl.nl' _VALID_URL = r'''(?x) https?://(?:www\.)? (?: ...
unlicense
isb-cgc/ISB-CGC-pipelines
lib/pipelines/db.py
1
4172
import os import sqlite3 class PipelineDatabaseError(Exception): def __init__(self, msg): super(PipelineDatabaseError, self).__init__() self.msg = msg class DatabaseRecord(object): def __init__(self, innerDict): self.__dict__.update(innerDict) class PipelineDatabase(object): def __init__(self, config): ...
apache-2.0
sestrella/ansible
test/integration/targets/gathering_facts/cache_plugins/none.py
159
1114
# (c) 2014, Brian Coca, Josh Drake, et al # (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 from ansible.plugins.cache import BaseCacheModule DOCUMENTATION = ...
gpl-3.0
leonardbinet/navitia_client
test/test_route_schedules.py
1
1235
"""Tests for the route_schedules module.""" import responses # initialize test package __init__, and does not mix up names import test as _test import navitia_client import requests class RouteSchedulesTest(_test.TestCase): def setUp(self): self.user = 'leo' self.core_url = "https://api.navitia...
mit
androidarmv6/android_external_chromium_org
native_client_sdk/src/build_tools/dsc2gyp.py
107
11228
#!/usr/bin/env python # 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 StringIO import sys import os import optparse SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.pat...
bsd-3-clause
orbitfp7/nova
nova/db/sqlalchemy/migrate_repo/versions/248_add_expire_reservations_index.py
52
1913
# 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 agreed to in...
apache-2.0
hgl888/blink-crosswalk-efl
Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py
628
31933
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
ethantang95/DIGITS
digits/dataset/images/views.py
5
2135
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import os.path # Find the best implementation available try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import flask import PIL.Image import digits from digits im...
bsd-3-clause
garrettr/onionshare
onionshare_gui/webapp.py
1
2966
from flask import Flask, render_template import threading, json, os, time, platform, sys onionshare = None onionshare_port = None filename = None onion_host = None qtapp = None clipboard = None stay_open = None url = None app = Flask(__name__, template_folder='./templates') def debug_mode(): import logging ...
gpl-3.0
moelius/async-task-processor
examples/periodic_processor.py
1
2018
import time from async_task_processor import ATP from async_task_processor.processors import PeriodicProcessor from examples import logger # first test function def test_func_one(sleep_time, word): """ :type sleep_time: int :type word: str :return: """ logger.info('start working') time.s...
mit
2014cdag4/2014cdag4_1
wsgi/static/Brython2.1.0-20140419-113919/Lib/linecache.py
785
3864
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
gpl-2.0
alexbruy/QGIS
python/ext-libs/pygments/lexer.py
265
26921
# -*- coding: utf-8 -*- """ pygments.lexer ~~~~~~~~~~~~~~ Base lexer classes. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re, itertools from pygments.filter import apply_filters, Filter from pygments.filters import get_filt...
gpl-2.0
4rado/RepositoryForProject
Lib/_threading_local.py
241
7456
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
gpl-3.0
fedora-infra/anitya
anitya/tests/lib/test_plugins.py
1
4047
# -*- coding: utf-8 -*- # # Copyright © 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed in t...
gpl-2.0
gganis/root
interpreter/llvm/src/utils/wciia.py
99
2944
#!/usr/bin/env python """ wciia - Whose Code Is It Anyway Determines code owner of the file/folder relative to the llvm source root. Code owner is determined from the content of the CODE_OWNERS.TXT by parsing the D: field usage: utils/wciia.py path limitations: - must be run from llvm source root - very simplist...
lgpl-2.1
haad/ansible
lib/ansible/modules/commands/telnet.py
24
2332
# this is a virtual module that is entirely implemented server side # Copyright: 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...
gpl-3.0
knittledan/imageResizer
PIL/windows/PIL/XVThumbImagePlugin.py
52
1845
# # The Python Imaging Library. # $Id$ # # XV Thumbnail file handler by Charles E. "Gene" Cash # (gcash@magicnet.net) # # see xvcolor.c and xvbrowse.c in the sources to John Bradley's XV, # available from ftp://ftp.cis.upenn.edu/pub/xv/ # # history: # 98-08-15 cec created (b/w only) # 98-12-09 cec added color palette...
mit
shsingh/ansible
lib/ansible/modules/windows/win_owner.py
38
1169
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported...
gpl-3.0
Joslyn-Maddie/BunnyCore
dep/libmpq/bindings/python/mpq.py
107
10430
"""wrapper for libmpq""" # 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 th...
gpl-2.0
sourcelair/mongoengine
tests/document/dynamic.py
15
12110
import unittest import sys sys.path[0:0] = [""] from mongoengine import * from mongoengine.connection import get_db __all__ = ("DynamicTest", ) class DynamicTest(unittest.TestCase): def setUp(self): connect(db='mongoenginetest') self.db = get_db() class Person(DynamicDocument): ...
mit
arnaud-morvan/QGIS
tests/src/python/test_python_repr.py
2
5735
# -*- coding: utf-8 -*- """QGIS Unit tests for core additions .. note:: 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. """ __a...
gpl-2.0
Dalanar/DotA2DraftBot
tools/collect_bot_info.py
1
3877
import vdf implemented_bots = set([ 'npc_dota_hero_axe', 'npc_dota_hero_bane', 'npc_dota_hero_bounty_hunter', 'npc_dota_hero_bloodseeker', 'npc_dota_hero_bristleback', 'npc_dota_hero_chaos_knight', 'npc_dota_hero_crystal_maiden', 'npc_dota_hero_dazzle', 'npc_dota_hero_death...
mit
odubno/microblog
flask/lib/python2.7/site-packages/pytz/tzinfo.py
380
19368
'''Base classes and helpers for building zone specific tzinfo classes''' from datetime import datetime, timedelta, tzinfo from bisect import bisect_right try: set except NameError: from sets import Set as set import pytz from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError __all__ = [] _time...
bsd-3-clause
cysnake4713/odoo
addons/crm_partner_assign/report/crm_lead_report.py
16
5264
# -*- 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
namgivu/flask-aosh4
app/controller/user_controller.py
1
4136
from app import * import random from flask import session @app.route('/user/switch-role') def user_switch_role(): return render_template('user/switch-role.html') @app.route('/user/wallet') def user_wallet(): template = userRole_to_dashboardView() fake_data = [] my_point = 2000 for i in range(10): data...
gpl-3.0
colinbrislawn/bioconda-recipes
recipes/mz_to_sqlite/1.2.0/mz_to_sqlite.py
60
3265
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
mit
gregcaporaso/qiime
tests/test_clean_raxml_parsimony_tree.py
15
3447
#!/usr/bin/env python # File created on 16 Nov 2011 from __future__ import division __author__ = "Jesse Stombaugh" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Jesse Stombaugh"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jesse Stombaugh" __email__ = "jesse.stombaugh@colorado...
gpl-2.0
PeterWangIntel/chromium-crosswalk
media/tools/layout_tests/test_expectations_history_unittest.py
156
2572
#!/usr/bin/env python # 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. from datetime import datetime import calendar import unittest from test_expectations_history import TestExpectationsHistory cl...
bsd-3-clause
nmercier/linux-cross-gcc
linux/lib/python2.7/dist-packages/numpy/core/function_base.py
23
6891
from __future__ import division, absolute_import, print_function __all__ = ['logspace', 'linspace'] from . import numeric as _nx from .numeric import result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None): """ Return evenly...
bsd-3-clause
LLNL/spack
var/spack/repos/builtin/packages/py-atropos/package.py
5
1111
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyAtropos(PythonPackage): """Atropos is tool for specific, sensitive, and speedy trimming ...
lgpl-2.1
stefanw/froide
froide/foirequest/validators.py
1
1237
from django.utils.encoding import force_str from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ import magic from .models.attachment import POSTAL_CONTENT_TYPES def get_content_type(scan): scan.seek(0) content_type = magic.from_buffer(scan.read(1024), mi...
mit
Rocamadour7/ml_tutorial
02. Regression/main.py
1
1623
from statistics import mean import numpy as np import matplotlib.pyplot as plt from matplotlib import style import random style.use('fivethirtyeight') # xs = np.array([1, 2, 3, 4, 5, 6], dtype=np.float64) # ys = np.array([5, 4, 6, 5, 6, 7], dtype=np.float64) def create_dataset(how_much, variance, step=2, correlatio...
mit
joeyjojo/django_offline
src/django/contrib/formtools/tests/wizard/wizardtests/forms.py
313
2203
import os import tempfile from django import forms from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from django.forms.formsets import formset_factory from django.forms.models import modelformset_factory from django.http import HttpResponse from django.template import ...
mit
ApplauseAQI/androguard
androguard/decompiler/dad/basic_blocks.py
23
11191
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # 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://...
apache-2.0
frictionlessdata/tabulator-py
tests/schemes/test_remote.py
3
1872
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import pytest from tabulator import Stream from tabulator.loaders.remote import RemoteLoader from tabulator.exceptions import HTTPError from time ...
mit
varunagrawal/azure-services
varunagrawal/VarunWeb/env/Lib/site-packages/django/db/backends/mysql/base.py
28
22109
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings try: import MySQLdb as Database except ImportError as e: from django.core.exceptions import ImproperlyConfigur...
gpl-2.0
hocinebendou/bika.gsoc
bika/lims/exportimport/instruments/agilent/masshunter/quantitative.py
5
23863
""" Agilent's 'Masshunter Quant' """ from DateTime import DateTime from Products.Archetypes.event import ObjectInitializedEvent from Products.CMFCore.utils import getToolByName from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from bika.lims import bikaMessageFactory as _ from bika.lims.utils impo...
mit
georgtroska/root
interpreter/llvm/src/utils/lit/lit/formats/base.py
81
3910
from __future__ import absolute_import import os import sys import lit.Test import lit.util class TestFormat(object): pass ### class FileBasedTest(TestFormat): def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig): source_path = testSuite.getSour...
lgpl-2.1
FuegoFro/mongo-web-shell
tests/__init__.py
7
1316
# Copyright 2013 10gen Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
Dee-UK/D33_KK_RK3066
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
Datera/cinder
cinder/tests/unit/backup/test_backup.py
1
98639
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
mgit-at/ansible
lib/ansible/modules/packaging/os/zypper.py
27
17960
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Patrick Callahan <pmc@patrickcallahan.com> # based on # openbsd_pkg # (c) 2013 # Patrik Lundin <patrik.lundin.swe@gmail.com> # # yum # (c) 2012, Red Hat, Inc # Written by Seth Vidal <skvidal at fedoraproject.org> # # GNU Gene...
gpl-3.0
tsiktsiris/falcon
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
mohamed--abdel-maksoud/chromium.src
tools/perf/measurements/repaint_unittest.py
12
2429
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from measurements import repaint from telemetry import decorators from telemetry.core import wpr_modes from telemetry.page import page as page_module from te...
bsd-3-clause
ColorFuzzy/tornado
tornado/test/util_test.py
3
6672
# coding: utf-8 from __future__ import absolute_import, division, print_function, with_statement import sys import datetime import tornado.escape from tornado.escape import utf8 from tornado.util import raise_exc_info, Configurable, exec_in, ArgReplacer, timedelta_to_seconds, import_object from tornado.test.util impor...
apache-2.0
mancoast/CPythonPyc_test
fail/314_threaded_import_hangers.py
203
1410
# This is a helper module for test_threaded_import. The test imports this # module, and this module tries to run various Python library functions in # their own thread, as a side effect of being imported. If the spawned # thread doesn't complete in TIMEOUT seconds, an "appeared to hang" message # is appended to the m...
gpl-3.0
dzc34/searx
searx/tests/engines/test_searchcode_doc.py
6
2477
from collections import defaultdict import mock from searx.engines import searchcode_doc from searx.testing import SearxTestCase class TestSearchcodeDocEngine(SearxTestCase): def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 params = search...
agpl-3.0
Tesora/tesora-tempest
tempest/lib/common/api_version_request.py
12
5783
# Copyright 2014 IBM Corp. # # 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 t...
apache-2.0
stephenrjones/geoq
geoq/core/migrations/0004_auto__add_userprofile.py
6
9987
# -*- 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 'UserProfile' db.create_table(u'core_userprofile', ( (u'id', self.gf('django.db.m...
mit
nealtodd/django
django/contrib/admin/templatetags/admin_modify.py
342
2505
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and i...
bsd-3-clause
SmartInfrastructures/fuel-web-dev
network_checker/network_checker/tests/test_multicast.py
7
3095
# Copyright 2014 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
Endika/website
website_backend_views/controllers/demo.py
36
1453
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV <http://therp.nl>. # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
dllsf/odootest
addons/payment_buckaroo/controllers/main.py
325
1270
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class BuckarooController(http.Controller): _return_url = '/pa...
agpl-3.0
pdelsante/thug
tests/Logging/test_ThugLogging.py
1
5373
import os import logging import thug from thug.ThugAPI.ThugOpts import ThugOpts from thug.DOM.HTTPSession import HTTPSession from thug.Logging.ThugLogging import ThugLogging from thug.Classifier.URLClassifier import URLClassifier from thug.Classifier.SampleClassifier import SampleClassifier configuration_path = thug....
gpl-2.0
google/hypebot
hypebot/plugins/hypejack_lib.py
1
15524
# coding=utf-8 # Copyright 2018 The Hypebot 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...
apache-2.0
BiznetGIO/horizon
openstack_dashboard/test/api_tests/neutron_rest_tests.py
2
12748
# # (c) Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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 ap...
apache-2.0
ray-project/ray
rllib/agents/dreamer/dreamer_torch_policy.py
1
8742
import logging import ray from ray.rllib.agents.dreamer.utils import FreezeParameters from ray.rllib.models.catalog import ModelCatalog from ray.rllib.policy.policy_template import build_policy_class from ray.rllib.utils.framework import try_import_torch from ray.rllib.utils.torch_ops import apply_grad_clipping torch...
apache-2.0
n0m4dz/odoo
addons/mrp/wizard/mrp_workcenter_load.py
381
2222
# -*- 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
Slezhuk/ansible
lib/ansible/modules/web_infrastructure/ejabberd_user.py
48
7599
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com> # # 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 ...
gpl-3.0
BIT-SYS/gem5-spm-module
src/arch/x86/isa/insts/x87/control/initialize.py
91
2159
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
MediffRobotics/DeepRobotics
DeepLearnMaterials/tutorials/tensorflowTUT/tf14_tensorboard/full_code.py
1
2025
# View more python learning tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial """ Please note, this code is only for python 3+. If you are using python 2+, please modify the code acco...
gpl-3.0
qnl/pyalazar
alazar/board_mock.py
1
7971
# Copyright (C) 2015 Chris Macklin # # 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...
gpl-2.0
eemirtekin/edx-platform
lms/djangoapps/open_ended_grading/staff_grading_service.py
17
16274
""" This module provides views that proxy to the staff grading backend service. """ import json import logging from django.conf import settings from django.http import HttpResponse, Http404 from django.utils.translation import ugettext as _ from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.o...
agpl-3.0
buntyke/Flask
microblog/flask/lib/python2.7/site-packages/whoosh/codec/base.py
52
24009
# Copyright 2011 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
mit
lucarebuffi/wofrysrw
wofrysrw/beamline/optical_elements/mirrors/srw_spherical_mirror.py
1
3978
from wofrysrw.beamline.optical_elements.mirrors.srw_mirror import SRWMirror, Orientation, SimulationMethod, TreatInputOutput from syned.beamline.shape import Sphere from oasys_srw.srwlib import SRWLOptMirSph class SRWSphericalMirror(SRWMirror): def __init__(self, name ...
mit
dsullivan7/scikit-learn
sklearn/qda.py
21
7639
""" Quadratic Discriminant Analysis """ # Author: Matthieu Perrot <matthieu.perrot@gmail.com> # # License: BSD 3 clause import warnings import numpy as np from .base import BaseEstimator, ClassifierMixin from .externals.six.moves import xrange from .utils import check_array, check_X_y from .utils.validation import ...
bsd-3-clause
adamjmcgrath/glancydesign
django/contrib/auth/management/commands/changepassword.py
320
1527
from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User import getpass class Command(BaseCommand): help = "Change a user's password for django.contrib.auth." requires_model_validation = False def _get_pass(self, prompt="Password: "): p = getpa...
bsd-3-clause
anushbmx/kitsune
kitsune/kbadge/models.py
1
13303
# Pruned and mnodified version of django-badger/badger/models.py # https://github.com/mozilla/django-badger/blob/master/badger/models.py import re from django.conf import settings from django.db import models from django.db.models import Q from django.contrib.auth.models import User from django.core.urlresolvers impo...
bsd-3-clause
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/tornado/stack_context.py
26
13160
#!/usr/bin/env python # # Copyright 2010 Facebook # # 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...
mit
bors-ltd/c2json
c2json/views.py
1
3172
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from os import path import zipfile from django.contrib import messages from django.http.response import HttpResponse from django.shortcuts import render from django.utils import timezone from django.utils.translation impor...
agpl-3.0
wanderknight/trading-with-python
cookbook/downloadVixFutures.py
77
1313
#------------------------------------------------------------------------------- # Name: download CBOE futures # Purpose: get VIX futures data from CBOE and save to user directory # # # Created: 15-10-2011 # Copyright: (c) Jev Kuznetsov 2011 # Licence: GPL v2 #------------------------------...
bsd-3-clause
tushar7795/MicroBlog
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## 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...
bsd-3-clause
yoer/hue
desktop/core/ext-py/Django-1.6.10/tests/m2m_through_regress/tests.py
51
9138
from __future__ import absolute_import from django.core import management from django.contrib.auth.models import User from django.test import TestCase from django.utils.six import StringIO from .models import (Person, Group, Membership, UserMembership, Car, Driver, CarDriver) class M2MThroughTestCase(TestCase):...
apache-2.0
lepistone/account-financial-reporting
__unported__/account_financial_report_webkit_xls/report/__init__.py
28
1165
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
jacebrowning/gdm
gitman/common.py
2
5221
"""Common exceptions, classes, and functions.""" import argparse import logging import os import sys import time import log from . import settings class WideHelpFormatter(argparse.HelpFormatter): """Command-line help text formatter with wider help text.""" def __init__(self, *args, **kwargs): kwar...
mit
Arable/old-www-do-not-use
lib/python2.7/site-packages/pip/vendor/distlib/scripts.py
79
9291
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import logging import os import re import struct import sys from . import DistlibException from .compat import sysconfig, fsencode, detect_en...
mit
AutorestCI/azure-sdk-for-python
azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images.py
2
1999
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
h3biomed/ansible
test/units/modules/source_control/test_gitlab_deploy_key.py
6
4130
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import import pytest from ansible.modules.source_control.gitlab_deploy_key import GitLabDeployKey def _...
gpl-3.0
benedictpaten/cactus
src/cactus/progressive/multiCactusProject.py
1
5516
#!/usr/bin/env python #Copyright (C) 2011 by Glenn Hickey # #Released under the MIT license, see LICENSE.txt """ Basic interface to the multi cactus project xml file. """ import xml.etree.ElementTree as ET from xml.dom import minidom from cactus.progressive.multiCactusTree import MultiCactusTree from cactus.shared...
mit
pytorch/fairseq
fairseq/optim/adagrad.py
1
1279
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch.optim from . import LegacyFairseqOptimizer, register_optimizer @register_optimizer("adagrad") class Adagrad(LegacyFairseqOptim...
mit
g-vidal/upm
examples/python/adxrs610.py
6
2289
#!/usr/bin/env python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 # witho...
mit
jkandasa/integration_tests
cfme/tests/intelligence/test_chargeback_assignments.py
1
4594
# -*- coding: utf-8 -*- import cfme.intelligence.chargeback.assignments as cb import pytest import random from cfme.intelligence.chargeback.assignments import AssignmentsView from cfme import test_requirements from cfme.utils.appliance.implementations.ui import navigate_to pytestmark = [ pytest.mark.tier(3), ...
gpl-2.0