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 |
|---|---|---|---|---|---|
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/deployment_manager/commands/operations/describe.py | 2 | 2578 | # Copyright 2014 Google Inc. All Rights Reserved.
"""operations describe command."""
from googlecloudapis.apitools.base import py as apitools_base
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import log
from googlecloudsdk.core import properties
from... | apache-2.0 |
openstack/sahara-tests | sahara_tempest_plugin/services/data_processing/v2/data_processing_client.py | 2 | 8985 | # Copyright (c) 2013 Mirantis Inc.
# Copyright (c) 2018 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
#
# Un... | apache-2.0 |
gwangjin2/gwangcoin-core | contrib/pycoin/pycoin/serialize/streamer.py | 27 | 1729 |
import io
class Streamer(object):
def __init__(self):
self.parse_lookup = {}
self.stream_lookup = {}
def register_functions(self, lookup):
for c, v in lookup:
parse_f, stream_f = v
self.parse_lookup[c] = parse_f
self.stream_lookup[c] = stream_f
... | mit |
pkleimert/hrpt | apps/survey/views.py | 1 | 11206 | # -*- coding: utf-8 -*-
from django import forms
from django.template import Context, loader, RequestContext
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.db import connection, transaction, DatabaseError
from django.core.urlresolvers import reverse
from django.shortcuts import render_... | agpl-3.0 |
kevinlondon/youtube-dl | youtube_dl/extractor/niconico.py | 34 | 10884 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
encode_dict,
ExtractorError,
int_or_none,
parse_dura... | unlicense |
kivhift/qmk | src/commands/convert.py | 1 | 1152 | #
# Copyright (c) 2010-2012 Joshua Hughes <kivhift@gmail.com>
#
import qmk
from conversion.pressure import Pressure
from conversion.temperature import Temperature
from conversion.volume import Volume
class DummyConversion(object): pass
class ConvertCommand(qmk.Command):
'''Convert values with given units to othe... | mit |
dbcli/vcli | tests/test_vspecial.py | 1 | 2864 | import pytest
from vcli.packages.sqlcompletion import suggest_type
from test_sqlcompletion import sorted_dicts
def test_slash_suggests_special():
suggestions = suggest_type('\\', '\\')
assert sorted_dicts(suggestions) == sorted_dicts(
[{'type': 'special'}])
def test_slash_d_suggests_special():
sug... | bsd-3-clause |
hyperized/ansible | lib/ansible/modules/network/fortios/fortios_firewall_interface_policy6.py | 13 | 19964 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
open-synergy/bank-payment | account_payment_blocking/model/__init__.py | 16 | 1106 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Blocking module for Odoo
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# This program is free software: you can red... | agpl-3.0 |
rryan/django-cms | cms/tests/po.py | 64 | 2672 | from __future__ import with_statement
from cms.test_utils.util.context_managers import TemporaryDirectory
from django.core.management.base import CommandError
from django.core.management.commands.compilemessages import has_bom
from django.test.testcases import TestCase
import os
import shutil
import subprocess
import s... | bsd-3-clause |
ohrstrom/obp-media-preflight-api | app/auth_extra/migrations/0001_initial.py | 1 | 2592 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-23 20:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_length... | gpl-3.0 |
googleglass/mirror-catfacts-python | libs/oauth2client/locked_file.py | 144 | 11379 | # Copyright 2011 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,... | apache-2.0 |
ogrisel/scipy | scipy/optimize/tests/test_zeros.py | 16 | 1963 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from math import sqrt, exp, sin, cos
from numpy.testing import TestCase, assert_almost_equal, assert_warns, \
assert_, run_module_suite, assert_allclose
from scipy.optimize import zeros as cc
from scipy... | bsd-3-clause |
yuxiang-zhou/menpo | menpo/shape/groupops.py | 5 | 1083 | from __future__ import division
from menpo.shape import PointCloud
def mean_pointcloud(pointclouds):
r"""
Compute the mean of a `list` of :map:`PointCloud` or subclass objects.
The list is assumed to be homogeneous i.e all elements of the list are
assumed to belong to the same point cloud subclass jus... | bsd-3-clause |
yeyanchao/calibre | src/calibre/gui2/convert/xpath_wizard.py | 6 | 3138 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt4.Qt import QDialog, QWidget, SIGNAL, Qt, QDialogButtonBox, QVBoxLayout
fro... | gpl-3.0 |
cjones/madcow | madcow/include/chardet/chardistribution.py | 215 | 8602 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | gpl-3.0 |
bepitulaz/huntingdimana | env/Lib/site-packages/pip/req/req_install.py | 31 | 44179 | from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import warnings
import zipfile
from distutils.util import change_root
from distutils import sysconfig
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from pip._vendor.dist... | gpl-3.0 |
eric-stanley/NewsBlur | vendor/paypal/standard/pdt/tests/test_pdt.py | 2 | 5516 | """
run this with ./manage.py test website
see http://www.djangoproject.com/documentation/testing/ for details
"""
import os
from django.conf import settings
from django.shortcuts import render_to_response
from django.test import TestCase
from vendor.paypal.standard.pdt.forms import PayPalPDTForm
from vendor.paypal.sta... | mit |
shanglt/youtube-dl | test/test_subtitles.py | 52 | 13284 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, md5
from youtube_dl.extractor import (
BlipTVIE,
YoutubeIE,
Dailymo... | unlicense |
xiangke/pycopia | net/pycopia/model/Networks.py | 1 | 2044 | #!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# This library 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 Foundati... | lgpl-2.1 |
Allow2CEO/browser-ios | brave/node_modules/ad-block/vendor/depot_tools/third_party/gsutil/gslib/commands/ls.py | 51 | 23261 | # Copyright 2011 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... | mpl-2.0 |
revanthkolli/osf.io | scripts/migrate_counters.py | 64 | 2509 | """
Ensure that all node IDs embedded in the analytics collections (page counters,
user activity counters) are lower-cased following GUID migration.
Examples:
Dry run:
python migrate_counters.py
Real:
python migrate_counters.py false
"""
import re
import logging
from pymongo.errors import Dup... | apache-2.0 |
appsembler/edx-platform | common/lib/xmodule/xmodule/exceptions.py | 22 | 1266 | class InvalidDefinitionError(Exception):
pass
class NotFoundError(Exception):
pass
class ProcessingError(Exception):
'''
An error occurred while processing a request to the XModule.
For example: if an exception occurs while checking a capa problem.
'''
pass
class InvalidVersionError(Ex... | agpl-3.0 |
zvolsky/zv | languages/id.py | 148 | 11233 | # coding: utf8
{
'!langcode!': 'id',
'!langname!': 'Indonesian',
'%d days ago': '%d hari yang lalu',
'%d hours ago': '%d jam yang lalu',
'%d minutes ago': '%d menit yang lalu',
'%d months ago': '%d bulan yang lalu',
'%d seconds ago': '%d detik yang lalu',
'%d seconds from now': '%d detik dari sekarang',
'%d weeks ago':... | agpl-3.0 |
missionpinball/mpf | mpf/devices/ball_device/pulse_coil_ejector.py | 1 | 4069 | """Standard pulse ejector."""
from typing import List
import asyncio
from mpf.devices.ball_device.ball_device_ejector import BallDeviceEjector
from mpf.devices.ball_device.default_ball_search import DefaultBallSearch
from mpf.exceptions.config_file_error import ConfigFileError
class PulseCoilEjector(DefaultBallSear... | mit |
Lujeni/ansible | test/units/modules/network/fortios/test_fortios_endpoint_control_forticlient_ems.py | 21 | 11163 | # 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 |
timopulkkinen/BubbleFish | chrome/test/functional/perf_endure.py | 3 | 53326 | #!/usr/bin/env python
# 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.
"""Performance tests for Chrome Endure (long-running perf tests on Chrome).
This module accepts the following environment variable... | bsd-3-clause |
imsparsh/python-for-android | python3-alpha/extra_modules/pyxmpp2/resolver.py | 46 | 14959 | #
# (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
fidomason/kbengine | kbe/src/lib/python/Lib/tkinter/test/test_tkinter/test_images.py | 91 | 13355 | import unittest
import tkinter
from test import support
from tkinter.test.support import AbstractTkTest, requires_tcl
support.requires('gui')
class MiscTest(AbstractTkTest, unittest.TestCase):
def test_image_types(self):
image_types = self.root.image_types()
self.assertIsInstance(image_types, tu... | lgpl-3.0 |
sandeip-yadav/foursquared.eclair | mock_server/playfoursquare.py | 127 | 1999 | #!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self):
logg... | apache-2.0 |
hynekcer/django | tests/flatpages_tests/test_views.py | 290 | 6953 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin(object):
... | bsd-3-clause |
Orav/kbengine | kbe/res/scripts/common/Lib/distutils/unixccompiler.py | 3 | 13419 | """distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
*... | lgpl-3.0 |
ajaysaini725/spark | sql/hive/src/test/resources/data/scripts/cat.py | 105 | 1040 | #
# 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 u... | apache-2.0 |
mongodb/mongo-disco | demos/test_shards.py | 1 | 1427 | import time
from mongodisco.job import MongoJob
from disco.core import Job,result_iterator
from mongodisco.mongodb_io import mongodb_output_stream,mongodb_input_stream
from mongodisco.splitter import calculate_splits as do_split
import pymongo
from pymongo import Connection
from mongodisco.mongo_util import get_collect... | apache-2.0 |
dfolch/pysal | pysal/core/IOHandlers/tests/test_arcgis_txt.py | 20 | 2268 | import unittest
import pysal
from pysal.core.IOHandlers.arcgis_txt import ArcGISTextIO
import tempfile
import os
import warnings
class test_ArcGISTextIO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal.examples.get_path('arcgis_txt.txt')
self.obj = ArcGISTextIO(test_file, 'r... | bsd-3-clause |
sebastian-philipp/DeepSea | srv/salt/ceph/iperf/ceph_diagnose_iperf_client.py | 2 | 2179 | #!/usr/bin/env python
#
# Simple client to run iperf3 from salt in parallel across many nodes.
# Since passing different command line parameters to different targets
# is difficult to do with in salt.
#
from __future__ import print_function
import sys
import json
import salt.config
import os
try:
from salt.utils im... | gpl-3.0 |
zerothi/sisl | sisl/viz/plotly/_user_customs.py | 1 | 3819 | # 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 https://mozilla.org/MPL/2.0/.
import os
from pathlib import Path
import sys
import importlib
from sisl.messages import warn
from sisl._environ import... | lgpl-3.0 |
cupy/cupy | cupy/_misc/who.py | 1 | 3358 | import sys
import cupy
def who(vardict=None):
"""Print the CuPy arrays in the given dictionary.
Prints out the name, shape, bytes and type of all of the ndarrays
present in `vardict`.
If there is no dictionary passed in or `vardict` is None then returns
CuPy arrays in the globals() dictionary (a... | mit |
antiface/pycoinnet | pycoinnet/helpers/dnsbootstrap.py | 1 | 4043 | """
Bitcoin client that connects to DNS bootstrap connections, grabs addr records,
disconnects after enough records are obtained, and that's that.
"""
import asyncio
import logging
import time
from asyncio.queues import PriorityQueue
from pycoinnet.PeerAddress import PeerAddress
from pycoinnet.helpers.standards impo... | mit |
40223112/0623test1 | static/Brython3.1.1-20150328-091302/Lib/signal.py | 743 | 1646 | """This module provides mechanisms to use signal handlers in Python.
Functions:
alarm() -- cause SIGALRM after a specified time [Unix only]
setitimer() -- cause a signal (described below) after a specified
float time and the timer may restart then [Unix only]
getitimer() -- get current value of timer [... | gpl-3.0 |
catapult-project/catapult | third_party/google-endpoints/Crypto/Hash/MD2.py | 124 | 2734 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | bsd-3-clause |
xyzy/androguard | androguard/core/bytecode.py | 37 | 24731 | # This file is part of Androguard.
#
# Copyright (C) 2012/2013, Anthony Desnos <desnos at t0t0.fr>
# 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.a... | apache-2.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/test/files.py | 62 | 1339 | # (c) 2015, Ansible, 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 di... | bsd-3-clause |
PearsonIOKI/compose-forum | askbot/migrations/0168_add_twitter_fields_to_user_profile.py | 13 | 35766 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from askbot.migrations_api import safe_add_column
class Migration(SchemaMigration):
def forwards(self, orm):
"""add fields twitter_access_token, twitter_handle, social_sharing... | gpl-3.0 |
abhikumar22/MYBLOG | blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/contrib/gis/geos/prototypes/predicates.py | 171 | 1587 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
# #... | gpl-3.0 |
MounirMesselmeni/django | django/contrib/gis/gdal/libgdal.py | 449 | 3598 | from __future__ import unicode_literals
import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contri... | bsd-3-clause |
cjhak/b2share | invenio/modules/records/testsuite/functions/sync_corparate_names.py | 33 | 1868 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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 later... | gpl-2.0 |
piotrpawlaczek/suds-jurko | suds/sax/attribute.py | 15 | 5538 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 hope that it will b... | lgpl-3.0 |
raycarnes/account-invoicing | account_payment_term_extension/tests/test_payment_term.py | 28 | 2395 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | agpl-3.0 |
path/mockredis | mockredis/client.py | 2 | 50395 | from __future__ import division
from collections import defaultdict
from itertools import chain
from datetime import datetime, timedelta
from hashlib import sha1
from operator import add
from random import choice, sample
import re
import sys
import time
from mockredis.clock import SystemClock
from mockredis.lock impor... | apache-2.0 |
ataylor32/django | tests/null_fk_ordering/tests.py | 381 | 2012 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Author, Comment, Forum, Post, SystemInfo
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Key... | bsd-3-clause |
Cinntax/home-assistant | homeassistant/components/fritzbox_netmonitor/sensor.py | 2 | 4958 | """Support for monitoring an AVM Fritz!Box router."""
import logging
from datetime import timedelta
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_HOST, STATE_UNAVAILABLE
from homeass... | apache-2.0 |
Cashiuus/metagoofil | hachoir_parser/file_system/fat.py | 95 | 16153 | from hachoir_core.compatibility import sorted
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, StaticFieldSet,
RawBytes, PaddingBytes, createPaddingField, Link, Fragment,
Bit, Bits, UInt8, UInt16, UInt32,
String, Bytes, NullBytes)
from hachoir_core.field.integer import GenericInte... | gpl-2.0 |
marylandSUAS/Path_Planning | MissionPlanner/mission_upload.py | 1 | 1584 |
import sys
import clr
import time
import System
clr.AddReference("MissionPlanner")
import MissionPlanner
clr.AddReference("MissionPlanner.Utilities") #includes the Utilities class
from MissionPlanner.Utilities import Locationwp
clr.AddReference("MAVLink") # includes the Utilities class
import MAVLink
MissionPlanner.M... | gpl-3.0 |
googleapis/python-appengine-admin | google/cloud/appengine_admin_v1/services/services/async_client.py | 1 | 17658 | # -*- coding: utf-8 -*-
# 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... | apache-2.0 |
shakamunyi/nova | nova/tests/functional/api/client.py | 2 | 10898 | # Copyright (c) 2011 Justin Santa Barbara
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
lbule/ALPS.L0.MP6.V3.18_LCSH6795_LWT_L_KERNEL | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
alvaroaleman/ansible | lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup.py | 32 | 6998 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
petertodd/stealth-addresses-ref-implementation | lib/python-bitcoinlib/examples/make-bootstrap-rpc.py | 6 | 1224 | #!/usr/bin/python3
#
# make-bootstrap-rpc.py
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Make a boostrap.dat file by getting the blocks from the RPC interface."""
import bitcoin
from bitcoin.core import CBlock
impo... | mit |
karlfloersch/pyethereum | ethereum/experimental/spv.py | 1 | 2781 | from ethereum import blocks
from ethereum import processblock
from ethereum import transactions
from ethereum import utils
import rlp
from ethereum import trie
def mk_transaction_spv_proof(block, tx):
trie.proof.push(trie.RECORDING)
processblock.apply_transaction(block, tx)
o = trie.proof.get_nodelist()
... | mit |
lietu/godot | platform/osx/detect.py | 19 | 2873 |
import os
import sys
def is_active():
return True
def get_name():
return "OSX"
def can_build():
if (sys.platform != "darwin"):
return False
return True # osx enabled
def get_opts():
return [
('force_64_bits','Force 64 bits binary','no'),
]
def get_flags():
return [
('opengl', 'no'),
('lega... | mit |
neto71/courses-1 | deeplearning1/nbs/vgg16.py | 7 | 4129 | from __future__ import division, print_function
import os, json
from glob import glob
import numpy as np
from scipy import misc, ndimage
from scipy.ndimage.interpolation import zoom
from keras.utils.data_utils import get_file
from keras import backend as K
from keras.layers.normalization import BatchNormalization
fro... | apache-2.0 |
spiceqa/virt-test | libvirt/tests/src/virsh_cmd/host/virsh_nodecpumap.py | 2 | 4679 | import os
import logging
from autotest.client import utils
from autotest.client.shared import error
from virttest import virsh
SYSFS_SYSTEM_PATH = "/sys/devices/system/cpu"
def get_present_cpu():
"""
Get host present cpu
:return: the host present cpu number
"""
if os.path.exists("%s/present" % ... | gpl-2.0 |
bneg/Empire | lib/modules/powershell/trollsploit/message.py | 10 | 3349 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Message',
'Author': ['@harmj0y'],
'Description': ("Displays a specified message to the user."),
'Background' : True,
'OutputE... | bsd-3-clause |
vaidap/zulip | zerver/management/commands/convert_bot_to_outgoing_webhook.py | 2 | 2374 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from zerver.lib.management import ZulipBaseCommand
from zerver.models import Service, UserProfile
class Command(ZulipBaseCommand):
help = """Given an existing bot, converts it ... | apache-2.0 |
phoebe-project/phoebe2-docs | development/tutorials/units.py | 2 | 3403 | #!/usr/bin/env python
# coding: utf-8
# Advanced: Parameter Units
# ======================
#
# In this tutorial we will learn about how units are handled in the frontend and how to translate between different units.
# # Setup
# Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this... | gpl-3.0 |
louietsai/python-for-android | python3-alpha/python3-src/Lib/wsgiref/headers.py | 145 | 6682 | """Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
# Regular expression that matches `special' characters in parameters, the
# existence of which force ... | apache-2.0 |
j5shi/Thruster | pylibs/test/test_generators.py | 3 | 52675 | tutorial_tests = """
Let's try a simple generator:
>>> def f():
... yield 1
... yield 2
>>> for i in f():
... print i
1
2
>>> g = f()
>>> g.next()
1
>>> g.next()
2
"Falling off the end" stops the generator:
>>> g.next()
Traceback ... | gpl-2.0 |
castelao/AutoQC | qctests/ICDC_aqc_09_local_climatology_check.py | 3 | 4796 | '''
Python version of check_aqc_09_gradient_check.f.
Details of the original code are:
c/ DATE: FEBRUARY 4 2016
c/ AUTHOR: Viktor Gouretski
c/ AUTHOR'S AFFILIATION: Integrated Climate Data Center, University of Hamburg, Hamburg, Germany
c/ PROJECT: International Quality Controlled Ocean DataBase (IQ... | mit |
benthomasson/ansible | test/utils/shippable/tools/download.py | 124 | 10149 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# (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 yo... | gpl-3.0 |
cathalmccabe/PYNQ | pynq/gpio.py | 4 | 10788 | # Copyright (c) 2016, Xilinx, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | bsd-3-clause |
zhaodelong/django | django/contrib/gis/db/backends/postgis/schema.py | 333 | 3091 | from django.db.backends.postgresql.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
rast_index_wrapper = 'ST_ConvexHull(%s)'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(inde... | bsd-3-clause |
steventimberman/masterDebater | env/lib/python2.7/site-packages/django/template/loaders/base.py | 199 | 3759 | import warnings
from django.template import Origin, Template, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.inspect import func_supports_parameter
class Loader(object):
def __init__(self, engine):
self.engine = engine
def __call__(self, templat... | mit |
mdrumond/tensorflow | tensorflow/tools/docs/generate_lib.py | 7 | 17916 | # 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 |
lychyi/color-tools | node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # Copyright (c) 2012 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | apache-2.0 |
keybits/memuri | memuri/bookmarks/models.py | 1 | 1566 | # encoding: utf-8
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.utils.timezone import now
class Tag(models.Model):
name = models.CharField(max_length=50, unique=True)
class Meta:
verbose_name = u'tag'
verbose_name_plural ... | bsd-3-clause |
cloudbase/nova-virtualbox | nova/virt/vmwareapi/ds_util.py | 1 | 22529 | # Copyright (c) 2014 VMware, 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 a... | apache-2.0 |
jayceyxc/hue | apps/jobbrowser/src/jobbrowser/windmilltests.py | 38 | 1114 | # Generated by the windmill services transformer
# 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.... | apache-2.0 |
LeZhang2016/openthread | tests/scripts/thread-cert/Cert_5_2_01_REEDAttach.py | 3 | 6085 | #!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
davidzchen/tensorflow | tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py | 4 | 3929 | # Copyright 2020 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 |
genialis/resolwe-bio-py | tests/unit/test_collection_tables.py | 1 | 15570 | import unittest
from datetime import datetime
from time import sleep, time
import pandas as pd
import pytz
from mock import MagicMock, patch
from pandas.testing import assert_frame_equal
from resdk import CollectionTables
from resdk.collection_tables import EXP, META, RC
class TestCollectionTables(unittest.TestCase... | apache-2.0 |
levilucio/SyVOLT | GM2AUTOSAR_MM/transformation/faulty_from_DSLTrans/HMapPN2FiveElements.py | 1 | 4259 | from core.himesis import Himesis
import uuid
class HMapPN2FiveElements(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule MapPN2FiveElements.
"""
# Flag this instance as compiled now
self.is_compiled = True
... | mit |
miloszz/DIRAC | DataManagementSystem/scripts/dirac-dms-replicate-and-register-request.py | 8 | 3608 | #!/bin/env python
""" create and put 'ReplicateAndRegister' request """
__RCSID__ = "$Id: $"
import os
from DIRAC.Core.Base import Script
Script.setUsageMessage( '\n'.join( [ __doc__,
'Usage:',
' %s [option|cfgfile] requestName LFNs targetSE [tar... | gpl-3.0 |
ict-felix/stack | modules/resource/orchestrator/src/extensions/geni/ch.py | 9 | 18984 | #----------------------------------------------------------------------
# Copyright (c) 2011 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including witho... | apache-2.0 |
violine1101/MCEdit-Unified | albow/root.py | 1 | 23759 | # ---------------------------------------------------------------------------
#
# Albow - Root widget
#
#---------------------------------------------------------------------------
import sys
import pygame
from pygame import key
from pygame.locals import *
#from pygame.time import get_ticks
from pygame.event import... | isc |
kyleabeauchamp/pysam | doc/conf.py | 1 | 7506 | # -*- coding: utf-8 -*-
#
# samtools documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 12 14:43:42 2009.
#
# 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.
#
# Al... | mit |
itaiin/parquet-cpp | dev/merge_parquet_pr.py | 12 | 13233 | #!/usr/bin/env python
#
# 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 "Li... | apache-2.0 |
sktjdgns1189/android_kernel_samsung_SHV-E110S | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
xiangel/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/set_default_site.py | 35 | 2244 | """
set_default_site.py
"""
import socket
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django_extensions.management.utils import signalcommand
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--name', dest... | apache-2.0 |
beezee/GAE-Django-site | django/contrib/gis/db/backends/util.py | 377 | 1749 | """
A collection of utility routines and classes used by the spatial
backends.
"""
def gqn(val):
"""
The geographic quote name function; used for quoting tables and
geometries (they use single rather than the double quotes of the
backend quotename function).
"""
if isinstance(val, basestring):
... | bsd-3-clause |
edry/edx-platform | common/test/acceptance/tests/lms/test_lms_courseware_search.py | 74 | 7330 | """
Test courseware search
"""
import json
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest, remove_file
from ...pages.common.logout import LogoutPage
from ...pages.common.utils import click_css
from ...pages.studio.utils import add_html_component, type_in_codemirror
from ...pages.studio.au... | agpl-3.0 |
dropbox/bazel | third_party/py/gflags/gflags/_helpers_test.py | 11 | 6928 | #!/usr/bin/env python
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of c... | apache-2.0 |
alexandrul-ci/robotframework | src/robot/output/listenermethods.py | 4 | 3637 | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | apache-2.0 |
henrytao-me/openerp.positionq | openerp/addons/document_webdav/dav_fs.py | 54 | 36371 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
AntonioMtn/NZBMegaSearch | jinja2/parser.py | 171 | 35218 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.utils impo... | gpl-2.0 |
R4v3nBl4ck/Apache-Struts-2-CVE-2017-5638-Exploit- | Struts2_Shell001.py | 1 | 3004 | #!/usr/bin/python
import urllib2
import os, sys, time
__Author__="Rvbk"
RED = '\033[1;31m'
BLUE = '\033[94m'
BOLD = '\033[1m'
GREEN = '\033[32m'
OTRO = '\033[36m'
YELLOW = '\033[33m'
ENDC = '\033[0m'
def cls():
os.system(['clear', 'cls'][os.name == 'nt'])
cls()
logo = BLUE+''' ... | mit |
jkoelker/quark | quark/api/extensions/ip_addresses.py | 2 | 3451 | # Copyright (c) 2013 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
kurli/blink-crosswalk | Tools/Scripts/webkitpy/style/checkers/xml_unittest.py | 51 | 3702 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
maftieu/CouchPotatoServer | libs/subliminal/subtitles.py | 136 | 5252 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | gpl-3.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/libgridxc/package.py | 3 | 2010 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.