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
zhengyongbo/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/setup.py
226
5923
#! /usr/bin/python # # See README for usage instructions. # We must use setuptools, not distutils, because we need to use the # namespace_packages option for the "google" package. from ez_setup import use_setuptools use_setuptools() from setuptools import setup, Extension from distutils.spawn import find_executable i...
bsd-3-clause
simsong/grr-insider
lib/parsers.py
1
5759
#!/usr/bin/env python """Registry for parsers and abstract classes for basic parser functionality.""" from grr.lib import artifact_lib from grr.lib import rdfvalue from grr.lib import registry class Error(Exception): """Base error class.""" class ParserDefinitionError(Exception): """A parser was defined badly....
apache-2.0
feigames/Odoo
addons/pos_discount/discount.py
315
1468
# -*- 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
igemsoftware/SYSU-Software2013
project/Python27/Lib/ctypes/test/test_unaligned_structures.py
282
1215
import sys, unittest from ctypes import * structures = [] byteswapped_structures = [] if sys.byteorder == "little": SwappedStructure = BigEndianStructure else: SwappedStructure = LittleEndianStructure for typ in [c_short, c_int, c_long, c_longlong, c_float, c_double, c_ushort, c_uint...
mit
jtg-gg/blink
Source/build/scripts/make_internal_runtime_flags.py
42
2736
#!/usr/bin/env python # Copyright (C) 2013 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 ...
bsd-3-clause
kwanghui/patents
test/test_sqlite_merge.py
6
3869
#!/usr/bin/env python import unittest import os import sqlite3 import sys sys.path.append( '../lib/' ) import SQLite class TestSQLite(unittest.TestCase): def removeFile(self, fname): #delete a fname if it exists try: os.remove(fname) except OSError: pass def c...
bsd-2-clause
arbrandes/edx-platform
openedx/core/djangoapps/dark_lang/views.py
4
4169
""" Views file for the Darklang Django App """ from django.contrib.auth.decorators import login_required from django.http import Http404 from django.shortcuts import redirect from django.template.loader import render_to_string from django.utils.decorators import method_decorator from django.utils.translation import L...
agpl-3.0
yglazko/socorro
socorro/unittest/external/postgresql/test_platforms.py
11
2365
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from nose.plugins.attrib import attr from nose.tools import eq_ from socorro.external.postgresql.platforms import Platf...
mpl-2.0
apache/airflow
airflow/providers/apache/kylin/operators/kylin_cube.py
2
7632
# # 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...
apache-2.0
CoDEmanX/ArangoDB
3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/command/bdist_wininst.py
49
14929
"""distutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: bdist_wininst.py 71422 2009-04-09 22:48:19Z tarek.ziade $" import sys, os, string from distutils.core import C...
apache-2.0
Mr-lin930819/SimplOS
fill_screens.py
17
2574
#!/usr/bin/env python2.5 import cgi import os import shutil import sys import sqlite3 SCREENS = 5 COLUMNS = 4 ROWS = 4 CELL_SIZE = 110 DIR = "db_files" AUTO_FILE = "launcher.db" APPLICATION_COMPONENTS = [ "com.android.calculator2/com.android.calculator2.Calculator", "com.android.providers.downloads.ui/com.andro...
gpl-3.0
robertswiecki/oss-fuzz
infra/gcb/builds_status.py
1
3990
#!/usr/bin/env python2 import datetime import os import sys import jinja2 import json import tempfile import dateutil.parser from oauth2client.client import GoogleCredentials import googleapiclient from googleapiclient.discovery import build as gcb_build from google.cloud import logging from google.cloud import stora...
apache-2.0
liguangsheng/shadowsocks
shadowsocks/tcprelay.py
922
28870
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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
hastexo/edx-platform
common/djangoapps/django_comment_common/models.py
1
7716
import json import logging from config_models.models import ConfigurationModel from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.translation import ugettext_noop...
agpl-3.0
p/pycurl-archived
tests/internals_test.py
2
6879
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et import pycurl import unittest from .util import StringIO try: import cPickle except ImportError: cPickle = None import pickle import gc import copy class InternalsTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() ...
lgpl-2.1
CiuffysHub/MITMf
mitmflib-0.18.4/mitmflib/impacket/krb5/ccache.py
2
17647
# Copyright (c) 2003-2015 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Author: Alberto Solino (@agsolino) # # Description: # Kerberos Credential Cache format implementati...
gpl-3.0
TeamNyx/external_gtest
test/gtest_uninitialized_test.py
2901
2480
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
shlomif/rhizi
src/local/server-tools/rz-user-tool.py
4
7072
#!/usr/bin/python2.7 # This file is part of rhizi, a collaborative knowledge graph editor. # Copyright (C) 2014-2015 Rhizi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundatio...
agpl-3.0
beppec56/core
uitest/writer_tests/insertTableDialog.py
1
3904
# # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues class WriterInse...
gpl-3.0
albertomurillo/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vm_facts.py
40
4928
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
gpl-3.0
mozilla/inferno
test/lib/test_archiver.py
4
6834
from nose.tools import eq_ from nose.tools import ok_ from inferno.lib.archiver import Archiver from test.mock.disco import DDFS class TestArchiver(object): def _setup(self, tags=()): self.archiver = Archiver( ddfs=DDFS(), archive_prefix='processed', archive_mode=Tru...
mit
henryfjordan/django
django/contrib/gis/utils/ogrinspect.py
391
9090
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
bsd-3-clause
savoca/ifc6540
scripts/build-all.py
26
14705
#! /usr/bin/env python # Copyright (c) 2009-2014, The Linux Foundation. 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 # ...
gpl-2.0
jzmnd/Stino
stino/pyarduino/arduino_target_platform.py
14
1331
#!/usr/bin/env python #-*- coding: utf-8 -*- # 1. Copyright # 2. Lisence # 3. Author """ Documents """ from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals from . import base class TargetPlatform(object): def __ini...
mit
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/django/contrib/gis/tests/test_spatialrefsys.py
88
6775
from django.db import connection from django.contrib.gis.gdal import GDAL_VERSION from django.contrib.gis.tests.utils import no_mysql, oracle, postgis, spatialite from django.utils import unittest test_srs = ({'srid' : 4326, 'auth_name' : ('EPSG', True), 'auth_srid' : 4326, 'srt...
agpl-3.0
happy5214/pywikibot-core
tests/data_ingestion_tests.py
6
4044
#!/usr/bin/python # -*- coding: utf-8 -*- """Unit tests for data_ingestion.py script.""" # # (C) Pywikibot team, 2012-2015 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals from scripts import data_ingestion from tests import join_data_path, join_images_pat...
mit
pshen/ansible
lib/ansible/module_utils/facts/system/service_mgr.py
59
5946
# Collect facts related to system service manager and init. # # 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) a...
gpl-3.0
fibbo/DIRAC
Core/Workflow/Step.py
7
17136
''' Step. Steps are included in the workflows, and include modules ''' import os import time import types import traceback import sys from DIRAC import S_OK, S_ERROR from DIRAC.Core.Workflow.Parameter import Parameter, AttributeCollection, ParameterCollection, indent from DIRAC.Core.Workflow.Module import InstancesP...
gpl-3.0
Pikecillo/genna
external/PyXML-0.8.4/test/test_domreg.py
1
2996
"""Test DOM registration framework.""" import unittest import test_support from xml.dom import domreg def parse_feature_string(s): # helper to make sure the results are always plain lists return list(domreg._parse_feature_string(s)) class DomregTestCase(unittest.TestCase): def setUp(self): d...
gpl-2.0
nikoonia/gem5v
src/mem/slicc/ast/TypeFieldAST.py
92
1754
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
raschlemper/teratec
node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
zennobjects/kivy
kivy/adapters/listadapter.py
7
17276
''' ListAdapter ================= .. versionadded:: 1.5 .. warning:: This code is still experimental, and its API is subject to change in a future version. A :class:`ListAdapter` is an adapter around a python list. Selection operations are a main concern for the class. From an :class:`Adapter`, a :class:`...
mit
fanghuaqi/mbed
tools/host_tests/stdio_auto.py
122
2105
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping
configs/common/cpu2000.py
48
22462
# Copyright (c) 2006-2008 The Regents of The University of Michigan # 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
connexio/cypb
pb2.4/google/protobuf/service_reflection.py
601
11010
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
afrigeo/google-visualization-python
examples/dynamic_example.py
13
1525
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
aroberge/docpicture
examples/uml_sequence.py
1
4381
""" Just an empty module used as a test for uml sequence diagrams. The following include some examples taken from the original website http://www.websequencediagrams.com and adapted for our purpose by including the docpicture directive. Aside: just for a quick test, we include another type of object. ..docpicture:: u...
bsd-3-clause
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/threading.py
31
32474
"""Thread module emulating a subset of Java's threading model.""" import sys as _sys try: import thread except ImportError: del _sys.modules[__name__] raise import warnings from time import time as _time, sleep as _sleep from traceback import format_exc as _format_exc # Note regarding PEP 8 compliant a...
gpl-2.0
Runscope/pysaml2
src/saml2/ecp_client.py
1
11162
#!/usr/bin/env python # -*- coding: utf-8 -*- # """ Contains a class that can do SAML ECP Authentication for other python programs. """ import cookielib import logging from saml2 import soap from saml2 import saml from saml2 import samlp from saml2 import SAMLError from saml2 import BINDING_SOAP from saml2.client_ba...
bsd-2-clause
proxysh/Safejumper-for-Mac
buildlinux/env64/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
713
5879
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
gpl-2.0
JulienPeloton/LaFabrique
generate_dataset.py
1
3629
import os import sys import argparse import ConfigParser from LaFabrique import scanning_strategy from LaFabrique import noise from LaFabrique import util_CMB from LaFabrique import communication as comm try: from LaFabrique import foreground except: print 'PySM not found - no foreground generation possible.....
gpl-3.0
ericschultz/baddatelist_django
hetaira/parser/tests.py
1
2486
from django.test import TestCase from hetaira.parser import TokenizerError, MessageParser, ParserError class TestParsing(TestCase): def test_phone_numbers_request(self): parser = MessageParser() possible_numbers = ["9205555555", " 9205555555", "9205555555 ", " (92055555)5-5 "] results = ma...
agpl-3.0
ak110/pytoolkit
pytoolkit/models.py
1
26024
"""Kerasのモデル関連。 Horovodに対応した簡単なwrapperなど。 ただし引数のデフォルトや細かい挙動を変えていたりするので要注意。 """ from __future__ import annotations import functools import hashlib import logging import os import pathlib import tempfile import typing import numpy as np import tensorflow as tf import pytoolkit as tk # モデルの入出力の型 ModelIOType = typin...
mit
Metaswitch/calico-neutron
neutron/tests/post_mortem_debug.py
72
4237
# Copyright 2013 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
skearnes/pylearn2
pylearn2/costs/autoencoder.py
5
6144
""" .. todo:: WRITEME """ from theano import tensor import theano.sparse from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin from theano.tensor.shared_randomstreams import RandomStreams class GSNFriendlyCost(DefaultDataSpecsMixin, Cost): """ .. todo:: WRITEME """ @staticmethod ...
bsd-3-clause
CapOM/ChromiumGStreamerBackend
tools/screenshot_testing/update_golden_screenshots.py
59
3403
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import getopt import os here = os.path.realpath(__file__) src_path = (os.path.normpath(os.path.join(here, '..', '..', '..'))) sys.path.append(os...
bsd-3-clause
google-research/google-research
smu/smu_sqlite.py
1
7381
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
GeotrekCE/Geotrek-admin
mapentity/urls.py
3
1439
from django.conf import settings from django.urls import path, re_path, include from .settings import app_settings from .registry import registry from .views import (map_screenshot, history_delete, serve_attachment, JSSettings, Convert) if app_settings['ACTION_HISTORY_ENABLED']: from .models im...
bsd-2-clause
chiviak/CouchPotatoServer
libs/subliminal/core.py
53
12854
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
gpl-3.0
panosmdma/SlackOnly-SlackBuilds
development/python3-matplotlib/setupext.py
2
58330
from __future__ import print_function, absolute_import from distutils import sysconfig from distutils import version from distutils.core import Extension import glob import io import multiprocessing import os import re import subprocess import sys import warnings from textwrap import fill import versioneer PY3min =...
mit
Elizaveta239/PyDev.Debugger
pydevd_attach_to_process/winappdbg/util.py
102
36223
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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 ...
epl-1.0
mrrrgn/AutobahnPython
examples/twisted/websocket/broadcast/client.py
18
1802
############################################################################### ## ## Copyright (C) 2011-2013 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
Heathckliff/SU2
SU2_PY/patient_designspace.py
3
3679
#!/usr/bin/env python ## \file patient_designspace.py # \brief Python script for running multiple design configurations in multiple sessions # \author T. Lukaczyk # \version 4.0.1 "Cardinal" # # SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com). # Dr. Thomas D. Econ...
lgpl-2.1
edx/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/formtools/tests.py
44
9574
import unittest from django import forms from django.conf import settings from django.contrib.formtools import preview, wizard, utils from django import http from django.test import TestCase success_string = "Done was called!" class TestFormPreview(preview.FormPreview): def done(self, request, cleaned_data): ...
gpl-3.0
Tesla-Redux/android_external_skia
tools/tests/bench_pictures_cfg_test.py
155
1340
# 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. """ Verify that the bench_pictures.cfg file is sane. """ import os import sys def ThrowIfNotAString(obj): """ Raise a TypeError if obj is not a st...
bsd-3-clause
bdcht/amoco
amoco/ui/graphics/qt_/graphwin.py
1
13132
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2020 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license from math import sin,cos,pi,pow,radians from PySide2.QtCore import (Qt, Signal, QPointF, QRec...
gpl-2.0
Lapotor/libretime
dev_tools/compare_cc_files_to_fs.py
10
5060
import os import time import shutil import sys import logging from configobj import ConfigObj from subprocess import Popen, PIPE from api_clients import api_client as apc """ The purpose of this script is that you can run it, and it will compare what the database has to what your filesystem has. It will then report i...
agpl-3.0
septicmk/MEHI
test/test_p_fusion.py
1
1315
################################ # Author : septicmk # Date : 2015/07/24 20:08:44 # FileName : test_p_fusion.py ################################ from MEHI.paralleled.fusion import * from MEHI.paralleled.IO import load_tiff from test_utils import PySparkTestCase import numpy as np import os L_pwd = os.path.abspa...
bsd-3-clause
Therp/odoo
addons/project/wizard/__init__.py
381
1075
# -*- 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
profjrr/scrapy
tests/test_settings/__init__.py
98
12165
import six import unittest import warnings from scrapy.settings import Settings, SettingsAttribute, CrawlerSettings from tests import mock from . import default_settings class SettingsAttributeTest(unittest.TestCase): def setUp(self): self.attribute = SettingsAttribute('value', 10) def test_set_gre...
bsd-3-clause
lahosken/pants
contrib/node/src/python/pants/contrib/node/targets/node_package.py
18
1308
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.payl...
apache-2.0
mdavid/zulip
analytics/management/commands/realm_stats.py
113
7859
from __future__ import absolute_import import datetime import pytz from django.core.management.base import BaseCommand from django.db.models import Count from zerver.models import UserProfile, Realm, Stream, Message, Recipient, UserActivity, \ Subscription, UserMessage MOBILE_CLIENT_LIST = ["Android", "ios"] HUM...
apache-2.0
sajeeshcs/nested_quota_latest
nova/virt/libvirt/host.py
2
15703
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # (c) Copyright 2013 Hewlett-Pa...
apache-2.0
mikanbako/ri_ar
ri_advertiser/test/test_ri_advertiser.py
1
1126
# Copyright (c) 2016 Keita Kita # # This software is released under the MIT License. # http://opensource.org/licenses/mit-license.php import unittest from unittest.mock import MagicMock from ri_advertiser.ri_advertiser import Gpio, Advertiser, RiAdvertiser class RiAdvertiserTest(unittest.TestCase): def setUp(sel...
mit
lhfei/spark-in-action
spark-3.x/src/main/python/ml/pca_example.py
27
1510
# # 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
Meriipu/quodlibet
quodlibet/ext/songsmenu/splitting.py
4
2189
# Copyright 2005 Joe Wreschnig # 2016 Nick Boultbee # # 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. from qu...
gpl-2.0
wileeam/airflow
airflow/migrations/versions/bba5a7cfc896_add_a_column_to_track_the_encryption_.py
5
1350
# # 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...
apache-2.0
andyzsf/edx
common/test/acceptance/pages/studio/video/video.py
24
22244
""" CMS Video """ import time import os import requests from bok_choy.promise import EmptyPromise, Promise from bok_choy.javascript import wait_for_js, js_defined from ....tests.helpers import YouTubeStubConfig from ...lms.video.video import VideoPage from selenium.webdriver.common.keys import Keys from ..utils import ...
agpl-3.0
brandonlee503/Intro-to-Computing-Projects
COMP1001_Assignment2_14010627X.py
1
2082
#Brandon Lee #ID: 14010627X #9/26/14 #Question 1 Pseudocode: #function definition: def main(): #prompt user input for first name: firstName = input("String Prompt") #prompt user input for last time: lastName = input("String Prompt") #combine both inputs into a single string: ful...
mit
alvaroaleman/ansible
lib/ansible/modules/cloud/softlayer/sl_vm.py
12
11492
#!/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 distributed...
gpl-3.0
Ensighten/Diamond
src/collectors/nfs/nfs.py
16
8775
# coding=utf-8 """ The NfsCollector collects nfs utilization metrics using /proc/net/rpc/nfs. #### Dependencies * /proc/net/rpc/nfs """ import diamond.collector import os class NfsCollector(diamond.collector.Collector): PROC = '/proc/net/rpc/nfs' def get_default_config_help(self): config_help ...
mit
liweitianux/chandra-acis-analysis
acispy/spectrum.py
1
1572
# Copyright (c) 2017 Weitian LI <liweitianux@live.com> # MIT license """ Chandra ACIS spectrum. """ from astropy.io import fits from .acis import ACIS class Spectrum: """ Chandra ACIS spectrum """ def __init__(self, filepath): self.filepath = filepath self.fitsobj = fits.open(filep...
mit
slightperturbation/Cobalt
ext/emsdk_portable/emscripten/1.27.0/tools/jsrun.py
1
2085
import time, os, sys, logging from subprocess import Popen, PIPE, STDOUT TRACK_PROCESS_SPAWNS = True if (os.getenv('EM_BUILD_VERBOSE') and int(os.getenv('EM_BUILD_VERBOSE')) >= 3) else False def timeout_run(proc, timeout=None, note='unnamed process', full_output=False): start = time.time() if timeout is not None:...
apache-2.0
barak/ciml
projects/p1/runClassifier.py
4
6063
""" This module is for training, testing an evaluating classifiers. """ from numpy import * from pylab import * import sys import util import binary def trainTest(classifier, X, Y, Xtest, Ytest): """ Train a classifier on data (X,Y) and evaluate on data (Xtest,Ytest). Return a triple of: * Trainin...
gpl-2.0
deveninfotech/deven-frappe
frappe/website/doctype/blog_post/test_blog_post.py
29
6159
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """Use blog post test to test user permissions logic""" import frappe import frappe.defaults import unittest import json import frappe.model.meta from frappe.core.page.user_permissions.user_permissions import add, r...
mit
cyclecomputing/boto
tests/unit/s3/test_tagging.py
136
1526
from tests.unit import AWSMockServiceTestCase from boto.s3.connection import S3Connection from boto.s3.bucket import Bucket from boto.s3.tagging import Tag class TestS3Tagging(AWSMockServiceTestCase): connection_class = S3Connection def default_body(self): return """ <Tagging> ...
mit
MTG/essentia
test/src/unittests/spectral/test_tensorflowinputmusicnn.py
1
3641
#!/usr/bin/env python # Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), e...
agpl-3.0
KDB2/OpenReliability
veusz/qtwidgets/__init__.py
8
1599
# Copyright (C) 2011 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 # ...
gpl-2.0
pwndbg/pwndbg
pwndbg/commands/next.py
2
3572
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Stepping until an event occurs """ import argparse import gdb import pwndbg.commands import pwndbg.next @pwndbg.commands.ArgparsedCommand("Breaks at the next jump instruction.", aliases=["nextjump"]) @pwndbg.commands.OnlyWhenRunning def nextjmp(): """Breaks at ...
mit
cirocosta/hpcos
lib/gtest-1.6.0/test/gtest_list_tests_unittest.py
1068
5415
#!/usr/bin/env python # # Copyright 2006, 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...
gpl-3.0
VagrantApe/flaskMicroblog
venv/lib/python2.7/site-packages/openid/yadis/manager.py
167
6081
class YadisServiceManager(object): """Holds the state of a list of selected Yadis services, managing storing it in a session and iterating over the services in order.""" def __init__(self, starting_url, yadis_url, services, session_key): # The URL that was used to initiate the Yadis protocol ...
bsd-3-clause
timothyparez/PyBitmessage
src/helper_msgcoding.py
2
2961
#!/usr/bin/python2.7 import msgpack import zlib from debug import logger BITMESSAGE_ENCODING_IGNORE = 0 BITMESSAGE_ENCODING_TRIVIAL = 1 BITMESSAGE_ENCODING_SIMPLE = 2 BITMESSAGE.ENCODING_EXTENDED = 3 class MsgEncode(object): def __init__(self, message, encoding = BITMESSAGE_ENCODING_SIMPLE): self.data =...
mit
jerryjobs/thirdpartPushSystem
push/getui/igetui/igt_message.py
1
2672
__author__ = 'wei' #from igetui.template.igt_base_template import * #from igetui.utils.AppConditions import * from .template.igt_base_template import * from .utils.AppConditions import * class IGtMessage: def __init__(self): self.isOffline = False self.offlineExpireTime = 0 self...
apache-2.0
matthaywardwebdesign/rethinkdb
test/interface/shard_fuzzer.py
24
8023
#!/usr/bin/env python # Copyright 2014 RethinkDB, all rights reserved. '''This test randomly rebalances tables and shards to probabilistically find bugs in the system.''' from __future__ import print_function import pprint, os, sys, time, random, threading startTime = time.time() sys.path.append(os.path.abspath(os...
agpl-3.0
axinging/chromium-crosswalk
tools/perf/PRESUBMIT.py
6
5076
# Copyright 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. """Presubmit script for changes affecting tools/perf/. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about th...
bsd-3-clause
Webee-IOT/webee210-linux-kernel-3.8
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
dmnfarrell/peat
DataPipeline/Custom.py
1
3731
#!/usr/bin/env python # # DataPipeline - A data import and fitting tool # Copyright (C) 2011 Damien Farrell # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
mit
Ryanglambert/pybrain
pybrain/rl/agents/logging.py
31
2380
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from pybrain.rl.agents.agent import Agent from pybrain.datasets import ReinforcementDataSet class LoggingAgent(Agent): """ This agent stores actions, states, and rewards encountered during interaction with an environment in a ReinforcementDataSet (whi...
bsd-3-clause
JVillella/tensorflow
tensorflow/contrib/tpu/python/tpu/tpu_function_test.py
75
5272
# 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
darjeeling/django
django/db/backends/postgresql/introspection.py
16
10779
import warnings from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.db.models.indexes import Index from django.utils.deprecation import RemovedInDjango21Warning class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django F...
bsd-3-clause
faywong/FFPlayer
project/jni/python/src/Lib/test/test_quopri.py
58
7365
from test import test_support import unittest import sys, cStringIO, subprocess import quopri ENCSAMPLE = """\ Here's a bunch of special=20 =A1=A2=A3=A4=A5=A6=A7=A8=A9 =AA=AB=AC=AD=AE=AF=B0=B1=B2=B3 =B4=B5=B6=B7=B8=B9=BA=BB=BC=BD=BE =BF=C0=C1=C2=C3=C4=C5=C6 =C7=C8=C9=CA=CB=CC=CD=CE=CF =D0=D1=D2=D3=D4=D5=D6=D7 =D8=...
lgpl-2.1
mksachs/UberCC
Uber.py
2
3909
#!/usr/bin/env python import datetime import numpy as np ''' A subclass of the Exception class to handle bad increment input in the daterange generator ''' class DateRangeNotSupported(Exception): def __init__(self, code): self.code = code def __str__(self): return 'Time increment of "%s" not su...
mit
h3biomed/ansible
test/units/modules/network/f5/test_bigip_ssl_certificate.py
16
4735
# -*- 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 import os import json import pytest import sys if sys.version_info < (2, ...
gpl-3.0
CiscoSystems/openstack-dashboard
django-openstack/django_openstack/syspanel/urls.py
7
2972
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
DMOJ/site
judge/bridge/django_handler.py
1
1990
import json import logging import struct from judge.bridge.base_handler import Disconnect, ZlibPacketHandler logger = logging.getLogger('judge.bridge') size_pack = struct.Struct('!I') class DjangoHandler(ZlibPacketHandler): def __init__(self, request, client_address, server, judges): super().__init__(re...
agpl-3.0
Bjwebb/detecting-clouds
totalimage.py
1
2943
from django.core.management import setup_environ import clouds.settings setup_environ(clouds.settings) from django.db.models import Count, Sum, Avg, F from django.db.models.query import QuerySet from clouds.models import RealPoint import PIL.Image, PIL.ImageDraw import pickle, os from django.db import connection mini...
mit
TheNeikos/rust
src/etc/tidy.py
31
6552
# Copyright 2010-2014 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 license # <LICENSE-MIT or ht...
apache-2.0
danakj/chromium
tools/android/loading/report_unittest.py
4
13616
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import metrics import report from queuing_lens import QueuingLens import test_utils import user_satisfied_lens_unittest class LoadingRepor...
bsd-3-clause
TGAC/KAT
deps/boost/tools/build/src/tools/gcc.py
8
39530
# Status: being ported by Steven Watanabe # Base revision: 47077 # TODO: common.jam needs to be ported # TODO: generators.jam needs to have register_c_compiler. # # Copyright 2001 David Abrahams. # Copyright 2002-2006 Rene Rivera. # Copyright 2002-2003 Vladimir Prus. # Copyright (c) 2005 Reece H. Dunn. # Copyright 200...
gpl-3.0
ferriman/SSandSP
pyxel-test/venv/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py
28
108277
# coding: utf-8 """ Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path opera...
gpl-3.0