code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/usr/bin/env python
"""
This is an example MIDAS module
"""
from os.path import isfile
from os import chmod
from time import time, gmtime, strftime
import logging
from sys import argv
from lib.ty_orm import TyORM
from lib.plist import read_plist, get_plist_key
from lib.config import Config
from lib.data_science imp... | serbyy/MIDAS | midas/modules/example_analyzeplist.py | Python | mit | 7,999 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | KhronosGroup/COLLADA-CTS | StandardDataSets/collada/library_images/image/imageindifferentdir/imageindifferentdir.py | Python | mit | 3,904 |
import datetime
import sys
from decimal import Decimal
if sys.version_info[0] == 2:
integer_types = int, long
text_type = unicode
binary_type = str
else:
integer_types = int,
text_type = str
binary_type = bytes
class Generator(object):
def __init__(self, dict):
self.dict = dict
... | DiptoDas8/Biponi | lib/python2.7/site-packages/braintree/util/generator.py | Python | mit | 2,578 |
from rekall import resources
from rekall_agent import testlib
from rekall_agent.client_actions import files
from rekall_agent.client_actions import tsk
class TestTSK(testlib.ClientAcionTest):
def setUp(self):
super(TestTSK, self).setUp()
# Add a fake mount point to the image.
mount_tree_h... | dsweet04/rekall | rekall-agent/rekall_agent/client_actions/tsk_test.py | Python | gpl-2.0 | 1,298 |
##
# Copyright 2009-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | hpcugent/easybuild-framework | test/framework/sandbox/easybuild/easyblocks/generic/makecp.py | Python | gpl-2.0 | 1,888 |
#!/usr/bin/env python
#-
# Copyright (C) 2011 Oy L M Ericsson Ab, NomadicLab
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# Alternatively, this software may be distributed und... | tefino/kanycast-cinc-combined | examples/swig-samples/python/streaming/recv_and_pub.py | Python | gpl-2.0 | 3,579 |
import json
import os
import urllib
from ..storage import WatchLaterList, FunctionCache, SearchHistory, FavoriteList, AccessManager
from .abstract_settings import AbstractSettings
from .. import utils
class AbstractContext(object):
CACHE_ONE_MINUTE = 60
CACHE_ONE_HOUR = 60 * CACHE_ONE_MINUTE
CACHE_ONE_DA... | listamilton/supermilton.repository | plugin.audio.soundcloud/resources/lib/nightcrawler/core/abstract_context.py | Python | gpl-2.0 | 10,518 |
# Author: Christopher Gearhart
# System imports
from numba import jit, prange
import numpy as np
# Blender imports
# NONE!
# Module imports
# NONE!
@jit(nopython=True, parallel=True)
def resize_pixels(size, channels, old_pixels, old_size):
new_pixels = np.empty(size[0] * size[1] * channels)
for col in pran... | feureau/Small-Scripts | Blender/Blender config/2.91/scripts/addons/bricksculpt_v1-2-0/functions/common/images/pixel_effects_numba.py | Python | gpl-3.0 | 4,588 |
"""
Execute impacket's smbexec shell on a partiular host.
This creates a semi-interactive shell without uploading
a binary, but creates lots of shit in the event logs!
All cred to the the awesome Impacket project !
https://code.google.com/p/impacket/
Module built by @harmj0y
"""
from lib import impacket_smbex... | Exploit-install/Veil-Pillage | modules/impacket/smbexec_shell.py | Python | gpl-3.0 | 2,025 |
import os
import sqlite3
import thread
threaddbs = {}
def get_db_connection(conn, name=''):
"returns an sqlite3 connection to a persistent database"
if not name:
name = '{}.db'.format(conn.name)
threadid = thread.get_ident()
if name in threaddbs and threadid in threaddbs[name]:
retu... | ScottSteiner/uguubot | core/db.py | Python | gpl-3.0 | 620 |
# file: runme.py
import example
pmap = example.pymap()
pmap["hi"] = 1
pmap["hello"] = 2
dmap = {}
dmap["hello"] = 1.0
dmap["hi"] = 2.0
print dmap.items()
print dmap.keys()
print dmap.values()
print dmap
hmap = example.halfd(dmap)
dmap = hmap
print dmap
for i in dmap.iterkeys():
print "key", i
for i in dmap.... | DGA-MI-SSI/YaCo | deps/swig-3.0.7/Examples/python/std_map/runme.py | Python | gpl-3.0 | 1,089 |
import import_stl_b
import import_stl_a
v_new = import_stl_b.process_vector([1, 2, 3])
if v_new != (1, 2, 3, 4):
raise RuntimeError, v_new
| DGA-MI-SSI/YaCo | deps/swig-3.0.7/Examples/test-suite/python/import_stl_runme.py | Python | gpl-3.0 | 144 |
"""TestCases for distributed transactions.
"""
import os
import time
import unittest
from test_all import db, test_support, have_threads, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
class DBReplication(unittest.TestCase)... | HiSPARC/station-software | user/python/Lib/bsddb/test/test_replication.py | Python | gpl-3.0 | 21,476 |
#!/usr/bin/python
#
# Copyright 2009 Dan Smith <dsmith@danplanet.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | coddingtonbear/d-rats | d_rats/ui/main_messages.py | Python | gpl-3.0 | 41,043 |
## This file is part of PyGaze - the open-source toolbox for eye tracking
##
## PyGaze is a Python module for easily creating gaze contingent experiments
## or other software (as well as non-gaze contingent experiments/software)
## Copyright (C) 2012-2013 Edwin S. Dalmaijer
##
## This program is free... | esdalmaijer/PyGaze | examples/simple_experiment/constants.py | Python | gpl-3.0 | 4,461 |
#!/usr/bin/env python
# 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/.
# Copyright (c) 2015 Mozilla Corporation
#
# Contributors:
# Aaron Meihm <ameihm@mozilla.com>
fro... | serbyy/MozDef | alerts/unauth_ssh_pyes.py | Python | mpl-2.0 | 2,867 |
import pygame
class Slice():
"""docstring for Slice"""
def __init__(self, context):
self.context = context
| FOSSRIT/PyCut | game/objects/slice.py | Python | mpl-2.0 | 124 |
"""Helpers to create and manage local juju charms."""
from contextlib import contextmanager
import logging
import os
import re
import subprocess
import pexpect
import yaml
from utility import (
ensure_deleted,
JujuAssertionError,
)
__metaclass__ = type
log = logging.getLogger("jujucharm")
class Char... | freyes/juju | acceptancetests/jujucharm.py | Python | agpl-3.0 | 6,215 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
from spack import *
class Guidance(MakefilePackage):
"""Guidance: Accurate detection of unreliable alig... | LLNL/spack | var/spack/repos/builtin/packages/guidance/package.py | Python | lgpl-2.1 | 1,752 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the `iris.fileformats.pp._interpret_field` function."""
# Import iris.tests first so that some things can be... | SciTools/iris | lib/iris/tests/unit/fileformats/pp/test__interpret_field.py | Python | lgpl-3.0 | 5,255 |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
distribution = Exponential(2.5, -1.3)
size = 10000
sample = distribution.getSample(size)
factory = ExponentialFactory()
estimatedDistribution = factory.build(sample)... | aurelieladier/openturns | python/test/t_ExponentialFactory_std.py | Python | lgpl-3.0 | 1,511 |
# coding: utf-8
from __future__ import unicode_literals
import re
from hashlib import sha1
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
determine_ext,
float_or_none,
int_or_none,
unified_strdate,
)
class ProSiebenSat1BaseIE(InfoExtractor... | jbuchbinder/youtube-dl | youtube_dl/extractor/prosiebensat1.py | Python | unlicense | 17,378 |
#!/usr/bin/env python
# Copyright (c) Sasha Goldshtein
# Licensed under the Apache License, Version 2.0 (the "License")
import bcc
import unittest
from time import sleep
import distutils.version
import os
import subprocess
def kernel_version_ge(major, minor):
# True if running kernel is >= X.Y
version = distu... | shodoco/bcc | tests/python/test_tracepoint.py | Python | apache-2.0 | 2,128 |
input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1... | Yarrick13/hwasp | tests/asp/AllAnswerSets/tight/graph.colouring.3.40.5_1.asp.test.py | Python | apache-2.0 | 23,789 |
#!/usr/bin/env python
import os, sys, mobilesdk
class CreateProject(mobilesdk.MobileSDKTest):
def testCreateWithProjectScript(self):
self.createProject("iphoneProject", "iphone")
self.tiappXml = os.path.join(self.projectDir, 'tiapp.xml')
self.manifest = os.path.join(self.projectDir, 'manifest')
self.assertTr... | pinnamur/titanium_mobile | drillbit/sdk_tests/iphone/create_project.py | Python | apache-2.0 | 647 |
# 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... | gunan/tensorflow | tensorflow/python/data/kernel_tests/list_files_test.py | Python | apache-2.0 | 8,979 |
#!/usr/bin/env python3
import os
import sys
from tools import impl
parser = impl.argparser()
parser.add_argument("-o", dest="output", action=impl.StripQuotesAction)
(options, args) = parser.parse_known_args()
# ranlib may have hid the archive next to what buck thinks the archive is
input = args[-1] + ".secret"
... | facebook/buck | test/com/facebook/buck/cxx/testdata/cxx_toolchain/tools/linker.py | Python | apache-2.0 | 531 |
import os
from twisted.trial import unittest
from scrapy.contrib.djangoitem import DjangoItem, Field
from scrapy import optional_features
os.environ['DJANGO_SETTINGS_MODULE'] = 'scrapy.tests.test_djangoitem.settings'
if 'django' in optional_features:
from .models import Person, IdentifiedPerson
class BasePe... | rahul-c1/scrapy | scrapy/tests/test_djangoitem/__init__.py | Python | bsd-3-clause | 2,978 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'GroupSnooze'
db.create_table(
'sentry_groupsno... | looker/sentry | src/sentry/south_migrations/0216_auto__add_groupsnooze.py | Python | bsd-3-clause | 61,069 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | eunchong/build | third_party/buildbot_8_4p1/buildbot/test/unit/test_db_buildrequests.py | Python | bsd-3-clause | 30,318 |
"""
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
import warnings
from django.http import (
Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect,
)
from dj... | dracos/django | django/shortcuts.py | Python | bsd-3-clause | 5,580 |
from sqlalchemy.util import topological
from sqlalchemy.testing import assert_raises, eq_
from sqlalchemy.testing.util import conforms_partial_ordering
from sqlalchemy import exc
from sqlalchemy.testing import fixtures
class DependencySortTest(fixtures.TestBase):
def assert_sort(self, tuples, allitems=None):
... | alex/sqlalchemy | test/base/test_dependency.py | Python | mit | 8,781 |
# -*- coding: utf-8 -*-
EXPERIMENTAL_STUFF = True
MAXNFILES = 1000
if EXPERIMENTAL_STUFF:
if is_mobile:
response.view = response.view.replace('default/', 'default.mobile/')
response.menu = []
import re
from gluon.admin import *
from gluon.fileutils import abspath, read_file, write_file
from gluon... | laonawuli/addrest | web2py/applications/admin/controllers/default.py | Python | mit | 73,035 |
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD, Adam, RMSprop
from keras.utils import np_utils
from elephas.ml... | daishichao/elephas | examples/ml_mlp.py | Python | mit | 2,318 |
# ybrowserauth installation script
#
from distutils.core import setup
setup(name='ybrowserauth',
version='1.2',
py_modules=['ybrowserauth'],
license='http://www.opensource.org/licenses/bsd-license.php',
url='http://developer.yahoo.com/auth',
description='Lets you add Yahoo! Brows... | pombreda/django-hotclub | libs/external_libs/ybrowserauth/setup.py | Python | mit | 455 |
import unittest, sys
def main(modulename):
'''run the tests found in module, printing nothing when all tests pass'''
module = sys.modules[modulename]
suite = unittest.defaultTestLoader.loadTestsFromModule(module)
results = unittest.TestResult()
suite.run(results)
if results.errors or results.fa... | iaddict/mercurial.rb | vendor/mercurial/tests/silenttestrunner.py | Python | mit | 593 |
#!/usr/bin/env python
import os, sys
try:
from Tkinter import *
except:
sys.stderr.write('Please install Tkinter!\n\n')
sys.exit(1)
root = Tk()
root.title('Wavelet Demo')
wtype = StringVar()
wtype.set('b')
type_frame = Frame(root,relief=SUNKEN,borderwidth=2)
type_frame.pack(side=TOP,fill=X)
Label(type_... | zxtstarry/src | book/rsf/rsf/gui/gui.py | Python | gpl-2.0 | 1,270 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 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 option) a... | MSusik/invenio | invenio/modules/records/testsuite/functions/get_modification_date.py | Python | gpl-2.0 | 1,109 |
# Copyright 2017 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 by applicable law or a... | michellemorales/OpenMM | models/lfads/utils.py | Python | gpl-2.0 | 12,183 |
from func.overlord.groups import Groups,get_hosts_spec
from certmaster.config import read_config, CONFIG_FILE
from certmaster.commonconfig import CMConfig
import os
import fnmatch
from func.overlord.group.conf_backend import ConfBackend
from func.overlord.group.sqlite_backend import SqliteBackend
TEST_DB_FILE = "/tm... | dockerera/func | test/unittest/test_groups_api.py | Python | gpl-2.0 | 16,593 |
# Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | eri-trabiccolo/exaile | xl/__init__.py | Python | gpl-2.0 | 1,239 |
# CTK: Cherokee Toolkit
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2010-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.... | lmcro/webserver | admin/CTK/CTK/Plugin.py | Python | gpl-2.0 | 7,366 |
#!/usr/bin/env python
# Copyright (c) 2021 by
# Donatas Abraitis <donatas.abraitis@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
#
# T... | freerangerouting/frr | tests/topotests/bgp_dont_capability_negogiate/test_bgp_dont_capability_negotiate.py | Python | gpl-2.0 | 2,727 |
"""
Fallback to callee definition when definition not found.
- https://github.com/davidhalter/jedi/issues/131
- https://github.com/davidhalter/jedi/pull/149
"""
"""Parenthesis closed at next line."""
# Ignore these definitions for a little while, not sure if we really want them.
# python <= 2.5
#? isinstance
isinsta... | snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/completion/definition.py | Python | gpl-3.0 | 1,072 |
# Copyright (c) 2017 Mark D. Hill and David A. Wood
# 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 conditio... | vineodd/PIMSim | GEM5Simulation/gem5/tests/gem5/__init__.py | Python | gpl-3.0 | 1,633 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Mrp Repairs',
'version': '1.0',
'category': 'Inventory/Inventory',
'depends': ['repair', 'mrp'],
'installable': True,
'auto_install': True,
'application': False,
'license': 'LG... | jeremiahyan/odoo | addons/mrp_repair/__manifest__.py | Python | gpl-3.0 | 329 |
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests import common
from openerp.tools import SUPERUSER_ID
class TestPurchaseRequestToRequisition(common.TransactionCase):
def setUp(self):
super(Te... | andrius-preimantas/purchase-workflow | purchase_request_to_requisition/tests/test_purchase_request_to_requisition.py | Python | agpl-3.0 | 3,251 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Smile (<http://www.smile.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | tiexinliu/odoo_addons | smile_log/tools/db_logger.py | Python | agpl-3.0 | 2,985 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | var/spack/repos/builtin/packages/viennarna/package.py | Python | lgpl-2.1 | 2,706 |
#!/usr/bin/env python2.7
#
# Copyright 2017 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 l... | tst-mswartz/earthenterprise | earth_enterprise/src/server/wsgi/search/plugin/poi_search_app.py | Python | apache-2.0 | 3,568 |
# Copyright 2015 Mirantis 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 or a... | bswartz/manila | manila/tests/cmd/test_api.py | Python | apache-2.0 | 1,877 |
# 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... | punalpatel/st2 | st2actions/tests/unit/test_rescheduler.py | Python | apache-2.0 | 4,718 |
#!/usr/bin/env python
""" Create application check for v3 """
# We just want to see any exception that happens
# don't want the script to die under any cicumstances
# script must try to clean itself up
# pylint: disable=broad-except
# main() function has a lot of setup and error handling
# pylint: disable=too-many-st... | rhdedgar/openshift-tools | scripts/monitoring/cron-send-create-app.py | Python | apache-2.0 | 12,893 |
"""Support for the Fitbit API."""
import datetime
import logging
import os
import time
from fitbit import Fitbit
from fitbit.api import FitbitOauth2Client
from oauthlib.oauth2.rfc6749.errors import MismatchingStateError, MissingTokenError
import voluptuous as vol
from homeassistant.components.http import HomeAssistan... | tboyce021/home-assistant | homeassistant/components/fitbit/sensor.py | Python | apache-2.0 | 19,671 |
# Copyright 2018 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... | jbedorf/tensorflow | tensorflow/python/kernel_tests/linalg/linear_operator_algebra_test.py | Python | apache-2.0 | 7,452 |
from io import BytesIO
import os
import pickle
from tempfile import mkstemp
import unittest
from unittest.mock import patch, Mock
import warnings
from Orange.widgets.settings import SettingsHandler, Setting, SettingProvider
class SettingHandlerTestCase(unittest.TestCase):
@patch('Orange.widgets.settings.SettingPr... | marinkaz/orange3 | Orange/widgets/tests/test_settings_handler.py | Python | bsd-2-clause | 7,342 |
from __future__ import absolute_import
from django.shortcuts import render_to_response
from sentry.web.frontend.base import BaseView
class AuthCloseView(BaseView):
"""This is a view to handle when sentry log in has been opened from
another window. This view loads an html page with a script that sends a mess... | JackDanger/sentry | src/sentry/web/frontend/auth_close.py | Python | bsd-3-clause | 561 |
# 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 fnmatch
import imp
import logging
import modulefinder
import optparse
import os
import sys
import zipfile
from telemetry import benchmark
from teleme... | guorendong/iridium-browser-ubuntu | tools/telemetry/telemetry/util/find_dependencies.py | Python | bsd-3-clause | 9,310 |
import json
import threading
import time
import traceback
import urllib
from vtdb import cursor
from vtdb import dbexceptions
import environment
import framework
class TestStream(framework.TestCase):
def tearDown(self):
self.env.conn.begin()
self.env.execute("delete from vtocc_big")
self.env.conn.commi... | anusornc/vitess | test/queryservice_tests/stream_tests.py | Python | bsd-3-clause | 6,435 |
# -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: November 8, 2014
# Author: Alistair Muldal - alimuldal@gmail.com
#
# $Id$
#
########################################################################
"""This utility prints the contents of an H... | jennolsen84/PyTables | tables/scripts/pttree.py | Python | bsd-3-clause | 15,724 |
'''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None, indentl... | wdv4758h/ZipPy | lib-python/3/pickletools.py | Python | bsd-3-clause | 79,093 |
#!/usr/bin/env python
# Based heavily on the Bowtie 2 data manager wrapper script by Dan Blankenberg
from __future__ import print_function
import argparse
import os
import shlex
import subprocess
import sys
from json import dumps, loads
DEFAULT_DATA_TABLE_NAME = "hisat2_indexes"
def get_id_name( params, dbkey, fast... | blankclemens/tools-iuc | data_managers/data_manager_hisat2_index_builder/data_manager/hisat2_index_builder.py | Python | mit | 3,657 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import StringIO
import gc
import re
import sys
import textwrap
import types
from twisted.trial import unittest
from twisted.trial.runner import (
TrialRunner, TestSuite, DestructiveTestSuite, TestLoader)
from twisted.trial._dist.disttrial imp... | engdan77/edoAutoHomeMobile | twisted/trial/test/test_script.py | Python | mit | 29,653 |
#!/usr/bin/python
import os
from autotest.client import utils
version = 3
def setup(tarball, topdir):
srcdir = os.path.join(topdir, 'src')
if not os.path.exists(tarball):
utils.get_file('http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.45.tar.gz', tarball)
utils.extract_tarball_to_dir(tarb... | spcui/autotest | client/deps/mysql/mysql.py | Python | gpl-2.0 | 997 |
# coding: utf-8
"""
MoinMoin wiki stats about updated pages
Config example::
[wiki]
type = wiki
wiki test = http://moinmo.in/
"""
import xmlrpclib
from did.utils import item
from did.base import Config
from did.stats import Stats, StatsGroup
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | oskopek/did | did/plugins/wiki.py | Python | gpl-2.0 | 2,434 |
# This is a distutils/py2exe script to build the Windows binary version
# of gambit-enumphc
from distutils.core import setup
import py2exe
setup(console=["enumphc.py"],
data_files=[(".",
[ "phc.exe", "README" ])])
| chumsley/gambit | contrib/scripts/enumpoly/setup.py | Python | gpl-2.0 | 241 |
#!/usr/bin/env python
#
# Copyright (c) 2001-2010 The SCons Foundation
#
# 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,... | bigmonachus/Delaunay | site_scons/site_tools/scons_qt4/test/ts_qm/noclean/sconstest-noclean.py | Python | gpl-3.0 | 1,813 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class IrModel(models.Model):
_inherit = 'ir.model'
_order = 'is_mail_thread DESC, name ASC'
is_mail_thread = fields.Boolean(
... | jeremiahyan/odoo | addons/mail/models/ir_model.py | Python | gpl-3.0 | 4,660 |
# Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
import os
import sys
import json
import urllib2
import urllib
from base import (create_org, site_url, api_key)
def create_org_members(id, members):
for member in members :
data_di... | gjlawran/ckanext-bcgov | ckanext/bcgov/scripts/load_orgs.py | Python | agpl-3.0 | 3,527 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPickleshare(PythonPackage):
"""Tiny 'shelve'-like database with concurrency support"""
... | LLNL/spack | var/spack/repos/builtin/packages/py-pickleshare/package.py | Python | lgpl-2.1 | 764 |
# Copyright 2018 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... | tensorflow/tensorflow | tensorflow/python/framework/function_def_to_graph_test.py | Python | apache-2.0 | 10,231 |
# Copyright 2013 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 requ... | shail2810/nova | nova/tests/unit/virt/vmwareapi/test_vmops.py | Python | apache-2.0 | 114,813 |
# 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 of conditions and the ... | weolar/miniblink49 | third_party/WebKit/Source/bindings/scripts/code_generator_v8.py | Python | apache-2.0 | 21,053 |
from unittest.mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
class FreshdeskHookTests(WebhookTestCase):
STREAM_NAME = "freshdesk"
URL_TEMPLATE = "/api/v1/external/freshdesk?stream={stream}"
WEBHOOK_DIR_NAME = "freshdesk"
def test_ticket_creation(self) -> None:
... | andersk/zulip | zerver/webhooks/freshdesk/tests.py | Python | apache-2.0 | 4,844 |
#
# Copyright 2016 The BigDL 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 applicable law or agreed to in ... | yiheng/BigDL | spark/dl/src/test/resources/tf/models/tensor_array.py | Python | apache-2.0 | 2,142 |
# 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... | tensorflow/tensorflow | tensorflow/python/debug/lib/common.py | Python | apache-2.0 | 2,967 |
#!/usr/bin/env python
#
# 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
#
# Unless required by applicable law o... | mikea/appengine-mapreduce | python/src/mapreduce/mock_webapp.py | Python | apache-2.0 | 6,577 |
"""Entity class that represents Z-Wave node."""
# pylint: disable=import-outside-toplevel
from itertools import count
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_ENTITY_ID, ATTR_WAKEUP
from homeassistant.core import callback
from homeassistant.helpers.device_registry import async_get_registry as get_dev_r... | tboyce021/home-assistant | homeassistant/components/zwave/node_entity.py | Python | apache-2.0 | 12,522 |
from datetime import datetime, timedelta
import logging
from django.conf import settings
from django.core.cache import cache
from django.db import models
import bleach
from celeryutils import task
from tower import ugettext_lazy as _
import amo.models
from amo.helpers import shared_url
from translations.fields impor... | wagnerand/zamboni | apps/reviews/models.py | Python | bsd-3-clause | 8,152 |
import os
import numpy as np
from statsmodels.duration.hazard_regression import PHReg
from numpy.testing import (assert_allclose,
assert_equal)
import pandas as pd
# TODO: Include some corner cases: data sets with empty strata, strata
# with no events, entry times after censoring times,... | DonBeo/statsmodels | statsmodels/duration/tests/test_phreg.py | Python | bsd-3-clause | 11,981 |
import argparse
import cPickle as pickle
import colorama as color
import csv
import json
import os
import requests
import sys
import time
from time import gmtime, strftime
# test_algorithms has two modes of operation:
# 1. Create reference output of algorithms
# 2. Validate current algorithm results against refere... | ehein6/stinger | util/flask/test/test_algorithms.py | Python | bsd-3-clause | 6,389 |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | staranjeet/fjord | vendor/packages/requests-2.7.0/requests/packages/chardet/euctwprober.py | Python | bsd-3-clause | 1,674 |
import os
import sys
import unittest
from cStringIO import StringIO
from optparse import OptionParser
import nose.core
from nose.config import Config
from nose.tools import set_trace
from mock import Bucket, MockOptParser
class NullLoader:
def loadTestsFromNames(self, names):
return unittest.TestSuite()
... | DESHRAJ/fjord | vendor/packages/nose/unit_tests/test_core.py | Python | bsd-3-clause | 2,069 |
# Author: Adam Chodorowski
# Contact: chodorowski@users.sourceforge.net
# Revision: $Revision: 2224 $
# Date: $Date: 2004-06-05 21:40:46 +0200 (Sat, 05 Jun 2004) $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# re... | jmchilton/galaxy-central | modules/docutils/languages/sv.py | Python | mit | 2,135 |
#
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling issues
# 2... | Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/PIL/ImageColor.py | Python | mit | 8,085 |
import os
import string
import random
import mmap
import sys
DATATYPES = dict(
ascii_letters=string.ascii_letters.encode(),
ascii_lowercase=string.ascii_lowercase.encode(),
ascii_uppercase=string.ascii_uppercase.encode(),
digits=string.digits.encode(),
hexdigits=string.hexdigits.encode(),
octdi... | zlorb/mitmproxy | pathod/language/generators.py | Python | mit | 2,469 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,... | Distrotech/yum-utils | plugins/tsflags/tsflags.py | Python | gpl-2.0 | 1,294 |
#
# Copyright 2006,2007 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 versi... | UpYou/relay | my_gnuradio/gr/hier_block2.py | Python | gpl-3.0 | 4,316 |
"""Implementation of :class:`SymPyRealDomain` class. """
from sympy.polys.domains.realdomain import RealDomain
from sympy.polys.domains.groundtypes import SymPyRealType
class SymPyRealDomain(RealDomain):
"""Domain for real numbers based on SymPy Float type. """
dtype = SymPyRealType
zero = dtype(0)
... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sympy/polys/domains/sympyrealdomain.py | Python | agpl-3.0 | 1,456 |
"""
Proctored Exams Transformer
"""
from django.conf import settings
from edx_proctoring.api import get_attempt_status_summary
from edx_proctoring.models import ProctoredExamStudentAttemptStatus
from openedx.core.lib.block_structure.transformer import BlockStructureTransformer, FilteringTransformerMixin
class Proct... | shabab12/edx-platform | lms/djangoapps/course_api/blocks/transformers/proctored_exam.py | Python | agpl-3.0 | 2,327 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Daniel Reis, 2013
#
# 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 Foundation, eith... | vrenaville/project-service | project_issue_baseuser/__openerp__.py | Python | agpl-3.0 | 1,603 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db import models
from shoop.utils.analog import define_log_model... | arth-co/shoop | shoop_tests/utils/test_analog.py | Python | agpl-3.0 | 837 |
#!/bin/env python
# mainly for sys.argv[], sys.argv[0] is the name of the program
import sys
# mainly for arrays
import numpy as np
if __name__ == '__main__':
print 'hello'
| ketancmaheshwari/hello-goog | src/python/trie.py | Python | apache-2.0 | 179 |
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkFeatureEdges(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.v... | nagyistoce/devide | modules/vtk_basic/vtkFeatureEdges.py | Python | bsd-3-clause | 485 |
from __future__ import absolute_import
from sentry.models import (
AuditLogEntry,
AuditLogEntryEvent,
)
from sentry.web.forms.base_organization_member import BaseOrganizationMemberForm
class EditOrganizationMemberForm(BaseOrganizationMemberForm):
def save(self, actor, organization, ip_address=None):
... | JackDanger/sentry | src/sentry/web/forms/edit_organization_member.py | Python | bsd-3-clause | 741 |
#!/usr/bin/env python
# Copyright (c) 2010 ActiveState Software Inc.
# See LICENSE.txt for license details.
"""Less support for CodeIntel"""
import logging
from codeintel2.common import _xpcom_
from codeintel2.lang_css import CSSLexer, CSSLangIntel, CSSBuffer
from codeintel2.lang_css import isident, WHITESPACE
from ... | archifix/settings | sublime/Packages/SublimeCodeIntel/libs/codeintel2/lang_less.py | Python | mit | 20,867 |
# See http://www.python.org/dev/peps/pep-0386/ for version numbering, especially NormalizedVersion
from distutils import version
version = version.LooseVersion('0.7.1-dev')
| foundit/Piped | contrib/zmq/piped_zmq/__init__.py | Python | mit | 173 |
import sys, os
import re
import unittest
import traceback
import pywin32_testutil
# A list of demos that depend on user-interface of *any* kind. Tests listed
# here are not suitable for unattended testing.
ui_demos = """GetSaveFileName print_desktop win32cred_demo win32gui_demo
win32gui_dialog win32gui_... | JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/test/testall.py | Python | gpl-2.0 | 5,957 |
#!/usr/bin/env python
#
# Copyright 2010 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)
... | pgoeser/gnuradio | gnuradio-examples/python/digital/benchmark_qt_rx2.py | Python | gpl-3.0 | 17,370 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class MrpRepair(... | esthermm/odoomrp-wip | mrp_repair_full_editable/models/mrp_repair.py | Python | agpl-3.0 | 755 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.