repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
NLeSC/pyxenon | xenon/compat.py | 1 | 1807 | """
Define cross-platform methods.
"""
from pathlib import Path
import logging
import subprocess
import os
import sys
import site
import signal
from .create_keys import create_self_signed_cert
from .version import xenon_grpc_version
def find_xenon_grpc_jar():
"""Find the Xenon-GRPC jar-file, windows version."""... | apache-2.0 |
w1ll1am23/home-assistant | homeassistant/components/person/__init__.py | 3 | 16241 | """Support for tracking people."""
from __future__ import annotations
import logging
from typing import cast
import voluptuous as vol
from homeassistant.auth import EVENT_USER_REMOVED
from homeassistant.components import websocket_api
from homeassistant.components.device_tracker import (
ATTR_SOURCE_TYPE,
DO... | apache-2.0 |
ddzialak/boto | boto/cloudfront/object.py | 170 | 1798 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
mikewesner-wf/glasshouse | appengine/lib/werkzeug/_internal.py | 89 | 14082 | # -*- coding: utf-8 -*-
"""
werkzeug._internal
~~~~~~~~~~~~~~~~~~
This module provides internally used helpers and constants.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import inspect
from weakref import WeakKeyDictiona... | apache-2.0 |
craigderington/studentloan5 | studentloan5/Lib/site-packages/django/utils/html.py | 45 | 15098 | """HTML utilities suitable for global use."""
from __future__ import unicode_literals
import re
import sys
import warnings
from django.utils import six
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_str, force_text
from django.utils.functional import allow_lazy... | bsd-3-clause |
muyeby/NLP | Seg/Hmmseg/test/test.py | 1 | 6005 | #!/usr/bin/env python
# encoding: utf-8
"""
@version: ??
@author: muyeby
@contact: bxf_hit@163.com
@site: http://muyeby.github.io
@software: PyCharm
@file: test.py
@time: 16-9-4 下午8:17
"""
import time
import sys
import os
import re
import math
sys.path.append(os.getcwd() + "/../../../")
sys.path.append(os.getcwd() ... | mit |
rapilabs/django-db-constraints | django_db_constraints/autodetector.py | 1 | 2101 | from django.db.migrations import operations
from django.db.migrations.autodetector import MigrationAutodetector
from .operations import AlterConstraints
class MigrationAutodetectorWithDbConstraints(MigrationAutodetector):
db_constraints_operations = []
def generate_created_models(self, *args, **kwargs):
... | mit |
zhaishaomin/LDS-prefetcher-research | gem5_src/arch/x86/isa/insts/__init__.py | 91 | 2409 | # 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... | apache-2.0 |
rsm5139/learning-bowtie | build/src/server.py | 1 | 10189 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import traceback
from functools import wraps
from builtins import bytes
import click
import msgpack
import flask
from flask import Flask, render_template, copy_current_request_context
from flask import request, Response
from flask_socketio import Sock... | mit |
woodscn/scipy | scipy/signal/tests/test_max_len_seq.py | 117 | 3262 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (TestCase, assert_raises, run_module_suite,
assert_allclose, assert_array_equal)
from numpy.fft import fft, ifft
from scipy.signal import max_len_seq
class TestMLS(TestCase):
... | bsd-3-clause |
numerigraphe/odoo | addons/hr_timesheet_sheet/__init__.py | 434 | 1127 | # -*- 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 |
rgerkin/neuroConstruct | lib/jython/Lib/_threading_local.py | 241 | 7456 | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-local d... | gpl-2.0 |
ravindrapanda/tensorflow | tensorflow/python/platform/tf_logging.py | 9 | 8684 | # 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 |
karec/extrapypi | extrapypi/models/package.py | 1 | 1284 | import datetime
from pkg_resources import parse_version
from extrapypi.extensions import db
package_maintainers = db.Table(
'package_maintainers',
db.Column('package_id', db.Integer, db.ForeignKey('package.id', name='_fk_package_maintainers_package')),
db.Column('user_id', db.Integer, db.ForeignKey('user... | mit |
edoburu/django-parler | parler/tests/test_model_relations.py | 2 | 2255 | from .utils import AppTestCase
from .testapp.models import TranslationRelated, TranslationRelatedRelation
from .testapp.models import ForeignKeyTranslationModel, RegularModel
class TranslationRelationTestCase(AppTestCase):
def test_related_objects_in_translation_model(self):
instance = TranslationRelate... | apache-2.0 |
ptoraskar/django | django/contrib/sites/migrations/0001_initial.py | 276 | 1096 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.Create... | bsd-3-clause |
jetty-project/FrameworkBenchmarks | frameworks/Python/blacksheep/app.py | 4 | 4534 | import os
import ujson
import asyncpg
from random import randint
from multiprocessing import cpu_count
from blacksheep.server import Application, ServerOptions
from blacksheep import Response, Headers, Header, Content
from jinja2 import Environment, PackageLoader, select_autoescape
json_dumps = ujson.dumps
_is_travis... | bsd-3-clause |
Sungup/Undine | undine/api/database/sqlite.py | 1 | 1434 | from undine.api.database.base_client import BaseClient
from undine.database.sqlite import SQLiteConnector
class SQLiteClient(BaseClient):
_QUERY = {
'task': '''
INSERT INTO task(tid, name, cid, iid, wid, reportable, state)
VALUES(:tid, :name, :cid, :iid, :wid, :reportable, 'R')
... | mit |
fetzerch/xbmc | lib/freetype/src/tools/docmaker/formatter.py | 515 | 4962 | # Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... | gpl-2.0 |
pysb/pysb | pysb/examples/run_earm_hpp.py | 5 | 2377 | """ Run the Extrinsic Apoptosis Reaction Model (EARM) using BioNetGen's
Hybrid-Particle Population (HPP) algorithm.
NFsim provides stochastic simulation without reaction network generation,
allowing simulation of models with large (or infinite) reaction networks by
keeping track of species counts. However, it can fa... | bsd-2-clause |
kaiueo/octs | octs/commands.py | 23 | 4250 | # -*- coding: utf-8 -*-
"""Click commands."""
import os
from glob import glob
from subprocess import call
import click
from flask import current_app
from flask.cli import with_appcontext
from werkzeug.exceptions import MethodNotAllowed, NotFound
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path... | bsd-3-clause |
inflector/atomspace | scripts/rule-engine/extract-bc-trace.py | 4 | 2867 | #!/usr/bin/env python2
# Given a log file, and a FCS handle, filtered that log file to retain
# only the iterations leading to that FCS.
import sys
import re
#############
# Constants #
#############
# Usage message
usage = "Usage: " + sys.argv[0] + " FCSHANDLE LOGFILE"
# Useful regex
timestamp_re = r'\[\d{4}-\d{2... | agpl-3.0 |
smn/onadata | onadata/apps/api/tests/viewsets/test_abstract_viewset.py | 5 | 14971 | import json
import os
import re
import requests
from django.conf import settings
from django.contrib.auth.models import Permission
from django.test import TestCase
from django_digest.test import Client as DigestClient
from tempfile import NamedTemporaryFile
from django.contrib.auth.models import User
from django_diges... | bsd-2-clause |
azumimuo/family-xbmc-addon | script.module.youtube.dl/lib/youtube_dl/extractor/muenchentv.py | 64 | 2126 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
)
class MuenchenTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?muenchen\.tv/livestream'
IE_DESC = 'münchen.tv'
_TEST = {... | gpl-2.0 |
drxaero/calibre | src/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | gpl-3.0 |
deshbandhu-renovite/receipt-eCommerce | node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py | 1824 | 3474 | # Copyright (c) 2011 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | gpl-3.0 |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/numpy/polynomial/tests/test_legendre.py | 123 | 16522 | """Tests for legendre module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.legendre as leg
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_mod... | gpl-2.0 |
SciDevs/heroku-buildpack-python-scikit-learn-git | vendor/virtualenv-1.7/docs/conf.py | 19 | 4191 | # -*- coding: utf-8 -*-
#
# Paste documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 22 22:08:49 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleabl... | mit |
mgree/sigplan | lda/by_year.py | 2 | 2049 | import codecs
import re
import sys
from operator import add
def quote(s):
return '"' + s + '"'
title = re.compile(u'(.*) \((.*) (\\d*)\)$')
def split_title(doc):
m = title.match(doc)
return [m.group(3),m.group(2),quote(m.group(1))]
def run(docs,gammas,normalize=True):
# show the header
num_topic... | mit |
CharlieCorner/manga_downloader | src/ConvertPackage/image.py | 3 | 5281 | #!/usr/bin/env python
# Copyright (C) 2010 Alex Yatskov
#
# 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 pro... | mit |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/bson/json_util.py | 12 | 9080 | # Copyright 2009-2014 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 applicable law or agreed to in writin... | agpl-3.0 |
hlzz/dotfiles | graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/test/test_protocols.py | 2 | 7629 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.protocols package.
"""
from twisted.trial import unittest
from twisted.protocols import wire, portforward
from twisted.internet import reactor, defer, address, protocol
from twisted.test import proto_helpers
... | bsd-3-clause |
lightcn/odoo | addons/project_issue/__openerp__.py | 260 | 2329 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
jivesoftware/platform_cli | platform_cli/props.py | 1 | 3175 | #!/usr/bin/env python
# Copyright (C) 2013 Jive Software. All rights reserved.
"""High-level functions for manipulating a .properties file.
"""
import ConfigParser
import itertools
import os
import StringIO
FAKE_SECTION_NAME = 'fake_section'
class Error(Exception):
"""Base exception class for this module."""
c... | apache-2.0 |
xbmc/xbmc-antiquated | xbmc/lib/libPython/Python/Lib/test/test_errno.py | 39 | 2132 | #! /usr/bin/env python
"""Test the errno module
Roger E. Masse
"""
import errno
from test.test_support import verbose
errors = ['E2BIG', 'EACCES', 'EADDRINUSE', 'EADDRNOTAVAIL', 'EADV',
'EAFNOSUPPORT', 'EAGAIN', 'EALREADY', 'EBADE', 'EBADF',
'EBADFD', 'EBADMSG', 'EBADR', 'EBADRQC', 'EBADSLT',
... | gpl-2.0 |
calfonso/ansible | lib/ansible/modules/network/f5/bigip_monitor_https.py | 7 | 18087 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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',
... | gpl-3.0 |
tschneidereit/servo | tests/wpt/web-platform-tests/tools/html5lib/setup.py | 418 | 1694 | from distutils.core import setup
import os
import codecs
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Pyt... | mpl-2.0 |
iandev/HarvestMood | Requests/requests/packages/urllib3/exceptions.py | 77 | 2557 | # urllib3/exceptions.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
... | mit |
jiajiax/crosswalk-test-suite | stability/stability-embeddingapi-android-tests/inst.apk.py | 1 | 3492 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
sleibrock/discord-bots | junkyard/hacker-bot.py | 1 | 16271 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Hacker bot
Designed as a way to interact with the host machine
Also comes with a Lis.py interpreter (thanks Peter Norvig)
Requires: cowsay, screenfetch, cowfortune
"""
from botinfo import *
from bs4 import BeautifulSoup as BS
from requests import get as re_get
from ra... | mit |
yephper/django | tests/fixtures/tests.py | 1 | 81690 | <<<<<<< HEAD
from __future__ import unicode_literals
import os
import sys
import tempfile
import unittest
import warnings
from django.apps import apps
from django.contrib.sites.models import Site
from django.core import management
from django.core.files.temp import NamedTemporaryFile
from django.core.mana... | bsd-3-clause |
echohenry2006/tvb-library | tvb/tests/library/datatypes/spectral_test.py | 3 | 6667 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... | gpl-2.0 |
wikimedia/analytics-user-metrics | user_metrics/api/engine/request_manager.py | 1 | 18101 | """
This module implements the request manager functionality.
Job Queue and Processing
^^^^^^^^^^^^^^^^^^^^^^^^
As requests are issued via http to the API a process queue will store all
active jobs. Processes will be created and assume one of the following
states throughout their existence: ::... | bsd-3-clause |
ahmed-mahran/hue | desktop/core/ext-py/Django-1.6.10/tests/backends/tests.py | 46 | 40386 | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import absolute_import, unicode_literals
import copy
import datetime
from decimal import Decimal
import threading
from django.conf import settings
from django.core.management.color import no_style
from django.db import (connec... | apache-2.0 |
grlee77/nipype | nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py | 9 | 1171 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.surface import ProbeVolumeWithModel
def test_ProbeVolumeWithModel_inputs():
input_map = dict(InputModel=dict(argstr='%s',
position=-2,
),
InputVolume=dict(argstr='%s',
positio... | bsd-3-clause |
natecook1000/swift | utils/gyb_syntax_support/Token.py | 3 | 13979 | from Classification import classification_by_name
from Node import error
from kinds import lowercase_first_word
class Token(object):
"""
Represents the specification for a Token in the TokenSyntax file.
"""
def __init__(self, name, kind, serialization_code, unprefixed_kind=None,
tex... | apache-2.0 |
ramitalat/odoo | addons/l10n_ma/__openerp__.py | 260 | 2074 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010 kazacube (http://kazacube.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
waveFrontSet/box_management | config/wsgi.py | 1 | 1714 | """
WSGI config for box_management project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICA... | mit |
senttech/Cura | plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py | 2 | 5890 | # Copyright (c) 2015 Ultimaker B.V.
# Copyright (c) 2013 David Braam
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
from . import RemovableDrivePlugin
import string
import ctypes
from ctypes import wintypes # Using ctypes.wintypes in the c... | agpl-3.0 |
RaoUmer/cudamat | examples/rbm_cudamat.py | 6 | 2457 | from __future__ import division
import time
import numpy as np
import cudamat as cm
import util
# initialize CUDA
cm.cublas_init()
cm.CUDAMatrix.init_random(1)
# load data
util.load('mnist.dat', globals())
dev_dat = cm.CUDAMatrix(cm.reformat(dat/255.))
# training parameters
epsilon = 0.1
momentum = 0.9
num_epochs =... | bsd-3-clause |
loopCM/chromium | chrome/test/functional/perf/endure_result_parser.py | 59 | 29633 | #!/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.
"""Script to parse perf data from Chrome Endure test executions, to be graphed.
This script connects via HTTP to a buildbot master... | bsd-3-clause |
ghchinoy/tensorflow | tensorflow/python/keras/backend_config_test.py | 16 | 2087 | # 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 |
ayesandarmoe/microblog_flask_tutorial | flask/lib/python2.7/site-packages/pip/_vendor/__init__.py | 252 | 2508 | """
pip._vendor is for vendoring dependencies of pip to prevent needing pip to
depend on something external.
Files inside of pip._vendor should be considered immutable and should only be
updated to versions from upstream.
"""
from __future__ import absolute_import
import glob
import os.path
import sys
# Downstream r... | gpl-2.0 |
Dino0631/RedRain-Bot | cogs/lib/youtube_dl/extractor/cctv.py | 64 | 6903 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
float_or_none,
try_get,
unified_timestamp,
)
class CCTVIE(InfoExtractor):
IE_DESC = '央视网'
_VALID_URL = r'https?://(?:(?:[^/]+)\.(?:cntv|cctv)\... | gpl-3.0 |
killbug2004/amoco | amoco/arch/x86/env.py | 5 | 2585 | # -*- coding: utf-8 -*-
# This code is part of Amoco
# Copyright (C) 2006-2011 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license
# import expressions:
from amoco.cas.expressions import *
# 32bits registers :
#-------------------
eax = reg('eax',32) # accumulator for operands and results data
... | gpl-2.0 |
andrewcmyers/tensorflow | tensorflow/python/summary/summary.py | 4 | 12422 | # 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 |
yakky/django-localflavor | tests/test_id.py | 4 | 7045 | from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.id_.forms import (IDPhoneNumberField, IDPostCodeField,
IDNationalIdentityNumberField,
IDLicensePlateField,
IDProvince... | bsd-3-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | agpl-3.0 |
hoosteeno/mozillians | vendor-local/lib/python/tablib/packages/openpyxl/workbook.py | 116 | 6200 | # file openpyxl/workbook.py
# Copyright (c) 2010 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | bsd-3-clause |
wnesl/gnuradio-IA | gnuradio-core/src/examples/network/audio_source.py | 18 | 2624 | #!/usr/bin/env python
#
# Copyright 2006,2007,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/imghdr.py | 259 | 3544 | """Recognize image file formats based on their first few bytes."""
__all__ = ["what"]
#-------------------------#
# Recognize image headers #
#-------------------------#
def what(file, h=None):
if h is None:
if isinstance(file, basestring):
f = open(file, 'rb')
h = f.read(32)
... | gpl-2.0 |
igueths/ansible-modules-extras | network/nmcli.py | 61 | 40842 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Chris Long <alcamie@gmail.com> <chlong@redhat.com>
#
# This file is a module for Ansible that interacts with Network Manager
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... | gpl-3.0 |
yoer/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/geoapp/tests.py | 47 | 37664 | from __future__ import absolute_import
import re
from django.db import connection
from django.contrib.gis import gdal
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import (
HAS_SPATIAL_DB, no_mysql, no_oracle, no_spatialite,
mysql, oracle, postgis, spatialite)
from django.te... | apache-2.0 |
katrid/django | tests/view_tests/generic_urls.py | 329 | 1356 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle
date_based_info_dict = {
'queryset': Article.objects.all()... | bsd-3-clause |
pdellaert/ansible | test/units/modules/network/fortios/test_fortios_ips_rule.py | 21 | 11633 | # 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 |
madj4ck/ansible | v1/ansible/runner/connection_plugins/ssh.py | 104 | 19988 | # (c) 2012, 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) any lat... | gpl-3.0 |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/boto/dynamodb/__init__.py | 145 | 1697 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 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 ... | mit |
vitorio/kivy | kivy/input/postproc/ignorelist.py | 59 | 1365 | '''
Ignore list
===========
Ignore touch on some areas of the screen
'''
__all__ = ('InputPostprocIgnoreList', )
from kivy.config import Config
from kivy.utils import strtotuple
class InputPostprocIgnoreList(object):
'''
InputPostprocIgnoreList is a post-processor which removes touches in the
Ignore li... | mit |
robin-lai/scikit-learn | doc/tutorial/machine_learning_map/pyparsing.py | 258 | 137838 | # module pyparsing.py
#
# Copyright (c) 2003-2008 Paul T. McGuire
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to u... | bsd-3-clause |
jaumemarti/l10n-spain-txerpa | l10n_es_payment_order/wizard/csb32.py | 1 | 10991 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com)
# Pedro Tarrafeta <pedro@acysos.com>
# Copyright (c) 2008 Pablo Rocandio. All Rights Res... | agpl-3.0 |
NCI-Cloud/horizon | openstack_dashboard/dashboards/project/database_backups/tables.py | 33 | 6058 | # Copyright 2013 Rackspace Hosting
#
# 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 |
sorenk/ansible | lib/ansible/module_utils/facts/system/caps.py | 232 | 2153 | # Collect facts related to systems 'capabilities' via capsh
#
# 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) a... | gpl-3.0 |
itstriz/chicago_bus_equity | download_stops.py | 1 | 2860 | #!env/bin/python
import csv, os, urllib2
import xml.etree.ElementTree as ET
from app import db
from app.models import Route, Stop
from bs4 import BeautifulSoup
from config_local import STOPS_FILE
from zipfile import ZipFile
# Define URLs and file name
url = 'https://data.cityofchicago.org/download/84eu-buny/applicatio... | gpl-2.0 |
simonwydooghe/ansible | contrib/inventory/vagrant.py | 30 | 4064 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... | gpl-3.0 |
ross128/stg | ships/migrations/0005_add_ship_cargo.py | 1 | 1089 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from goods.models import Stock
def insertDefaultCargoIDs(apps, schema_editor):
"""inserts the default stock IDs for the newly created OneToOneField"""
Ship = apps.get_model("ships", "Ship")
for ship in... | gpl-3.0 |
Spike96/Python_Training_ | fixture/application.py | 1 | 1045 | from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.users import UsersHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox()
elif browser == "chrome... | apache-2.0 |
Airphrame/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/template_tools.py | 215 | 9443 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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... | gpl-3.0 |
holachek/ecosense | app/tastypie/management/commands/backfill_api_keys.py | 5 | 1060 | from django.core.management.base import NoArgsCommand
from tastypie.compat import User
from tastypie.models import ApiKey
class Command(NoArgsCommand):
help = "Goes through all users and adds API keys for any that don't have one."
def handle_noargs(self, **options):
"""Goes through all users and ... | mit |
waxmanr/moose | framework/contrib/nsiqcppstyle/rules/RULE_4_2_A_B_space_around_word.py | 43 | 3213 | """
Provide space around word.
This rule checks if the spaces are provided before and after 'if', 'else', 'for' word
in the function scope
It doens't check 'switch' and 'while' because they are commonly attached following "("
== Violation ==
void function()
{
for(k;j;c) { <== Violation. it should be '... | lgpl-2.1 |
havard024/prego | venv/lib/python2.7/site-packages/unidecode/x0b0.py | 253 | 4853 | data = (
'ggwem', # 0x00
'ggweb', # 0x01
'ggwebs', # 0x02
'ggwes', # 0x03
'ggwess', # 0x04
'ggweng', # 0x05
'ggwej', # 0x06
'ggwec', # 0x07
'ggwek', # 0x08
'ggwet', # 0x09
'ggwep', # 0x0a
'ggweh', # 0x0b
'ggwi', # 0x0c
'ggwig', # 0x0d
'ggwigg', # 0x0e
'ggwigs', # 0x0f
'gg... | mit |
Nateowami/flex-languagedepot-metadata | src/createDb.py | 1 | 3005 | #!/usr/bin/python3
from LanguageDepotAnalyze import getListOfCapabilities
from importlib import import_module
# in this file, we write a SQL script which will create the database.
# the script will take this format:
#
# -- create schemas
# CREATE SCHEMA project;
#
# -- set search path
# SET search_path TO project,publi... | mit |
tucksaun/status.tucksaun.net | stashboard/contrib/httplib2/__init__.py | 23 | 53960 | from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | mit |
espadrine/opera | chromium/src/third_party/python_26/Lib/distutils/tests/test_sdist.py | 47 | 4905 | """Tests for distutils.command.sdist."""
import os
import unittest
import shutil
import zipfile
from os.path import join
import sys
from distutils.command.sdist import sdist
from distutils.core import Distribution
from distutils.tests.test_config import PyPIRCCommandTestCase
from distutils.errors import DistutilsExecE... | bsd-3-clause |
rhertzog/django | tests/force_insert_update/tests.py | 381 | 2213 | from __future__ import unicode_literals
from django.db import DatabaseError, IntegrityError, transaction
from django.test import TestCase
from .models import (
Counter, InheritedCounter, ProxyCounter, SubCounter, WithCustomPK,
)
class ForceTests(TestCase):
def test_force_update(self):
c = Counter.ob... | bsd-3-clause |
vnsofthe/odoo | addons/auth_ldap/__openerp__.py | 260 | 1516 | ##############################################################################
#
# 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 GNU Affero General Public L... | agpl-3.0 |
shepdelacreme/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py | 10 | 5144 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# 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
ANS... | gpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/M2Crypto/util.py | 8 | 1588 | """
M2Crypto utility routines.
Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.
Portions created by Open Source Applications Foundation (OSAF) are
Copyright (C) 2004 OSAF. All Rights Reserved.
"""
import sys
import m2
class UtilError(Exception): pass
m2.util_init(UtilError)
def... | agpl-3.0 |
ktnyt/chainer | tests/chainer_tests/links_tests/connection_tests/test_scale.py | 9 | 4443 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(
{'learn_W': True, 'bias_term': False, 'bias_shape':... | mit |
lukeiwanski/tensorflow-opencl | tensorflow/contrib/layers/__init__.py | 11 | 2919 | # 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 |
maheshakya/NearPy | nearpy/filters/uniquefilter.py | 2 | 1946 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Ole Krause-Sparmann
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | mit |
SlimKat-U8950/chil360-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 |
kutenai/django | django/urls/utils.py | 133 | 2229 | from __future__ import unicode_literals
from importlib import import_module
from django.core.exceptions import ViewDoesNotExist
from django.utils import lru_cache, six
from django.utils.module_loading import module_has_submodule
@lru_cache.lru_cache(maxsize=None)
def get_callable(lookup_view):
"""
Return a ... | bsd-3-clause |
mbiciunas/nix | src/config/config_scripts.py | 1 | 3091 | # Nix
# Copyright (c) 2017 Mark Biciunas.
#
# 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 distrib... | gpl-3.0 |
kurikuri99/xen_study | tools/python/xen/util/xmlrpcclient.py | 41 | 4533 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
sudovijay/youtube-dl | youtube_dl/downloader/fragment.py | 11 | 3696 | from __future__ import division, unicode_literals
import os
import time
from .common import FileDownloader
from .http import HttpFD
from ..utils import (
encodeFilename,
sanitize_open,
)
class HttpQuietDownloader(HttpFD):
def to_screen(self, *args, **kargs):
pass
class FragmentFD(FileDownloade... | unlicense |
partofthething/home-assistant | homeassistant/components/mobile_app/http_api.py | 1 | 3847 | """Provides an HTTP API for mobile_app."""
import secrets
from typing import Dict
from aiohttp.web import Request, Response
import emoji
from nacl.secret import SecretBox
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.http.data_validator import Reque... | mit |
udacity/gae-discourse-sso | example.py | 1 | 1068 | """
Example usage for using DiscourseSSOHandler:
- set SSO_SECRET to the same value as sso_secret from the Discourse settings
- setup DISCOURSE_URL
- set enable_sso in Discourse and set sso_url to http://localhost:8080/
"""
import sys
sys.path.insert(0, '..')
import discourse_sso
from google.appengine.api import user... | apache-2.0 |
dakcarto/QGIS | python/ext-libs/pygments/scanner.py | 365 | 3114 | # -*- coding: utf-8 -*-
"""
pygments.scanner
~~~~~~~~~~~~~~~~
This library implements a regex based scanner. Some languages
like Pascal are easy to parse but have some keywords that
depend on the context. Because of this it's impossible to lex
that just by using a regular expression lexer like ... | gpl-2.0 |
e0ne/python-brickagentclient | brickclient/utils.py | 1 | 9615 | # Copyright (c) 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 ... | apache-2.0 |
chicagopython/CodingWorkshops | problems/webdev/django_pn_tracker/django_pn_tracker/apps/challenges/models.py | 1 | 1614 | from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
class DateModelBase(models.Model):
# Learn about model fields:
# https://docs.djangoproject.com/en/2.1/ref/models/fields/
created_date = models.DateTimeField(auto_now_add=True)
modified_date = models.D... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.