repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
brandond/ansible
lib/ansible/modules/cloud/google/gcp_dns_managed_zone_facts.py
10
5224
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
bonezuk/linux
scripts/analyze_suspend.py
1537
120394
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
gpl-2.0
huchoi/edx-platform
lms/djangoapps/django_comment_client/permissions.py
19
4384
""" Module for checking permissions with the comment_client backend """ import logging from types import NoneType from django.core import cache from opaque_keys.edx.keys import CourseKey CACHE = cache.get_cache('default') CACHE_LIFESPAN = 60 def cached_has_permission(user, permission, course_id=None): """ C...
agpl-3.0
jordanemedlock/psychtruths
temboo/core/Library/Zillow/GetZestimate.py
5
3437
# -*- coding: utf-8 -*- ############################################################################### # # GetZestimate # Retrieve estimate information for a specified property. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you ...
apache-2.0
nagyistoce/edx-platform
lms/djangoapps/dashboard/support.py
50
4528
""" Views for support dashboard """ import logging from django.contrib.auth.models import User from django.views.generic.edit import FormView from django.views.generic.base import TemplateView from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect from django.contrib import mes...
agpl-3.0
ruslanloman/nova
nova/network/ldapdns.py
68
13225
# Copyright 2012 Andrew Bogott for the Wikimedia 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
hronoses/vispy
vispy/geometry/tests/test_generation.py
4
1541
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np from numpy.testing import assert_array_equal, assert_allclose from vispy.testing import run_tests_if_main from vispy.geometry import (create_box, create_cub...
bsd-3-clause
stephane-caron/rss-2015
lib/pymanoid_sage/ik.py
1
7773
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Stephane Caron <stephane.caron@normalesup.org> # # This file is part of pymanoid. # # pymanoid 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 # Foundatio...
gpl-3.0
Harmon758/Harmonbot
Discord/utilities/logging.py
1
5836
import asyncio import datetime import logging import logging.handlers import sys from aiohttp.web_log import AccessLogger from utilities.database import create_database_connection sys.path.insert(0, "..") from units.files import create_folder sys.path.pop(0) class ConsoleLogger(object): '''Console Logger''' ...
mit
procangroup/edx-platform
openedx/core/djangoapps/programs/management/commands/backpopulate_program_credentials.py
12
4490
"""Management command for backpopulating missing program credentials.""" import logging from collections import namedtuple from django.contrib.sites.models import Site from django.core.management import BaseCommand from django.db.models import Q from opaque_keys.edx.keys import CourseKey from lms.djangoapps.certifica...
agpl-3.0
raildo/nova
nova/tests/unit/cells/test_cells_state_manager.py
17
11725
# Copyright (c) 2013 Rackspace Hosting # 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 req...
apache-2.0
azaghal/ansible
test/units/module_utils/basic/test_run_command.py
5
10520
# -*- coding: utf-8 -*- # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division) __metaclass__ = type import errno from itertools import product from io import Byt...
gpl-3.0
ageron/tensorflow
tensorflow/python/training/adagrad_test.py
22
15078
# 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
beeftornado/sentry
tests/sentry/integrations/msteams/test_client.py
1
2323
from __future__ import absolute_import import responses from six.moves.urllib.parse import urlencode from sentry.models import Integration from sentry.integrations.msteams.client import MsTeamsClient from sentry.testutils import TestCase from sentry.utils.compat.mock import patch class MsTeamsClientTest(TestCase):...
bsd-3-clause
Opentrons/labware
api/tests/opentrons/hardware_control/test_calibration_functions.py
2
2931
import numpy as np from opentrons import config from opentrons.calibration_storage import file_operators as io from opentrons.hardware_control import robot_calibration from opentrons.util.helpers import utc_now from opentrons.types import Mount def test_migrate_affine_xy_to_attitude(): affine = [[1.0, 2.0, 3.0, ...
apache-2.0
beeftornado/sentry
src/sentry/migrations/0039_delete_incidentsuspectcommit.py
1
1478
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-02-03 22:32 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn't be automatically run in # production. We set this to True for operat...
bsd-3-clause
firebitsbr/pwn_plug_sources
src/metagoofil/extractors/metadataPDF.py
9
1554
#!/usr/bin/env python # # metadataPDF.py - dump pdf metadata # # Copy of Yusuke's dumppdf to add dumpmeta import sys, re from pdfminer.psparser import PSKeyword, PSLiteral from pdfminer.pdfparser import PDFDocument, PDFParser from pdfminer.pdftypes import PDFStream, PDFObjRef, resolve1, stream_value # dumpmeta class...
gpl-3.0
Dandandan/wikiprogramming
jsrepl/build/extern/python/closured/lib/python2.7/email/mime/message.py
573
1286
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class...
mit
huguesmayolle/famille
famille/tests/test_templates.py
1
2004
from django.test import TestCase from famille import models from famille.templatetags import helpers, users __all__ = ["TemplateTagsTestCase", ] class TemplateTagsTestCase(TestCase): def test_get_class_name(self): obj = models.Prestataire() self.assertEqual(helpers.get_class_name(obj), "Presta...
apache-2.0
chrisndodge/edx-platform
lms/djangoapps/dashboard/management/commands/tests/test_git_add_course.py
17
8904
""" Provide tests for git_add_course management command. """ import logging import os import shutil import StringIO import subprocess import unittest from uuid import uuid4 from nose.plugins.attrib import attr from django.conf import settings from django.core.management import call_command from django.core.management....
agpl-3.0
monkeysecurity/npyscreen
npyscreen/wgannotatetextbox.py
15
3116
from . import wgwidget from .wgtextbox import Textfield class AnnotateTextboxBase(wgwidget.Widget): """A base class intented for customization. Note in particular the annotationColor and annotationNoColor methods which you should override.""" ANNOTATE_WIDTH = 5 def __init__(self, screen, value =...
bsd-2-clause
a-doumoulakis/tensorflow
tensorflow/python/debug/cli/debugger_cli_common.py
68
38908
# 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
himikof/aiohttp_debugtoolbar
aiohttp_debugtoolbar/tbtools/tbtools.py
2
14461
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import inspect import traceback imp...
apache-2.0
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/management/commands/showmigrations.py
440
4901
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader class Command(BaseCommand): help = "Shows all available migrations for the ...
artistic-2.0
jms/FlyNi-API
docs/conf.py
1
7787
# -*- coding: utf-8 -*- # # FlyNi-API documentation build configuration file, created by # sphinx-quickstart. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have...
bsd-3-clause
HashAppsLabs/TiCairo
plugins/ti.alloy/plugin.py
229
4668
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
slashback/handsome-echo-backend
tests/feed.py
1
5157
from tornado import testing from mainWebserver import make_app import json from echo.feeds.feed import Feed HTTP_SUCCESS_CODE = 200 HTTP_NOT_FOUND_CODE = 404 class CustomFeedTest(testing.AsyncHTTPTestCase): def get_app(self): return make_app() def test_crud_feed(self): payload = { ...
mit
jgressmann/sc2links
addon.py
1
11878
__author__ = 'jgressmann' from datetime import date import pickle import sys import traceback import urllib import urlparse #import urlresolver import xbmc import xbmcaddon import xbmcgui import xbmcplugin import zlib import resources.lib.sc2links as sc2links addon = xbmcaddon.Addon() #__addonname__ = addon.getAddon...
mit
xenigmax/seqan
util/py_lib/seqan/dox/validation.py
9
6106
#!/usr/bin/env python2 """Some validation for proc_doc.Proc*""" __author__ = 'Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>' class ProcDocValidator(object): """Validate proc_doc.Proc* objects. Implements the visitor pattern. """ def __init__(self, msg_printer): self.msg_printer = msg_prin...
bsd-3-clause
egabancho/invenio-ext
invenio_ext/jasmine/bundles.py
6
1520
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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) any...
gpl-2.0
OpenFacetracker/facetracker-core
lib/youtube-dl/youtube_dl/compat.py
5
13628
from __future__ import unicode_literals import collections import getpass import optparse import os import re import shutil import socket import subprocess import sys try: import urllib.request as compat_urllib_request except ImportError: # Python 2 import urllib2 as compat_urllib_request try: import u...
gpl-2.0
alexeyum/scikit-learn
sklearn/cluster/tests/test_spectral.py
72
7950
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
bgris/ODL_bgris
lib/python3.5/idlelib/idle_test/test_formatparagraph.py
2
14331
# Test the functions and main class method of FormatParagraph.py import unittest from idlelib import FormatParagraph as fp from idlelib.EditorWindow import EditorWindow from tkinter import Tk, Text from test.support import requires class Is_Get_Test(unittest.TestCase): """Test the is_ and get_ functions""" te...
gpl-3.0
IONISx/edx-platform
common/djangoapps/config_models/tests.py
11
13830
# -*- coding: utf-8 -*- """ Tests of ConfigurationModel """ import ddt from django.contrib.auth.models import User from django.db import models from django.test import TestCase from rest_framework.test import APIRequestFactory from freezegun import freeze_time from mock import patch, Mock from config_models.models i...
agpl-3.0
axsauze/eventsfinder
django/contrib/messages/api.py
321
2952
from django.contrib.messages import constants from django.contrib.messages.storage import default_storage __all__ = ( 'add_message', 'get_messages', 'get_level', 'set_level', 'debug', 'info', 'success', 'warning', 'error', ) class MessageFailure(Exception): pass def add_message(request, level, mess...
bsd-3-clause
zhangxq5012/sky_engine
mojo/tools/check_mojom_golden_files.py
10
3768
#!/usr/bin/env python # 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 argparse import os.path import sys from filecmp import dircmp from shutil import rmtree from tempfile import mkdtemp from mopy.p...
bsd-3-clause
cchurch/ansible
test/units/cli/test_galaxy.py
2
40697
# -*- coding: utf-8 -*- # (c) 2016, Adrian Likins <alikins@redhat.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 you...
gpl-3.0
spatialdev/onadata
onadata/apps/main/migrations/0012_auto__add_unique_metadata_xform_data_type_data_value.py
8
9948
# -*- 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 unique constraint on 'MetaData', fields ['xform', 'data_type', 'data_value'] db.create_unique(u'mai...
bsd-2-clause
ysekky/chainer
chainer/functions/theano/theano_function.py
4
2370
import numpy import six from chainer import cuda from chainer import function from chainer import utils from chainer.utils import type_check class TheanoFunction(function.Function): def __init__(self, forward_func, backward_func): utils.experimental('chainer.functions.TheanoFunction') self.forwa...
mit
pkilambi/ceilometer
ceilometer/compute/pollsters/instance.py
4
1618
# # Copyright 2012 eNovance <licensing@enovance.com> # Copyright 2012 Red Hat, 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 # # Unle...
apache-2.0
sebastienhupin/qxrad
qooxdoo/tool/pylib/generator/code/DependencyLoader.py
1
19794
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de # # License: # LGPL: http://www.gnu.org/li...
lgpl-3.0
BrianHicks/probe
probe/cli.py
1
3949
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from argparse import ArgumentParser from datetime import datetime from dateutil.rrule import rrulestr import os import sys from textwrap import dedent from .config import ConfigHandler from .errors import AnswerError CONFIG_LOCATION =...
bsd-3-clause
gdimitris/ChessPuzzlerBackend
Virtual_Environment/lib/python2.7/site-packages/setuptools/depends.py
462
6370
import sys import imp import marshal from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from distutils.version import StrictVersion from setuptools import compat __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building or inst...
mit
Arcanfel/whatToPlay
openid/fetchers.py
10
13415
# -*- test-case-name: openid.test.test_fetchers -*- """ This module contains the HTTP fetcher interface and several implementations. """ __all__ = ['fetch', 'getDefaultFetcher', 'setDefaultFetcher', 'HTTPResponse', 'HTTPFetcher', 'createHTTPFetcher', 'HTTPFetchingError', 'HTTPError'] import urll...
apache-2.0
ChristopherHogan/pip
pip/_vendor/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
alfonsodev/ansible-modules-extras
system/puppet.py
51
6731
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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 late...
gpl-3.0
runeksvendsen/btcdice
privaddr.py
1
1333
import hashlib import Crypto.Hash.SHA256 as sha256 import binascii from bitcoin import key as ecdsa from bitcoin import base58 from baseconv import dice_to_10 def dsha256(s): return sha256.new(sha256.new(s).digest()).digest() def rhash(s): h1 = hashlib.new('ripemd160') h1.update(hashlib.sha256(s).digest()) retu...
mit
fuzzysteve/yamlloader
tableloader/tableFunctions/dogmaEffects.py
1
3091
# -*- coding: utf-8 -*- import sys import os reload(sys) sys.setdefaultencoding("utf-8") from sqlalchemy import Table from yaml import load,dump try: from yaml import CSafeLoader as SafeLoader print "Using CSafeLoader" except ImportError: from yaml import SafeLoader print "Using Python SafeLoader" distribution={...
mit
maxteufel/weechat
doc/docgen.py
1
32544
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2018 Sébastien Helleu <flashcode@flashtux.org> # # 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 opt...
gpl-3.0
ernado/infosessions
infosessions/migrations/0001_initial.py
1
1741
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
bsd-3-clause
vrv/tensorflow
tensorflow/python/kernel_tests/random_shuffle_queue_test.py
65
50664
# 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
jasonmccampbell/numpy-refactor-sprint
numpy/f2py/tests/test_return_character.py
59
3768
from numpy.testing import * from numpy import array from numpy.compat import asbytes import util class TestReturnCharacter(util.F2PyTest): def check_function(self, t): tname = t.__doc__.split()[0] if tname in ['t0','t1','s0','s1']: assert t(23)==asbytes('2') r = t('ab');asse...
bsd-3-clause
wscullin/spack
var/spack/repos/builtin/packages/libvorbis/package.py
3
1890
############################################################################## # 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...
lgpl-2.1
mhotwagner/abackend
abackend-env/lib/python3.5/site-packages/psycopg2/_json.py
48
7836
"""Implementation of the JSON adaptation objects This module exists to avoid a circular import problem: pyscopg2.extras depends on psycopg2.extension, so I can't create the default JSON typecasters in extensions importing register_json from extras. """ # psycopg/_json.py - Implementation of the JSON adaptation object...
mit
indrajitr/ansible-modules-extras
notification/sns.py
44
5736
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Michael J. Schultz <mjschultz@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 ...
gpl-3.0
egoldchain/egoldchain-master
test/functional/invalidtxrequest.py
50
2621
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test node responses to invalid transactions. In this test we connect to one node over p2p, and test tx...
mit
simbs/edx-platform
openedx/core/djangoapps/credit/exceptions.py
60
2281
"""Exceptions raised by the credit API. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from rest_framework import status from rest_framework.exceptions import APIException # TODO: Cleanup this mess! ECOM-2908 class CreditApiBadRequest(Exception): """ Could...
agpl-3.0
Koulio/rietveld
third_party/oauth2client/file.py
253
3160
# Copyright (C) 2010 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 writ...
apache-2.0
jiachenning/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py
384
12556
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
Belxjander/Kirito
Python-3.5.0-main/Lib/json/encoder.py
8
15978
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import encode_basestring as c_encode_basestring except ImportError: c_encode_basestring = None try: from _j...
gpl-3.0
xcgd/account_voucher_sepa
account_sepa_purpose.py
1
1468
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 XCG Consulting # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
agpl-3.0
minhphung171093/GreenERP
openerp/addons/base/tests/test_translate.py
10
6065
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import unittest from openerp.tools.translate import quote, unquote, xml_translate class TranslationToolsTestCase(unittest.TestCase): def test_quote_unquote(self): def test_string(str): quoted =...
gpl-3.0
maartenq/ansible
lib/ansible/plugins/action/ironware.py
21
4380
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
saifrahmed/bokeh
examples/plotting/server/markers.py
42
1618
# The plot server must be running # Go to http://localhost:5006/bokeh to view this plot from numpy.random import random from bokeh.plotting import figure, show, output_server def mscatter(p, x, y, typestr): p.scatter(x, y, marker=typestr, line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, si...
bsd-3-clause
rainslytherin/ansible
plugins/inventory/collins.py
22
18049
#!/usr/bin/env python """ Collins external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. Collins ...
gpl-3.0
f-prettyland/angr
tests/test_director.py
5
2232
import os import sys import logging import nose.tools import angr from angr.sim_type import SimTypePointer, SimTypeChar test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')) def test_execute_address_brancher(): p = angr.Project(os.path.join(test_locati...
bsd-2-clause
chengdh/openerp-ktv
openerp/addons/base_module_doc_rst/wizard/tech_rst_guide.py
9
17321
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
coinkeeper/2015-04-19_21-21_nautiluscoin
contrib/testgen/base58.py
4
2833
''' Nautiluscoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return...
mit
immenz/pyload
module/plugins/hoster/FilepostCom.py
2
4945
# -*- coding: utf-8 -*- import re from time import time from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilepostCom(SimpleHoster): __name__ = "FilepostCom" __t...
gpl-3.0
guschmue/tensorflow
tensorflow/contrib/slim/nets.py
191
1609
# 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 applicable ...
apache-2.0
mpvoss/RickAndMortyWeatherTweets
env/lib/python3.5/site-packages/pyowm/webapi25/stationparser.py
1
2291
""" Module containing a concrete implementation for JSONParser abstract class, returning a Station instance """ import json import time from pyowm.webapi25 import station from pyowm.webapi25 import weather from pyowm.abstractions import jsonparser from pyowm.exceptions import parse_response_error, api_response_error ...
mit
Leoniela/nipype
nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py
9
1107
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.fsl.utils import PowerSpectrum def test_PowerSpectrum_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(noh...
bsd-3-clause
sda2b/youtube-dl
youtube_dl/extractor/hotnewhiphop.py
129
2306
from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, HEADRequest, ) class HotNewHipHopIE(InfoExtractor): _VALID_URL = r'http://www\.hotnewhiphop\.com/.*\....
unlicense
RealTimeWeb/wikisite
MoinMoin/formatter/text_html.py
1
51473
# -*- coding: iso-8859-1 -*- """ MoinMoin - "text/html+css" Formatter @copyright: 2000-2004 by Juergen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ import os.path, re from MoinMoin import log logging = log.getLogger(__name__) from MoinMoin.formatter import FormatterBase from MoinMo...
apache-2.0
petewarden/tensorflow
tensorflow/python/debug/lib/check_numerics_callback_test.py
9
17920
# 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...
apache-2.0
NetApp/manila
manila/share/drivers/huawei/v3/rpcapi.py
1
1665
# Copyright (c) 2016 Huawei Technologies Co., Ltd. # 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....
apache-2.0
dkubiak789/OpenUpgrade
addons/website_certification/certification.py
385
1789
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
blakfeld/ansible
lib/ansible/galaxy/api.py
82
5143
#!/usr/bin/env python ######################################################################## # # (C) 2013, James Cammarata <jcammarata@ansible.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 ...
gpl-3.0
efortuna/AndroidSDKClone
ndk/prebuilt/linux-x86_64/lib/python2.7/distutils/tests/test_build_ext.py
11
20233
import sys import os from StringIO import StringIO import textwrap from distutils.core import Extension, Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig from distutils.tests import support from distutils.errors import (DistutilsSetupError, CompileError, ...
apache-2.0
svn2github/exiv2_
website/bin/gen.py
2
1779
#! /usr/bin/env python # ---------------------------------------------------------------------- # Settings vardir = "./var" date_format = "%d-%b-%Y" # ---------------------------------------------------------------------- # functions def usage(): print("""Usage: gen.py file.in [...] Substitute placeholders in in...
gpl-2.0
kgraney/msm-kernel
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
a-pertsev/flask-security
tests/test_configuration.py
21
1379
# -*- coding: utf-8 -*- """ test_configuration ~~~~~~~~~~~~~~~~~~ Basic configuration tests """ import base64 import pytest from utils import authenticate, logout @pytest.mark.settings( logout_url='/custom_logout', login_url='/custom_login', post_login_view='/post_login', post_logout_v...
mit
381426068/MissionPlanner
Lib/gzip.py
50
18735
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import io import __builtin__ __all__ =...
gpl-3.0
shawger/s-kape
lib/requests/packages/urllib3/util/url.py
713
5879
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
gpl-3.0
TheMadCoder1/Spambot
commands/data.py
2
1974
from classes import * from helper_functions import * def method(servers_and_threads, arguments): print # Line break # Argument Check if len(arguments) != 0: email = arguments[0] if not helpers_for_commands.email_is_valid(email): print "You did not enter a valid email." ...
mit
rogersprates/word2vec-financial-sentiment
pmi/pmi.py
1
3966
#BRUNO IOCHINS GRISCI import json import sys import math import os def create_vocabulary(news): vocabulary = [] for ide in news: vocabulary = vocabulary + news[ide]["text"] return set(vocabulary) def count_labels(news): n_positive_news = 0.0 n_negative_news = 0.0 for ide in news: ...
mit
sameeptandon/sail-car-log
mapping/pipeline/ldr_to_h5.py
1
2958
import os import argparse import numpy as np import h5py from Q50_config import LoadParameters from GPSReader import GPSReader from GPSTransforms import IMUTransforms from LidarTransforms import loadLDR from pipeline_config import LANE_FILTER, PARAMS_TO_LOAD, OPT_POS_FILE from LidarIntegrator import transform_points_in...
bsd-2-clause
mnahm5/django-estore
Lib/site-packages/boto/route53/domains/exceptions.py
151
1482
# Copyright (c) 2014 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
OECFHTW/oecluster
ConfigReader.py
1
1281
#!/usr/bin/env python3 # Author: Dennis Strasser mailto:dennis.f.strasser@gmail.com import configparser as cp __version__ = "1.0" class ConfigReader(object): """This class holds information on devices in the network This class holds information about people and their contact information: first- and last na...
gpl-3.0
YourCyborg/Sun-RPI
contrib/procpools/ampoule/util.py
11
1349
""" some utilities """ import os import sys import __main__ from twisted.python.filepath import FilePath from twisted.python.reflect import namedAny # from twisted.python.modules import theSystemPath def findPackagePath(modulePath): """ Try to find the sys.path entry from a modulePath object, simultaneously ...
bsd-3-clause
bigdatauniversity/edx-platform
cms/djangoapps/contentstore/tests/test_course_create_rerun.py
56
6545
""" Test view handler for rerun (and eventually create) """ import ddt from mock import patch from django.test.client import RequestFactory from django.core.urlresolvers import reverse from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.module...
agpl-3.0
collects/VTK
IO/Parallel/Testing/Python/TestPImageWriter.py
26
1106
#!/usr/bin/env python # Image pipeline image1 = vtk.vtkTIFFReader() image1.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/beach.tif") # "beach.tif" image contains ORIENTATION tag which is # ORIENTATION_TOPLEFT (row 0 top, col 0 lhs) type. The TIFF # reader parses this tag and sets the internal TIFF image # orientation a...
bsd-3-clause
vmax-feihu/hue
desktop/core/ext-py/requests-2.6.0/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
apache-2.0
redhat-openstack/nova
nova/compute/task_states.py
96
3443
# Copyright 2010 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...
apache-2.0
Molecular-Image-Recognition/Molecular-Image-Recognition
code/rmgpy/molecule/inchiparsingTest.py
2
10760
################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu), # Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of cha...
mit
s20121035/rk3288_android5.1_repo
external/chromium_org/chrome/common/extensions/docs/server2/github_file_system.py
94
7358
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import logging from StringIO import StringIO import posixpath from appengine_blobstore import AppEngineBlobstore, BLOBSTORE_GITHUB from appe...
gpl-3.0
matiasbastos/OpenBazaar
db/migrations/migration4.py
13
1172
#!/usr/bin/env python from sqlite3 import dbapi2 from db.migrations import migrations_util from node import constants def upgrade(db_path): with dbapi2.connect(db_path) as con: cur = con.cursor() # Use PRAGMA key to encrypt / decrypt database. cur.execute("PRAGMA key = '%s';" % constants...
mit
ApuliaSoftware/odoo
addons/document/wizard/__init__.py
444
1084
# -*- 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
gnieboer/tensorflow
tensorflow/python/kernel_tests/sparse_split_op_test.py
138
13629
# 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
giorgiop/scipy
scipy/weave/c_spec.py
69
17274
from __future__ import absolute_import, print_function import types from .base_spec import base_converter from . import base_info #---------------------------------------------------------------------------- # C++ code template for converting code from python objects to C++ objects # # This is silly code. There is a...
bsd-3-clause