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 |
|---|---|---|---|---|---|
amenonsen/ansible | test/units/modules/network/fortios/test_fortios_system_auto_install.py | 21 | 6598 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
avedaee/DIRAC | Core/scripts/dirac-fix-ld-library-path.py | 10 | 4148 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-fix-ld-lib
# Author : Joel Closier
########################################################################
__RCSID__ = "$Id$"
""" This is a script to fix oversized LD_LIBRARY_PATH variables.
"""... | gpl-3.0 |
achang97/YouTunes | lib/python2.7/site-packages/youtube_dl/extractor/canalc2.py | 25 | 2143 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_duration
class Canalc2IE(InfoExtractor):
IE_NAME = 'canalc2.tv'
_VALID_URL = r'https?://(?:(?:www\.)?canalc2\.tv/video/|archives-canalc2\.u-strasbg\.fr/video\.asp\?.*\bidVideo=)(?P<i... | mit |
phil-lopreiato/the-blue-alliance-android | scripts/do_release.py | 1 | 9702 | #! /usr/bin/env python
import argparse
import time
import subprocess
import sys
import re
from subprocess import CalledProcessError
"""
A script to push releases to Google Play
See samples: https://github.com/googlesamples/android-play-publisher-api
Requires Google API python client
Insall with: pip install google-... | mit |
G1DR4/buendia | tools/generate_site_sql.py | 13 | 10584 | #!/usr/bin/python
# Copyright 2015 The Project Buendia 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 l... | apache-2.0 |
firebitsbr/raspberry_pwn | src/pentest/metagoofil/hachoir_parser/network/tcpdump.py | 9 | 14972 | """
Tcpdump parser
Source:
* libpcap source code (file savefile.c)
* RFC 791 (IPv4)
* RFC 792 (ICMP)
* RFC 793 (TCP)
* RFC 1122 (Requirements for Internet Hosts)
Author: Victor Stinner
Creation: 23 march 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
Enum, ... | gpl-3.0 |
rogerhu/django | django/db/models/options.py | 2 | 25038 | from __future__ import unicode_literals
from collections import OrderedDict
import re
from bisect import bisect
import warnings
from django.conf import settings
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy... | bsd-3-clause |
kstaniek/csm | csmserver/server_helper.py | 1 | 15049 | # =============================================================================
# Copyright (c) 2016, Cisco Systems, 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 ... | apache-2.0 |
kingvuplus/TT-gui | lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py | 8 | 13872 | from Screens.Wizard import wizardManager, WizardSummary
from Screens.WizardLanguage import WizardLanguage
from Screens.Rc import Rc
from Screens.MessageBox import MessageBox
from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap
from Components.Sources.Boolean import Boolean
from Components.Network import iNet... | gpl-2.0 |
google-research/ott | tests/core/sinkhorn_unbalanced_test.py | 1 | 2940 | # coding=utf-8
# Copyright 2021 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 agreed ... | apache-2.0 |
shibanis1/spark-tk | python/sparktk/models/classification/random_forest_classifier.py | 1 | 9387 | from sparktk.loggers import log_load; log_load(__name__); del log_load
from sparktk.propobj import PropertiesObject
from sparktk.frame.ops.classification_metrics_value import ClassificationMetricsValue
import os
def train(frame,
label_column,
observation_columns,
num_classes = 2,
... | apache-2.0 |
sysadminmatmoz/OCB | addons/warning/warning.py | 6 | 10871 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api
from openerp.osv import fields,osv
from openerp.tools.translate import _
WARNING_MESSAGE = [
('no-message','No Message'),
('warning','Warning'),
... | agpl-3.0 |
sanjeevtripurari/hue | apps/rdbms/setup.py | 37 | 1209 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
jankoslavic/numpy | tools/swig/test/testMatrix.py | 116 | 14309 | #! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeE... | bsd-3-clause |
kidburglar/youtube-dl | youtube_dl/extractor/nosvideo.py | 64 | 2480 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata,
xpath_text,
xpath_with_ns,
)
_x = lambda p: xpath_with_ns(p, {'xspf': 'http://xspf.org/ns/0/'})
class NosVideoIE(InfoE... | unlicense |
knifenomad/django | tests/template_backends/test_jinja2.py | 315 | 3048 | # Since this package contains a "jinja2" directory, this is required to
# silence an ImportWarning warning on Python 2.
from __future__ import absolute_import
from unittest import skipIf
from django.template import TemplateSyntaxError
from .test_dummy import TemplateStringsTests
try:
import jinja2
except Import... | bsd-3-clause |
anksp21/Community-Zenpacks | ZenPacks.example.Techniques/setup.py | 2 | 2673 | ################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.example.Techniques"
VERSION = "1.4.1"
AUTHOR = "Chet Luther"
LICENSE = ""
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.exa... | gpl-2.0 |
shaunbrady/boto | boto/redshift/exceptions.py | 151 | 8236 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
android-ia/platform_external_chromium_org | tools/perf/measurements/session_restore.py | 26 | 2907 | # Copyright 2013 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 collections
from measurements import startup
from metrics import cpu
from metrics import startup_metric
from telemetry.core import util
from telemetr... | bsd-3-clause |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/django/contrib/sessions/backends/signed_cookies.py | 94 | 3019 | try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core import signing
from django.contrib.sessions.backends.base import SessionBase
class PickleSerializer(object):
"""
Simple wrapper around pickle to be used in signing.dumps and
signing.... | mit |
ShadowKyogre/mypaint | gui/brushiconeditor.py | 3 | 12995 | # -*- encoding: utf-8 -*-
# This file is part of MyPaint.
# Copyright (C) 2009-2013 by Martin Renold <martinxyz@gmx.ch>
# Copyright (C) 2013-2016 by the MyPaint Development Team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | gpl-2.0 |
fangxingli/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/config.py | 8 | 16500 | #!/usr/bin/env python
__author__ = 'rolandh'
import copy
import sys
import os
import re
import logging
import logging.handlers
from importlib import import_module
from saml2 import root_logger, BINDING_URI, SAMLError
from saml2 import BINDING_SOAP
from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_HT... | apache-2.0 |
gdw2/zim | tests/tags.py | 1 | 11770 | # -*- coding: utf-8 -*-
# Copyright 2011 Jaap Karssenberg <jaap.karssenberg@gmail.com>
import tests
import gtk
import pango
from zim.index import Index, IndexPath, IndexTag
from zim.notebook import Path
from zim.gui.pageindex import FGCOLOR_COL, \
EMPTY_COL, NAME_COL, PATH_COL, STYLE_COL
# Explicitly don't import... | gpl-2.0 |
pipermerriam/django | tests/gis_tests/gdal_tests/test_geom.py | 256 | 20748 | import json
import unittest
from binascii import b2a_hex
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.utils.six.moves import range
from ..test_data import TestDataMixin
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
if... | bsd-3-clause |
dbbhattacharya/kitsune | vendor/packages/sqlalchemy/lib/sqlalchemy/test/requires.py | 6 | 9872 | """Global database feature support policy.
Provides decorators to mark tests requiring specific feature support from the
target database.
"""
from testing import \
_block_unconditionally as no_support, \
_chain_decorators_on, \
exclude, \
emits_warning_on,\
skip_if,\
fails_on,\
fai... | bsd-3-clause |
andreparrish/python-for-android | python3-alpha/python3-src/Lib/test/test_list.py | 53 | 2600 | import sys
from test import support, list_tests
class ListTest(list_tests.CommonTest):
type2test = list
def test_basic(self):
self.assertEqual(list([]), [])
l0_3 = [0, 1, 2, 3]
l0_3_bis = list(l0_3)
self.assertEqual(l0_3, l0_3_bis)
self.assertTrue(l0_3 is not l0_3_bis)
... | apache-2.0 |
google/grr | grr/core/grr_response_core/lib/registry.py | 1 | 5649 | #!/usr/bin/env python
"""This is the GRR class registry.
A central place responsible for registering plugins. Any class can have plugins
if it defines __metaclass__ = MetaclassRegistry. Any derived class from this
baseclass will have the member classes as a dict containing class name by key
and class as value.
"""
#... | apache-2.0 |
rwgdrummer/maskgen | maskgen/software_loader.py | 1 | 28738 | # =============================================================================
# Authors: PAR Government
# Organization: DARPA
#
# Copyright (c) 2016 PAR Government
# All rights reserved.
# ==============================================================================
import json
import logging
import os
from json i... | bsd-3-clause |
finfish/scrapy | tests/test_utils_conf.py | 2 | 4165 | import unittest
from scrapy.settings import BaseSettings
from scrapy.utils.conf import build_component_list, arglist_to_dict
class BuildComponentListTest(unittest.TestCase):
def test_build_dict(self):
d = {'one': 1, 'two': None, 'three': 8, 'four': 4}
self.assertEqual(build_component_list(d, con... | bsd-3-clause |
htzy/bigfour | common/djangoapps/cors_csrf/tests/test_views.py | 150 | 2397 | """Tests for cross-domain request views. """
import json
from django.test import TestCase
from django.core.urlresolvers import reverse, NoReverseMatch
import ddt
from config_models.models import cache
from cors_csrf.models import XDomainProxyConfiguration
@ddt.ddt
class XDomainProxyTest(TestCase):
"""Tests for... | agpl-3.0 |
morph027/ansible-modules-extras | cloud/cloudstack/cs_ip_address.py | 33 | 7989 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 So... | gpl-3.0 |
tdegrunt/or-tools | examples/python/crypta.py | 34 | 3413 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ... | apache-2.0 |
utkarsh-goswami/erpnext | erpnext/demo/user/accounts.py | 33 | 4171 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import random
from frappe.utils import random_string
from frappe.desk import query_report
from erpnext.accounts.doctype.journal_entry.jo... | gpl-3.0 |
tsaitsai/jasper-client | client/populate.py | 28 | 5053 | # -*- coding: utf-8-*-
import os
import re
from getpass import getpass
import yaml
from pytz import timezone
import feedparser
import jasperpath
def run():
profile = {}
print("Welcome to the profile populator. If, at any step, you'd prefer " +
"not to enter the requested information, just hit 'Ente... | mit |
Xowap/ansible | lib/ansible/playbook/handler.py | 237 | 1957 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
adrifloresm/sssweep | sssweep/web_viewer_gen.py | 1 | 13431 | """
* Copyright (c) 2012-2017, Adriana Flores
* 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 co... | bsd-3-clause |
DDelon/youtube-dl | youtube_dl/downloader/rtmp.py | 17 | 8354 | from __future__ import unicode_literals
import os
import re
import subprocess
import time
from .common import FileDownloader
from ..compat import compat_str
from ..utils import (
check_executable,
encodeFilename,
encodeArgument,
get_exe_version,
)
def rtmpdump_version():
return get_exe_version(
... | unlicense |
syedsuhail/customer_analyzer | lib/flask/signals.py | 783 | 2140 | # -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Implements signals based on blinker if available, otherwise
falls silently back to a noop
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
signals_available = False
try:
from blinker import Name... | apache-2.0 |
gam17/QAD | qad_break_fun.py | 1 | 4906 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
funzioni per comando SPEZZA per tagliare un oggetto
-------------------
begin : 2019-08-08
copyright ... | gpl-3.0 |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/django/shortcuts.py | 78 | 5688 | """
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.
"""
from django.template import loader, RequestContext
from django.http import HttpResponse, Http404
from django.http import HttpRespons... | mit |
JPMoresmau/aifh | vol2/vol2-python-examples/lib/aifh/aifh_error.py | 6 | 1218 | """
Artificial Intelligence for Humans
Volume 2: Nature-Inspired Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by Jeff Heaton
Licensed under the Apache License, Version 2.0 (the "License")... | apache-2.0 |
eenchev/idea-note-taking-app | env/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/gaerdbms.py | 33 | 3387 | # mysql/gaerdbms.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+gaerdbms
:name: Google Cloud SQL
:dbapi: rdbms
:... | mit |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/tensorflow/contrib/distributions/python/ops/distribution.py | 7 | 33841 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | gpl-3.0 |
d33tah/npyscreen | tokentextbox.py | 9 | 1333 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: npsapp.py
import cProfile
import pstats
from npyscreen import NPSApp
from npyscreen import Form
from npyscreen import TextTokens, TitleTextTokens
class TextBoxForm(Form):
def create(self):
tb = self.add(TextTokens, name="TokenField", )#max_width=25... | bsd-2-clause |
emedvedev/st2 | st2common/tests/unit/test_util_api.py | 7 | 3292 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 |
SqueezeStudioAnimation/omtk | python/omtk/vendor/pyparsing.py | 22 | 157475 | # module pyparsing.py
#
# Copyright (c) 2003-2013 Paul T. McGuire
#
# 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 u... | mit |
quizlet/grpc | src/python/grpcio_tests/tests/testing/_time_test.py | 12 | 6050 | # Copyright 2017 gRPC 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 writing... | apache-2.0 |
google/nitroml | nitroml/benchmark/suites/openml_cc18_test.py | 1 | 1850 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
artemh/asuswrt-merlin | release/src/router/samba36/wintest/test-s3.py | 19 | 9730 | #!/usr/bin/env python
'''automated testing of Samba3 against windows'''
import sys, os
import optparse
import wintest
def set_libpath(t):
t.putenv("LD_LIBRARY_PATH", "${PREFIX}/lib")
def set_krb5_conf(t):
t.run_cmd("mkdir -p ${PREFIX}/etc")
t.write_file("${PREFIX}/etc/krb5.conf",
''... | gpl-2.0 |
ZHAW-INES/rioxo-uClinux-dist | user/python/python-2.4.4/Lib/_strptime.py | 11 | 18819 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | gpl-2.0 |
azurestandard/django | tests/regressiontests/comment_tests/tests/app_api_tests.py | 50 | 2600 | from __future__ import absolute_import
from django.conf import settings
from django.contrib import comments
from django.contrib.comments.models import Comment
from django.contrib.comments.forms import CommentForm
from . import CommentTestCase
class CommentAppAPITests(CommentTestCase):
"""Tests for the "comment ... | bsd-3-clause |
CTSNE/NodeDefender | NodeDefender/mail/node.py | 1 | 1136 | from flask_mail import Message
from flask import render_template, url_for
import NodeDefender
import smtplib
@NodeDefender.decorators.mail_enabled
@NodeDefender.decorators.celery_task
def new_node(group, node):
group = NodeDefender.db.group.get(group)
if group is None:
return False
if group.email i... | mit |
kevin-coder/tensorflow-fork | tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver.py | 8 | 6532 | # 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 applicable ... | apache-2.0 |
foxwill/ol-api-tester | env/lib/python2.7/site-packages/setuptools/tests/test_find_packages.py | 43 | 6005 | """Tests for setuptools.find_packages()."""
import os
import sys
import shutil
import tempfile
import unittest
import platform
import setuptools
from setuptools import find_packages
from setuptools.tests.py26compat import skipIf
find_420_packages = setuptools.PEP420PackageFinder.find
# modeled after CPython's test.s... | gpl-2.0 |
Bergiu/smarthomepi | packages/shp/server/Program.py | 1 | 3915 | #
from datetime import datetime
class Program ( ):
#private:
"""
id # int
datetime # datetime
description # string
status # boolean
inactive # boolean
weekly # boolean
pin # int(4)
id_related_dev # int
id_initiator # int
"""
def __init__(self,**kwargs):
"""
@**kwargs:
id: int
datetime: date... | gpl-3.0 |
tereka114/chainer | tests/functions_tests/test_split_axis.py | 1 | 2359 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer.testing import attr
if cuda.available:
cuda.init()
class TestSplitAxis0(unittest.TestCase):
def setUp(self):
self.x = numpy.arange(42, dtype=numpy.flo... | mit |
FinalAngel/djangocms-installer | tests/config.py | 3 | 25247 | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
from mock import patch
from six import StringIO, text_type
from tzlocal import get_localzone
from djangocms_installer import config
from djangocms_installer.install import check_install
from djangocms_installer.utils import less_than_v... | bsd-3-clause |
tochange/ShadowsocksFork | shadowsocks/crypto/rc4_md5.py | 1042 | 1339 | #!/usr/bin/env python
#
# 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 by applicable law or ... | apache-2.0 |
drpngx/tensorflow | tensorflow/tools/docker/simple_console.py | 605 | 1028 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
yw374cornell/e-mission-server | emission/tests/storageTests/analysis_ts_common.py | 1 | 3325 | # Standard imports
import unittest
import datetime as pydt
import logging
import uuid
import json
import emission.storage.timeseries.abstract_timeseries as esta
import emission.storage.decorations.analysis_timeseries_queries as esda
import emission.storage.timeseries.timequery as estt
import emission.core.get_databas... | bsd-3-clause |
cfriedt/gnuradio | gr-uhd/examples/python/fm_tx_2_daughterboards.py | 58 | 7706 | #!/usr/bin/env python
#
# Copyright 2005-2007,2011,2012 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 ... | gpl-3.0 |
analyseuc3m/ANALYSE-v1 | openedx/core/djangoapps/ccxcon/tests/test_api.py | 24 | 8241 | """
Unit tests for the API module
"""
import datetime
import mock
import pytz
import urlparse
from nose.plugins.attrib import attr
from opaque_keys.edx.keys import CourseKey
from student.tests.factories import AdminFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils ... | agpl-3.0 |
snyderr/robotframework | src/robot/model/message.py | 2 | 2643 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
benlangmuir/swift | utils/build_swift/tests/utils.py | 21 | 2090 | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... | apache-2.0 |
klahnakoski/esShardBalancer | pyLibrary/env/big_data.py | 2 | 12353 | # encoding: utf-8
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __fu... | mpl-2.0 |
MTASZTAKI/ApertusVR | plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/examples/getClosestPoints.py | 2 | 2665 | import pybullet as p
import time
p.connect(p.GUI)
useCollisionShapeQuery = True
p.configureDebugVisualizer(p.COV_ENABLE_GUI, 0)
geom = p.createCollisionShape(p.GEOM_SPHERE, radius=0.1)
geomBox = p.createCollisionShape(p.GEOM_BOX, halfExtents=[0.2, 0.2, 0.2])
baseOrientationB = p.getQuaternionFromEuler([0, 0.3, 0]) #[0... | mit |
alexisVallet/anime-character-detection | dpmDetection.py | 1 | 2469 | import cv2
import pymatlab as mlb
class DPMObjectDetection:
def __init__(self):
self.session = mlb.session_factory()
self.session.run('cd ./voc-dpm/')
self.model = None
def trainDPMmodel(self, model, pos, neg, warp, randneg, nbiter, nbnegiter,
maxnumexamp... | gpl-2.0 |
bendk/thesquirrel | thesquirrel/views.py | 1 | 1123 | # thesquirrel.org
#
# Copyright (C) 2015 Flying Squirrel Community Space
#
# thesquirrel.org 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, either version 3 of the License, or (at your
# option) any la... | agpl-3.0 |
agroknow/aginfra | sites/all/modules/ak_cp/js/leaflet_search/tilestache_server_with_autocomplete.py | 2 | 5844 | import json
import marisa_trie
import os
import shutil
from operator import itemgetter
import TileStache
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
from cartograph import Utils
from cartograph import Config
""" This is an example from a summer research projec... | gpl-2.0 |
cuckoobox/cuckoo | tests/test_search.py | 1 | 4842 | # Copyright (C) 2017-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import mock
import os
import tempfile
from cuckoo.common.elastic import Elastic
from cuckoo.common.mongo import Mongo, mongo
from cuckoo.common.object... | mit |
asterisk/ari-py | ari_test/utils.py | 2 | 2013 | #!/usr/bin/env python
import httpretty
import os
import unittest
import urlparse
import ari
import requests
class AriTestCase(unittest.TestCase):
"""Base class for mock ARI server.
"""
BASE_URL = "http://ari.py/ari"
def setUp(self):
"""Setup httpretty; create ARI client.
"""
... | bsd-3-clause |
LumaPictures/rez | src/rez/cli/complete.py | 4 | 3454 | """
Prints package completion strings.
"""
from rez.vendor import argparse
__doc__ = argparse.SUPPRESS
def setup_parser(parser, completions=False):
pass
def command(opts, parser, extra_arg_groups=None):
from rez.cli._util import subcommands, hidden_subcommands
import os
import re
# get comp i... | lgpl-3.0 |
daviddupont69/CouchPotatoServer | libs/rsa/transform.py | 216 | 6848 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | gpl-3.0 |
maxamillion/atomic-reactor | atomic_reactor/plugins/pre_inject_parent_image.py | 3 | 5041 | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, unicode_literals
from atomic_reactor.build import ImageName
from atomic_reactor.koji_util import creat... | bsd-3-clause |
handroissuazo/tensorflow | tensorflow/python/ops/gradient_checker_test.py | 18 | 11199 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
geosharath/sm | drivers/mpath_dmp.py | 4 | 11094 | #!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program 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; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
baris/fullerite | src/diamond/collectors/ipmisensor/ipmisensor.py | 23 | 4467 | # coding=utf-8
"""
This collector uses the [ipmitool](http://openipmi.sourceforge.net/) to read
hardware sensors from servers
using the Intelligent Platform Management Interface (IPMI). IPMI is very common
with server hardware but usually not available in consumer hardware.
#### Dependencies
* [ipmitool](http://ope... | apache-2.0 |
lpramuk/robottelo | robottelo/cli/puppet.py | 1 | 1998 | # -*- encoding: utf-8 -*-
"""
Usage::
hammer puppet-class [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
info Show a puppetclass
list List all... | gpl-3.0 |
santiag0aragon/pgp_dongle | pgp_wrapper.py | 1 | 11716 | import os
import gnupg
import socket
import struct
import re
import sys
import getpass
from socket_utils import *
# For the generation of the key you may want to run
# sudo rngd -r /dev/urandom
# to generate randomnes
class PGP:
def __init__(self, path, email=None, verbose=False, pass_phrase=None):
self.D... | gpl-3.0 |
sontek/rethinkdb | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-ordering.py | 225 | 3058 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure the link order of object files is the same between msvs and ninja.
"""
import TestGyp
import sys
if sys.platform == 'win32'... | agpl-3.0 |
40223133/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/sre_compile.py | 630 | 16898 | #
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import sys
import _sre
import sre_parse
from sre_constan... | gpl-3.0 |
pacificclimate/pdp_util | tests/test_util.py | 1 | 3182 | from urllib.parse import urlencode
from datetime import datetime
from pycds import Network, CrmpNetworkGeoserver as cng
from pdp_util.util import get_stn_list, get_clip_dates, get_extension
import pytest
from sqlalchemy import text
from webob.request import Request
def test_get_stn_list(test_session):
stns = ge... | gpl-3.0 |
numpy/numpy | numpy/distutils/intelccompiler.py | 5 | 4234 | import platform
from distutils.unixccompiler import UnixCCompiler
from numpy.distutils.exec_command import find_executable
from numpy.distutils.ccompiler import simple_version_match
if platform.system() == 'Windows':
from numpy.distutils.msvc9compiler import MSVCCompiler
class IntelCCompiler(UnixCCompiler):
... | bsd-3-clause |
feliperfranca/django-nonrel-example | django/contrib/admindocs/utils.py | 314 | 3796 | "Misc. utility functions/classes for admin documentation generator."
import re
from email.Parser import HeaderParser
from email.Errors import HeaderParseError
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_str
try:
import docutils.... | bsd-3-clause |
381426068/MissionPlanner | Lib/site-packages/numpy/core/tests/test_scalarmath.py | 53 | 14311 | import sys
from numpy.testing import *
import numpy as np
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
np.int_, np.uint, np.longlong, np.ulonglong,
np.single, np.double, np.longdouble, np.csingle,
np.cdouble, np.clongdouble]
real_types = [ np.byte, np.ubyte,... | gpl-3.0 |
da2ce7/cjdns | node_build/dependencies/libuv/build/gyp/test/lib/TestCmd.py | 330 | 52544 | """
TestCmd.py: a testing framework for commands and scripts.
The TestCmd module provides a framework for portable automated testing
of executable commands and scripts (in any language, not just Python),
especially commands and scripts that require file system interaction.
In addition to running tests and evaluating... | gpl-3.0 |
nwjs/chromium.src | ios/build/bots/scripts/run_test.py | 1 | 5516 | #!/usr/bin/python
# Copyright 2019 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.
"""Unittests for run.py."""
import json
import re
import unittest
import run
class UnitTest(unittest.TestCase):
def test_parse_args_o... | bsd-3-clause |
meituan/mcsapi_python | mosclient/common/client.py | 1 | 4879 | import sys
import json
import urllib
import urllib2
from urlparse import urlparse
from datetime import datetime
import ec2utils
from xmltodict import parse
class BaseClient(object):
def __init__(self, access, secret, url, format=None,
timeout=300, debug=False, region='Beijing'):
self.a... | mit |
yongshengwang/builthue | desktop/core/ext-py/Paste-1.7.2/tests/test_auth/test_auth_digest.py | 10 | 2959 | # (c) 2005 Clark C. Evans
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from paste.auth.digest import *
from paste.wsgilib import raw_interactive
from paste.response import header_value
from paste.httpexceptions import *
fr... | apache-2.0 |
FCP-INDI/C-PAC | CPAC/pipeline/engine.py | 1 | 92736 | import os
import ast
import six
import json
import warnings
import logging
import copy
from unittest import TestCase
from CPAC.pipeline import nipype_pipeline_engine as pe
import nipype.interfaces.utility as util
from nipype.interfaces.utility import Rename
from CPAC.utils.interfaces.function import Function
from CPAC... | bsd-3-clause |
amrdraz/brython | www/tests/test_set.py | 9 | 1178 | x = set(['a','r','bg','Z'])
assert x==set(['bg','Z','a','r'])
assert len(x)==4
x.add('tail')
assert len(x)==5
x.add('tail')
assert len(x)==5
assert 'r' in x
assert 'rty' not in x
y = set([1,2,3])
assert x.isdisjoint(y)
y.add('r')
assert not x.isdisjoint(y)
z = set(['a','r'])
assert z.issubset(x)
assert z <= x
assert... | bsd-3-clause |
cylc/cylc | cylc/flow/parsec/validate.py | 1 | 34282 | # THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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,... | gpl-3.0 |
eloquentstore/appimager | cli/install.py | 1 | 1599 | from cli import base
from core import data, container
import shutil
import os
import sys
import tarfile
from docker import Client
from urllib.request import urlretrieve
from cement.core.controller import CementBaseController, expose
class InstallController(CementBaseController):
class Meta:
label = 'instal... | mit |
ESOedX/edx-platform | common/test/acceptance/pages/lms/library.py | 2 | 1513 | """
Library Content XBlock Wrapper
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
class LibraryContentXBlockWrapper(PageObject):
"""
A PageObject representing a wrapper around a LibraryContent block seen in the LMS
"""
url = None
BODY_SELECTOR = '.xblock-st... | agpl-3.0 |
fieraloca/CODEPROJ | PYTHON/COMP_PHOTO/hw0/part0.py | 1 | 3516 | import sys
import os
import numpy as np
import cv2
def split_rgb(image):
'''Split the target image into its red, green and blue channels.
image - a numpy array of shape (rows, columns, 3).
output - three numpy arrays of shape (rows, columns) and dtype same as
image, containing the corresponding cha... | mit |
popazerty/EG-2 | lib/python/Screens/InfoBarGenerics.py | 4 | 131511 | # -*- coding: utf-8 -*-
from Components.ActionMap import ActionMap, HelpableActionMap, NumberActionMap
from Components.Harddisk import harddiskmanager, findMountPoint
from Components.Input import Input
from Components.Label import Label
from Components.MovieList import AUDIO_EXTENSIONS, MOVIE_EXTENSIONS, DVD_EXTENSIONS... | gpl-2.0 |
lyager/rpcz | python/compiler.py | 5 | 1758 | #!/usr/bin/env python
import os
import sys
from distutils import spawn
class CompilerException(Exception):
pass
def generate_proto(source, output_dir,
with_plugin='python', suffix='_pb2.py', plugin_binary=None):
"""Invokes the Protocol Compiler to generate a _pb2.py from the given
.p... | apache-2.0 |
eerwitt/tensorflow | tensorflow/python/kernel_tests/losses_test.py | 21 | 54130 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
leorochael/odoo | addons/subscription/__init__.py | 441 | 1076 | # -*- 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... | agpl-3.0 |
analyseuc3m/ANALYSE-v1 | cms/lib/xblock/tagging.py | 5 | 3903 | """
Structured Tagging based on XBlockAsides
"""
from xblock.core import XBlockAside, XBlock
from xblock.fragment import Fragment
from xblock.fields import Scope, Dict
from xmodule.x_module import STUDENT_VIEW
from xmodule.capa_module import CapaModule
from abc import ABCMeta, abstractproperty
from edxmako.shortcuts i... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.