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 |
|---|---|---|---|---|---|
horance-liu/tensorflow | tensorflow/python/keras/_impl/keras/datasets/__init__.py | 22 | 1349 | # Copyright 2017 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 |
eunchong/build | third_party/cherrypy/lib/auth_basic.py | 88 | 3416 | # This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
__doc__ = """This module provides a CherryPy 3.x tool which implements
the server-side of HTTP Basic Access Authentication, as described in :rfc:`2617`.
Example usage, using the built-in che... | bsd-3-clause |
zofuthan/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py | 74 | 6714 | import datetime
import random
import unittest
import uuid
from nose.plugins.attrib import attr
import mock
from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator
from xmodule.modulestore import ModuleStoreEnum
from xmodule.x_module import XModuleMixin
from xmodule.modulestore.inheritance import Inherita... | agpl-3.0 |
andreif/django | tests/sessions_tests/tests.py | 33 | 31244 | import base64
import os
import shutil
import string
import sys
import tempfile
import unittest
from datetime import timedelta
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.sessions.backends.cached_db import \
SessionStore as Cac... | bsd-3-clause |
newsages/nQTrucks | ntrain/puertoct/truck2/prep.py | 1 | 5615 | #!/usr/bin/python
import os
from PIL import Image
import uuid
import shutil
import sys
WIDTH=52
HEIGHT=13
COUNTRY='trucks2'
#WIDTH=52
#HEIGHT=13
#COUNTRY='eu'
#constants
OPENCV_DIR= '/usr/bin'
SAMPLE_CREATOR = OPENCV_DIR + '/opencv_createsamples'
BASE_DIR = './'
OUTPUT_DIR = BASE_DIR + "out... | gpl-3.0 |
joshblum/eeg-toolkit | webapp/webapp/server.py | 2 | 3878 | from flask import Flask
from flask import jsonify
from flask import render_template
from flask import request
import os
import csv
import simplejson as json
import regression
app = Flask(__name__)
PROFILE_FILENAME = 'profile-dump-{0}.csv'
# TODO: All of these should live in flask config.
# Are we running an expe... | mit |
Jobava/zamboni | mkt/files/tests/test_helpers.py | 4 | 11149 | # -*- coding: utf-8 -*-
import os
import re
import zipfile
from shutil import copyfileobj
from django import forms
from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import default_storage as storage
from django.core.urlresolvers import reverse
from mock import Mock, p... | bsd-3-clause |
bobobox/ansible | contrib/inventory/fleet.py | 56 | 3069 | #!/usr/bin/env python
"""
fleetctl base external inventory script. Automatically finds the IPs of the booted coreos instances and
returns it under the host group 'coreos'
"""
# Copyright (C) 2014 Andrew Rothstein <andrew.rothstein at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
... | gpl-3.0 |
marnnie/Cable-buenaventura | plugin.video.genesis/resources/lib/sources/mvsnap_mv_tv.py | 1 | 4444 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-2.0 |
QuLogic/iris | lib/iris/_constraints.py | 5 | 17145 | # (C) British Crown Copyright 2010 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris 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 the License, or
# (at your option) any l... | gpl-3.0 |
sandeepgupta2k4/tensorflow | tensorflow/contrib/bayesflow/python/ops/stochastic_variables.py | 103 | 6065 | # 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 |
cindyyu/kuma | vendor/packages/logilab/common/clcommands.py | 93 | 11237 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | mpl-2.0 |
prmtl/fuel-web | nailgun/nailgun/db/sqlalchemy/models/plugins.py | 2 | 2989 | # Copyright 2014 Mirantis, 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 ... | apache-2.0 |
micropython/micropython-esp32 | tests/extmod/utimeq1.py | 26 | 2884 | # Test for utimeq module which implements task queue with support for
# wraparound time (utime.ticks_ms() style).
try:
from utime import ticks_add, ticks_diff
from utimeq import utimeq
except ImportError:
print("SKIP")
raise SystemExit
DEBUG = 0
MAX = ticks_add(0, -1)
MODULO_HALF = MAX // 2 + 1
if DE... | mit |
sestrella/ansible | test/units/modules/network/f5/test_bigip_asm_policy_server_technology.py | 22 | 3691 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
sestrella/ansible | lib/ansible/modules/windows/win_command.py | 40 | 3974 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATIO... | gpl-3.0 |
metabrainz/botbot-web | botbot/apps/plugins/core/logger.py | 1 | 2002 | import re
from botbot.apps.logs.models import Log
from botbot_plugins.base import BasePlugin
import botbot_plugins.config as config
class Config(config.BaseConfig):
ignore_prefixes = config.Field(
default=["!-"],
required=False,
help_text="""
Specify a list of regular expressi... | mit |
MartinDelzant/scikit-learn | sklearn/linear_model/tests/test_coordinate_descent.py | 114 | 25281 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.utils.testing ... | bsd-3-clause |
pandeyadarsh/sympy | sympy/physics/mechanics/tests/test_linearize.py | 40 | 11621 | from __future__ import division
from sympy import symbols, Matrix, solve, simplify, cos, sin, atan, sqrt
from sympy.physics.mechanics import dynamicsymbols, ReferenceFrame, Point,\
dot, cross, inertia, KanesMethod, Particle, RigidBody, Lagrangian,\
LagrangesMethod
from sympy.utilities.pytest import slow
@slow... | bsd-3-clause |
Alwnikrotikz/pyglet | make.py | 13 | 1192 | #!/usr/bin/env python
from __future__ import print_function
import os
import os.path as op
import sys
import shutil
import inspect
import webbrowser
from subprocess import call, check_output
THIS_DIR = op.dirname(op.abspath(__file__))
DOC_DIR = op.join(THIS_DIR, 'doc')
def clean():
dirs = [op.join(DOC_DIR, '_buil... | bsd-3-clause |
astrofrog/numpy | numpy/oldnumeric/mlab.py | 13 | 3441 | # This module is for compatibility only. All functions are defined elsewhere.
__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle',
'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort',
'LinearAlgebra', 'RandomArray', 'prod', 'std', 'hamming', 'flipud',
... | bsd-3-clause |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-mac/lib-scriptpackages/SystemEvents/Processes_Suite.py | 80 | 7620 | """Suite Processes Suite: Terms and Events for controlling Processes
Level 1, version 1
Generated from /System/Library/CoreServices/System Events.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'prcs'
class Processes_Suite_Events:
pass
class application(aetool... | gpl-2.0 |
willingc/oh-mainline | vendor/packages/gdata/src/gdata/projecthosting/data.py | 120 | 3309 | #!/usr/bin/env python
#
# Copyright 2009 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 ... | agpl-3.0 |
rjoudrey/volatility | volatility/plugins/linux/dump_map.py | 58 | 3166 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
piotrek-golda/CivilHubCopy | maps/models.py | 2 | 2355 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.gis.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_... | gpl-3.0 |
daineseh/kodi-plugin.video.ted-talks-chinese | youtube_dl/extractor/twentytwotracks.py | 178 | 3212 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
# 22Tracks regularly replace the audio tracks that can be streamed on their
# site. The tracks usually expire after 1 months, so we can't add tests.
class TwentyTwoTracksIE(InfoExtractor):
_VALID... | gpl-2.0 |
RafaelTorrealba/odoo | addons/account/res_config.py | 200 | 25453 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
netpocket/webui | app/bower_components/js-beautify/python/jsbeautifier/__init__.py | 6 | 56788 | from __future__ import print_function
import sys
import os
import getopt
import re
import string
import errno
from jsbeautifier.__version__ import __version__
#
# The MIT License (MIT)
# Copyright (c) 2007-2013 Einar Lielmanis and contributors.
# Permission is hereby granted, free of charge, to any person
# obtainin... | bsd-2-clause |
evanmiltenburg/Dutch-corpora | overheid/scripts/make_xml_plain.py | 1 | 1350 | from bs4 import BeautifulSoup
import nltk.data
from nltk.tokenize import word_tokenize
import glob
import gzip
import sys
tokenizer = nltk.data.load('tokenizers/punkt/dutch.pickle')
def good_sentence(s):
if len(s) < 4 or s.count(',') > 4:
return False
else:
digits = filter(lambda x:x.isdigit()... | apache-2.0 |
ofermend/medicare-demo | socialite/jython/Lib/tempfile.py | 86 | 15003 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | apache-2.0 |
erikdejonge/newsrivr | daemons/oauth.py | 1 | 23551 | """
The MIT License
Copyright (c) 2007 Leah Culver
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, modify, merge, publis... | gpl-2.0 |
datapythonista/pandas | pandas/core/arrays/sparse/accessor.py | 2 | 11479 | """Sparse accessor"""
import numpy as np
from pandas.compat._optional import import_optional_dependency
from pandas.core.dtypes.cast import find_common_type
from pandas.core.accessor import (
PandasDelegate,
delegate_names,
)
from pandas.core.arrays.sparse.array import SparseArray
from pandas.core.arrays.sp... | bsd-3-clause |
daxxi13/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/freevideo.py | 147 | 1189 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError
class FreeVideoIE(InfoExtractor):
_VALID_URL = r'^http://www.freevideo.cz/vase-videa/(?P<id>[^.]+)\.html(?:$|[?#])'
_TEST = {
'url': 'http://www.freevideo.cz/vase-videa/vysukany-zadecek-22033... | gpl-3.0 |
no1seman/symmetricjsonrpc | examples/client_emulate.py | 2 | 1980 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set fileencoding=UTF-8 :
# python-symmetric-jsonrpc
# Copyright (C) 2009 Egil Moeller <redhog@redhog.org>
# Copyright (C) 2009 Nicklas Lindgren <nili@gulmohar.se>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GN... | lgpl-2.1 |
rvykydal/anaconda | pyanaconda/modules/storage/bootloader/base.py | 2 | 37489 | #
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be ... | gpl-2.0 |
prashanthr/wakatime | wakatime/packages/pygments_py3/pygments/styles/murphy.py | 135 | 2751 | # -*- coding: utf-8 -*-
"""
pygments.styles.murphy
~~~~~~~~~~~~~~~~~~~~~~
Murphy's style from CodeRay.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment,... | bsd-3-clause |
ifduyue/django | tests/template_tests/filter_tests/test_length_is.py | 161 | 3192 | from django.template.defaultfilters import length_is
from django.test import SimpleTestCase
from ..utils import setup
class LengthIsTests(SimpleTestCase):
@setup({'length_is01': '{% if some_list|length_is:"4" %}Four{% endif %}'})
def test_length_is01(self):
output = self.engine.render_to_string('len... | bsd-3-clause |
RCMRD/FloodMapsWorkshop | python/generate_image.py | 3 | 3643 | #!/usr/bin/env python
#
# This is to generate an OSM Water Reference Image
# This is based on Mapnik code
# This code has been seriously hacked by Pat Cappealere pat@cappelaere.con
#
import mapnik
import sys, os
import argparse
merc = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0... | apache-2.0 |
nkalodimas/invenio | modules/bibsched/lib/bibtask.py | 1 | 50380 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 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
## ... | gpl-2.0 |
0xPr0xy/speedtest-cli | speedtest_cli.py | 5 | 20936 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2014 Matt Martz
# 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.or... | apache-2.0 |
alanmcruickshank/superset-dev | superset/connectors/druid/models.py | 1 | 45334 | # pylint: disable=invalid-unary-operand-type
from collections import OrderedDict
from copy import deepcopy
from datetime import datetime, timedelta
import json
import logging
from multiprocessing import Pool
from dateutil.parser import parse as dparse
from flask import escape, Markup
from flask_appbuilder import Model... | apache-2.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/django/contrib/gis/gdal/tests/test_ds.py | 233 | 10504 | import os, os.path, unittest
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS
# List of acceptable data sources.... | bsd-3-clause |
aral/isvat | django/contrib/gis/gdal/envelope.py | 221 | 7049 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | mit |
DualSpark/ansible | contrib/inventory/openstack.py | 65 | 5631 | #!/usr/bin/env python
# Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
# Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com>
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-3.0 |
shsdev/khclass | khclarifai/khclarifai_predict.py | 1 | 1302 | #!/usr/bin/env python
# coding=UTF-8
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from math import floor
from clarifai.rest import ClarifaiApp
from config.configuration import data_path, test_set_id, clarifai_api_key, clarifai_model_name
def floored_percentage(val, digits):
... | gpl-3.0 |
ceache/treadmill | lib/python/treadmill/spawn/instance.py | 2 | 1778 | """An individual treadmill spawn instance.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import logging
import os
from treadmill.spawn import utils as spawn_utils
from treadmill import yamlwrapper as ... | apache-2.0 |
h2g2bob/ynmp-wikipedia-sync | chgparty_dot.py | 1 | 5461 | import csv
from collections import defaultdict
from collections import namedtuple
class Pty(object):
def __init__(self, ynmp, name, rank=3, color="white"):
self.ynmp = ynmp
self.name = name.replace('"', '').replace("'", "")
self.rank = rank
self.color = color
self.code = "".join(x for x in self.ynmp if x.is... | agpl-3.0 |
scith/htpc-manager_ynh | sources/libs/formencode/rewritingparser.py | 11 | 5021 |
import cgi
import HTMLParser
import re
from htmlentitydefs import name2codepoint
def html_quote(v):
if v is None:
return ''
elif hasattr(v, '__html__'):
return v.__html__()
elif isinstance(v, basestring):
return cgi.escape(v, 1)
else:
if hasattr(v, '__unicode__'):
... | gpl-3.0 |
gautamMalu/rootfs_xen_arndale | usr/lib/python3/dist-packages/apt/package.py | 4 | 42811 | # package.py - apt package abstraction
#
# Copyright (c) 2005-2009 Canonical
#
# Author: Michael Vogt <michael.vogt@ubuntu.com>
#
# 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 vers... | gpl-2.0 |
waytai/networkx | networkx/algorithms/graphical.py | 30 | 12990 | # -*- coding: utf-8 -*-
"""Test sequences for graphiness.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from collections import defaultdict
import heapq
import networkx as nx
_... | bsd-3-clause |
DavidLP/home-assistant | tests/components/yr/test_sensor.py | 8 | 4105 | """The tests for the Yr sensor platform."""
import asyncio
from datetime import datetime
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
import homeassistant.util.dt as dt_util
from tests.common import assert_setup_component, load_fixture
NOW = datetime(2016, 6, 9, 1, tzinfo... | apache-2.0 |
emidln/django_roa | env/lib/python2.7/site-packages/django/contrib/gis/feeds.py | 327 | 5925 | from django.contrib.syndication.feeds import Feed as BaseFeed, FeedDoesNotExist
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C Geo elements.
"""
... | bsd-3-clause |
repotvsupertuga/tvsupertuga.repository | plugin.video.TVsupertuga/resources/lib/plugins/unidecode/x021.py | 21 | 4012 | data = (
' a/c ', # 0x00
' a/s ', # 0x01
'C', # 0x02
'', # 0x03
'', # 0x04
' c/o ', # 0x05
' c/u ', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'g', # 0x0a
'H', # 0x0b
'H', # 0x0c
'H', # 0x0d
'h', # 0x0e
'', # 0x0f
'I', # 0x10
'I', # 0x11
'L', # 0x12
'l', # 0x13
'... | gpl-2.0 |
Richard-Mathie/cassandra_benchmark | vendor/github.com/datastax/python-driver/cassandra/connection.py | 2 | 42031 | # Copyright 2013-2016 DataStax, 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 writi... | apache-2.0 |
edx-solutions/edx-platform | openedx/core/djangoapps/content/course_overviews/admin.py | 9 | 2505 | """
Django admin page for CourseOverviews, the basic metadata about a course that
is used in user dashboard queries and other places where you need info like
name, and start dates, but don't actually need to crawl into course content.
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib imp... | agpl-3.0 |
fzheng/codejam | lib/python2.7/site-packages/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | mit |
underyx/TheMajorNews | main.py | 1 | 2711 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import config
import requests
from requests_oauthlib import OAuth1
from base64 import b64encode
def get_access_token():
token = config.twitter_app_key + ':' + config.twitter_app_secret
h = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
... | mit |
meerkat-code/meerkat_frontend | meerkat_frontend/views/homepage.py | 1 | 5469 | """
homepage.py
A Flask Blueprint module for the homepage.
"""
from flask import Blueprint, render_template, current_app, g
from flask import request, make_response, redirect, flash, abort
from flask_babel import gettext
from meerkat_frontend import app, auth
from meerkat_frontend import common as c
from meerkat_front... | mit |
nataddrho/DigiCue-USB | Python3/src/venv/Lib/site-packages/pip/_vendor/chardet/langbulgarianmodel.py | 7 | 105697 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pip._vendor.chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
BULGARIAN_LANG_MODEL = {
63: { # 'e'
63: 1, # 'e'
45: 0, # '\xad'
31: 0, # 'А'
32: 0, # 'Б'
35: ... | mit |
teodoc/home-assistant | homeassistant/components/sensor/forecast.py | 4 | 7264 | """
homeassistant.components.sensor.forecast
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Forecast.io service.
Configuration:
To use the Forecast sensor you will need to add something like the
following to your config/configuration.yaml
sensor:
platform: forecast
api_key: YOUR_APP_KEY
monitored_conditions:
- ... | mit |
hunse/vrep-python | dvs-play.py | 1 | 1515 | """
Play DVS events in real time
TODO: deal with looping event times for recordings > 65 s
"""
import numpy as np
import matplotlib.pyplot as plt
import dvs
def close(a, b, atol=1e-8, rtol=1e-5):
return np.abs(a - b) < atol + rtol * b
def imshow(image, ax=None):
ax = plt.gca() if ax is None else ax
ax.i... | gpl-2.0 |
csmart/hostboot | src/build/simics/hb-pnor-vpd-preload.py | 3 | 1608 | # IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/build/simics/hb-pnor-vpd-preload.py $
#
# OpenPOWER HostBoot Project
#
# COPYRIGHT International Business Machines Corp. 2012,2014
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | apache-2.0 |
jasonmaier/CircularEconomyBlog | db_repository/versions/013_migration.py | 1 | 1155 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
tasks = Table('tasks', pre_meta,
Column('id', INTEGER, primary_key=True, nullable=False),
Column('priority', INTEGER, nullable=False),
Column('user_id', INTEGER),
Column('ta... | bsd-3-clause |
JPMoresmau/aifh | vol1/python-examples/lib/aifh/rbf.py | 4 | 2779 | """
Artificial Intelligence for Humans
Volume 1: Fundamental Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by Jeff Heaton
Licensed under the Apache License, Version 2.0 (the "License");
... | apache-2.0 |
mtesauro/gauntlt-demo | examples/webgoat/vuln-19/attack.py | 2 | 1077 | import requests
import json
import sys
base_url = "http://127.0.0.1:8080/WebGoat/"
#Creates a new session, logs into the server.
sess = requests.Session()
login = {'username': 'guest', 'password': 'guest'}
resp = sess.post(base_url + "j_spring_security_check", data=login)
resp = sess.get(base_url + "service/lessonme... | mit |
ludia/moto | tests/test_ec2/test_regions.py | 14 | 4862 | from __future__ import unicode_literals
import boto.ec2
import boto.ec2.autoscale
import sure
from moto import mock_ec2, mock_autoscaling
def add_servers_to_region(ami_id, count, region):
conn = boto.ec2.connect_to_region(region)
for index in range(count):
conn.run_instances(ami_id)
@mock_ec2
def te... | apache-2.0 |
jmighion/ansible | lib/ansible/plugins/callback/minimal.py | 57 | 3060 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
... | gpl-3.0 |
flycheck/flycheck | doc/info.py | 3 | 6521 | # Copyright (C) 2016 Sebastian Wiesner and Flycheck contributors
# This file is not part of GNU Emacs.
# 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 y... | gpl-3.0 |
mrb/letsencrypt | acme/acme/jose/interfaces.py | 46 | 7771 | """JOSE interfaces."""
import abc
import collections
import json
import six
from acme.jose import errors
from acme.jose import util
# pylint: disable=no-self-argument,no-method-argument,no-init,inherit-non-class
# pylint: disable=too-few-public-methods
@six.add_metaclass(abc.ABCMeta)
class JSONDeSerializable(objec... | apache-2.0 |
kennedyshead/home-assistant | homeassistant/components/kulersky/light.py | 2 | 5988 | """Kuler Sky light platform."""
from __future__ import annotations
from datetime import timedelta
import logging
import pykulersky
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_WHITE_VALUE,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_WHITE_VALUE,
LightEn... | apache-2.0 |
Barmaley-exe/scikit-learn | sklearn/metrics/cluster/tests/test_bicluster.py | 394 | 1770 | """Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils.testing import assert_equal, assert_almost_equal
from sklearn.metrics.cluster.bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([T... | bsd-3-clause |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | mit |
dwaiter/django-filebrowser-old | filebrowser/base.py | 1 | 5606 | # coding: utf-8
# imports
import os, re, datetime
from time import gmtime, strftime
# django imports
from django.conf import settings
# filebrowser imports
from filebrowser.settings import *
from filebrowser.functions import get_file_type, url_join, is_selectable, get_version_path
# PIL import
if STRICT_PIL:
fr... | bsd-3-clause |
Firedroid/android_kernel_lge_g3 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
frankrousseau/weboob | contrib/plugin.video.videoobmc/resources/lib/base/common_xbmc.py | 9 | 4641 | # -*- coding: utf-8 -*-
from __future__ import print_function
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import urllib
import sys
from traceback import print_exc
def get_addon():
if hasattr(sys.modules["__main__"], "addon_id"):
_id = sys.modules["__main__"].addon_id
return xb... | agpl-3.0 |
ytoyama/yans_chainer_hackathon | examples/modelzoo/download_model.py | 28 | 1047 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import six
parser = argparse.ArgumentParser(
description='Download a Caffe reference model')
parser.add_argument('model_type', choices=('alexnet', 'caffenet', 'googlenet'),
help='Model type (alexnet, caffenet, googlen... | mit |
tuxfux-hlp-notes/python-batches | archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/contrib/gis/sitemaps/views.py | 82 | 2239 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExist
from django.db import DEFAULT_DB_ALIAS, connections
from django.h... | gpl-3.0 |
capchu/TextRPGOnline | rpgonline/env/lib/python2.7/site-packages/setuptools/dist.py | 65 | 32132 | __all__ = ['Distribution']
import re
import sys
from distutils.core import Distribution as _Distribution
from setuptools.depends import Require
from setuptools.command.install import install
from setuptools.command.sdist import sdist
from setuptools.command.install_lib import install_lib
from setuptools.compat import ... | gpl-3.0 |
ClydeSpace-GroundStation/GroundStation | Utilities/Supporting_Libraries/gr-ec/docs/doxygen/doxyxml/doxyindex.py | 223 | 6551 | #
# Copyright 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 option)
# any later version.
#
#... | mit |
hvy/chainer | tests/chainermn_tests/functions_tests/test_collective_communication.py | 5 | 8507 | import chainer
import chainer.testing
import chainer.testing.attr
import numpy
import pytest
import chainermn
import chainermn.functions
class Param(object):
def __init__(self, param):
self.dtype = None
self.__dict__.update(param)
params = [Param(p) for p in [
{
'dtype': numpy.float... | mit |
jayceyxc/hue | desktop/core/ext-py/boto-2.42.0/boto/mws/__init__.py | 429 | 1101 | # Copyright (c) 2008, Chris Moyer http://coredumped.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, modify, ... | apache-2.0 |
DarkFenX/Pyfa | service/conversions/releaseFeb2020.py | 2 | 1405 | """
Conversion pack for February 2020 release
"""
CONVERSIONS = {
# Renamed items
"Small Asymmetric Remote Capacitor Transmitter": "Small Radiative Scoped Remote Capacitor Transmitter",
"Small 'Regard' Remote Capacitor Transmitter": "Small Inductive Compact Remote Capacitor Transmitter",
"Medium Asymme... | gpl-3.0 |
Danielweber7624/pybuilder | src/unittest/python/plugins/python/test_plugin_helper_tests.py | 7 | 3292 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... | apache-2.0 |
zsiciarz/django | tests/urlpatterns_reverse/test_localeregexprovider.py | 39 | 2415 | import os
from unittest import mock
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, override_settings
from django.urls import LocaleRegexProvider
from django.urls.resolvers import LocaleRegexDescriptor
from django.utils import translation
here = os.path.dirname(os.path.... | bsd-3-clause |
mbrukman/libcloud | libcloud/compute/drivers/hostvirtual.py | 25 | 13868 | # 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 use ... | apache-2.0 |
yangming85/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/utils/dateformat.py | 51 | 5778 | from datetime import datetime, date
import os
import time
from django.utils.dateformat import format
from django.utils import dateformat, translation, unittest
from django.utils.tzinfo import FixedOffset, LocalTimezone
class DateFormatTests(unittest.TestCase):
def setUp(self):
self.old_TZ = os.environ.ge... | gpl-3.0 |
indictranstech/reciphergroup-frappe | frappe/utils/jinja.py | 9 | 4026 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
def get_jenv():
import frappe
if not frappe.local.jenv:
from jinja2 import Environment, DebugUndefined
# frappe will be loaded last, so app templates will get precedence
... | mit |
zinic/chuckbox | src/chuckbox/project.py | 2 | 1241 | import os
import importlib
import chuckbox.log as log
_LOG = log.get_logger(__name__)
class MissingResourceError(Exception):
pass
class PackageManifest(object):
def __init__(self, name, module):
self.name = name
self._module = module
def find(self, relative):
return FindResou... | mit |
jmanuel1/GitSavvy | core/commands/push.py | 2 | 6943 | import sublime
from sublime_plugin import WindowCommand
from ..git_command import GitCommand
from ...common import util
NO_REMOTES_MESSAGE = "You have not configured any remotes."
START_PUSH_MESSAGE = "Starting push..."
END_PUSH_MESSAGE = "Push complete."
PUSH_TO_BRANCH_NAME_PROMPT = "Enter remote branch name:"
SET_... | mit |
AnimeshSinha1309/Website-Edunet | WebsiteEdunet/env/Lib/site-packages/pip/vcs/subversion.py | 280 | 10468 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile... | mit |
thingsboard/thingsboard-gateway | thingsboard_gateway/extensions/mqtt/custom_mqtt_uplink_converter.py | 1 | 2643 | # Copyright 2021. ThingsBoard
#
# 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 ... | apache-2.0 |
derekjchow/models | research/object_detection/utils/label_map_util_test.py | 1 | 9044 | # Copyright 2017 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 |
Srisai85/scikit-learn | examples/covariance/plot_sparse_cov.py | 300 | 5078 | """
======================================
Sparse inverse covariance estimation
======================================
Using the GraphLasso estimator to learn a covariance and sparse precision
from a small number of samples.
To estimate a probabilistic model (e.g. a Gaussian model), estimating the
precision matrix, t... | bsd-3-clause |
shaufi/odoo | addons/web/static/lib/py.js/doc/conf.py | 543 | 7829 | # -*- coding: utf-8 -*-
#
# py.js documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 9 19:36:23 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | agpl-3.0 |
Fokko/druid | distribution/bin/generate-license-dependency-reports.py | 13 | 5043 | #!/usr/bin/env python3
# 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 "Lic... | apache-2.0 |
thedep2/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/thesixtyone.py | 40 | 2986 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import unified_strdate
class TheSixtyOneIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?thesixtyone\.com/
(?:.*?/)*
(?:
s|
song/comments... | gpl-3.0 |
FusionSP/android_external_chromium_org | tools/update_reference_build.py | 41 | 10057 | #!/usr/bin/env python
#
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Updates the Chrome reference builds.
Before running this script, you should first verify that you are authenticated
for SVN. ... | bsd-3-clause |
iotile/coretools | iotilesensorgraph/test/test_datastream.py | 1 | 8473 | """Tests for DataStream objects."""
import pytest
from iotile.core.exceptions import InternalError
from iotile.sg import DataStream, DataStreamSelector
def test_stream_type_parsing():
"""Make sure we can parse each type of stream."""
# Make sure parsing stream type works
stream = DataStream.FromString('... | gpl-3.0 |
petterreinholdtsen/cinelerra-hv | thirdparty/OpenCV-2.3.1/doc/pattern_tools/svgfig.py | 2 | 151675 | # svgfig.py copyright (C) 2008 Jim Pivarski <jpivarski@gmail.com>
#
# 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 the License, or (at your option) any later version.
#
# ... | gpl-2.0 |
zulip/django | django/db/utils.py | 192 | 11323 | import inspect
import os
import pkgutil
import warnings
from importlib import import_module
from threading import local
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils._os import npath, upath
from django.utils.deprecation import Re... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.