repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jwiggins/scikit-image | doc/examples/features_detection/plot_corner.py | 34 | 1160 | """
================
Corner detection
================
Detect corner points using the Harris corner detector and determine subpixel
position of corners.
.. [1] http://en.wikipedia.org/wiki/Corner_detection
.. [2] http://en.wikipedia.org/wiki/Interest_point_detection
"""
from matplotlib import pyplot as plt
from ski... | bsd-3-clause |
c-o-m-m-a-n-d-e-r/CouchPotatoServer | couchpotato/core/media/movie/providers/automation/popularmovies.py | 17 | 1465 | from couchpotato import fireEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.media.movie.providers.automation.base import Automation
log = CPLog(__name__)
autoload = 'PopularMovies'
class PopularMovies(Automation):
interval = 1800
url = 'https://s3.amazonaws.com/popular-movies/movies.j... | gpl-3.0 |
lanhel/pyzombie | pyzombied.py | 1 | 5754 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
"""
**Name**
pyzombied — Start pyzombie server.
**Synopsis**
``pyzombied.py [options]``
**Description**
The ``pyzombied.py`` command shall start the *pyzombie* HTTP RESTful
se... | apache-2.0 |
siddhika1889/Pydev-Editor | pysrc/third_party/pep8/lib2to3/lib2to3/fixes/fix_paren.py | 327 | 1228 | """Fixer that addes parentheses where they are required
This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""
# By Taek Joo Kim and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import LParen, RParen
# XXX This doesn't support nested for loops like [x for x in 1, 2 for x... | epl-1.0 |
shahbazn/neutron | neutron/db/l3_hascheduler_db.py | 46 | 3407 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 |
yencarnacion/jaikuengine | .google_appengine/google/appengine/ext/mapreduce/model.py | 2 | 42490 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | apache-2.0 |
ambikeshwar1991/gnuradio | gr-blocks/python/qa_stretch.py | 8 | 2110 | #!/usr/bin/env python
#
# Copyright 2013 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)
# ... | gpl-3.0 |
tritanium-industries/TITDev | main.py | 2 | 8432 | import os
import json
from flask import render_template, g, session, redirect, url_for, request
# noinspection PyPackageRequirements
from bson.objectid import ObjectId
from app import app, app_mongo, cdn_theme_url, app_redis
from views.navigation import Navigation
from views.auth import auth
from views.jump_freighte... | mit |
tuxfux-hlp-notes/python-batches | archieves/batch-57/modules/sheets/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/optionaltags.py | 354 | 10534 | from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... | gpl-3.0 |
mantidproject/mantid | qt/applications/workbench/workbench/plotting/plotscriptgenerator/figure.py | 3 | 2056 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
FokkeZB/titanium_mobile | support/common/markdown/blockprocessors.py | 109 | 17773 | """
CORE MARKDOWN BLOCKPARSER
=============================================================================
This parser handles basic parsing of Markdown blocks. It doesn't concern itself
with inline elements such as **bold** or *italics*, but rather just catches
blocks, lists, quotes, etc.
The BlockParser is made ... | apache-2.0 |
qutebrowser/qutebrowser | tests/unit/commands/test_argparser.py | 2 | 5136 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
podhub-io/teastore | setup.py | 1 | 1130 | #!/usr/bin/env python
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='p... | mit |
varunarya10/contrail-generateDS | process_includes.py | 5 | 11480 | #!/usr/bin/env python
"""
python %prog [options] <in_schema.xsd> <out_schema.xsd>
Synopsis:
Prepare schema document. Replace include and import elements.
Examples:
python %prog myschema.xsd
python %prog myschema.xsd newschema.xsd
python %prog -f myschema.xsd newschema.xsd
cat infile.xsd | pyth... | mit |
frankk00/realtor | gdata/books/__init__.py | 124 | 18532 | #!/usr/bin/python
"""
Data Models for books.service
All classes can be instantiated from an xml string using their FromString
class method.
Notes:
* Book.title displays the first dc:title because the returned XML
repeats that datum as atom:title.
There is an undocumented gbs:ope... | bsd-3-clause |
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/requests/compat.py | 30 | 1941 | # -*- coding: utf-8 -*-
"""
requests.compat
~~~~~~~~~~~~~~~
This module handles import compatibility issues between Python 2 and
Python 3.
"""
from pip._vendor import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is... | apache-2.0 |
DataDog/kafka-python | kafka/coordinator/heartbeat.py | 8 | 2304 | from __future__ import absolute_import, division
import copy
import time
class Heartbeat(object):
DEFAULT_CONFIG = {
'group_id': None,
'heartbeat_interval_ms': 3000,
'session_timeout_ms': 10000,
'max_poll_interval_ms': 300000,
'retry_backoff_ms': 100,
}
def __init... | apache-2.0 |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py | 125 | 6584 | # 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... | gpl-3.0 |
lz1988/django-web2015 | build/lib/django/contrib/gis/db/backends/oracle/introspection.py | 119 | 1779 | import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY,
# but it is the only o... | bsd-2-clause |
CDSFinance/zipline | zipline/data/benchmarks.py | 33 | 4096 | #
# Copyright 2013 Quantopian, 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 wr... | apache-2.0 |
halfak/Measuring-the-impact-of-GettingStarted | gs/daily_tagged_edits.py | 1 | 2083 | import argparse, sys, datetime
from menagerie.formatting import tsv
from . import database
def read_wikis(f):
if not f.isatty():
return list(row.wiki_db for row in tsv.Reader(f))
def main():
parser = argparse.ArgumentParser(
description = """
Gathers a set of daily edit counts for a tag across a set of... | mit |
AOSP-S4-KK/platform_external_chromium_org | chrome/browser/nacl_host/test/debug_stub_browser_tests.py | 97 | 3312 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import sys
import xml.etree.ElementTree
import gdb_rsp
def GetTargetArch(connection):
"""Get the CPU architecture of the NaCl application.... | bsd-3-clause |
doumadou/oms | oms/urls.py | 12 | 2064 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
# import views
from asset.views import *
from oms.views import index
from installed.views import system_install_managed,system_install_list,system_install,system_install_record
from deploy.... | gpl-2.0 |
Mhynlo/SickRage | lib/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(... | gpl-3.0 |
htwenhe/DJOA | env/Lib/site-packages/django/db/backends/mysql/features.py | 176 | 2682 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
update_can_self_select = False
... | mit |
jamesob/bitcoin | test/functional/feature_blocksdir.py | 45 | 1674 | #!/usr/bin/env python3
# Copyright (c) 2018-2019 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 blocksdir option.
"""
import os
import shutil
from test_framework.test_framework import Bitc... | mit |
40223105/w17test | static/Brython3.1.1-20150328-091302/Lib/_sre.py | 622 | 51369 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... | gpl-3.0 |
aminorex/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/rdf.py | 9 | 3095 | # Natural Language Toolkit: Generating RDF Triples from NL Relations
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This code shows how relational information extracted from text
can be converted into an RDF Graph.
"""
from nltk.sem.relextract im... | gpl-3.0 |
chrisguidry/django-rest-resources | resources/__init__.py | 1 | 11456 | from datetime import datetime
import httplib
import json
from time import mktime
from django.http import HttpResponse
from django.template import Context
try:
from django.views.decorators.vary import vary_on_headers
except ImportError:
def vary_on_headers(*args):
"""A no-op vary_on_headers decorator f... | mit |
Onirik79/aaritmud | src/commands/command_snoopers.py | 1 | 2549 | # -*- coding: utf-8 -*-
#= IMPORT ======================================================================
from src.command import get_command_syntax
from src.database import database
from src.enums import TRUST
from src.log import log
#= FUNZIONI =============================================================... | gpl-2.0 |
Work4Labs/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/tests/distapp/models.py | 406 | 1832 | from django.contrib.gis.db import models
class SouthTexasCity(models.Model):
"City model on projected coordinate system for South Texas."
name = models.CharField(max_length=30)
point = models.PointField(srid=32140)
objects = models.GeoManager()
def __unicode__(self): return self.name
class SouthTe... | gpl-3.0 |
wkubiak/grpc | src/python/src/grpc/framework/face/testing/control.py | 47 | 3057 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
lsaffre/lino | lino/setup_info.py | 1 | 7681 | # -*- coding: UTF-8 -*-
# Copyright 2009-2019 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
# Note that this module may not have a docstring because any
# global variable defined here will override the global
# namespace of lino/__init__.py who includes it with execfile.
# This module is part of the Li... | bsd-2-clause |
daviddesancho/RepeatDesigner | examples/simple_design.py | 1 | 2062 | #!/usr/bin/env python
# # Villin simple design
# Here we attempt to do the simplest possible modelling, which just tries to introduce
# new side chains at random that improve the total energy. We use the simple villin
# headpiece subdomain as an example. The more advanced usage designed for repeat
# proteins are no... | lgpl-3.0 |
davidwaroquiers/pymatgen | pymatgen/analysis/dimensionality.py | 5 | 22027 | """
This module provides functions to get the dimensionality of a structure.
A number of different algorithms are implemented. These are based on the
following publications:
get_dimensionality_larsen:
- P. M. Larsen, M. Pandey, M. Strange, K. W. Jacobsen. Definition of a
scoring parameter to identify low-dimens... | mit |
geosolutions-it/geonode | geonode/proxy/templatetags/proxy_lib_tags.py | 4 | 2501 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2019 OSGeo
#
# 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 ... | gpl-3.0 |
hpcloud-mon/tempest | tempest/scenario/test_volume_boot_pattern.py | 3 | 8258 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
eestay/edx-platform | lms/djangoapps/course_wiki/middleware.py | 35 | 4983 | """Middleware for course_wiki"""
from urlparse import urlparse
from django.conf import settings
from django.http import Http404
from django.shortcuts import redirect
from django.core.exceptions import PermissionDenied
from wiki.models import reverse
from courseware.courses import get_course_with_access
from courseware... | agpl-3.0 |
mpvoss/RickAndMortyWeatherTweets | env/lib/python3.5/site-packages/oauthlib/oauth2/rfc6749/endpoints/revocation.py | 51 | 5505 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.endpoint.revocation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the OAuth 2 `Token Revocation`_ spec (draft 11).
.. _`Token Revocation`: http://tools.ietf.org/html/draft-ietf-oauth-revocation-11
"""
from __future__ import absolute_import, unicod... | mit |
iansf/engine | sky/tools/webkitpy/layout_tests/models/test_configuration.py | 59 | 13691 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
joelby/heroku-buildpack-python-scikit-learn-git | vendor/pip-1.3.1/pip/req.py | 63 | 70057 | from email.parser import FeedParser
import os
import imp
import pkg_resources
import re
import sys
import shutil
import tempfile
import zipfile
from distutils.util import change_root
from pip.locations import bin_py, running_under_virtualenv
from pip.exceptions import (InstallationError, UninstallationError,
... | mit |
liaoyuke/EECS542_Final_Project_VQA | code/concept_extraction/lib/en/parser/nltk_lite/draw/tree.py | 9 | 37545 | # Natural Language Toolkit: Graphical Representations for Trees
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: tree.py 3667 2006-11-02 23:28:44Z stevenbird $
"""
Graphically d... | mit |
JioCloud/oslo.db | oslo/db/sqlalchemy/models.py | 3 | 4146 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012 Cloudscaling Group, Inc.
# All Rights Reserved.
#
# Licens... | apache-2.0 |
dingocuster/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_scalability.py | 225 | 5719 | """
============================================
Scalability of Approximate Nearest Neighbors
============================================
This example studies the scalability profile of approximate 10-neighbors
queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200``
when varying the number of sa... | bsd-3-clause |
blinktrade/bitex | libs/ws4py/client/threadedclient.py | 9 | 2480 | # -*- coding: utf-8 -*-
import threading
from ws4py.client import WebSocketBaseClient
__all__ = ['WebSocketClient']
class WebSocketClient(WebSocketBaseClient):
def __init__(self, url, protocols=None, extensions=None, heartbeat_freq=None):
"""
.. code-block:: python
from ws4py.client.t... | gpl-3.0 |
stonebig/numba | numba/tests/test_sets.py | 5 | 22011 | import unittest
from collections import namedtuple
import contextlib
import itertools
import math
import random
import sys
import numpy as np
from numba.core.compiler import compile_isolated, Flags, errors
from numba import jit
from numba.core import types
import unittest
from numba.tests.support import (TestCase, e... | bsd-2-clause |
lethe3000/fabric-bolt | fabric_bolt/web_hooks/client.py | 13 | 2487 | # Copyright (c) 2012 Zapier LLC.
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is
# hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRA... | mit |
yoyojacky/upm | examples/python/waterlevel.py | 17 | 1902 | #!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 limi... | mit |
jresendiz27/PatternRecognition | Python/WebModule/MathModule/MathModule/views.py | 2 | 1104 | __author__ = 'alberto'
from django.http import HttpResponse
#import Image
from django.shortcuts import render
'''
import Image
import matplotlib.pyplot as plt
from scipy import misc
jpegImage = Image.open("/home/alberto/Downloads/WP_001922.jpg")
print jpegImage.bits, jpegImage.size, jpegImage.format
print "\nok"
pri... | gpl-2.0 |
TalShafir/ansible | lib/ansible/modules/cloud/vmware/vmware_vmkernel_ip_config.py | 41 | 3638 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.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
ANSIBLE_METADATA = {'metadata_version'... | gpl-3.0 |
StefanRijnhart/OpenUpgrade | addons/account_check_writing/account.py | 379 | 2032 | # -*- 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 |
SystemsBioinformatics/cbmpy | cbmpy/fluxmodules/matroid.py | 1 | 38983 | """
CBMPy: fluxmodules matroid module
=====================
PySCeS Constraint Based Modelling (http://cbmpy.sourceforge.net)
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 Li... | gpl-3.0 |
Multimac/ansible-modules-extras | notification/sendgrid.py | 58 | 4699 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@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 ... | gpl-3.0 |
alimony/django | tests/generic_views/test_edit.py | 31 | 18148 | from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, TestCase, override_settings
from django.test.client import RequestFactory
from django.urls import reverse
from django.views.generic.base import View
from django.views.generic.edit import CreateView, ... | bsd-3-clause |
o1dnik/flaskapp-microblog-test | db_repository/versions/003_migration.py | 31 | 1047 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
user = Table('user', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('nickname', String(length=64)),
Column('email', String(length=120)),
Column('... | bsd-3-clause |
ciex/motor | lib/flask/templating.py | 783 | 4707 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | apache-2.0 |
40223227/w16b_test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/event.py | 603 | 19086 | #!/usr/bin/env python
'''Pygame module for interacting with events and queues.
Pygame handles all it's event messaging through an event queue. The routines
in this module help you manage that event queue. The input queue is heavily
dependent on the pygame display module. If the display has not been
initialized and a ... | gpl-3.0 |
sergiopasra/numina | numina/user/tests/test_cli_show_recipes.py | 3 | 10288 |
import pkgutil
import numina.drps
import numina.drps.drpbase
import numina.core.pipelineload as pload
from ..cli import main
drpdata1 = pkgutil.get_data('numina.drps.tests', 'drptest1.yaml')
drpdata2 = pkgutil.get_data('numina.drps.tests', 'drptest2.yaml')
# def test_show_recipes(capsys, monkeypatch):
def test_s... | gpl-3.0 |
markwang2764/sku | node_modules/.3.5.0@node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | 23354 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit |
soulaklabs/tofbot | plugins/lolrate.py | 2 | 3713 | # -*- coding: utf-8 -*-
#
# This file is part of tofbot, a friendly IRC bot.
# You may redistribute it under the Simplified BSD License.
# If we meet some day, and you think this stuff is worth it,
# you can buy us a beer in return.
#
# Copyright (c) 2011 Etienne Millon <etienne.millon@gmail.com>
# Q... | bsd-2-clause |
GenericStudent/home-assistant | homeassistant/components/acmeda/sensor.py | 10 | 1317 | """Support for Acmeda Roller Blind Batteries."""
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .base import AcmedaBase
from .const import ACMEDA_HUB_UPDATE, DOMAIN
from .helpers import ... | apache-2.0 |
joram/sickbeard-orange | lib/unidecode/x0c9.py | 253 | 4722 | data = (
'jun', # 0x00
'junj', # 0x01
'junh', # 0x02
'jud', # 0x03
'jul', # 0x04
'julg', # 0x05
'julm', # 0x06
'julb', # 0x07
'juls', # 0x08
'jult', # 0x09
'julp', # 0x0a
'julh', # 0x0b
'jum', # 0x0c
'jub', # 0x0d
'jubs', # 0x0e
'jus', # 0x0f
'juss', # 0x10
'jung', ... | gpl-3.0 |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_prune.py | 2 | 37269 | # Copyright (c) 2019 PaddlePaddle 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 app... | apache-2.0 |
kayone/Wox | PythonHome/Lib/site-packages/pip/_vendor/html5lib/treewalkers/_base.py | 310 | 6919 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
import gettext
_ = gettext.gettext
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE = Node.DOCUMENT_TYPE_NODE
TEXT = Node.TEXT_NODE
ELEMENT = Node.ELEMENT_NODE
COMMENT = Node.COMMENT_N... | mit |
gudcjfdldu/volatility | volatility/win32/hive.py | 44 | 10034 | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# 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... | gpl-2.0 |
sgraham/nope | tools/grit/grit/gather/txt.py | 62 | 1175 | #!/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.
'''Supports making amessage from a text file.
'''
from grit.gather import interface
from grit import tclib
class TxtFile(interfa... | bsd-3-clause |
geandersonlenz/Quimera | array_and_matrix_functions_basic.py | 1 | 2148 | from __future__ import division
from __future__ import print_function
import sys
from pylab import *
from numpy import *
# End Imports
x = arange(5)
type(x)
x.view(matrix)
x.view(recarray)
x = array([[1,2],[3,4]])
x * x # Element-by-element
mat(x) * mat(x) # Matrix multiplication
x = rand... | mit |
Cajoline/mezzanine | mezzanine/forms/models.py | 23 | 4797 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.fields import RichTextField
from mezzanine.core.models import Orderable, Ri... | bsd-2-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.3.0/Lib/bisect.py | 1261 | 2595 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | mit |
mrbox/django | tests/generic_views/test_list.py | 309 | 12129 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.utils.encoding import force_str
from django.views.generic.base import View
from .models import Artist, Author, Book, ... | bsd-3-clause |
tribeiro/chimera | src/chimera/util/catalogs/ucac2.py | 5 | 1494 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import os
from chimera.util.catalog import Catalog
from chimera.util.scat import SCatWrapper
class UCAC2 (Catalog):
def __init__(self):
Catalog.__init__(self)
self.scat = SCatWrapper()
def getName(self):
return "UCAC2"
def ge... | gpl-2.0 |
VoiDeD/Sick-Beard | lib/hachoir_parser/misc/lnk.py | 90 | 23407 | """
Windows Shortcut (.lnk) parser.
Documents:
- The Windows Shortcut File Format (document version 1.0)
Reverse-engineered by Jesse Hager
http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf
- Wine source code:
http://source.winehq.org/source/include/shlobj.h (SHELL_LINK_DATA_FLAGS enum)
http://... | gpl-3.0 |
google/makani | gs/monitor2/apps/plugins/indicators/tests/network_test.py | 1 | 3251 | # Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
JohnOrlando/gnuradio-bitshark | grc/base/FlowGraph.py | 6 | 7249 | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any ... | gpl-3.0 |
leo-at-rsmart/shiny-octo-batman | tests/functional/model_student_work.py | 16 | 7522 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
ueg1990/github3.py | tests/unit/test_auths.py | 2 | 2746 | """Unit tests for the auths module."""
import github3
import pytest
from .helper import UnitHelper, create_url_helper, create_example_data_helper
url_for = create_url_helper('https://api.github.com/authorizations/1')
class TestAuthorization(UnitHelper):
"""Authorization unit tests."""
described_class = gi... | bsd-3-clause |
simalytics/askbot-devel | askbot/middleware/locale.py | 7 | 1026 | "Taken from django.middleware.locale: this is the locale selecting middleware that will look at accept headers"
from django.utils.cache import patch_vary_headers
from django.utils import translation
from askbot.conf import settings
class LocaleMiddleware(object):
"""
This is a very simple middleware that pars... | gpl-3.0 |
bobwalker99/Pydev | plugins/org.python.pydev.jython/Lib/poplib.py | 223 | 12388 | """A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <david_ascher@brown.edu>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL clas... | epl-1.0 |
stanhu/linguist | samples/Python/django-models-base.py | 92 | 40883 | from __future__ import unicode_literals
import copy
import sys
from functools import update_wrapper
from future_builtins import zip
import django.db.models.manager # Imported to register signal handler.
from django.conf import settings
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObjectsRet... | mit |
daenamkim/ansible | lib/ansible/module_utils/network/ios/ios.py | 3 | 5314 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
glenngillen/dotfiles | .vscode/extensions/ms-toolsai.jupyter-2021.6.832593372/pythonFiles/vscode_datascience_helpers/jupyter_daemon.py | 2 | 6637 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
import logging
import os
# See comment at our point of usage of subprocess on why this usage is ok
import subprocess # nosec
import sys
from vscode_datascience_helpers.daemon.daemon_python import (
error_dec... | mit |
Hurence/log-island | logisland-components/logisland-processors/logisland-processor-scripting/src/main/resources/nltk/test/doctest_nose_plugin.py | 28 | 6008 | # -*- coding: utf-8 -*-
from __future__ import print_function
from nose.suite import ContextList
import re
import sys
import os
import codecs
import doctest
from nose.plugins.base import Plugin
from nose.util import tolist, anyp
from nose.plugins.doctests import Doctest, log, DocFileCase
ALLOW_UNICODE = doctest.regist... | apache-2.0 |
codester2/devide | modules/readers/objRDR.py | 7 | 2214 | # $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
import os
class objRDR(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
"""Constructor (initialiser) for the PD reader.
This is almost standard... | bsd-3-clause |
ameerbadri/amazon-alexa-twilio-customer-service | Lambda Function/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
jwhitlock/web-platform-compat | mdn/migrations/0011_add_committed_and_converted_compat.py | 2 | 1629 | # -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mdn', '0010_data_remove_non_english_content'),
]
operations = [
migrations.AddField(
model_name='... | mpl-2.0 |
CTCNano/GromacsWrapper | staging/extra/cleanup.py | 2 | 3031 | #!/usr/bin/env python
# $Id: cleanup.py 2459 2008-11-12 17:31:10Z oliver $
"""Remove files from a staged SGE python script: parses the SGE log
file to ssh into the node and remove the stage dir. Can also parse
some of my older Charmm/SGE log scripts that contain hostname and
scratch dir information.
"""
import sys,os... | gpl-3.0 |
krbaker/Diamond | src/collectors/userscripts/userscripts.py | 51 | 3524 | # coding=utf-8
"""
Runs third party scripts and collects their output.
Scripts need to be +x and should output metrics in the form of
```
metric.path.a 1
metric.path.b 2
metric.path.c 3
```
They are not passed any arguments and if they return an error code,
no metrics are collected.
#### Dependencies
* [subproce... | mit |
MikeAmy/django | tests/template_tests/filter_tests/test_escape.py | 28 | 1892 | from django.template.defaultfilters import escape
from django.test import SimpleTestCase
from django.utils import six
from django.utils.functional import Promise, lazy
from django.utils.safestring import mark_safe
from ..utils import setup
class EscapeTests(SimpleTestCase):
"""
The "escape" filter works the ... | bsd-3-clause |
sum2012/mame | 3rdparty/bgfx/3rdparty/scintilla/test/lexTests.py | 65 | 3416 | # -*- coding: utf-8 -*-
# Requires Python 2.7 or later
import io, os, sys, unittest
if sys.platform == "win32":
import XiteWin as Xite
else:
import XiteQt as Xite
keywordsHTML = [
b"b body content head href html link meta "
b"name rel script strong title type xmlns",
b"function",
b"sub"
]
class TestLexers(unitte... | gpl-2.0 |
dyoung418/tensorflow | tensorflow/python/grappler/cluster_test.py | 8 | 3424 | # 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 |
skirpichev/omg | diofant/tests/solvers/test_solvers.py | 1 | 68580 | import pytest
from diofant import (And, Derivative, E, Eq, Float, Function, Gt, I, Indexed,
IndexedBase, Integer, Integral, LambertW, Lt, Matrix, Max,
Mul, Or, Piecewise, Poly, Pow, Rational, RootOf, Symbol,
Tuple, Wild, acos, arg, asin, atan, atan2, cbrt,... | bsd-3-clause |
RadioFreeAsia/RDacity | lib-src/portmidi/pm_python/pyportmidi/midi.py | 90 | 19419 | """
Module for interacting with midi input and output.
The midi module can send output to midi devices, and get input
from midi devices. It can also list midi devices on the system.
Including real midi devices, and virtual ones.
It uses the portmidi library. Is portable to which ever platforms
portmidi supports (c... | gpl-2.0 |
nathanial/lettuce | tests/integration/lib/Django-1.3/django/forms/forms.py | 156 | 21754 | """
Form classes
"""
from django.core.exceptions import ValidationError
from django.utils.copycompat import deepcopy
from django.utils.datastructures import SortedDict
from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
from django.utils.safest... | gpl-3.0 |
zhenv5/scikit-learn | examples/semi_supervised/plot_label_propagation_versus_svm_iris.py | 286 | 2378 | """
=====================================================================
Decision boundary of label propagation versus SVM on the Iris dataset
=====================================================================
Comparison for decision boundary generated on iris dataset
between Label Propagation and SVM.
This demon... | bsd-3-clause |
Kazade/NeHe-Website | google_appengine/lib/django-1.4/django/contrib/admindocs/utils.py | 95 | 3797 | "Misc. utility functions/classes for admin documentation generator."
import re
from email.parser import HeaderParser
from email.errors import HeaderParseError
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_str
try:
import docutils... | bsd-3-clause |
ReachingOut/unisubs | apps/socialauth/auth_backends.py | 5 | 2832 | from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth.backends import ModelBackend
from socialauth.models import OpenidProfile as UserAssociation, AuthMeta
import random
class CustomUserBackend(ModelBackend):
def authenticate(self, username=None, password=None):
... | agpl-3.0 |
moto-timo/ironpython3 | Tests/interop/com/compat/hw.py | 3 | 1181 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | apache-2.0 |
GoSteven/Diary | django/contrib/localflavor/fi/fi_municipalities.py | 12 | 11174 | # -*- coding: utf-8 -*-
"""
An alphabetical list of Finnish municipalities for use as `choices` in a
formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
MUNICIPALITY_CHOICES = (
('akaa', u"Akaa"),
('alajarvi', u"Alajärvi"),
('alavie... | bsd-3-clause |
RPI-OPENEDX/edx-platform | lms/djangoapps/certificates/tests/test_create_fake_cert.py | 107 | 2003 | """Tests for the create_fake_certs management command. """
from django.test import TestCase
from django.core.management.base import CommandError
from nose.plugins.attrib import attr
from opaque_keys.edx.locator import CourseLocator
from student.tests.factories import UserFactory
from certificates.management.commands i... | agpl-3.0 |
notriddle/servo | tests/wpt/web-platform-tests/tools/third_party/h2/test/test_settings.py | 24 | 16844 | # -*- coding: utf-8 -*-
"""
test_settings
~~~~~~~~~~~~~
Test the Settings object.
"""
import pytest
import h2.errors
import h2.exceptions
import h2.settings
from hypothesis import given, assume
from hypothesis.strategies import integers
class TestSettings(object):
"""
Test the Settings object behaves as ex... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.