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
metabrainz/picard
picard/ui/coverartbox.py
3
24927
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2006-2007, 2011 Lukáš Lalinský # Copyright (C) 2009 Carlin Mangar # Copyright (C) 2009, 2018-2021 Philipp Wolfer # Copyright (C) 2011-2013 Michael Wiencek # Copyright (C) 2012 Chad Wilson # Copyright (C) 2012-2014 Wieland Hoffm...
gpl-2.0
krishnazure/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py
2763
12536
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
apache-2.0
cluckmaster/MissionPlanner
Lib/site-packages/numpy/oldnumeric/alter_code1.py
101
8498
""" This module converts code written for Numeric to run with numpy Makes the following changes: * Changes import statements (warns of use of from Numeric import *) * Changes import statements (using numerix) ... * Makes search and replace changes to: - .typecode() - .iscontiguous() - .byteswapped() - ....
gpl-3.0
erkrishna9/odoo
addons/email_template/__openerp__.py
64
3160
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
Comunitea/server-tools
auth_from_http_remote_user/res_users.py
28
2630
# -*- coding: utf-8 -*- ############################################################################## # # Author: Laurent Mignon # Copyright 2014 'ACSONE SA/NV' # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
brian-yang/mozillians
vendor-local/lib/python/djcelery/tests/test_backends/test_cache.py
30
4992
from __future__ import absolute_import import sys from datetime import timedelta from django.core.cache.backends.base import InvalidCacheBackendError from celery import result from celery import states from celery.utils import gen_unique_id from celery.datastructures import ExceptionInfo from djcelery.backends.cac...
bsd-3-clause
seem-sky/kbengine
kbe/res/scripts/common/Lib/test/test_pathlib.py
60
74519
import collections import io import os import errno import pathlib import pickle import shutil import socket import stat import sys import tempfile import unittest from contextlib import contextmanager from test import support TESTFN = support.TESTFN try: import grp, pwd except ImportError: grp = pwd = None ...
lgpl-3.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/google/protobuf/service.py
243
9144
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
bsd-2-clause
WorkflowConversion/CTDConverter
tests/test-data/fill_ctd.py
1
6778
import collections import json import operator import os import re import subprocess import sys from functools import reduce # forward compatibility for Python 3 from CTDopts.CTDopts import ( _Choices, _InFile, _Null, _NumericRange, CTDModel ) def getFromDict(dataDict, mapList): return reduc...
gpl-3.0
jaredlewis/django-entity-history
settings.py
2
1991
import os from django.conf import settings def configure_settings(): """ Configures settings for manage.py and for run_tests.py. """ if not settings.configured: # Determine the database settings depending on if a test_db var is set in CI mode or not test_db = os.environ.get('DB', None...
mit
Cito/sqlalchemy
examples/versioned_history/test_versioning.py
1
16501
"""Unit tests illustrating usage of the ``history_meta.py`` module functions.""" from unittest import TestCase from sqlalchemy.ext.declarative import declarative_base from .history_meta import Versioned, versioned_session from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Boolean from sqlalchem...
mit
Danath/gyp
test/library/gyptest-shared-obj-install-path.py
53
1098
#!/usr/bin/env python # 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. """ Verifies that .so files that are order only dependencies are specified by their install location rather than by their alias. """ # Pyth...
bsd-3-clause
coreynicholson/youtube-dl
youtube_dl/extractor/rottentomatoes.py
64
1281
from __future__ import unicode_literals from .common import InfoExtractor from .internetvideoarchive import InternetVideoArchiveIE class RottenTomatoesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rottentomatoes\.com/m/[^/]+/trailers/(?P<id>\d+)' _TEST = { 'url': 'http://www.rottentomatoes.co...
unlicense
delph-in/pydelphin
tests/util_test.py
1
5613
# coding: utf-8 from delphin.util import safe_int, SExpr, detect_encoding, LookaheadIterator import pytest, codecs def test_safe_int(): assert safe_int('1') == 1 assert safe_int('1.0') == '1.0' assert safe_int('-12345') == -12345 assert safe_int('1a') == '1a' def test_SExpr(): # atoms outside of...
mit
tboyce021/home-assistant
tests/components/songpal/test_media_player.py
11
9768
"""Test songpal media_player.""" from datetime import timedelta import logging from songpal import ( ConnectChange, ContentChange, PowerChange, SongpalException, VolumeChange, ) from homeassistant.components import media_player, songpal from homeassistant.components.songpal.const import SET_SOUND_...
apache-2.0
ntrtrung/RIOT
dist/tools/sniffer/sniffer.py
10
4809
#!/usr/bin/env python ''' (C) 2012, Mariano Alvira <mar@devl.org> (C) 2014, Oliver Hahm <oliver.hahm@inria.fr> (C) 2015, Hauke Petersen <hauke.petersen@fu-berlin.de> (C) 2015, Martine Lenders <mlenders@inf.fu-berlin.de> Redistribution and use in source and binary forms, with or without modification, are permitted prov...
lgpl-2.1
daineseh/kodi-plugin.video.ted-talks-chinese
youtube_dl/extractor/rtlnl.py
10
6786
# 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\.)? (?: ...
gpl-2.0
h3ld3rkid/FreeTV.repo
program.plexus/resources/plexus/resolver.py
25
1328
# -*- coding: utf-8 -*- """ Plexus (c) 2015 enen92 This file contains functions to link acestream or sopcast depending on the given argument (id or url). It is used for the items in the main menu Functions: go_to_id(p2p_type) -> Receives the type of stream (sop or ace) and activates the k...
gpl-2.0
smarkets/smk_python_sdk
smarkets/streaming_api/framing.py
1
2814
from __future__ import absolute_import, division, print_function, unicode_literals from six import int2byte MIN_FRAME_SIZE = 4 class IncompleteULEB128(Exception): pass def frame_encode(frame, payload): """ Encodes payload and appends it to the given frame. :type frame: bytearray :type payload...
mit
shoyer/xray
xarray/tests/test_options.py
1
5707
import pytest import xarray from xarray import concat, merge from xarray.backends.file_manager import FILE_CACHE from xarray.core.options import OPTIONS, _get_keep_attrs from xarray.tests.test_dataset import create_test_data def test_invalid_option_raises(): with pytest.raises(ValueError): xarray.set_opt...
apache-2.0
theflofly/tensorflow
tensorflow/python/client/session_partial_run_test.py
14
11707
# 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
redhat-cip/cauth
cauth/controllers/openid.py
2
1950
#!/usr/bin/env python # # Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # 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 # # Unle...
apache-2.0
yolowtf/idunnosomething
resources/site-packages/pyga/utils.py
16
4127
# -*- coding: utf-8 -*- import logging from random import randint import re import urllib import os from datetime import datetime __author__ = "Arun KR (kra3) <the1.arun@gmail.com>" __license__ = "Simplified BSD" RE_IP = re.compile(r'^[\d+]{1,3}\.[\d+]{1,3}\.[\d+]{1,3}\.[\d+]{1,3}$', re.I) RE_PRIV_IP = re.compile(r'...
gpl-3.0
timlinux/inasafe
safe/processors/minimum_needs_post_processors.py
5
4313
# coding=utf-8 """Postprocessors about additional items in minimum needs.""" from safe.definitions import minimum_needs_fields, displaced_field from safe.definitions.concepts import concepts from safe.definitions.fields import additional_rice_count_field from safe.definitions.fields import ( pregnant_displaced_co...
gpl-3.0
knehez/edx-platform
openedx/core/djangoapps/credit/tests/test_api.py
12
25653
""" Tests for the API functions in the credit app. """ import datetime import ddt import pytz from django.test import TestCase from django.test.utils import override_settings from django.db import connection, transaction from opaque_keys.edx.keys import CourseKey from util.date_utils import from_timestamp from opene...
agpl-3.0
xtfxme/uwsgi
examples/uwsgirouter.py
13
1882
import uwsgi def application(env, start_response): # open the socket fd = uwsgi.async_connect("192.168.173.100:3032") # wait for connection ready (3s timeout) yield uwsgi.wait_fd_write(fd, 3) # has timed out ? if env['x-wsgiorg.fdevent.timeout']: print "connection timed out !!!" uwsgi.close(fd) raise St...
gpl-2.0
WholeGrainGoats/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/ranges.py
142
3004
from .utils import HTTPException class RangeParser(object): def __call__(self, header, file_size): prefix = "bytes=" if not header.startswith(prefix): raise HTTPException(416, message="Unrecognised range type %s" % (header,)) parts = header[len(prefix):].split(",") ran...
mpl-2.0
slinderman/theano_pyglm
pyglm/inference/parallel_coord_descent.py
1
5427
import numpy as np from IPython.parallel.util import interactive from pyglm.inference.coord_descent import fit_glm from pyglm.utils.progress_report import wait_watching_stdout def initialize_imports(dview): """ Import functions req'd for coordinate descent """ print "Initializing imports for parallel coo...
mit
Distrotech/bzr
tools/rst2pdf.py
2
4885
#!/usr/bin/env python # -*- coding: utf8 -*- # $Id: rst2pdf.py 5560 2008-05-20 13:00:31Z milde $ # rst2pdf.py # ========== # :: """ A front end to the Docutils Publisher, producing PDF. Produces a latex file with the "latex" writer and converts it to PDF with the "rubber" building system for LaTeX documents. """ #...
gpl-2.0
adityacs/ansible
lib/ansible/modules/network/lenovo/cnos_showrun.py
5
4951
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
gpl-3.0
nickpack/django-oscar
src/oscar/apps/partner/prices.py
60
2295
from oscar.core import prices class Base(object): """ The interface that any pricing policy must support """ #: Whether any prices exist exists = False #: Whether tax is known is_tax_known = False #: Price excluding tax excl_tax = None #: Price including tax incl_tax = ...
bsd-3-clause
williamluke4/Examenable
node_modules/sitemap/env/src/node-v0.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py
2767
2174
# Copyright (c) 2011 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. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
gpl-3.0
caisq/tensorflow
tensorflow/python/ops/quantized_conv_ops_test.py
27
7519
# 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
RomainBrault/scikit-learn
examples/decomposition/plot_pca_3d.py
354
2432
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Principal components analysis (PCA) ========================================================= These figures aid in illustrating how a point cloud can be very flat in one direction--which is where PCA comes in to ch...
bsd-3-clause
IronLanguages/ironpython3
Src/StdLib/Lib/test/test_bisect.py
101
13960
import sys import unittest from test import support from collections import UserList py_bisect = support.import_fresh_module('bisect', blocked=['_bisect']) c_bisect = support.import_fresh_module('bisect', fresh=['_bisect']) class Range(object): """A trivial range()-like object that has an insert() method.""" ...
apache-2.0
eliben/luz-cpu
experimental/luz_uc/luz_uc_testbench/python_utils/VHDLCompiler.py
2
7228
""" Provides an interface to Modlsim's suite for VHDL compilation. Convenience features: * Automatically detects the path to Modelsim * Knows how to compile only those files that have been changed since their last compilation. """ import logging, os, re, stat from shutil import rmtree from su...
unlicense
roxana-lafuente/MTTT
constants.py
2
3399
"""@brief Contains constants common to all modules of TTT.""" # !/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## # # PyKeylogger: TTT for Linux and Windows # Copyright (C) 2016 Roxana Lafuente <roxana.lafuente@gmail.com> # ...
gpl-3.0
tzulitai/flink
flink-python/pyflink/table/tests/test_udtf.py
2
5276
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
apache-2.0
jneves/OctoPrint
src/octoprint/slicing/__init__.py
17
23087
# coding=utf-8 """ In this module the slicing support of OctoPrint is encapsulated. .. autoclass:: SlicingProfile :members: .. autoclass:: TemporaryProfile :members: .. autoclass:: SlicingManager :members: """ from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ =...
agpl-3.0
IanLewis/django-lifestream
lifestream/tests/testserver.py
2
3251
#!/usr/bin/env python #:coding=utf-8: import re import os from threading import * import httplib from SimpleHTTPServer import SimpleHTTPRequestHandler from BaseHTTPServer import HTTPServer ROOT_PATH = os.path.dirname(__file__) PORT = 8097 # not really configurable, must match hardcoded port in tests class FeedPars...
mit
skoppisetty/idigbio-appliance
lib/cherrypy/tutorial/tut01_helloworld.py
58
1137
""" Tutorial - Hello World The most basic (working) CherryPy application possible. """ # Import CherryPy global namespace import cherrypy class HelloWorld: """ Sample request handler class. """ def index(self): # CherryPy will call this method for the root URI ("/") and send # its return val...
gpl-3.0
idovear/odoo
addons/web/static/lib/py.js/doc/conf.py
543
7829
# -*- coding: utf-8 -*- # # py.js documentation build configuration file, created by # sphinx-quickstart on Sun Sep 9 19:36:23 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
agpl-3.0
hongbin/magnum
magnum/tests/unit/common/test_urlfetch.py
2
1984
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
deKupini/erp
addons/account/__openerp__.py
7
6571
# -*- 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
sephii/django
django/core/checks/compatibility/django_1_7_0.py
91
1368
from __future__ import unicode_literals from .. import Warning, register, Tags @register(Tags.compatibility) def check_1_7_compatibility(**kwargs): errors = [] errors.extend(_check_middleware_classes(**kwargs)) return errors def _check_middleware_classes(app_configs=None, **kwargs): """ Checks ...
bsd-3-clause
adsabs/adsabs-vagrant
dockerfiles/adsws/adsws.local_config.py
1
1383
import os import logging LOG_LEVEL=logging.DEBUG LOG_FILE='logs/adsws.log' #Relative to here #Set DEBUG=True to log to stderr, which is useful for development only. #Note that this will also print the traceback in the response to the client, which is not desirable in production. DEBUG=True # Automatically generated ...
bsd-3-clause
danielrd6/pyslight
pyslight/starlight.py
1
8113
#!/usr/bin/env python import numpy as np from ifscube.spectools import get_wl import pyfits as pf from scipy.interpolate import interp1d # import matplotlib as mpl import matplotlib.pyplot as plt # import scipy.ndimage as ndim from scipy.ndimage import gaussian_filter as gf import subprocess def perturbation(infile,...
gpl-3.0
tcalmant/ipopo
pelix/shell/ipopo.py
1
11977
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ iPOPO shell commands Provides commands to the Pelix shell to get the state of iPOPO instances. :author: Thomas Calmant :copyright: Copyright 2020, Thomas Calmant :license: Apache License 2.0 :version: 1.0.1 .. Copyright 2020 Thomas Calmant Licensed ...
apache-2.0
kenshinthebattosai/readthedocs.org
readthedocs/projects/forms.py
15
15658
"""Project forms""" from random import choice from django import forms from django.conf import settings from django.contrib.auth.models import User from django.template.defaultfilters import slugify from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from django...
mit
hnakamur/ansible
v1/ansible/playbook/task.py
89
16588
# (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
Forage/Gramps
gramps/plugins/gramplet/gramplet.gpr.py
1
36300
# encoding:utf-8 # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Benny Malengier # Copyright (C) 2011 Nick Hall # Copyright (C) 2011 Tim G L Lyons # # 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 # th...
gpl-2.0
Lab603/PicEncyclopedias
jni-build/jni-build/jni/include/tensorflow/examples/skflow/iris.py
5
1597
# 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 appl...
mit
AdrianP-/gym_trading
gym_trading/test/TestPortfolio.py
1
1071
import unittest import gym import gym_trading class TestPortfolio(unittest.TestCase): @classmethod def setUpClass(self): csv_name = "/home/adrian/Escritorio/polinex/EURUSD60.csv" self.env = gym.make('trading-v0') self.env.initialise_simulator(csv_name, ATR=True, trade_period=5, train_s...
apache-2.0
josrolgil/exjobbCalvin
calvin/runtime/south/plugins/io/display/platform/raspberry_pi/sensehat_impl/display.py
2
1363
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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 ...
apache-2.0
40223103/w16b_test
static/Brython3.1.3-20150514-095342/Lib/inspect.py
637
78935
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
agpl-3.0
sbinet/cxx-root
interpreter/llvm/src/utils/lit/lit/ShUtil.py
83
12179
from __future__ import absolute_import import itertools import lit.util from lit.ShCommands import Command, Pipeline, Seq class ShLexer: def __init__(self, data, win32Escapes = False): self.data = data self.pos = 0 self.end = len(data) self.win32Escapes = win32Escapes def eat(...
lgpl-2.1
Patola/Cura
plugins/UFPWriter/__init__.py
3
1059
#Copyright (c) 2018 Ultimaker B.V. #Cura is released under the terms of the LGPLv3 or higher. import sys from UM.Logger import Logger try: from . import UFPWriter except ImportError: Logger.log("w", "Could not import UFPWriter; libCharon may be missing") from UM.i18n import i18nCatalog #To translate the file...
lgpl-3.0
sergiocallegari/PyDSM
cvxpy_tinoco/functions/max.py
1
2594
#***********************************************************************# # Copyright (C) 2010-2012 Tomas Tinoco De Rubira # # # # This file is part of CVXPY # # ...
gpl-3.0
tarzan0820/odoo
addons/stock/__init__.py
376
1115
# -*- 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
shreyasp/erpnext
erpnext/manufacturing/doctype/production_planning_tool/test_production_planning_tool.py
14
14906
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt import frappe import frappe.defaults import unittest from frappe.test_runner import make_test_records from erpnext.manufacturing.doctype.production_planning_tool.production_planning_tool import ProductionPlanningTool ...
gpl-3.0
Observer-Wu/phantomjs
src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_shuffle_test.py
3023
12549
#!/usr/bin/env python # # Copyright 2009 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...
bsd-3-clause
andnovar/networkx
networkx/algorithms/mis.py
13
2484
# -*- coding: utf-8 -*- # $Id: maximalIndependentSet.py 576 2011-03-01 05:50:34Z lleeoo $ """ Algorithm to find a maximal (not maximum) independent set. """ # Leo Lopes <leo.lopes@monash.edu> # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All right...
bsd-3-clause
juhalindfors/bazel-patches
third_party/protobuf/3.2.0/python/google/protobuf/internal/import_test_package/__init__.py
165
1768
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
apache-2.0
YinongLong/scikit-learn
sklearn/base.py
5
19817
"""Base classes for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import copy import warnings import numpy as np from scipy import sparse from .externals import six from .utils.fixes import signature from .utils.deprecation import deprecated from .exceptions impo...
bsd-3-clause
fzalkow/scikit-learn
sklearn/gaussian_process/regression_models.py
259
2166
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in regression models submodule for the gaussian_process module. """ import numpy as np def constant(x): """ Zero order polynomial (...
bsd-3-clause
MarkWh1te/xueqiu_predict
python3_env/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py
2762
17725
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
PaesslerAG/django-performance-testing
tests/testapp/tests/test_integrates_with_template_rendering.py
1
1428
from datetime import timedelta from django.contrib.auth.models import Group from django.template import loader from django_performance_testing.core import LimitViolationError from freezegun import freeze_time import pytest def test_has_support_for_number_of_queries_in_templates(db, settings): settings.PERFORMANCE...
bsd-3-clause
radiasoft/radtrack
radtrack/util/simulationResultsTools.py
1
4798
from pykern.pkdebug import pkdc from PyQt4 import QtGui, QtCore from radtrack.util.fileTools import getSaveFileName, isSDDS from radtrack.beamlines.RbElegantElements import fileImporter as elegantFileImport import os, shutil from radtrack.RbRawDataDialogBox import RbRawDataDialogBox def add_result_file(listWidget, te...
apache-2.0
mintar/ros-infrastructure-rosdistro
test/test_source.py
1
1127
import os import yaml from rosdistro import get_index, get_source_file from rosdistro.loader import load_url from rosdistro.source_file import SourceFile FILES_DIR = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'files')) def test_source_file(): url = 'file://' + FILES_DIR + '/foo/di...
bsd-3-clause
tjanez/ansible
lib/ansible/modules/cloud/vmware/vsphere_copy.py
25
6506
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2015 Dag Wieers <dag@wieers.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 Lice...
gpl-3.0
fusioneng/gif2html5-app
tests/test_video_manager.py
1
1111
import unittest import urllib.error from unittest.mock import patch from gif2html5.video_manager import convert from gif2html5.exceptions import BadContentTypeException from tests.test_context import TestContext class VideoManagerTests(TestContext): @patch('gif2html5.video_manager.uuid') def test_convertin...
mit
jherico/qtwebkit
Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py
638
9836
# Copyright 2011, 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...
lgpl-3.0
pra85/calibre
src/calibre/devices/hanlin/driver.py
5
4550
# -*- coding: utf-8 -*- __license__ = 'GPL v3' __copyright__ = '2009, Tijmen Ruizendaal <tijmen at mybebook.com>' __docformat__ = 'restructuredtext en' ''' Device driver for Hanlin ''' import re from calibre.devices.usbms.driver import USBMS class HANLINV3(USBMS): name = 'Hanlin V3 driver' gui...
gpl-3.0
titom1986/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/videolecturesnet.py
40
2419
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( find_xpath_attr, int_or_none, parse_duration, unified_strdate, ) class VideoLecturesNetIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?videolectures\.net/(?P<id>[^/#?]+)/' IE_NAME = '...
gpl-3.0
apple/llvm-project
libcxx/utils/generate_header_inclusion_tests.py
4
6885
#!/usr/bin/env python import os def get_libcxx_paths(): utils_path = os.path.dirname(os.path.abspath(__file__)) script_name = os.path.basename(__file__) assert os.path.exists(utils_path) src_root = os.path.dirname(utils_path) test_path = os.path.join(src_root, 'test', 'libcxx', 'inclusions') ...
apache-2.0
iemejia/incubator-beam
sdks/python/apache_beam/utils/windowed_value.py
2
10981
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
bhansa/fireball
pyvenv/Lib/site-packages/pygame/tests/bufferproxy_test.py
6
17291
import sys import re import weakref import gc import ctypes import unittest if __name__ == '__main__': import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1]...
gpl-3.0
xxd3vin/spp-sdk
opt/Python27/Lib/distutils/tests/test_msvc9compiler.py
2
4405
"""Tests for distutils.msvc9compiler.""" import sys import unittest import os from distutils.errors import DistutilsPlatformError from distutils.tests import support _MANIFEST = """\ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1...
mit
google/google-ctf
third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_zlib.py
9
21240
import unittest from test.test_support import TESTFN, run_unittest, import_module, unlink, requires import binascii import random from test.test_support import precisionbigmemtest, _1G, _4G import sys try: import mmap except ImportError: mmap = None zlib = import_module('zlib') class Checksum...
apache-2.0
phammin1/QaManagement
QaManagement/env/Lib/site-packages/setuptools/command/bdist_rpm.py
1049
1508
import distutils.command.bdist_rpm as orig class bdist_rpm(orig.bdist_rpm): """ Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs...
mit
thelink2012/gta3sc
utils/ir2_to_gta3.py
1
21697
#!/usr/bin/env python2 """ Examples: py ir2_to_gta3.py main.ir2 ../config/gta3 output/ """ import sys, os, errno import gta3sc from gta3sc.bytecode import VarInfo, Scope from gta3sc.bytecode import DATATYPE_GLOBALVAR_NUMBER from gta3sc.bytecode import DATATYPE_GLOBALVAR_TEXTLABEL from gta3sc.bytecode import DATAT...
mit
Gustry/QGIS
python/PyQt/PyQt5/QtNetwork.py
45
1041
# -*- coding: utf-8 -*- """ *************************************************************************** QtNetwork.py --------------------- Date : March 2016 Copyright : (C) 2016 by Juergen E. Fischer Email : jef at norbit dot de ****************************...
gpl-2.0
FujiZ/ns-3
src/traffic-control/bindings/modulegen__gcc_ILP32.py
38
421868
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
meteoinfo/meteoinfolab
pylib/mipylib/imagelib/filters.py
1
18070
# coding=utf-8 #----------------------------------------------------- # Author: Yaqiang Wang # Date: 2017-5-25 # Purpose: MeteoInfoLab filters module in image package # Note: Jython #----------------------------------------------------- from org.meteoinfo.shape import Graphic from org.meteoinfo.image import I...
lgpl-3.0
amir343/ansible-modules-extras
notification/sns.py
61
5715
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Michael J. Schultz <mjschultz@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 ...
gpl-3.0
Qlwentt/walle
node_modules/grpc/third_party/boringssl/util/generate-asm-lcov.py
37
4797
#!/usr/bin/python # Copyright (c) 2016, Google Inc. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHO...
mit
c0hen/django-venv
lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/base.py
329
13942
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent for...
gpl-3.0
androidgilbert/v2ex
v2ex/babel/l10n/messages/zhHans.py
16
5076
# coding=utf-8 # Messages on top bar home = '首页' images = '图片上传' mentions = '提到我的' workspace = '工作空间' notes = '记事本' nearby = '附近' settings = '设置' backstage = '后台' signin = '登入' signup = '注册' signout = '登出' planes = '位面' # Messages shared by forms chevron = '<span class="chevron">&nbsp;›&nbsp;</span>' resolve_errors ...
bsd-3-clause
mattdennewitz/baseball-pagerank
bbpr/bbpr/spiders/tht.py
1
1790
# -*- coding: utf-8 -*- """Extracts links from Hardball Times and THT Live posts. """ import datetime import urlparse import scrapy import urltools from .base import BaseSpider from ..items import Link, Loader class HardballTimesSpider(BaseSpider): name = 'tht' allowed_domains = ('thehardballtimes.com', ...
mit
jezdez/kuma
vendor/packages/translate/filters/checks.py
21
94232
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2011 Zuza Software Foundation # 2013 F Wolff # # This file is part of translate. # # translate 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; e...
mpl-2.0
emkailu/PAT3DEM
bin/p3boxcoverall.py
1
1429
#!/usr/bin/env python import os import sys import argparse from EMAN2 import * def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <micrograph.mrc> Generate boxes to cover the entire micrograph. The module (micrograph size % box size) will be treaded as edge. """ args_def = {'...
mit
ryfeus/lambda-packs
pytorch/source/caffe2/python/layers/sparse_feature_hash.py
1
3772
## @package sparse_feature_hash # Module caffe2.python.layers.sparse_feature_hash from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import schema, core from caffe2.python.layers.layers import ( Mod...
mit
Johnzero/erp
openerp/addons/auction/barcode/fourstate.py
9
3915
# -*- coding: utf-8 -*- # # Copyright (c) 2000 Tyler C. Sarna <tsarna@sarna.org> # 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 copyrig...
agpl-3.0
caidongyun/pylearn2
pylearn2/models/dbm/__init__.py
43
9023
""" This module contains functionality related to deep Boltzmann machines. They are implemented generically in order to make it easy to support convolution versions, etc. This code was moved piece by piece incrementally over time from Ian's private research repository, and it is altogether possible that he broke somet...
bsd-3-clause
Samsung/skia
third_party/externals/gyp/test/gyp-defines/gyptest-regyp.py
268
1260
#!/usr/bin/env python # 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. """ Verifies that when the same value is repeated for a gyp define, duplicates are stripped from the regeneration rule. """ import os impor...
bsd-3-clause
utsav2601/cmpe295A
tools/harness/tests/channel_cost.py
10
2079
########################################################################## # Copyright (c) 2009, 2010, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Haldeneggsteig 4, C...
mit
abstract-open-solutions/OCB
openerp/cli/scaffold.py
193
4364
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import re import sys import jinja2 from . import Command from openerp.modules.module import (get_module_root, MANIFEST, load_information_from_description_file as load_manifest) class Scaffold(Command): """ Generates an Odoo module skeleton...
agpl-3.0
moyogo/robofab
Lib/robofab/tools/glifImport.py
9
2160
"""Tools for importing GLIFs into FontLab""" import os from FL import fl from robofab.tools.toolsFL import NewGlyph, FontIndex from robofab.pens.flPen import FLPointPen from robofab.glifLib import GlyphSet from robofab.interface.all.dialogs import ProgressBar, GetFolder class GlyphPlaceholder: pass def importAllG...
bsd-3-clause
arifsetiawan/edx-platform
common/djangoapps/course_modes/migrations/0008_auto__del_field_coursemodesarchive_description__add_field_coursemode_s.py
102
3098
# -*- 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 field 'CourseMode.sku' db.add_column('course_modes_coursemode', 'sku', self.g...
agpl-3.0
shashisp/blumix-webpy
app/scripts/service/linux.py
4
6540
from service import ServiceBase import os, sys, time, subprocess, atexit from signal import SIGTERM class LinuxService(ServiceBase): def __init__(self, name, label, stdout='/dev/null', stderr='/dev/null'): ServiceBase.__init__(self, name, label, stdout, stderr) self.pidfile = '/tmp/%s.pid' % name ...
mit