code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#############################################################################
#
# Copyright (C) 2013 Navi-X
#
# This file is part of Navi-X.
#
# Navi-X 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 Fou... | JamesLinEngineer/RKMC | addons/script.navi-x/src/CLogin.py | Python | gpl-2.0 | 3,203 |
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# 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... | sumara/ansible-lint-deb | deb_dist/ansible-lint-2.1.3/lib/ansiblelint/utils.py | Python | gpl-2.0 | 9,195 |
#!/usr/bin/env python
import sys
from coverage import coverage
from coverage.results import Numbers
from coverage.summary import SummaryReporter
from twisted.python import usage
# this is an adaptation of the code behind "coverage report", modified to
# display+sortby "lines uncovered", which (IMHO) is more importan... | zozo123/buildbot | master/contrib/coverage2text.py | Python | gpl-3.0 | 4,085 |
import easygui_qt as easy
import pandas as pd
import numpy as np
import geoplot
from matplotlib import pyplot as plt
import math
from matplotlib.colors import LinearSegmentedColormap
MTH = {'sum': np.sum, 'max': np.max, 'min': np.min, 'mean': np.mean}
class SpatialData:
def __init__(self, result_file=None):
... | oemof/reegis-hp | reegis_hp/de21/results.py | Python | gpl-3.0 | 11,607 |
import unittest
from xcolor.xparser import Xparser
class TestXcolorRegex(unittest.TestCase):
# expected output for the tested patterns
expected = dict(name='color5', value='aabbcc')
def test_comments(self):
line = ";*color5: rgb:aa/bb/cc"
self.assertFalse(Xparser.valid(line))
line... | mrhmouse/xcolors | tests/test_regex.py | Python | gpl-3.0 | 1,647 |
from SCons.Script import *
def exists(env):
return (env["PLATFORM"]=="win32")
def ConvertNewlines(target,source,env):
for t,s in zip(target,source):
f_in=open(str(s),"rb")
f_out=open(str(t),"wb")
f_out.write(f_in.read().replace("\n","\r\n"))
f_out.close()
f_in.close()
... | iakov/RHVoice | site_scons/site_tools/newlines.py | Python | gpl-3.0 | 816 |
#
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This application is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This application is ... | koppa/gr-air-modes | python/__init__.py | Python | gpl-3.0 | 3,039 |
from bedrock.redirects.util import redirect
redirectpatterns = (
# bug 926629
redirect(r'^newsletter/about_mobile(?:/(?:index\.html)?)?$', 'newsletter.subscribe'),
redirect(r'^newsletter/about_mozilla(?:/(?:index\.html)?)?$', 'mozorg.contribute.index'),
redirect(r'^newsletter/new(?:/(?:index\.html)?)?... | sgarrity/bedrock | bedrock/newsletter/redirects.py | Python | mpl-2.0 | 432 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from blinker import Namespace
namespace = Namespace()
#: Trigerred when a dataset is published
on_dataset_published = namespace.signal('on-dataset-published')
| jphnoel/udata | udata/core/dataset/signals.py | Python | agpl-3.0 | 226 |
"""
This is the default template for our main set of AWS servers.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
import json
from .common import *
from logsettings import get_logger_config
import os
# speci... | morpheby/levelup-by | cms/envs/aws.py | Python | agpl-3.0 | 6,436 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | MickSandoz/compassion-modules | partner_communication/models/communication_config.py | Python | agpl-3.0 | 4,257 |
# 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 PyOnnx(PythonPackage):
"""Open Neural Network Exchange (ONNX) is an open ecosystem that
... | LLNL/spack | var/spack/repos/builtin/packages/py-onnx/package.py | Python | lgpl-2.1 | 1,686 |
##############################################################################
# Copyright (c) 2013-2017, 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... | TheTimmy/spack | var/spack/repos/builtin/packages/xapian-core/package.py | Python | lgpl-2.1 | 1,768 |
from __future__ import print_function, division
import warnings
from itertools import permutations
import hmmlearn.hmm
import numpy as np
import pickle
import tempfile
from sklearn.pipeline import Pipeline
from msmbuilder.example_datasets import AlanineDipeptide
from msmbuilder.featurizer import SuperposeFeaturizer... | msmbuilder/msmbuilder | msmbuilder/tests/test_ghmm.py | Python | lgpl-2.1 | 6,280 |
# Copyright 2013-2019 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 REvd(RPackage):
"""evd: Functions for Extreme Value Distributions"""
homepage = "http... | iulian787/spack | var/spack/repos/builtin/packages/r-evd/package.py | Python | lgpl-2.1 | 597 |
#
# 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... | airbnb/airflow | airflow/contrib/operators/imap_attachment_to_s3_operator.py | Python | apache-2.0 | 1,222 |
import unittest
from collections import deque
import datetime
import sys
import os
import StringIO
from south import exceptions
from south.migration import migrate_app
from south.migration.base import all_migrations, Migration, Migrations
from south.migration.utils import depends, dfs, flatten, get_app_label
from sou... | defcube/django-south | south/tests/logic.py | Python | apache-2.0 | 32,253 |
#
# 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... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationpolicylabel.py | Python | apache-2.0 | 9,779 |
'''
eqtime: 30
'''
def main():
info('Felix CO2 analysis')
gosub('felix:WaitForCO2Access')
gosub('felix:PrepareForCO2Analysis')
set_motor('beam',beam_diameter)
if analysis_type=='blank':
info('is blank. not heating')
'''
sleep cumulative time to account for blank
... | USGSDenverPychron/pychron | docs/user_guide/operation/scripts/examples/helix/extraction/felix_co2.py | Python | apache-2.0 | 2,035 |
# Copyright 2016 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 or agreed to in writing, ... | quom/google-cloud-python | runtimeconfig/unit_tests/test_variable.py | Python | apache-2.0 | 7,382 |
from __future__ import absolute_import, unicode_literals
import logging
import os
from ...platformdirs import user_config_dir
from ..info import PY3
from ..util import ConfigParser
from ..util.path import Path
from ..util.six import ensure_str
from .convert import convert
class IniConfig(object):
VIRTUALENV_C... | pybuilder/pybuilder | src/main/python/pybuilder/_vendor/virtualenv/config/ini.py | Python | apache-2.0 | 2,807 |
# Copyright 2015 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... | sachinpro/sachinpro.github.io | tensorflow/python/training/momentum_test.py | Python | apache-2.0 | 17,251 |
# (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 OpenStack Foundation
#
# 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
#
# ... | tobegit3hub/cinder_docker | cinder/zonemanager/fc_zone_manager.py | Python | apache-2.0 | 9,631 |
# Copyright 2013 Donald Stufft
#
# 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, so... | robhudson/warehouse | tests/test_serving.py | Python | apache-2.0 | 1,290 |
#
# 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... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/cluster/clusterinstance_binding.py | Python | apache-2.0 | 3,621 |
'''
Created on Jul 19, 2010
@author: jnaous
'''
from django.core.urlresolvers import reverse
from django.test import Client
from common.tests.client import test_get_and_post_form
from django.contrib.auth.models import User
from pyquery import PyQuery as pq
from openflow.plugin.models import OpenFlowInterface, NonOpenF... | ict-felix/stack | vt_manager_kvm/src/python/scripts/setup_ch.py | Python | apache-2.0 | 3,204 |
# Copyright (c) 2014, MapR Technologies
#
# 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 agree... | citrix-openstack-build/sahara | sahara/plugins/mapr/versions/v4_0_1_mrv2/cluster_configurer.py | Python | apache-2.0 | 875 |
"""
Support for displaying the current CPU speed.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.cpuspeed/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CO... | JshWright/home-assistant | homeassistant/components/sensor/cpuspeed.py | Python | apache-2.0 | 2,256 |
#!/usr/bin/python3
# Copyright 2020 Google LLC
#
# 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 ag... | skia-dev/oss-fuzz | projects/ujson/ujson_fuzzer.py | Python | apache-2.0 | 1,921 |
from unittest import TestCase
from pandas import Timestamp, Timedelta
from zipline.utils.cache import CachedObject, Expired, ExpiringCache
class CachedObjectTestCase(TestCase):
def test_cached_object(self):
expiry = Timestamp('2014')
before = expiry - Timedelta('1 minute')
after = expir... | humdings/zipline | tests/utils/test_cache.py | Python | apache-2.0 | 2,166 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nebula, 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
#
# ... | andrewsmedina/horizon | horizon/horizon/dashboards/nova/instances_and_volumes/panel.py | Python | apache-2.0 | 870 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | eltonkevani/tempest_el_env | tempest/api/image/v2/test_images_tags_negative.py | Python | apache-2.0 | 1,762 |
# Copyright 2019 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... | sarvex/tensorflow | tensorflow/python/keras/tests/add_loss_correctness_test.py | Python | apache-2.0 | 16,393 |
"""
HSA driver bridge implementation
"""
from collections.abc import Sequence
import sys
import atexit
import os
import ctypes
import struct
import traceback
import weakref
import logging
from contextlib import contextmanager
from collections import defaultdict, deque
from functools import total_ordering
from numba ... | stonebig/numba | numba/roc/hsadrv/driver.py | Python | bsd-2-clause | 51,876 |
#!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | weblabdeusto/weblabdeusto | server/src/test/unit/weblab/core/test_alive_users.py | Python | bsd-2-clause | 6,851 |
import numpy as np
from scipy import linalg
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from nose.tools import assert_true
from mne.time_frequency.stft import stft, istft, stftfreq, stft_norm2
def test_stft():
"Test stft and istft tight frame property"
sfreq = 1000. # Hz
f =... | jaeilepp/eggie | mne/time_frequency/tests/test_stft.py | Python | bsd-2-clause | 1,272 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ExternalAccount'
db.create_table('users_externalaccount', (
('id', self.gf('djan... | justinpotts/mozillians | mozillians/users/migrations/0039_auto__add_externalaccount.py | Python | bsd-3-clause | 12,687 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.wiki_profile_url'
db.add_column('profiles_userprofile', 'wiki_profile_url', se... | chirilo/remo | remo/profiles/migrations/0014_auto__add_field_userprofile_wiki_profile_url.py | Python | bsd-3-clause | 6,986 |
from setuptools import (
setup,
find_packages,
)
import sys
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="beautifulsoup4",
# NOTE: We can't import __version__ from bs4 because bs4/__init__.py is Python 2 code,
# and converting it to Python 3 means going through t... | catapult-project/catapult | third_party/beautifulsoup4-4.9.3/setup.py | Python | bsd-3-clause | 1,713 |
from django.apps import AppConfig
class UserprofilesConfig(AppConfig):
name = 'userprofiles'
| robalford/reConstruct | userprofiles/apps.py | Python | bsd-3-clause | 99 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from froi.algorithm import imtool
class IntersectDialog(QDialog):
"""A dialog for action of intersection."""
def __init__(self, model, parent... | sealhuang/FreeROI | froi/gui/component/intersectdialog.py | Python | bsd-3-clause | 3,390 |
"""Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorMixin
from ..utils import array2d, as_float_... | B3AU/waveTree | sklearn/linear_model/omp.py | Python | bsd-3-clause | 31,732 |
# -*- coding: utf-8 -*-
"""
logbook.testsuite
~~~~~~~~~~~~~~~~~
The logbook testsuite.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
import logbook
_skipped_modules = []
_missing = object()
_func_ident = lambda f... | chiehwen/logbook | logbook/testsuite/__init__.py | Python | bsd-3-clause | 2,534 |
from email.utils import formatdate
from typing import Optional, Type, TypeVar
from twisted.internet import defer
from twisted.internet.error import (
ConnectError,
ConnectionDone,
ConnectionLost,
ConnectionRefusedError,
DNSLookupError,
TCPTimedOutError,
TimeoutError,
)
from twisted.web.clie... | starrify/scrapy | scrapy/downloadermiddlewares/httpcache.py | Python | bsd-3-clause | 5,481 |
"""SCons.Tool.mwcc
Tool-specific initialization for the Metrowerks CodeWarrior compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 ... | kuiche/chromium | third_party/scons/scons-local/SCons/Tool/mwcc.py | Python | bsd-3-clause | 6,796 |
#!/usr/bin/python
"""
@brief QuickBot class for Beaglebone Black
@author Rowland O'Flaherty (rowlandoflaherty.com)
@date 02/07/2014
@version: 1.0
@copyright: Copyright (C) 2014, Georgia Tech Research Corporation
see the LICENSE file included with this software (see LINENSE file)
"""
from __future__ import division
im... | chenxinzzu/quickbot_bbb | QuickBot.py | Python | bsd-3-clause | 28,390 |
from requests.auth import HTTPBasicAuth
def apply_updates(doc, update_dict):
# updates the doc with items from the dict
# returns whether or not any updates were made
should_save = False
for key, value in update_dict.items():
if getattr(doc, key, None) != value:
setattr(doc, key, v... | puttarajubr/commcare-hq | custom/api/utils.py | Python | bsd-3-clause | 714 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import time
import gzip
import tempfile
import ConfigParser
from cStringIO import StringIO
from datetime import datetime
from ellen.repo import Jagare
from ellen.utils import JagareError
from vilya.libs.permdir import get_tmpdir
from vilya.mode... | douban/code | vilya/models/ngit/repo.py | Python | bsd-3-clause | 21,073 |
def file_1_function_a():
pass
a_number = 7
a_string = 'bleh'
def file_1_function_b():
pass
file_1_function_a.is_setup_function = True
file_1_function_b.is_setup_function = True
| Pysellus/pysellus | spec/fixtures/multiple_files/file_1.py | Python | mit | 190 |
# coding: utf-8
# Maria Clara Dantas, UFCG
# xenia_and_ringroad
n, m = map(int, raw_input().split())
atividades_casas = map(int, raw_input().split())
tempo = 0
posicao = 1
for i in range(len(atividades_casas)):
if posicao < atividades_casas[i]:
tempo += (atividades_casas[i] - posicao)
elif posicao > atividades_c... | clarammdantas/Online-Jugde-Problems | online_judge_solutions/first-ones/xenia_and_ringroad.py | Python | mit | 425 |
import lxml
import requests
def requests_session():
"""
Get a suitable requests session for use in SmartBot.
In particular, this sets the `User-Agent` header to the value of
'SmartBot'.
"""
session = requests.Session()
session.headers.update({"User-Agent": "SmartBot"})
return session
... | thomasleese/smartbot-old | smartbot/utils/web.py | Python | mit | 1,353 |
from stormed.util import add_method, AmqpError, logger
from stormed.serialization import table2str
from stormed.heartbeat import HeartbeatMonitor
from stormed.frame import status
from stormed.method.codegen import id2class
from stormed.method.constant import id2constant
from stormed.method.codegen.connection import *
... | paolo-losi/stormed-amqp | stormed/method/connection.py | Python | mit | 2,532 |
#!/usr/bin/env python
""" cythonize.py
Cythonize pyx files into C++ files as needed.
Usage: cythonize.py [root]
Checks pyx files to see if they have been changed relative to their
corresponding C++ files. If they have, then runs cython on these files to
recreate the C++ files.
Additionally, checks pxd files and set... | syllog1sm/cymem | bin/cythonize.py | Python | mit | 4,402 |
'''Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
'''
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import re
from scipy import linalg
import scipy.ndimag... | kemaswill/keras | keras/preprocessing/image.py | Python | mit | 25,315 |
import pytest
@pytest.mark.online
class TestMyEpisodes:
"""Uses test account at MyEpisodes, username and password are 'flexget'"""
config = """
tasks:
test:
mock:
- title: the.simpsons.S10E10.hdtv
all_series: yes
myepisodes:
us... | Flexget/Flexget | flexget/tests/test_myepisodes.py | Python | mit | 859 |
"""2005_叫地主接口"""
import clr, sys
from action import *
from lang import Lang
clr.AddReference('ZyGames.Framework.Game')
clr.AddReference('ZyGames.Doudizhu.Lang')
clr.AddReference('ZyGames.Doudizhu.Model')
clr.AddReference('ZyGames.Doudizhu.Bll')
from ZyGames.Framework.Game.Service import *
from ZyGames.Doudizh... | wenhulove333/ScutServer | Sample/Doudizhu/Server/src/ZyGames.Doudizhu.HostServer/bin/Debug/Script/PyScript/Action/Action2005.py | Python | mit | 2,064 |
"""Pathname and path-related operations for the Macintosh."""
import os
from stat import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","islink","exists","isdir","isfile",
"walk","exp... | ai-ku/langvis | jython-2.1/Lib/macpath.py | Python | mit | 6,265 |
from csv import DictReader
from datetime import datetime, timedelta
from collections import defaultdict
import cPickle as pickle
from math import exp, log, sqrt
import random, gc
from util import read_dump, write_dump, cache, read_tsv, convert_ts, data, next_row, get_category
import argparse, ast, re, json
def filter_... | Gzsiceberg/kaggle-avito | ins2/gen_data.py | Python | mit | 19,154 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment.py | Python | mit | 1,773 |
#!/usr/bin/env python
# 2015 Copyright (C) White
#
# 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, version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
#... | 7anshuai/white | white/domain/storage.py | Python | gpl-2.0 | 2,170 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
gateway tests - Testing the gateway.getObject() and searchObjects() methods
Copyright 2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
pytest fixtures used as defined in conftest.py:
- gatewaywrap... | jballanc/openmicroscopy | components/tools/OmeroPy/test/gatewaytest/test_get_objects.py | Python | gpl-2.0 | 23,630 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import bdb
import inspect
import logging
import os
import re
import shutil
import sys
import time
import traceback
import warnings
warnings.filterwarnings(action="ignore", me... | krintoxi/NoobSec-Toolkit | NoobSecToolkit /tools/sqli/sqlmap.py | Python | gpl-2.0 | 5,756 |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from librehatti.catalog.models import PurchaseOrder
from librehatti.catalog.models import Category
from librehatti.catalog.models import PurchasedItem
from librehatti.catalog.models import ModeOfPayment
from librehatti.cata... | s-monisha/LibreHatti | src/librehatti/bills/views.py | Python | gpl-2.0 | 7,704 |
import collections
import ctypes
import hashlib
import os
import platform
import random
import re
import string
import sys
import traceback
from couchpotato.core.helpers.encoding import simplifyString, toSafeString, ss, sp
from couchpotato.core.logger import CPLog
import six
from six.moves import map, zip, filter
lo... | xombiemp/CouchPotatoServer | couchpotato/core/helpers/variable.py | Python | gpl-3.0 | 11,486 |
########################################################################
# $HeadURL$
# File : SSHGEComputingElement.py
# Author : A.T. V.H.
########################################################################
""" Grid Engine Computing Element with remote job submission via ssh/scp and using site
shared area ... | sposs/DIRAC | Resources/Computing/SSHGEComputingElement.py | Python | gpl-3.0 | 1,662 |
#!/usr/bin/env python
#
# backend for serial IO for POSIX compatible systems, like Linux, OSX
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2001-2016 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# parts based on code from Grant B. Edwards <grante@visi.... | technologiescollege/Blockly-rduino-communication | scripts/Lib/site-packages/serial/serialposix.py | Python | gpl-3.0 | 29,639 |
from django import template
from manage_treemap.views.roles import options_for_permission
from treemap.audit import FieldPermission
from treemap.lib.object_caches import role_field_permissions
register = template.Library()
@register.filter
def photo_permission_level(role):
photo_perms = role_field_permissions(... | maurizi/otm-core | opentreemap/manage_treemap/templatetags/roles.py | Python | agpl-3.0 | 594 |
"""Support for HomematicIP Cloud weather devices."""
import logging
from homematicip.aio.device import (
AsyncWeatherSensor, AsyncWeatherSensorPlus, AsyncWeatherSensorPro)
from homematicip.aio.home import AsyncHome
from homeassistant.components.weather import WeatherEntity
from homeassistant.config_entries impor... | jnewland/home-assistant | homeassistant/components/homematicip_cloud/weather.py | Python | apache-2.0 | 2,991 |
# Implements twisted-based UNIX domain socket transport
import sys
from twisted.internet import reactor
from pysnmp.carrier.twisted.dgram.base import DgramTwistedTransport
from pysnmp.carrier import error
domainName = snmpLocalDomain = (1, 3, 6, 1, 2, 1, 100, 1, 13)
class UnixTwistedTransport(DgramTwistedTransport):
... | BoundaryDev/boundary-plugin-mongodb-enterprise-dev | pysnmp/carrier/twisted/dgram/unix.py | Python | apache-2.0 | 1,019 |
input = """
p24|p8|not_p15:-p7,p2,not p25.
p11|not_p20|p8|not_p15:-p24,p2.
p3|p20|p18|p3:-p1,not p22.
not_p5|not_p5|not_p19|p22.
p1|p12|p2|not_p16:-not p23,not p3.
p3|not_p20|p18:-p13,not p22,not p14.
p17|p12|p8|not_p8.
p15|not_p22|p24|not_p12.
not_p21|p20|p18:-p1,not p22.
p24|p9|p24|not_p22:-p12,p23.
not_p2|... | Yarrick13/hwasp | tests/asp/gringo/modelchecker.046.test.py | Python | apache-2.0 | 186,113 |
"""Support for Tasmota fans."""
from hatasmota import const as tasmota_const
from homeassistant.components import fan
from homeassistant.components.fan import FanEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.util.percentage impo... | kennedyshead/home-assistant | homeassistant/components/tasmota/fan.py | Python | apache-2.0 | 3,093 |
# -*- coding: utf-8 -*-
import time
import urllib
from urlparse import parse_qs
from oauth_provider.tests.auth import BaseOAuthTestCase, METHOD_URL_QUERY, METHOD_AUTHORIZATION_HEADER, METHOD_POST_REQUEST_BODY
class XAuthTestCase(BaseOAuthTestCase):
def setUp(self):
super(XAuthTestCase, self).setUp()
... | frasern/ADL_LRS | oauth_provider/tests/xauth.py | Python | apache-2.0 | 2,360 |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Command to start up the Docker plugin.
"""
from os import umask
from stat import S_IRUSR, S_IWUSR, S_IXUSR
from twisted.python.usage import Options
from twisted.internet.endpoints import serverFromString
from twisted.application.internet import StreamServe... | hackday-profilers/flocker | flocker/dockerplugin/_script.py | Python | apache-2.0 | 3,412 |
# 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... | allenlavoie/tensorflow | tensorflow/python/training/warm_starting_util.py | Python | apache-2.0 | 15,397 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch
import to... | mlperf/training_results_v0.7 | NVIDIA/benchmarks/transformer/implementations/pytorch/fairseq/optim/adam.py | Python | apache-2.0 | 7,859 |
# 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... | phenoxim/cinder | cinder/objects/qos_specs.py | Python | apache-2.0 | 7,943 |
#!/usr/bin/python
# Copyright 2002 Dave Abrahams
# Copyright 2002, 2003, 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
from BoostBuild import Tester
import os
t = Tester("--build-system=project-tes... | cesarpazguzman/The-Eternal-Sorrow | dependencies/luabind/boost-build/test/project_test1.py | Python | apache-2.0 | 1,956 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import torch
from torchvision import transforms as T
from maskrcnn_benchmark.modeling.detector import build_detection_model
from maskrcnn_benchmark.utils.checkpoint import DetectronCheckpointer
from maskrcnn_benchmark.structures.image_l... | mlperf/training_results_v0.7 | NVIDIA/benchmarks/maskrcnn/implementations/pytorch/demo/predictor.py | Python | apache-2.0 | 15,180 |
#
# 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... | Acehaidrey/incubator-airflow | airflow/providers/google/marketing_platform/hooks/campaign_manager.py | Python | apache-2.0 | 11,618 |
from observertest import BaseObserverToscaTest
from core.models import Site, Deployment, User, ControllerUser
# Note that as a side effect, these tests will also create a Site
class ObserverUserTest(BaseObserverToscaTest):
tests = ["create_user"]
# hide_observer_output = False # uncomment to display lots of ... | xmaruto/mcord | xos/tosca/tests/observerUserTest.py | Python | apache-2.0 | 2,957 |
#
# 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/incubator-airflow | airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py | Python | apache-2.0 | 5,015 |
def __load():
import imp, os, sys
try:
dirname = os.path.dirname(__loader__.archive)
except NameError:
dirname = sys.prefix
path = os.path.join(dirname, '_winreg.pyd')
#print "py2exe extension module", __name__, "->", path
mod = imp.load_dynamic(__name__, path)
## mod.frozen ... | slozier/ironpython2 | Src/StdLib/Lib/site-packages/isapi/test/build/bdist.win32/winexe/temp/_winreg.py | Python | apache-2.0 | 344 |
#
# DEPRECATED: implementation for ffi.verify()
#
import sys, imp
from . import model
from .error import VerificationError
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._... | xyuanmu/XX-Net | python3.8.2/Lib/site-packages/cffi/vengine_cpy.py | Python | bsd-2-clause | 43,314 |
#
# Copyright (c) 2011, Regents of the University of California
# BSD license, See the COPYING file for more information
# Written by: Derek Kulinski <takeda@takeda.tk>
#
import curses, curses.wrapper, curses.textpad, threading, time, sys
from ChatNet import ChatNet, ChatServer
class ChatGUI(object):
def __init__(se... | cawka/packaging-PyNDN | examples/ndnChat/chat.py | Python | bsd-3-clause | 2,131 |
"""
********
Matching
********
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# Copyright (C) 2011 by
# Nicholas Mancuso <nick.mancuso@gmail.com>
# All rights reserved.
# ... | ltiao/networkx | networkx/algorithms/matching.py | Python | bsd-3-clause | 32,997 |
import pytest
from github3 import AuthenticationFailed, GitHubError
from github3.github import GitHub
from .helper import UnitHelper, UnitIteratorHelper
def url_for(path=''):
"""Simple function to generate URLs with the base GitHub URL."""
return 'https://api.github.com/' + path.strip('/')
class TestGitHu... | icio/github3.py | tests/unit/test_github.py | Python | bsd-3-clause | 31,906 |
from __future__ import unicode_literals
from django.db.models import signals
from django.dispatch import receiver
from django.test import TestCase
from django.utils import six
from .models import Person, Car
# #8285: signals can be any callable
class PostDeleteHandler(object):
def __init__(self, data):
... | denisenkom/django | tests/signals/tests.py | Python | bsd-3-clause | 5,273 |
# Authors:
# Trevor Perrin
# Martin von Loewis - python 3 port
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
#
# See the LICENSE file for legal information regarding use of this file.
"""cryptomath module
This module has basic math/crypto code."""
from __future__ import print_function
import os
impor... | scheib/chromium | third_party/tlslite/tlslite/utils/cryptomath.py | Python | bsd-3-clause | 8,434 |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS 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 json
import mox
import os
import sys
import shutil
import time
import constants
sys.path.insert(0, constants.SOURCE_ROOT)
f... | espadrine/opera | chromium/src/third_party/chromite/buildbot/remote_try_unittest.py | Python | bsd-3-clause | 7,349 |
"""
Custom manager for HelpEntry objects.
"""
from django.db import models
from src.utils import logger, utils
__all__ = ("HelpEntryManager",)
class HelpEntryManager(models.Manager):
"""
This HelpEntryManager implements methods for searching
and manipulating HelpEntries directly from the database.
Th... | google-code-export/evennia | src/help/manager.py | Python | bsd-3-clause | 3,168 |
"""Pgbouncer check
Collects metrics from the pgbouncer database.
"""
# 3p
import psycopg2 as pg
# project
from checks import AgentCheck, CheckException
class ShouldRestartException(Exception):
pass
class PgBouncer(AgentCheck):
"""Collects metrics from pgbouncer
"""
RATE = AgentCheck.rate
GAUGE... | mderomph-coolblue/dd-agent | checks.d/pgbouncer.py | Python | bsd-3-clause | 7,003 |
#!/usr/bin/env python
# Copyright 2020 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Helper script to execute a single-processed fuzzing session.
Creates fuzz tests in workdir/output/dir-<dir number>/fuzz-XXX.js.... | youtube/cobalt | third_party/v8/tools/clusterfuzz/js_fuzzer/tools/fuzz_one.py | Python | bsd-3-clause | 1,328 |
#!/usr/bin/env python
#
# Copyright 2011, Toru Maesaka
#
# Redistribution and use of this source code is licensed under
# the BSD license. See COPYING file for license description.
import os
import sys
sys.path.insert(0, os.path.join(os.path.split(__file__)[0], '..'))
| sapo/python-kyototycoon | tests/config.py | Python | bsd-3-clause | 271 |
"""
Accessors for related objects.
When a field defines a relation between two models, each model class provides
an attribute to access related instances of the other model class (unless the
reverse accessor has been disabled with related_name='+').
Accessors are implemented as descriptors in order to customize acces... | vincepandolfo/django | django/db/models/fields/related_descriptors.py | Python | bsd-3-clause | 47,154 |
"""
Various bayesian regression
"""
from __future__ import print_function
# Authors: V. Michel, F. Pedregosa, A. Gramfort
# License: BSD 3 clause
from math import log
import numpy as np
from scipy import linalg
from .base import LinearModel
from ..base import RegressorMixin
from ..utils.extmath import fast_logdet, p... | jmargeta/scikit-learn | sklearn/linear_model/bayes.py | Python | bsd-3-clause | 15,486 |
# Copyright 2015 Cedraro Andrea <a.cedraro@gmail.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | NcLang/vimrc | sources_non_forked/YouCompleteMe/third_party/ycmd/third_party/JediHTTP/jedihttp/compatibility.py | Python | mit | 2,108 |
'''
Tests for fileinput module.
Nick Mathewson
'''
import unittest
from test.support import verbose, TESTFN, run_unittest
from test.support import unlink as safe_unlink
import sys, re
from io import StringIO
from fileinput import FileInput, hook_encoded
# The fileinput module has 2 interfaces: the FileInput class whi... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_fileinput.py | Python | mit | 8,498 |
# coding: utf-8
# pylint: disable=missing-docstring, invalid-name
from __future__ import absolute_import
from google.appengine.api import users
import flask
import auth
import model
import util
from main import app
@app.route('/signin/google/')
def signin_google():
auth.save_request_params()
google_url = ... | sidharta/hansel-app | main/auth/google.py | Python | mit | 1,359 |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | viger/docker | proxy/proxy/code/default/gae_proxy/server/lib/httplib2/__init__.py | Python | mit | 69,728 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
"""
Sync's doctype and docfields from txt files to database
perms will get synced only if none exist
"""
import frappe
import os
from frappe.modules.import_file ... | bohlian/frappe | frappe/model/sync.py | Python | mit | 2,605 |