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
slohse/ansible
lib/ansible/modules/network/aci/aci_contract_subject.py
15
10537
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
Klaudit/livestreamer
src/livestreamer/plugins/streamingvideoprovider.py
34
2388
import re from time import time from livestreamer.plugin import Plugin, PluginError from livestreamer.plugin.api import http, validate from livestreamer.stream import RTMPStream, HLSStream SWF_URL = "http://play.streamingvideoprovider.com/player2.swf" API_URL = "http://player.webvideocore.net/index.php" _url_re = r...
bsd-2-clause
dmacd/FB-try1
nawak/setup.py
3
1451
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args, logfile, errfile): # compile the app setup_util.replace_text("nawak/nawak_app.nim", "host=.* port=5432", "host=" + args.database_host + " port=5432") subprocess.check_call("nimrod c -d:...
bsd-3-clause
ofavre/cellulart
utils.py
1
1311
# -*- coding: utf-8 -*- # License: See LICENSE file. import math CLASSIC = 0 WRAP = 1 #MOBIUS = 2 def distance(world_shape, type=CLASSIC): def distance_classic(a,b): val = 0.0 for ad,bd in zip(a,b): val += (ad-bd)**2 return math.sqrt(val) def distance_wrap(a,b): ...
bsd-3-clause
jokem59/heroprotocol
protocol35634.py
18
29680
# Copyright (c) 2015 Blizzard Entertainment # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
mit
MiltosD/CEF-ELRC
lib/python2.7/site-packages/django_jenkins/tasks/run_jslint.py
3
3353
# -*- coding: utf-8 -*- import os import sys from optparse import make_option from django.conf import settings from django_jenkins.functions import check_output, relpath from django_jenkins.tasks import BaseTask, get_apps_locations class Task(BaseTask): option_list = [make_option("--jslint-interpreter", ...
bsd-3-clause
Gaia3D/QGIS
python/plugins/processing/ui/ui_DlgGetScriptsAndModels.py
6
4645
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'DlgGetScriptsAndModels.ui' # # Created: Fri Nov 21 13:25:47 2014 # by: PyQt4 UI code generator 4.11.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf...
gpl-2.0
claesenm/optunity-benchmark
optimizers/tpe/hyperopt_august2013_mod_src/hyperopt/mongoexp.py
2
60046
""" Mongo-based Experiment driver and worker client =============================================== Components involved: - mongo e.g. mongod ... - driver e.g. hyperopt-mongo-search mongo://address bandit_json bandit_algo_json - worker e.g. hyperopt-mongo-worker --loop mongo://address Mongo ===== Mong...
gpl-3.0
rosmo/ansible
lib/ansible/plugins/terminal/iosxr.py
36
1895
# # (c) 2016 Red Hat 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 d...
gpl-3.0
nathanbjenx/cairis
cairis/core/colourcodes.py
1
3560
# 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...
apache-2.0
kivio/PerfKitBenchmarker
tests/hpcc_benchmark_test.py
2
1726
# Copyright 2014 PerfKitBenchmarker 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 appli...
apache-2.0
incaser/server-tools
base_module_doc_rst/report/__init__.py
23
1062
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
sanjeevtripurari/hue
desktop/libs/libzookeeper/src/libzookeeper/conf.py
24
2086
#!/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
operasoftware/twisted-apns
apns/notification.py
1
5424
from datetime import datetime import binascii import json import struct from apns.commands import NOTIFICATION from apns.utils import datetime_to_timestamp class NotificationError(Exception): """To be thrown upon failures on notification processing.""" pass class NotificationInvalidPriorityError(Notificati...
mit
resmo/ansible
lib/ansible/modules/network/f5/bigiq_utility_license_assignment.py
38
20784
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, 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
punalpatel/st2
st2debug/st2debug/processors.py
9
2965
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
Br3nda/calcalcal
pylib/cherrypy/test/test_objectmapping.py
36
14861
import cherrypy from cherrypy._cpcompat import ntou from cherrypy._cptree import Application from cherrypy.test import helper script_names = ["", "/foo", "/users/fred/blog", "/corp/blog"] class ObjectMappingTest(helper.CPWebCase): def setup_server(): class Root: def index(self, name="world")...
mit
whn09/tensorflow
tensorflow/python/estimator/inputs/numpy_io_test.py
65
9695
# 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
UOMx/edx-platform
common/test/acceptance/pages/lms/peer_grade.py
206
1389
""" Students grade peer submissions. """ from bok_choy.page_object import PageObject from bok_choy.promise import Promise from .rubric import RubricPage class PeerGradePage(PageObject): """ Students grade peer submissions. """ url = None def is_browser_on_page(self): def _is_correct_pag...
agpl-3.0
menardorama/ReadyNAS-Add-ons
headphones-1.0.0/debian/headphones/apps/headphones/lib/requests/packages/urllib3/packages/ordered_dict.py
2040
8935
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
gpl-2.0
jahodfra/mrkev
mrkev/__init__.py
1
1675
__version__ = '0.1' __license__ = ''' Copyright (c) 2012, Frantisek Jahoda 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...
bsd-3-clause
raags/ansible-modules-core
network/openswitch/ops_template.py
5
7706
#!/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
mozilla/popcorn_maker
vendor-local/lib/python/nose/case.py
92
13171
"""nose unittest.TestCase subclasses. It is not necessary to subclass these classes when writing tests; they are used internally by nose.loader.TestLoader to create test cases from test functions and methods in test classes. """ import logging import sys import unittest from inspect import isfunction from nose.config i...
bsd-3-clause
vessemer/concept-to-clinic
prediction/src/tests/test_segmentation.py
1
2579
import os import time import pylidc as pl import pytest from config import Config from . import get_timeout from ..algorithms.identify.prediction import load_patient_images from ..algorithms.segment.trained_model import predict from ..preprocess.lung_segmentation import save_lung_segments, get_z_range def test_cor...
mit
LordDamionDevil/Lony
lib/pip/_vendor/requests/packages/urllib3/_collections.py
666
10553
from __future__ import absolute_import from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): ...
gpl-3.0
ptisserand/ansible
contrib/inventory/foreman.py
22
16817
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # # Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>, # Daniel Lobato Garcia <dlobatog@redhat.com> # # This script is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # t...
gpl-3.0
dabrahams/0install
zeroinstall/0launch-gui/main.py
1
6132
# Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. from __future__ import print_function import os, sys import logging import warnings from optparse import OptionParser from zeroinstall import _, SafeException from zeroinstall.injector import requirements from zero...
lgpl-2.1
Nu3001/external_chromium_org
native_client_sdk/src/test_all.py
48
1176
#!/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 os import sys import unittest # add tools folder to sys.path SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.pa...
bsd-3-clause
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/tests/python/train/test_mlp.py
24
4074
# 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 u...
apache-2.0
prodromou87/gem5
src/arch/x86/isa/insts/simd128/integer/data_transfer/__init__.py
91
2388
# 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
otov4its/django-walletone
walletone/views.py
1
1337
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.http.response import HttpResponse, HttpResponseBadRequest from django.views.decorators.csrf import csrf_exempt from .forms import WalletOneConfirmForm from . import signals logger = logging.getLogger(__name__) @csrf_exempt ...
mit
isaac-philip/loolu
common/django/contrib/auth/middleware.py
28
3552
from django.contrib import auth from django.core.exceptions import ImproperlyConfigured class LazyUser(object): def __get__(self, request, obj_type=None): if not hasattr(request, '_cached_user'): from django.contrib.auth import get_user request._cached_user = get_user(request) ...
mit
dreamsxin/kbengine
kbe/src/lib/python/Tools/msi/msilib.py
37
24085
# Microsoft Installer Library # (C) 2003 Martin v. Loewis import win32com.client.gencache import win32com.client import pythoncom, pywintypes from win32com.client import constants import re, string, os, sets, glob, subprocess, sys, _winreg, struct, _msi try: basestring except NameError: basestring = (str, uni...
lgpl-3.0
amrishparmar/mal_cl_interface
nl_interface/search.py
1
4686
import html from enum import Enum import click import requests from bs4 import BeautifulSoup import agent import network import ui class StatusCode(Enum): """An Enum represented the type of result of database searches""" NO_RESULTS = 0 USER_CANCELLED = 1 def display_entry_details(entry): """Displa...
mit
dims/nova
nova/tests/unit/scheduler/filters/test_aggregate_multitenancy_isolation_filters.py
28
3069
# 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 # d...
apache-2.0
vlegoff/tsunami
src/secondaires/peche/commandes/banc/editer.py
1
2649
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 ...
bsd-3-clause
mitchcapper/mythbox
resources/lib/twisted/twisted/conch/test/test_recvline.py
59
21585
# -*- test-case-name: twisted.conch.test.test_recvline -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.recvline} and fixtures for testing related functionality. """ import sys, os from twisted.conch.insults import insults from twisted.conch import r...
gpl-2.0
shubhdev/openedx
openedx/core/lib/api/fields.py
3
1674
"""Fields useful for edX API implementations.""" from django.core.exceptions import ValidationError from rest_framework.serializers import CharField, Field class ExpandableField(Field): """Field that can dynamically use a more detailed serializer based on a user-provided "expand" parameter.""" def __init__(s...
agpl-3.0
tmpgit/intellij-community
python/helpers/epydoc/checker.py
108
12978
# # objdoc: epydoc documentation completeness checker # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: checker.py 1366 2006-09-07 15:54:59Z edloper $ # """ Documentation completeness checker. This module defines a single class, C{DocChecker}, which can be used to check the that specified classes of objects are d...
apache-2.0
reviewboard/rbtools
rbtools/clients/plastic.py
1
13440
"""A client for Plastic SCM.""" from __future__ import unicode_literals import logging import os import re from rbtools.clients import SCMClient, RepositoryInfo from rbtools.clients.errors import (InvalidRevisionSpecError, TooManyRevisionsError, ...
mit
304471720/tornado
tornado/test/httputil_test.py
50
12795
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado.httputil import url_concat, parse_multipart_form_data, HTTPHeaders, format_timestamp, HTTPServerRequest, parse_request_start_line from tornado.escape import utf8, native_str from tornado.log import gen_...
apache-2.0
jaysonsantos/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_http_header_util.py
496
3372
#!/usr/bin/env python # # 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...
mpl-2.0
Statoil/SegyIO
python/examples/write.py
1
2756
import sys import segyio import numpy as np def main(): if len( sys.argv ) < 2: sys.exit("Usage: write.py [file]") filename = sys.argv[1] # the mode parameter is passed directly to C's fopen # opening the file for writing requires r+, not rw because rw would # truncate (effectively destro...
lgpl-3.0
edensparkles/FIRSTAID
FIRST_AID/venv/Lib/encodings/cp775.py
272
34476
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
mit
CredoReference/edx-platform
lms/djangoapps/shoppingcart/tests/test_pdf.py
13
11103
""" Tests for Pdf file """ import unittest from datetime import datetime from io import BytesIO from django.conf import settings from django.test.utils import override_settings from shoppingcart.pdf import PDFInvoice from shoppingcart.utils import parse_pages PDF_RECEIPT_DISCLAIMER_TEXT = "THE SITE AND ANY INFORMATI...
agpl-3.0
andyzsf/django
tests/admin_changelist/models.py
96
2583
from django.db import models from django.utils.encoding import python_2_unicode_compatible class Event(models.Model): # Oracle can have problems with a column named "date" date = models.DateField(db_column="event_date") class Parent(models.Model): name = models.CharField(max_length=128) class Child(mo...
bsd-3-clause
jaywreddy/django
django/db/backends/oracle/base.py
174
24995
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import datetime import decimal import os import platform import sys import warnings from django.conf import settings from django.db import utils from django.db.backends.base.base ...
bsd-3-clause
freakboy3742/django
django/template/utils.py
39
3560
import functools from collections import Counter from pathlib import Path from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.functional import cached_property from django.utils.module_loading import import_string class InvalidTempla...
bsd-3-clause
mathspace/django
django/template/backends/django.py
119
4406
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import sys from importlib import import_module from pkgutil import walk_packages from django.apps import apps from django.conf import settings from django.template import TemplateDoesNotExist from dja...
bsd-3-clause
vineet-rh/incubator-airflow
airflow/hooks/mysql_hook.py
11
2955
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
jhawkesworth/ansible
lib/ansible/plugins/cache/__init__.py
39
12348
# (c) 2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2018, Ansible Project # # 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, o...
gpl-3.0
ivan-fedorov/intellij-community
python/lib/Lib/site-packages/django/test/_doctest.py
167
100621
# This is a slightly modified version of the doctest.py that shipped with Python 2.4 # It incorporates changes that have been submitted to the Python ticket tracker # as ticket #1521051. These changes allow for a DoctestRunner and Doctest base # class to be specified when constructing a DoctestSuite. # Module doctest....
apache-2.0
elssar/calibre
src/tinycss/tokenizer.py
20
7777
# coding: utf8 """ tinycss.tokenizer ----------------- Tokenizer for the CSS core syntax: http://www.w3.org/TR/CSS21/syndata.html#tokenization This is the pure-python implementation. See also speedups.pyx :copyright: (c) 2012 by Simon Sapin. :license: BSD, see LICENSE for more details. ""...
gpl-3.0
annegentle/magnum
magnum/common/pythonk8sclient/client/models/V1beta3_ServicePort.py
15
2051
#!/usr/bin/env python """ Copyright 2015 Reverb Technologies, 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 require...
apache-2.0
iradul/phantomjs-clone
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/irc/irc_mock.py
126
1754
# Copyright (c) 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 ...
bsd-3-clause
JTarball/tetherbox
docker/app/app/backend/apps/_archive/accounts_old/registration/tests/test_views.py
8
1665
from django import test class RegistrationViewTests(test.TestCase): """ A class to test registration views. """ def test_activation(self): pass def test_registration(self): pass def test_registration_failed_email(self): pass def test_post_activation(self): pass ...
isc
hongquan/saleor
saleor/dashboard/order/forms.py
2
4228
from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ from satchless.item import InsufficientStock from ...cart.forms import QuantityField from ...order.models import DeliveryGroup, OrderedItem, OrderNote from ...product.models import Product class ...
bsd-3-clause
drawks/ansible
lib/ansible/modules/system/systemd.py
9
20994
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Brian Coca <bcoca@ansible.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_version': '1...
gpl-3.0
oblalex/gnuplot.py-py3k
PlotItems.py
1
26123
# $Id: PlotItems.py 299 2007-03-30 12:52:17Z mhagger $ # Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu> # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """PlotItems.py -- Objects that can be plotted by Gnuplot. This module contains severa...
lgpl-2.1
webmull/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
139
10217
# 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
devs1991/test_edx_docmode
lms/djangoapps/courseware/features/lti.py
43
14188
# pylint: disable=missing-docstring import datetime import os import pytz from django.conf import settings from mock import patch from pytz import UTC from splinter.exceptions import ElementDoesNotExist from selenium.common.exceptions import NoAlertPresentException from nose.tools import assert_true, assert_equal, asse...
agpl-3.0
wtpayne/hiai
a3_src/h70_internal/da/lwc/env.py
1
8714
# -*- coding: utf-8 -*- """ Local working copy runtime environment control. --- type: python_module validation_level: v00_minimum protection: k00_public copyright: "Copyright 2016 High Integrity Artificial Intelligence Systems" license: "Licensed under the Apache License, Version 2.0 (the Licen...
apache-2.0
petermat/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/file_lock_mock.py
130
1551
# Copyright (c) 2012 Google Inc. All rights reserved. # # 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...
bsd-3-clause
xen0l/ansible
test/sanity/validate-modules/test_validate_modules_regex.py
49
2784
# This is a standalone test for the regex inside validate-modules # It is not suitable to add to the make tests target because the # file under test is outside the test's sys.path AND has a hyphen # in the name making it unimportable. # # To execute this by hand: # 1) cd <checkoutdir> # 2) source hacking/env-setup ...
gpl-3.0
TimmyTossPot/rk30-kernel
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
GPUOpen-Drivers/pal
tools/generate/offline/drmLoader.py
2
3475
## ####################################################################################################################### # # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associ...
mit
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_binding.py
1
4725
# # Copyright (c) 2008-2015 Citrix 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.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
jfouca/confucius
confucius/models/conference.py
1
7188
from django.db import models from django.db.models import Q from django.db.models.signals import pre_save, post_delete from django.dispatch import receiver from datetime import datetime from confucius.models import ConfuciusModel, User class Action(ConfuciusModel): name = models.CharField(max_length=155, verbose_...
bsd-3-clause
sriprasanna/django-1.3.1
tests/runtests.py
21
11624
#!/usr/bin/env python import os, subprocess, sys import django.contrib as contrib CONTRIB_DIR_NAME = 'django.contrib' MODEL_TESTS_DIR_NAME = 'modeltests' REGRESSION_TESTS_DIR_NAME = 'regressiontests' TEST_TEMPLATE_DIR = 'templates' CONTRIB_DIR = os.path.dirname(contrib.__file__) MODEL_TEST_DIR = os.path.join(os.pat...
bsd-3-clause
pabulumm/neighbors
lib/python3.4/site-packages/django/db/models/aggregates.py
65
6528
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Star from django.db.models.fields import FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] ...
bsd-3-clause
rajpushkar83/cloudmesh
cloudmesh/management/project.py
1
12236
from mongoengine import * from mongoengine.context_managers import switch_db from datetime import datetime import hashlib import uuid from user import User, Users # from comittee import Committee from pprint import pprint from cloudmeshobject import CloudmeshObject from cloudmesh_base.ConfigDict import ConfigDict from ...
apache-2.0
Baumelbi/IntroPython2016
students/jbearer/session07/html_render/test_html_render.py
3
4137
#!/usr/bin/env python """ test code for html_render.py """ import io from html_render import Element, Html, Body, P, Head, Title def test_init(): e = Element() e = Element("this is some text") def test_content(): # fixme: this tests internals!!!! e = Element("this is some text") assert "this i...
unlicense
svanschalkwyk/datafari
cassandra/pylib/cqlshlib/test/test_cqlsh_output.py
16
32038
# 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 u...
apache-2.0
junhuac/MQUIC
src/tools/grit/grit/extern/tclib.py
63
16892
#!/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. # The tclib module contains tools for aggregating, verifying, and storing # messages destined for the Translation Console, as well ...
mit
sellberg/SACLA2016B8055
scripts/03_plot_h5.py
2
1294
#!/home/doniach/dermen/epd731/bin/python import numpy as np import h5py import matplotlib import matplotlib.pyplot as plt import argparse import time import pandas as pd import sys # -- default parameters run = 448539 file_folder = '/UserData/fperakis/2016_6/01_test/' # h5 files folder src_folder = '/home/fperakis...
bsd-2-clause
Nowheresly/odoo
addons/l10n_pl/__init__.py
340
1155
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # l10n_pl module improved for Poland # by Grzegorz Grzelak grzegorz.g...
agpl-3.0
pkruskal/scikit-learn
examples/cluster/plot_cluster_iris.py
350
2593
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= K-means Clustering ========================================================= The plots display firstly what a K-means algorithm would yield using three clusters. It is then shown what the effect of a bad initializa...
bsd-3-clause
dpc/rust
src/etc/extract_grammar.py
26
3881
#!/usr/bin/env python # # Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice...
apache-2.0
ChrisCinelli/pgessays
env/lib/python2.7/site-packages/genshi/template/loader.py
21
14749
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2010 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consist...
bsd-2-clause
Justin-Yuan/Image2Music-Generator
library/jython2.5.3/Lib/test/pickletester.py
10
29661
import unittest import pickle import cPickle import pickletools import copy_reg from test.test_support import TestFailed, have_unicode, TESTFN, is_jython # Tests that try a number of pickle protocols should have a # for proto in protocols: # kind of outer loop. assert pickle.HIGHEST_PROTOCOL == cPickle.HIGHEST_PR...
gpl-2.0
kennedyshead/home-assistant
tests/components/group/test_reproduce_state.py
8
1610
"""The tests for reproduction of state.""" from asyncio import Future from unittest.mock import patch from homeassistant.components.group.reproduce_state import async_reproduce_states from homeassistant.core import Context, State async def test_reproduce_group(hass): """Test reproduce_state with group.""" c...
apache-2.0
rouault/Quantum-GIS
tests/src/python/test_qgsserver_wms_getmap.py
2
40401
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS. From build dir, run: ctest -R PyQgsServerWMS -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 version 2 of the Licen...
gpl-2.0
Pardus-Linux/pisi
tests/packagetest.py
4
1280
import unittest import os from pisi import util from pisi import package import pisi.context as ctx class PackageTestCase(unittest.TestCase): def setUp(self): unittest.TestCase.setUp(self) self.pkgName = "test-7.1-2-p11-x86_64.pisi" def testAddPackage(self): cur = os.getcwd() ...
gpl-2.0
jeffzheng1/tensorflow
tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py
10
10030
# 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
ChrisAntaki/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/promptforbugortitle.py
147
2253
# Copyright (C) 2010 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 th...
bsd-3-clause
varunarya10/tempest
tempest/api/orchestration/stacks/test_resource_types.py
23
2127
# 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 # d...
apache-2.0
emailweixu/Paddle
benchmark/paddle/image/googlenet.py
13
6477
#!/usr/bin/env python from paddle.trainer_config_helpers import * height = 224 width = 224 num_class = 1000 batch_size = get_config_arg('batch_size', int, 128) args = {'height': height, 'width': width, 'color': True, 'num_class': num_class} define_py_data_sources2( "train.list", None, module="provider", obj="proc...
apache-2.0
berkeley-stat159/project-epsilon
code/utils/scripts/t_test_plot_script.py
1
3981
""" Purpose: ----------------------------------------------------------- This script creates graphs for t-test for 4 conditions For each subject each run each condition, plot the t statistics ----------------------------------------------------------- """ import sys, os sys.path.append(os.path.join(os.path.dirname(_...
bsd-3-clause
simonswine/kubernetes-contrib
compare/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py
1138
3876
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
bowlofstew/zulip
zerver/test_events.py
115
38015
# -*- coding: utf-8 -*- from django.test import TestCase from zerver.models import ( get_client, get_realm, get_stream, get_user_profile_by_email, Message, Recipient, ) from zerver.lib.actions import ( apply_events, create_stream_if_needed, do_add_alert_words, do_add_realm_emoji, do_add_re...
apache-2.0
MattsFleaMarket/python-for-android
python3-alpha/python3-src/Lib/test/test_contextlib.py
55
10288
"""Unit tests for contextlib.py, and other context managers.""" import sys import tempfile import unittest from contextlib import * # Tests __all__ from test import support try: import threading except ImportError: threading = None class ContextManagerTestCase(unittest.TestCase): def test_contextmanage...
apache-2.0
ribag/ganeti-experiments
test/py/ganeti.uidpool_unittest.py
8
3899
#!/usr/bin/python # # Copyright (C) 2010 Google Inc. # # 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...
gpl-2.0
basho/riak-python-client
riak/test_server.py
1
10342
# Copyright 2010-present Basho Technologies, 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 a...
apache-2.0
destijl/forensicartifacts
frontend/thirdparty/networkx-1.9/networkx/algorithms/assortativity/tests/base_test.py
89
1489
import networkx as nx class BaseTestAttributeMixing(object): def setUp(self): G=nx.Graph() G.add_nodes_from([0,1],fish='one') G.add_nodes_from([2,3],fish='two') G.add_nodes_from([4],fish='red') G.add_nodes_from([5],fish='blue') G.add_edges_from([(0,1),(2,3),(0,...
apache-2.0
scripnichenko/nova
nova/tests/unit/pci/fakes.py
79
1156
# Copyright (c) 2014 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
arvinsahni/ml4
flask/app/vizarvin.py
2
9900
from __future__ import division from flask import render_template, request, Response, jsonify,redirect,url_for,flash from werkzeug.utils import secure_filename from app import app import pandas from pandas.util import hash_pandas_object import json import psycopg2 import psycopg2.extras import os import pandas as p...
mit
irvingprog/pilas
pilas/ejemplos/ejemplos/disparos/disparo.py
6
1541
import pilas pilas.iniciar() def eliminar_aceituna(proyectil, ovni): ovni.eliminar() proyectil.eliminar() def disparo_simple(): nave.aprender(pilas.habilidades.Disparar, municion=pilas.actores.proyectil.Bala, offset_disparo=(0, 30), grupo_enemigos=ovn...
lgpl-3.0
bkold/CarbonCopy
ribbit_app/tests.py
1
6847
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from django.conf.urls import url from ribbit_app.models import Ribbit from . import views from django.core.urlresolvers import reverse from django.test import LiveServerTestCase from django.contrib.auth....
mit
MatthieuBizien/scikit-learn
examples/exercises/plot_cv_digits.py
135
1223
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
bsd-3-clause
barnsnake351/nova
nova/api/openstack/compute/legacy_v2/contrib/services.py
42
6686
# Copyright 2012 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