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 |
|---|---|---|---|---|---|
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/python/training/slot_creator.py | 51 | 7287 | # 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... | mit |
dmlc/tvm | tests/python/unittest/test_target_codegen_device.py | 2 | 3264 | # 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 |
perlygatekeeper/glowing-robot | Project_Euler/15_lattice_paths/find_all_lattice_paths.py | 1 | 1517 | #!/opt/local/bin/python
# Python program to find largest common multiple
import sys
import math
import timeit
import time
def find_lattice_paths(grid_size=2):
grid = [] * (grid_size+1)
for row in range(grid_size+1):
this_row = []
for col in range(grid_size+1):
this_row.append(0... | artistic-2.0 |
hellsgod/hells-Core-N6P | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_internal/commands/wheel.py | 6 | 6807 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
from pip._internal import cmdoptions
from pip._internal.basecommand import RequirementCommand
from pip._internal.cache import WheelCache
from pip._internal.exceptions import CommandError, PreviousBuildDirError
from pip._internal.o... | apache-2.0 |
jhawkesworth/ansible | lib/ansible/modules/system/xfs_quota.py | 37 | 12876 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Emmanouil Kampitakis <info@kampitakis.de>
# Copyright: (c) 2018, William Leemans <willie@elaba.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_fun... | gpl-3.0 |
johnkit/vtk-dev | Filters/Core/Testing/Python/backdrop.py | 78 | 1921 | """this is python equivalent of ./Wrapping/Tcl/vtktesting/backdrop.tcl
This script is used while running python tests translated from Tcl."""
import vtk
basePlane = None
baseMapper = None
base = None
backPlane = None
backMapper = None
back = None
leftPlane = None
leftMapper = None
left = None
def BuildBackdrop (mi... | bsd-3-clause |
abenzbiria/clients_odoo | addons/sale/wizard/__init__.py | 444 | 1129 | # -*- 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 |
DualSpark/ansible | v1/ansible/runner/poller.py | 132 | 4480 | # (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 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_3/django/contrib/gis/gdal/prototypes/errcheck.py | 404 | 4207 | """
This module houses the error-checking routines used by the GDAL
ctypes prototypes.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.gdal.error import check_err, OGRException, SRSException
from django.contrib.gis.gdal.libgdal import lgdal
# Helper routines for retrieving pointers and/or values f... | mit |
MiltosD/CEF-ELRC | metashare/sync/management/__init__.py | 6 | 1699 | import logging
from django.db.models import get_models, signals
from metashare.sync import models as sync_models
from metashare.sync.management.commands.createsyncuser import \
grant_sync_permissions
from metashare import settings
from django.contrib.auth.models import User
# Setup logging support.
LOGGER = logg... | bsd-3-clause |
markmcclain/astara | akanda/rug/cli/message.py | 2 | 1757 | # Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, 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 applicabl... | apache-2.0 |
tavendo/AutobahnPython | autobahn/wamp/gen/wamp/proto/PublisherFeatures.py | 3 | 3124 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: proto
import flatbuffers
class PublisherFeatures(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsPublisherFeatures(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
... | mit |
caslei/TfModels | im2txt/im2txt/ops/image_embedding_test.py | 29 | 5550 | # 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 |
datamade/yournextmp-popit | elections/illinois_state_primary_2016/management/commands/illinois_state_primary_2016_save_geojson.py | 1 | 1221 | import json
from os.path import join, dirname, abspath
from django.core.management.base import BaseCommand
import requests
from elections.models import Election
class Command(BaseCommand):
help = 'Create posts and elections for the 2016 Illinois General Primary'
def handle(self, **options):
... | agpl-3.0 |
pfmoore/pip | noxfile.py | 1 | 12231 | """Automation using nox.
"""
import glob
import os
import shutil
import sys
from pathlib import Path
from typing import Iterator, List, Tuple
import nox
# fmt: off
sys.path.append(".")
from tools import release # isort:skip # noqa
sys.path.pop()
# fmt: on
nox.options.reuse_existing_virtualenvs = True
nox.options.... | mit |
atheiste/django-shop | shop/tests/payment.py | 2 | 4843 | # -*- coding: utf-8 -*-
from decimal import Decimal
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.testcases import TestCase
from shop.models import (
ExtraOrderItemPriceField,
ExtraOrderPriceField,
LazyOrder,
LazyOrderItem,
LazyAddress,
... | bsd-3-clause |
bcoca/ansible | test/units/plugins/action/test_pause.py | 13 | 2603 | # -*- coding: utf-8 -*-
# Copyright (c) 2021 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import curses
import importlib
import io
import pytest
import sys
from ansibl... | gpl-3.0 |
jnerin/ansible | lib/ansible/modules/cloud/centurylink/clc_group.py | 30 | 16779 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['previ... | gpl-3.0 |
Juicechuan/AMRParsing | stanfordnlp/unidecode/x0b9.py | 253 | 4704 | data = (
'ruk', # 0x00
'rut', # 0x01
'rup', # 0x02
'ruh', # 0x03
'rweo', # 0x04
'rweog', # 0x05
'rweogg', # 0x06
'rweogs', # 0x07
'rweon', # 0x08
'rweonj', # 0x09
'rweonh', # 0x0a
'rweod', # 0x0b
'rweol', # 0x0c
'rweolg', # 0x0d
'rweolm', # 0x0e
'rweolb', # 0x0f
'rweols',... | gpl-2.0 |
jiangzhixiao/odoo | addons/l10n_fr/wizard/fr_report_compute_resultant.py | 374 | 2312 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
popazerty/bnigma2 | lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py | 3 | 4564 | from Plugins.Plugin import PluginDescriptor
from GraphMultiEpg import GraphMultiEPG
from Screens.ChannelSelection import BouquetSelector
from enigma import eServiceCenter, eServiceReference
from ServiceReference import ServiceReference
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Co... | gpl-2.0 |
albertomurillo/ansible | lib/ansible/modules/source_control/github_webhook_facts.py | 22 | 5087 | #!/usr/bin/python
#
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],... | gpl-3.0 |
jkorell/PTVS | Python/Tests/TestData/DebuggerProject/UnhandledException1_v25.py | 18 | 1621 | try: raise Exception() # does not break
except: print('handled 1')
try: raise Exception() # does not break
except Exception: print('handled 2')
try: raise Exception() # does not break
except Exception, e: print('handled 4')
try: raise Exception() # does not break
except BaseException: print('handled 5'... | apache-2.0 |
swiftstack/swift | test/functional/__init__.py | 2 | 51999 | # Copyright (c) 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
alvarolopez/nova | nova/virt/xenapi/image/utils.py | 62 | 3274 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
glewis17/cvxpy | doc/sphinxext/docscrape_sphinx.py | 154 | 7759 | import re, inspect, textwrap, pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('use_plots', False)
NumpyDocString.__init__(self, docstring, config=config)
... | gpl-3.0 |
we7/vamp-aubio-plugins | aubio/interfaces/python/test_filter.py | 4 | 2001 | from numpy.testing import TestCase, run_module_suite
from numpy.testing import assert_equal, assert_almost_equal
from aubio import fvec, digital_filter
from numpy import array
def array_from_text_file(filename, dtype = 'float'):
return array([line.split() for line in open(filename).readlines()],
dtype = dtype... | gpl-2.0 |
Aryan-Barbarian/bigbang | bigbang/git_repo.py | 2 | 5894 | from git import *
import git
import pandas as pd
import numpy as np
from time import mktime
from datetime import datetime
from entity_resolution import entity_resolve
import networkx as nx
from config.config import CONFIG
ALL_ATTRIBUTES = CONFIG.all_attributes #["HEXSHA", "Committer Name", "Committer Email", "Commit Me... | gpl-2.0 |
chriskoz/OctoPrint | src/octoprint/plugins/softwareupdate/version_checks/commandline.py | 37 | 1727 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
from ..exce... | agpl-3.0 |
rudkx/swift | utils/vim/swift-format.py | 29 | 3125 | # This file is a minimal swift-format vim-integration. To install:
# - Change 'binary' if swift-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/swift-format.py<cr>
# imap <C-I> <c-o>:pyf <path-to-this-file>/swift-format.py<cr>
#
# The first line enables swift-f... | apache-2.0 |
chrys87/fenrir | src/fenrirscreenreader/utils/word_utils.py | 1 | 4100 | #!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
import string
def getCurrentWord(currX,currY, currText):
lineBreak = False
endOfScreen = False
if currText == '':
return -1, -1, '', endOfScre... | lgpl-3.0 |
kodybrown/lime | backend/testdata/Vintage/transformers.py | 14 | 2107 | import sublime
import sublime_plugin
from Vintageous.vi.constants import regions_transformer
from Vintageous.vi.utils import back_one_char
from Vintageous.vi.utils import forward_one_char
from Vintageous.vi.utils import is_at_bol
from Vintageous.vi.utils import is_at_eol
from Vintageous.vi.utils import is_at_h... | bsd-2-clause |
ageron/tensorflow | tensorflow/contrib/optimizer_v2/optimizer_v2_test.py | 9 | 12158 | # 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 |
hectord/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/null_fk_ordering/tests.py | 92 | 2012 | from django.test import TestCase
from regressiontests.null_fk_ordering.models import *
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Keys shouldn't exclude results
"""
author_1 =... | gpl-3.0 |
sander76/home-assistant | homeassistant/components/flo/__init__.py | 4 | 2250 | """The flo integration."""
import asyncio
import logging
from aioflo import async_get_api
from aioflo.errors import RequestError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from homeassistant.exceptions ... | apache-2.0 |
vivekmishra1991/scikit-learn | sklearn/cluster/tests/test_dbscan.py | 176 | 12155 | """
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from scipy.spatial import distance
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing im... | bsd-3-clause |
ssut/flickr-dump | flickrdump/flickrdump.py | 1 | 2803 | from __future__ import division
import sys
if sys.version_info < (3, 4):
raise Exception('')
exit(1)
import asyncio
import aiohttp
import functools
import flickrapi
import itertools
import os
from ctypes import c_bool
def dump(api, secret, user_id, target='./data'):
try:
loop = asyncio.get_event_... | gpl-2.0 |
briansan/inv | server/inv/util.py | 1 | 3088 | """
@file inv/api/util.py
@author Brian Kim
@brief a script that defines utility methods for the server
"""
from auth import auth_inv
from datetime import timedelta
from functools import update_wrapper, wraps
from flask import current_app, make_response, request, Response
import base64
"""
convenience methods ... | mit |
x111ong/odoo | addons/mail/mail_thread.py | 111 | 109095 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
nikkuman/jsunpack-n | debug.py | 23 | 5831 | #!/usr/bin/python
'''
Jsunpackn - A generic JavaScript Unpacker Network Edition
Copyright (C) 2010 Blake Hartstein
http://jsunpack.jeek.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 Softwar... | gpl-2.0 |
GitHublong/hue | desktop/core/ext-py/Django-1.6.10/django/core/files/uploadedfile.py | 223 | 4156 | """
Classes representing uploaded files.
"""
import os
from io import BytesIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',... | apache-2.0 |
tesidroni/mp | Lib/lib2to3/fixes/fix_execfile.py | 324 | 1998 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
"""
from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
... | gpl-3.0 |
thresholdsoftware/asylum | openerp/addons/account/wizard/account_open_closed_fiscalyear.py | 14 | 2510 | # -*- 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 |
derickr/mongo-c-driver | build/generate-evergreen-config.py | 2 | 2332 | #!/usr/bin/env python
#
# Copyright 2018-present MongoDB, 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 applicab... | apache-2.0 |
dpac-vlsi/SynchroTrace | src/arch/x86/isa/insts/simd64/integer/data_conversion.py | 91 | 2209 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
thruflo/pyramid_weblayer | src/pyramid_weblayer/request_logger.py | 1 | 5109 | # -*- coding: utf-8 -*-
"""WSGI middleware to log all requests to Dynamodb on AWS.
Username and API Key are infered from following environment variables:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
The user needs a policy on AWS that allows it to PUT to DynamoDB.
You can ignore body of the requests by controlling the ... | unlicense |
spraints/plugin.video.prime_instant | default.py | 1 | 63995 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import socket
import mechanize
import cookielib
import sys
import re
import os
import json
import time
import string
import random
import shutil
import subprocess
import xbmcplugin
import xbmcgui
import xbmcaddon
import xbmcvfs
... | gpl-2.0 |
gomi1992/tiny210v2-uboot | tools/patman/test.py | 66 | 7785 | #
# Copyright (c) 2011 The Chromium OS Authors.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
#... | gpl-2.0 |
pattisdr/osf.io | scripts/analytics/addon_snapshot.py | 5 | 5536 | from __future__ import absolute_import
import logging
# App must be initialized before models or ADDONS_AVAILABLE are available
from website.app import init_app
init_app()
from osf.models import OSFUser, AbstractNode
from framework.database import paginated
from scripts.analytics.base import SnapshotAnalytics
from w... | apache-2.0 |
firerszd/kbengine | kbe/src/lib/python/Lib/macurl2path.py | 110 | 2732 | """Macintosh-specific module for conversion between pathnames and URLs.
Do not import directly; use urllib instead."""
import urllib.parse
import os
__all__ = ["url2pathname","pathname2url"]
def url2pathname(pathname):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path;... | lgpl-3.0 |
krez13/scikit-learn | sklearn/ensemble/tests/test_forest.py | 26 | 41675 | """
Testing for the forest module (sklearn.ensemble.forest).
"""
# Authors: Gilles Louppe,
# Brian Holt,
# Andreas Mueller,
# Arnaud Joly
# License: BSD 3 clause
import pickle
from collections import defaultdict
from itertools import combinations
from itertools import product
import numpy ... | bsd-3-clause |
grevutiu-gabriel/sympy | sympy/ntheory/multinomial.py | 91 | 6870 | from __future__ import print_function, division
from collections import defaultdict
from sympy.core.compatibility import range
def binomial_coefficients(n):
"""Return a dictionary containing pairs :math:`{(k1,k2) : C_kn}` where
:math:`C_kn` are binomial coefficients and :math:`n=k1+k2`.
Examples
====... | bsd-3-clause |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/lib2to3/fixes/fix_print.py | 5 | 2941 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No chang... | gpl-2.0 |
mbernasocchi/inasafe | safe_extras/raven/__init__.py | 6 | 1237 | """
raven
~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import os
import os.path
__all__ = ('VERSION', 'Client', 'get_version')
VERSION = '6.7.0'
def _get_git_revision(path):
revision_fi... | gpl-3.0 |
sebmarchand/syzygy | third_party/numpy/files/numpy/core/tests/test_numeric.py | 11 | 49172 | import sys
import platform
from decimal import Decimal
import numpy as np
from numpy.core import *
from numpy.random import rand, randint, randn
from numpy.testing import *
from numpy.testing.utils import WarningManager
from numpy.core.multiarray import dot as dot_
import warnings
class Vec:
def __init__(self,seq... | apache-2.0 |
aparo/django-nonrel | django/contrib/syndication/views.py | 20 | 8227 | import datetime
from django.conf import settings
from django.contrib.sites.models import Site, RequestSite
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.template import loader, Template, TemplateDoesNotExist, RequestContext
from dja... | bsd-3-clause |
ngpestelos/ansible-for-devops | dynamic-inventory/custom/inventory.py | 7 | 2005 | #!/usr/bin/env python
'''
Example custom dynamic inventory script for Ansible, in Python.
'''
import os
import sys
import argparse
try:
import json
except ImportError:
import simplejson as json
class ExampleInventory(object):
def __init__(self):
self.inventory = {}
self.read_cli_args()
... | mit |
seadsystem/website | web2py/scripts/standalone_exe_cxfreeze.py | 38 | 1722 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage:
Install cx_Freeze: http://cx-freeze.sourceforge.net/
Copy script to the web2py directory
c:\Python27\python standalone_exe_cxfreeze.py build_exe
"""
from cx_Freeze import setup, Executable
from gluon.import_all import base_modules, contributed_module... | mit |
jhaux/tensorflow | tensorflow/examples/learn/mnist.py | 45 | 3999 | # 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 appl... | apache-2.0 |
windmill/windmill | windmill/dep/_simplejson/scanner.py | 6 | 2130 | """JSON token scanner
"""
import re
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scanner(context):
parse_object = context.parse_object
parse_array = context.parse_array
p... | apache-2.0 |
jnishi/chainer | tests/chainer_tests/distributions_tests/test_bernoulli.py | 2 | 5265 | import unittest
import numpy
from chainer.backends import cuda
from chainer import distributions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'shape': [(3, 2), (1,)],
'is_variable': [True, False],
'sample_shape':... | mit |
iMichka/mini-iw | pygccxml/binary_parsers/get_dll_exported_symbols.py | 12 | 9547 | # The content of this file was contributed by leppton
# (http://mail.python.org/pipermail/patches/2006-November/020942.html) to
# ctypes project, under MIT License.
# This example shows how to use ctypes module to read all
# function names from dll export directory
import os
if os.name != "nt":
raise Exception("W... | apache-2.0 |
pashango2/sphinxcontrib-pandoc-markdown | setup.py | 1 | 1386 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from sphinxcontrib.pandoc_markdown import __version__
# long_desc = open('README.md').read()
requires = ['Sphinx>=0.6', "pandocfilters"]
setup(
name='sphinxcontrib-pandoc-markdown',
version=__version__,
url='https://github.com/pashango2... | bsd-2-clause |
sogelink/ansible | lib/ansible/modules/identity/opendj/opendj_backendprop.py | 72 | 6925 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Werner Dijkerman (ikben@werner-dijkerman.nl)
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass_... | gpl-3.0 |
0359xiaodong/viewfinder | backend/www/test/new_client_log_url_test.py | 13 | 3479 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
# -*- coding: utf-8 -*-
__author__ = 'spencer@emailscrubbed.com (Spencer Kimball)'
import datetime
import json
import time
from viewfinder.backend.base import util
from viewfinder.backend.base.testing import async_test
from viewfinder.backend.db.client_log import... | apache-2.0 |
Nepherhotep/django | tests/template_tests/syntax_tests/test_firstof.py | 199 | 3728 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from ..utils import setup
class FirstOfTagTests(SimpleTestCase):
libraries = {'future': 'django.templatetags.future'}
@setup({'firstof01': '{... | bsd-3-clause |
ludoo/wpkit | attic/wpfrontman/wp_frontman/wpf_cached_template_loader.py | 1 | 2690 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
Basically identical to the django default caching loader, but takes
into account the blog id.
"""
from django.core.exceptions import ImproperlyConfigured
from django.template i... | bsd-3-clause |
liuquansheng47/ansible | lib/ansible/plugins/lookup/redis_kv.py | 251 | 2433 | # (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver... | gpl-3.0 |
stefanw/froide | froide/upload/migrations/0001_initial.py | 1 | 1428 | # Generated by Django 2.1.9 on 2019-06-24 13:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_fsm
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | mit |
havard024/prego | crm/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py | 624 | 1426 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
d... | mit |
Probely/CTF-Challenges | WebHacking/100-Rolodex/tests/t_app.py | 1 | 9779 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, Bright Pixel
#
# For these tests to work, remember to start the service
# from a clean slate. Otherwise, if a test fails, it may
# leave stuff around and mess up the next testing round.
#
from __future__ import print_function
from __future__ import... | apache-2.0 |
rukku/inasafe | safe/impact_functions/inundation/flood_OSM_building_impact.py | 1 | 15830 | from safe.impact_functions.core import (FunctionProvider,
get_hazard_layer,
get_exposure_layer,
get_question)
from safe.storage.vector import Vector
from safe.storage.utilities import DEFAULT_ATTRIBUT... | gpl-3.0 |
sergecodd/FireFox-OS | B2G/gecko/python/virtualenv/virtualenv.py | 5 | 114569 | #!/usr/bin/env python
"""Create a "virtual" Python installation
"""
# If you change the version here, change it in setup.py
# and docs/conf.py as well.
__version__ = "1.8.4" # following best practices
virtualenv_version = __version__ # legacy, again
import base64
import sys
import os
import codecs
import optparse
i... | apache-2.0 |
repotvsupertuga/repo | script.module.requests/lib/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-2.0 |
zhelfinstein/ABOUT | todo/models.py | 1 | 1131 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from social_django.models import USER_MODEL
class Item(models.Model):
user = models.ForeignKey(USER_MODEL)
priority = models.PositiveSmallIntegerField()
title = models.CharField(max_length=100)
description = ... | agpl-3.0 |
atsao72/sympy | sympy/utilities/tests/test_lambdify.py | 28 | 19078 | from sympy.utilities.pytest import XFAIL, raises
from sympy import (
symbols, lambdify, sqrt, sin, cos, tan, pi, acos, acosh, Rational,
Float, Matrix, Lambda, Piecewise, exp, Integral, oo, I, Abs, Function,
true, false, And, Or, Not)
from sympy.printing.lambdarepr import LambdaPrinter
import mpmath
from sym... | bsd-3-clause |
ross/memcache-debug-panel | memcache_toolbar/panels/__init__.py | 1 | 3882 | # work around modules with the same name
from __future__ import absolute_import
from datetime import datetime
from debug_toolbar.panels import Panel
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from os.path import dirname, ... | bsd-3-clause |
yanlend/scikit-learn | examples/linear_model/plot_sgd_iris.py | 286 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
machine-intelligence/rl-teacher-atari | agents/pposgd-mpi/pposgd_mpi/mlp_policy.py | 1 | 2614 | from pposgd_mpi.common.mpi_running_mean_std import RunningMeanStd
import pposgd_mpi.common.tf_util as U
import tensorflow as tf
import gym
from pposgd_mpi.common.distributions import make_pdtype
class MlpPolicy(object):
recurrent = False
def __init__(self, name, *args, **kwargs):
with tf.variable_scop... | mit |
vheon/YouCompleteMe | third_party/pythonfutures/crawl.py | 85 | 2422 | """Compare the speed of downloading URLs sequentially vs. using futures."""
import functools
import time
import timeit
import sys
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
from concurrent.futures import (as_completed, ThreadPoolExecutor,
... | gpl-3.0 |
donald-pinckney/EM-Simulator | EM Sim/EM SimContent/Lib/distutils/command/install_headers.py | 251 | 1346 | """distutils.command.install_headers
Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory."""
__revision__ = "$Id$"
from distutils.core import Command
# XXX force is never used
class install_headers(Command):
description = "install C/C++ header file... | apache-2.0 |
technologiescollege/Blockly-rduino-communication | scripts/Lib/site-packages/werkzeug/_compat.py | 342 | 6311 | # flake8: noqa
# This whole file is full of lint errors
import codecs
import sys
import operator
import functools
import warnings
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
WIN = sys.platform.startswith('win')
_identity = lambda x: x
if PY2:
u... | gpl-3.0 |
djpnewton/beerme | beerme/__init__.py | 1 | 5457 | # coding: utf-8
import os
from datetime import datetime, timedelta
from flask import Flask, session
from flask_sqlalchemy import SQLAlchemy
from flask_kvsession import KVSessionExtension
from simplekv.db.sql import SQLAlchemyStore
from sqlalchemy import create_engine, MetaData
from flask_seasurf import SeaSurf
from fl... | mit |
st135yle/django-site | dbenv/lib/python3.4/site-packages/psycopg2/tests/testconfig.py | 23 | 1431 | # Configure the test suite from the env variables.
import os
dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test')
dbhost = os.environ.get('PSYCOPG2_TESTDB_HOST', None)
dbport = os.environ.get('PSYCOPG2_TESTDB_PORT', None)
dbuser = os.environ.get('PSYCOPG2_TESTDB_USER', None)
dbpass = os.environ.get('PSYCOPG2_T... | mit |
food52/thumbor | thumbor/detectors/local_detector.py | 14 | 2401 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import join, dirname, abspath, isabs
try:
import c... | mit |
s-hertel/ansible | packaging/sdist/check-link-behavior.py | 114 | 1290 | #!/usr/bin/env python
"""Checks for link behavior required for sdist to retain symlinks."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import platform
import shutil
import sys
import tempfile
def main():
"""Main program entry point."""
temp_dir = tempf... | gpl-3.0 |
shastah/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/actions/up2date_config.py | 12 | 2988 | #!/usr/bin/python
# Copyright (c) 1999--2015 Red Hat, Inc. Distributed under GPLv2.
#
# Author: Adrian Likins <alikins@redhat.com>
#
import os
import re
import sys
sys.path.append("/usr/share/rhn")
from up2date_client import config
cfg = config.initUp2dateConfig()
__rhnexport__ = [
'update',
'rpmmacros',
... | gpl-2.0 |
joshloyal/scikit-learn | examples/linear_model/plot_lasso_and_elasticnet.py | 24 | 2080 | """
========================================
Lasso and Elastic Net for Sparse Signals
========================================
Estimates Lasso and Elastic-Net regression models on a manually generated
sparse signal corrupted with an additive noise. Estimated coefficients are
compared with the ground-truth.
"""
print(... | bsd-3-clause |
jordigh/mercurial-crew | hgext/churn.py | 2 | 6887 | # churn.py - create a graph of revisions count grouped by template
#
# Copyright 2006 Josef "Jeff" Sipek <jeffpc@josefsipek.net>
# Copyright 2008 Alexander Solovyov <piranha@piranha.org.ua>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later ve... | gpl-2.0 |
globality-corp/microcosm-pubsub | microcosm_pubsub/consumer.py | 1 | 5739 | """
Message consumer.
"""
from os.path import exists
from urllib.parse import urlparse
from boto3 import Session
from microcosm.api import defaults, typed
from microcosm_logging.decorators import logger
from microcosm_pubsub.backoff import BackoffPolicy
from microcosm_pubsub.reader import SQSFileReader, SQSJsonReade... | apache-2.0 |
stefan-andritoiu/upm | tests/check_file_encoding.py | 12 | 1990 | #!/usr/bin/python
import unittest
import os
import chardet
target_exts = ['.h', '.hpp', '.hxx', '.txt']
valid_encodings = ['ascii', 'utf-8']
class EncodingTests(unittest.TestCase):
'''Non-ascii/utf-8 encodings can cause failures on downstream tools
such as documentation-generation and python2 module loading.... | mit |
dfdx/masque | others/faceless-python-old/faceless/lucaskanade.py | 1 | 7321 |
from PIL import Image
from scipy.ndimage.interpolation import affine_transform
from numpy import *
from matplotlib import pylab as plt
from matplotlib import gridspec
# nabla_Ix = array([[1, 1, 2, 2], [1, 1, 2, 2], [1, 1, 2, 2]])
# nabla_Iy = array([[1, 1, 3, 3], [1, 1, 3, 3], [1, 1, 3, 3]])
# im_grad = (nabla_Ix, ... | mit |
trabacus-softapps/openerp-8.0-cc | openerp/addons/account_voucher/invoice.py | 382 | 2496 | # -*- 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 |
IQSS/geoconnect | gc_apps/gis_tabular/tests/test_json_field.py | 1 | 2515 | from __future__ import print_function
from os.path import abspath, dirname, isfile, join, isdir
from unittest import skip
from django.test import TestCase
from gc_apps.gis_tabular.models import TestIt
from msg_util import msgt
class JSONFieldTester(TestCase):
def setUp(self):
pass
#self.upload_... | apache-2.0 |
zenodo/zenodo | zenodo/modules/deposit/views.py | 1 | 13211 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016, 2017 CERN.
#
# Zenodo 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 l... | gpl-2.0 |
Jcing95/iop-hd | test/functional/replace-by-fee.py | 2 | 22471 | #!/usr/bin/env python3
# Copyright (c) 2014-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 the RBF code."""
from test_framework.test_framework import IoPTestFramework
from test_framework.u... | mit |
KeyWeeUsr/plyer | plyer/platforms/android/gravity.py | 2 | 2145 | '''
Android gravity
---------------------
'''
from jnius import autoclass
from jnius import cast
from jnius import java_method
from jnius import PythonJavaClass
from plyer.facades import Gravity
from plyer.platforms.android import activity
Context = autoclass('android.content.Context')
Sensor = autoclass('android.ha... | mit |
Aloomaio/googleads-python-lib | examples/adwords/v201809/targeting/add_demographic_targeting_criteria.py | 1 | 2990 | #!/usr/bin/env python
#
# Copyright 2016 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 requir... | apache-2.0 |
M4rtinK/pyside-bb10 | tests/QtCore/qflags_test.py | 6 | 3405 | #!/usr/bin/python
'''Test cases for QFlags'''
import unittest
from PySide.QtCore import Qt, QTemporaryFile, QFile, QIODevice, QObject
class QFlagTest(unittest.TestCase):
'''Test case for usage of flags'''
def testCallFunction(self):
f = QTemporaryFile()
self.assertTrue(f.open())
fileN... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.