repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
ronan22/mic
mic/3rdparty/pykickstart/commands/device.py
10
4279
# # Chris Lumens <clumens@redhat.com> # # Copyright 2005, 2006, 2007 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. This program is distributed in the hope that it # ...
gpl-2.0
qqzwc/XX-Net
code/default/gae_proxy/server/lib/antlr3/constants.py
123
2111
"""ANTLR3 runtime package""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # 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 ...
bsd-2-clause
chauhanhardik/populo
cms/djangoapps/course_creators/models.py
183
4070
""" Table for storing information about whether or not Studio users have course creation privileges. """ from django.db import models from django.db.models.signals import post_init, post_save from django.dispatch import receiver, Signal from django.contrib.auth.models import User from django.utils import timezone from...
agpl-3.0
cisco-openstack/tempest
tempest/tests/lib/services/compute/test_agents_client.py
7
3553
# Copyright 2015 NEC Corporation. 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
totolef/Sick-beard
lib/hachoir_core/field/fake_array.py
90
2298
import itertools from lib.hachoir_core.field import MissingField class FakeArray: """ Simulate an array for GenericFieldSet.array(): fielset.array("item")[0] is equivalent to fielset.array("item[0]"). It's possible to iterate over the items using:: for element in fieldset.array("item"): ...
gpl-3.0
koyuawsmbrtn/eclock
windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/Demos/win32gui_dialog.py
13
14824
# A demo of a fairly complex dialog. # # Features: # * Uses a "dynamic dialog resource" to build the dialog. # * Uses a ListView control. # * Dynamically resizes content. # * Uses a second worker thread to fill the list. # * Demostrates support for windows XP themes. # If you are on Windows XP, and specify a '--noxp' ...
gpl-2.0
Fireblend/scikit-learn
sklearn/linear_model/base.py
2
16019
""" Generalized Linear models. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Vincent Michel <vincent.michel@inria.fr> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # ...
bsd-3-clause
ncphillips/django_rpg
rpg_base/models/encounter.py
1
1907
from django.db import models class EncounterManager(models.Manager): def enemy_npcs(self): pass def friendly_npcs(self): pass def players(self): return super(EncounterManager, self).get_queryset().filter(character__player_owned=True) class Encounter(models.Model): name = mo...
mit
detiber/lib_openshift
lib_openshift/models/v1_host_subnet.py
2
8397
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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
Just-D/chromium-1
tools/telemetry/third_party/gsutilz/third_party/boto/boto/gs/key.py
114
42702
# Copyright 2010 Google Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
bsd-3-clause
wwj718/edx-platform
lms/djangoapps/course_structure_api/v0/tests.py
41
24799
""" Run these tests @ Devstack: paver test_system -s lms --fasttest --verbose --test_id=lms/djangoapps/course_structure_api """ # pylint: disable=missing-docstring,invalid-name,maybe-no-member,attribute-defined-outside-init from abc import ABCMeta from datetime import datetime from mock import patch, Mock from iter...
agpl-3.0
Syrcon/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/_base.py
715
13699
from __future__ import absolute_import, division, unicode_literals from 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 formatting # fr...
mpl-2.0
Syrcon/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_pdb.py
170
9594
import sys import _pytest._code def runpdb_and_get_report(testdir, source): p = testdir.makepyfile(source) result = testdir.runpytest_inprocess("--pdb", p) reports = result.reprec.getreports("pytest_runtest_logreport") assert len(reports) == 3, reports # setup/call/teardown return reports[1] cl...
mpl-2.0
Split-Screen/android_kernel_lge_hammerhead
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
thecubic/zerorpc-python
tests/testutils.py
101
1875
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
mit
DiptoDas8/Biponi
lib/python2.7/site-packages/django/contrib/gis/db/backends/base/features.py
93
3542
from functools import partial from django.contrib.gis.db.models import aggregates class BaseSpatialFeatures(object): gis_enabled = True # Does the database contain a SpatialRefSys model to store SRID information? has_spatialrefsys_table = True # Does the backend support the django.contrib.gis.utils...
mit
spcui/virt-test
virttest/guest_agent.py
3
21202
""" Interfaces to the virt agent. :copyright: 2008-2012 Red Hat Inc. """ import socket import time import logging import random from autotest.client.shared import error from qemu_monitor import Monitor, MonitorError try: import json except ImportError: logging.warning("Could not import json module. " ...
gpl-2.0
chokribr/inveniotest
modules/bibrank/lib/bibrank_selfcites_regression_tests.py
11
12770
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your opt...
gpl-2.0
siminles/LG-f460s
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
Metaswitch/calico-nova
nova/api/openstack/compute/contrib/server_password.py
10
2496
# Copyright (c) 2012 Nebula, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
rawWhipIT/p22-goldant-buildpack
vendor/pip-1.5.6/pip/_vendor/requests/packages/urllib3/request.py
567
5808
# urllib3/request.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php try: from urllib.parse import urlencode except ImportError: from urllib import urlencod...
mit
maartenq/ansible
lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py
37
9318
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
gpl-3.0
dbbhattacharya/kitsune
kitsune/search/tests/test_json.py
1
2106
from nose.tools import eq_ from kitsune.search.tests.test_es import ElasticTestCase from kitsune.sumo.urlresolvers import reverse from kitsune.sumo.tests import LocalizingClient class JSONTest(ElasticTestCase): client_class = LocalizingClient def test_json_format(self): """JSON without callback shou...
bsd-3-clause
DreamerKing/LightweightHtmlWidgets
LightweightHtmlWidgets/bin/Debug/Ipy.Lib/lib2to3/pgen2/tokenize.py
156
19112
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. # All rights reserved. """Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line o...
gpl-3.0
wangyum/tensorflow
tensorflow/tools/test/upload_test_benchmarks.py
54
9195
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Arundhatii/erpnext
erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py
3
8749
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt """ Import chart of accounts from OpenERP sources """ from __future__ import unicode_literals import os, json import ast from xml.etree import ElementTree as ET from frappe.utils.csvutils imp...
gpl-3.0
SymbiFlow/edalize
edalize/trellis.py
1
3499
# Copyright edalize contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import os.path from edalize.edatool import Edatool from edalize.yosys import Yosys from importlib import import_module class Trellis(Edatool): argtypes = ['vlogdefine', 'v...
bsd-2-clause
markiskander/biomaj
biomaj/user.py
1
7346
from builtins import str from builtins import object import bcrypt import logging from biomaj.mongo_connector import MongoConnector from biomaj.config import BiomajConfig class BmajUser(object): ''' Biomaj User ''' def __init__(self, user): if MongoConnector.db is None: MongoConn...
agpl-3.0
kbrebanov/ansible
lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py
3
17521
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
nsat/gnuradio
gr-utils/python/modtool/scm.py
49
8688
# # Copyright 2013 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
bobwalker99/Pydev
plugins/org.python.pydev/pysrc/third_party/pep8/lib2to3/lib2to3/fixes/fix_tuple_params.py
324
5577
"""Fixer for function definitions with tuple parameters. def func(((a, b), c), d): ... -> def func(x, d): ((a, b), c) = x ... It will also support lambdas: lambda (x, y): x + y -> lambda t: t[0] + t[1] # The parens are a syntax error in Python 3 lambda (x): x + y -> lambda x: x + y """...
epl-1.0
openstack/neutron
neutron/tests/functional/agent/l3/test_metadata_proxy.py
2
5593
# 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
elioth010/lugama
activate/lib/python3.4/site-packages/pip/_vendor/requests/cookies.py
413
17191
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes...
gpl-2.0
mariaantoanelam/Licenta
Lib/profile.py
9
21461
#! /usr/bin/env python # # Class for profiling python code. rev 1.0 6/2/94 # # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum # # See profile.doc for more information """Class for profiling Python code.""" # Copyright 1994, by InfoSeek Corporation, all rights ...
mit
Jorge-Rodriguez/ansible-modules-core
system/group.py
90
13032
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
TEAM-Gummy/platform_external_chromium
testing/gmock/scripts/generator/cpp/utils.py
1158
1153
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 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...
bsd-3-clause
shrutisingala/ns-3-dev-git-limited-slow-start
src/buildings/bindings/modulegen__gcc_LP64.py
28
373233
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
Caylo/easybuild-framework
easybuild/tools/asyncprocess.py
2
5128
## # Copyright 2005 Josiah Carlson # Copyright 2009-2016 Ghent University # # The Asynchronous Python Subprocess recipe was originally created by Josiah Carlson. # and released under the GPL v2 on March 14, 2012 # # http://code.activestate.com/recipes/440554/ # # This file is part of EasyBuild, # originally created by ...
gpl-2.0
elijah513/django
tests/template_tests/syntax_tests/test_include.py
322
11505
from django.template import ( Context, Engine, TemplateDoesNotExist, TemplateSyntaxError, ) from django.test import SimpleTestCase from ..utils import setup from .test_basic import basic_templates include_fail_templates = { 'include-fail1': '{% load bad_tag %}{% badtag %}', 'include-fail2': '{% load broke...
bsd-3-clause
noba3/KoTos
addons/script.module.youtube.dl/lib/youtube_dl/extractor/telebruxelles.py
150
2352
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TeleBruxellesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?telebruxelles\.be/(news|sport|dernier-jt)/?(?P<id>[^/#?]+)' _TESTS = [{ 'url': 'http://www.telebruxelles.be/news/auditions-devant-parlement...
gpl-2.0
akoskovacs/qemu
tests/qemu-iotests/qed.py
248
7194
#!/usr/bin/env python # # Tool to manipulate QED image files # # Copyright (C) 2010 IBM, Corp. # # Authors: # Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> # # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. import sys import struct import r...
gpl-2.0
aselle/tensorflow
tensorflow/contrib/quantization/__init__.py
178
1441
# 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
harmsm/PyCmdMessenger
examples/python-basic.py
2
1164
# ------------------------------------------------------------------------------ # Python program using the library to interface with the arduino sketch above. # ------------------------------------------------------------------------------ import PyCmdMessenger # Initialize an ArduinoBoard instance. This is where y...
mit
mjg2203/edx-platform-seas
lms/envs/edx4edx_aws.py
6
1495
# We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=W0401, W0614 # Settings for edx4edx production instance from .aws import * COURSE_NAME = "edx4edx" COURSE_NUMBER = "edX.01" COURSE_TITLE = "edx4edx: edX Author Course" EDX4EDX_ROO...
agpl-3.0
HyperBaton/ansible
lib/ansible/modules/network/aci/mso_schema_template_bd_subnet.py
13
6932
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ve...
gpl-3.0
Xeralux/tensorflow
tensorflow/tools/gcs_test/python/gcs_smoke.py
63
10316
# 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
dietrichc/streamline-ppc-reports
examples/dfp/v201405/creative_service/get_creatives_by_statement.py
1
2307
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/distutils/command/bdist_rpm.py
72
20997
"""distutils.command.bdist_rpm Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).""" __revision__ = "$Id$" import sys import os import string from distutils.core import Command from distutils.debug import DEBUG from distutils.file_util import write_file from distutils.errors ...
apache-2.0
mskrzypkows/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_msgutil.py
413
54959
#!/usr/bin/env python # # 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...
mpl-2.0
LiveZenLK/CeygateERP
addons/l10n_in_hr_payroll/report/payslip_report.py
47
3022
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import tools from openerp.osv import fields, osv class payslip_report(osv.osv): _name = "payslip.report" _description = "Payslip Analysis" _auto = False _columns = { 'name':fields.ch...
gpl-3.0
sssundar/Drone
rotation/viz.py
1
5332
# Python script to visualize rotation about a non-body axis. # Let the lab frame be the inertial frame S. # Let the origin of the rigid body be O, in the inertial frame S'. # Let r_ss' be the vector from S to S'. # Let the body frame relative to O be S''. # Consider a fixed point on the body, r_s' in S', and r_s'' in...
gpl-3.0
fartashf/python-mode
pymode/libs3/rope/refactor/similarfinder.py
32
12376
"""This module can be used for finding similar code""" import re import rope.refactor.wildcards from rope.base import codeanalyze, evaluate, exceptions, ast, builtins from rope.refactor import (patchedast, sourceutils, occurrences, wildcards, importutils) class BadNameInCheckError(exceptio...
lgpl-3.0
manishpatell/erpcustomizationssaiimpex123qwe
addons/point_of_sale/report/pos_lines.py
150
2369
# -*- 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
caphrim007/ansible
lib/ansible/plugins/action/net_logging.py
648
1057
# (c) 2017, Ansible Inc, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
gpl-3.0
soldag/home-assistant
tests/components/websocket_api/test_init.py
13
2653
"""Tests for the Home Assistant Websocket API.""" from aiohttp import WSMsgType import voluptuous as vol from homeassistant.components.websocket_api import const, messages from tests.async_mock import Mock, patch async def test_invalid_message_format(websocket_client): """Test sending invalid JSON.""" await...
apache-2.0
j3ffhubb/neoteric
tests/neoteric/resource/test_hdata.py
2
2439
""" """ import logging from neoteric.resource.hdata import AbstractHData from neoteric.util.compat import unittest, StringIO from neoteric.util.files import temp_file_name class TestAbstractHData(unittest.TestCase): def test_setattr_getattr(self): hdata = AbstractHData() hdata.variable = 123 ...
gpl-3.0
yongshengwang/hue
desktop/libs/libopenid/src/libopenid/views.py
33
2179
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
fulcrum7/training_a
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
mozilla/normandy
normandy/recipes/tests/test_checks.py
1
4355
from datetime import timedelta from django.db.utils import ProgrammingError import pytest import requests.exceptions from normandy.recipes import checks, signing from normandy.recipes.tests import ActionFactory, RecipeFactory, SignatureFactory, UserFactory @pytest.mark.django_db class TestSignaturesUseGoodCertific...
mpl-2.0
Dwii/Master-Thesis
implementation/Palabos/cavity_benchmark/plot_benchmark.py
1
1854
# Display a list of *.dat files in a bar chart. # Based on an example from https://chrisalbon.com/python/matplotlib_grouped_bar_plot.html import sys import os import matplotlib.pyplot as plt import numpy as np if len(sys.argv) > 3 and (len(sys.argv)-3) % 2 : print("usage: python3 {0} <benchmark> <image path> (<da...
mit
wanggang3333/scikit-learn
sklearn/tests/test_kernel_approximation.py
244
7588
import numpy as np from scipy.sparse import csr_matrix from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true from sklearn.utils.testing import assert_not_equal from sklearn.utils.testing import assert_array_almost_equal, assert_raises from sklearn.utils.testing import assert_less_equal from ...
bsd-3-clause
duramato/SickRage
autoProcessTV/lib/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
playm2mboy/edx-platform
openedx/core/djangoapps/user_api/preferences/views.py
5
10884
""" NOTE: this API is WIP and has not yet been approved. Do not use this API without talking to Christina or Andy. For more information, see: https://openedx.atlassian.net/wiki/display/TNL/User+API """ from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import stat...
agpl-3.0
AxelTLarsson/robot-localisation
robot_localisation/main.py
1
6009
""" This module contains the logic to run the simulation. """ import sys import os import argparse import numpy as np sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from robot_localisation.grid import Grid, build_transition_matrix from robot_localisation.robot import Robot, Sensor from robot_localisatio...
mit
confpack/confpacker
libconfpacker/packagers/base/__init__.py
1
4696
from __future__ import absolute_import from datetime import datetime import logging import os import os.path import subprocess import yaml from cpcommon import cd from .task import Task class Package(object): def src_path(self, *path): return os.path.join(self.src_directory, *path) def __init__(self, nam...
apache-2.0
3nids/QGIS
tests/src/python/test_qgsserver_wms_getprint.py
13
14158
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS GetPrint. From build dir, run: ctest -R PyQgsServerWMSGetPrint -V .. 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 versi...
gpl-2.0
ClearwaterCore/pjsip-upstream
tests/pjsua/mod_pesq.py
59
5140
# $Id: mod_pesq.py 2417 2009-01-05 15:31:25Z bennylp $ # Quality test of media calls. # - UA1 calls UA2 # - UA1 plays a file until finished to be streamed to UA2 # - UA2 records from stream # - Apply PESQ to played file (reference) and recorded file (degraded) # # File should be: # - naming: xxxxxx.CLOCK_RATE.wav, e.g...
gpl-2.0
jamesthechamp/zamboni
sites/s3dev/settings_base.py
6
5383
"""private_base will be populated from puppet and placed in this directory""" import logging import os import dj_database_url from mkt.settings import (CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING, HOSTNAME) from .. import splitstrip import private_base as private ALLOWED_HOSTS = ['.a...
bsd-3-clause
nonbeing/simplemonitor
Alerters/slack.py
1
5883
try: import requests requests_available = True except: requests_available = False from alerter import Alerter from pytz import timezone import pytz class SlackAlerter(Alerter): """Send alerts to a Slack webhook.""" def __init__(self, config_options): if not requests_available: ...
bsd-3-clause
Jokeren/neon
neon/data/imagecaption.py
2
17212
# ---------------------------------------------------------------------------- # Copyright 2016 Nervana Systems 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.o...
apache-2.0
mythos234/AndromedaB-LL-N910F
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
JulienMcJay/eclock
windows/kivy/kivy/core/audio/audio_pygame.py
11
3144
''' AudioPygame: implementation of Sound with Pygame ''' __all__ = ('SoundPygame', ) from kivy.clock import Clock from kivy.utils import platform from kivy.core.audio import Sound, SoundLoader _platform = platform try: if _platform == 'android': try: import android.mixer as mixer exce...
gpl-2.0
chromium/chromium
third_party/android_deps/libs/com_google_errorprone_error_prone_annotation/3pp/fetch.py
5
1396
#!/usr/bin/env python # Copyright 2021 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. # This is generated, do not edit. Update BuildConfigGenerator.groovy and # 3ppFetch.template instead. from __future__ import print_fun...
bsd-3-clause
Dhivyap/ansible
lib/ansible/modules/cloud/opennebula/one_service.py
21
25615
#!/usr/bin/python # -*- coding: utf-8 -*- # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type """ (c) 2017, Milan Ilic <milani@nordeus.com> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the ter...
gpl-3.0
ramitalat/odoo
addons/stock_account/product.py
84
10799
# -*- 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
feanil/ansible-modules-core
system/sysctl.py
105
11861
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com> # (c) 2014, James Tanner <tanner.jc@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 ...
gpl-3.0
mutirri/bokeh
bokeh/cli/core.py
42
16025
from __future__ import absolute_import, print_function import sys, os from six.moves.urllib import request as urllib2 from six.moves import cStringIO as StringIO import pandas as pd try: import click is_click = True except ImportError: is_click = False from . import help_messages as hm from .utils import...
bsd-3-clause
cloudcopy/seahub
thirdpart/rest_framework/response.py
5
2190
from django.core.handlers.wsgi import STATUS_CODE_TEXT from django.template.response import SimpleTemplateResponse class Response(SimpleTemplateResponse): """ An HttpResponse that allows it's data to be rendered into arbitrary media types. """ def __init__(self, data=None, status=200, ...
apache-2.0
xuxiao19910803/edx-platform
lms/djangoapps/bulk_email/migrations/0006_add_course_email_template.py
182
6003
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseEmailTemplate' db.create_table('bulk_email_courseemailtemplate', ( ('id', self.gf('django....
agpl-3.0
TheCoSMoCompany/biopredyn
Prototype/src/libsbml-5.10.0/src/bindings/python/test/sbml/TestSBMLDocument.py
1
6600
# # @file TestSBMLDocument.py # @brief SBMLDocument unit tests # # @author Akiya Jouraku (Python conversion) # @author Ben Bornstein # # ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ====== # # DO NOT EDIT THIS FILE. # # This file was generated automatically by converting the file loca...
bsd-3-clause
aioue/ansible
lib/ansible/modules/network/nxos/nxos_vpc_interface.py
22
10091
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
nitzmahone/ansible
lib/ansible/modules/network/f5/bigip_sys_global.py
11
14522
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2016, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
vovojh/gem5
configs/topologies/BaseTopology.py
62
2958
# Copyright (c) 2012 Advanced Micro Devices, 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...
bsd-3-clause
mclaughlin6464/pearce
bin/optimization/sloppy_joes_optimization_indiv_bins.py
1
1573
from pearce.emulator import OriginalRecipe, ExtraCrispy, SpicyBuffalo, LemonPepperWet from pearce.mocks import cat_dict import numpy as np from os import path from SloppyJoes import lazy_wrapper training_file = '/scratch/users/swmclau2/xi_zheng07_cosmo_lowmsat/PearceRedMagicXiCosmoFixedNd.hdf5' em_method = 'gp' fixed_...
mit
premanandchandrasekar/boto
boto/emr/bootstrap_action.py
56
1795
# Copyright (c) 2010 Spotify AB # Copyright (c) 2010 Yelp # # 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...
mit
janocat/odoo
addons/mail/mail_group.py
247
12877
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
tillahoffmann/tensorflow
tensorflow/python/keras/_impl/keras/datasets/cifar10.py
15
2118
# 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
SyamGadde/cython
Cython/Compiler/CodeGeneration.py
30
1108
from __future__ import absolute_import from .Visitor import VisitorTransform from .Nodes import StatListNode class ExtractPxdCode(VisitorTransform): """ Finds nodes in a pxd file that should generate code, and returns them in a StatListNode. The result is a tuple (StatListNode, ModuleScope), i.e. ...
apache-2.0
leschzinerlab/AWS
awslib/awsdatatransfer.py
2
3723
import math import subprocess import sys import os from fabric.api import env,run,hide,settings #==================== def exec_remote_cmd(cmd): from fabric.operations import run, put from fabric.api import hide,settings with hide('output','running','warnings') and settings(warn_only=True): return r...
mit
sysadmin75/ansible-modules-core
cloud/docker/docker_image.py
11
19382
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # # 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 la...
gpl-3.0
frreiss/tensorflow-fred
tensorflow/python/data/experimental/ops/readers.py
5
48793
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
AndyDiamondstein/vitess
py/vtctl/grpc_vtctl_client.py
4
1752
# Copyright 2015 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. """This file contains the grpc implementation of the vtctl client. """ import datetime from urlparse import urlparse # Import main protobuf library first # to work ar...
bsd-3-clause
rleadbetter/Sick-Beard
sickbeard/metadata/wdtv.py
42
8836
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
Alexanderkorn/Automatisation
oude scripts/Self/IFScraper.py
1
2199
__author__ = 'alexander' import urllib2 import os from lib import pyperclip def PageScrape(pageurl): hdr= {'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.3...
gpl-3.0
tomasreimers/tensorflow-emscripten
tensorflow/python/debug/cli/offline_analyzer.py
16
2561
# 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
prometheanfire/portage
pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
6
4359
# Copyright 2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import textwrap import portage from portage import os from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import ResolverPlayground from portage.package.ebuild._ipc.QueryCommand import Q...
gpl-2.0
istio/envoy
tools/type_whisperer/type_whisperer.py
3
2450
# protoc plugin to map from FileDescriptorProtos to a tools.type_whisperer.Types # proto. This is the type information for a single .proto, consumed by # typedb_gen.py. from tools.api_proto_plugin import plugin from tools.api_proto_plugin import visitor from tools.type_whisperer.types_pb2 import Types from udpa.annot...
apache-2.0
damiencalloway/djtut
mysite/env/lib/python2.7/site-packages/django/conf/locale/pl/formats.py
107
1089
# -*- 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 = 'j E Y' TIME_FORMAT = 'H:i:s' DATE...
mit
appleseedhq/gaffer
python/GafferSceneUI/__init__.py
1
4899
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2012-2016, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
bsd-3-clause
jdumas/autobib
pdftitle.py
1
14035
#!/usr/bin/env python2.7 # https://gist.github.com/nevesnunes/84b2eb7a2cf63cdecd170c139327f0d6 """ Extract title from PDF file. Dependencies: pip install --user unidecode pyPDF PDFMiner Usage: find . -name "*.pdf" | xargs -I{} pdftitle -d tmp --rename {} Limitations: - No processing of CID keyed fonts. ...
gpl-3.0