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 |
|---|---|---|---|---|---|
yestech/gae-django-template | django/core/xheaders.py | 518 | 1157 | """
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custo... | bsd-3-clause |
aequitas/CouchPotato | library/sqlalchemy/orm/strategies.py | 11 | 51396 | # strategies.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related Mapper... | gpl-3.0 |
tmxdyf/CouchPotatoServer | couchpotato/core/media/_base/search/main.py | 14 | 1791 | from couchpotato.api import addApiView
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.variable import mergeDicts
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
class Search(Plugin):
def __init__(self):
... | gpl-3.0 |
goblincoding/ninja-ide | ninja_ide/core/plugin_manager.py | 9 | 19407 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
Rona111/sale_commission | __unported__/stock_block_prodlots/block_prodlot_case.py | 5 | 10632 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 Pexego (<www.pexego.es>). All Rights Reserved
# $Omar Castiñeira Saavedra$
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
wyc/django | django/core/files/locks.py | 725 | 3516 | """
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... | bsd-3-clause |
40423135/2016fallcadp_hw | plugin/sitemap/sitemap.py | 292 | 8774 | # -*- coding: utf-8 -*-
'''
Sitemap
-------
The sitemap plugin generates plain-text or XML sitemaps.
'''
from __future__ import unicode_literals
import re
import collections
import os.path
from datetime import datetime
from logging import warning, info
from codecs import open
from pytz import timezone
from pelican... | gpl-3.0 |
kool79/intellij-community | python/lib/Lib/site-packages/django/template/context.py | 78 | 5383 | from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Cache of actual callables.
_standard_context_processors = None
# We need the CSRF processor no matter what the user has in their settings,
# because otherwise it is a security vulnerability, and we can't afford t... | apache-2.0 |
pasqualguerrero/django | django/forms/widgets.py | 184 | 37166 | """
HTML Widget classes
"""
from __future__ import unicode_literals
import copy
import datetime
import re
from itertools import chain
from django.conf import settings
from django.forms.utils import flatatt, to_current_timezone
from django.utils import datetime_safe, formats, six
from django.utils.datastructures impo... | bsd-3-clause |
listamilton/supermilton.repository | script.module.youtube.dl/lib/youtube_dl/extractor/youporn.py | 9 | 6873 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
sanitized_Request,
str_to_int,
unescapeHTML,
unified_strdate,
)
from ..aes import aes_decrypt_text
class YouPornIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?youporn\... | gpl-2.0 |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/traits-4.3.0-py2.7-macosx-10.10-x86_64.egg/traits/tests/test_event_order.py | 1 | 3111 | #-------------------------------------------------------------------------------
#
# Copyright (c) 2007, Enthought, Inc.
# All rights reserved.
#
# This Software is provided without warranty under the terms of the
# BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions descri... | gpl-2.0 |
lenstr/rethinkdb | external/v8_3.30.33.16/build/gyp/test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py | 216 | 1427 | #!/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.
"""
Verify that relinking a solib doesn't relink a dependent executable if the
solib's public API hasn't changed.
"""
import os
import sys
... | agpl-3.0 |
anryko/ansible | lib/ansible/modules/network/fortios/fortios_dnsfilter_domain_filter.py | 7 | 12762 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
BackupGGCode/python-for-android | python-modules/twisted/twisted/lore/process.py | 57 | 3831 | # -*- test-case-name: twisted.lore.test.test_lore -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
import sys, os
import tree #todo: get rid of this later
import indexer
class NoProcessorError(Exception):
pass
class ProcessingFailure(Exception):
pass
cols = 79
def dir... | apache-2.0 |
Team02-TeamGuinness/BIOE421_RoboHand | Printrun/printrun/projectlayer.py | 20 | 38361 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | gpl-2.0 |
EdDev/vdsm | lib/vdsm/network/netlink/addr.py | 1 | 2889 | # Copyright 2014-2017 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in... | gpl-2.0 |
rvianello/rdkit | rdkit/Chem/Features/ShowFeats.py | 5 | 12247 | # $Id: ShowFeats.py 537 2007-08-20 14:54:35Z landrgr1 $
#
# Created by Greg Landrum Aug 2006
#
#
from __future__ import print_function
_version = "0.3.2"
_usage = """
ShowFeats [optional args] <filenames>
if "-" is provided as a filename, data will be read from stdin (the console)
"""
_welcomeMessage = "This i... | bsd-3-clause |
walterdejong/synctool | src/synctool/overlay.py | 1 | 12401 | #
# synctool.overlay.py WJ111
#
# synctool Copyright 2015 Walter de Jong <walter@heiho.net>
#
# synctool COMES WITH NO WARRANTY. synctool IS FREE SOFTWARE.
# synctool is distributed under terms described in the GNU General Public
# License.
#
'''synctool.overlay maps the repository onto the root directory... | gpl-2.0 |
hachreak/invenio-demosite | invenio_demosite/testsuite/regression/test_bibauthority.py | 7 | 4791 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN.
#
# Invenio Demosite 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... | gpl-2.0 |
kamma/ace_kernel | scripts/rt-tester/rt-tester.py | 904 | 5366 | #!/usr/bin/env python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
impor... | gpl-2.0 |
yavalvas/yav_com | build/matplotlib/doc/mpl_examples/api/scatter_piecharts.py | 6 | 1194 | """
This example makes custom 'pie charts' as the markers for a scatter plotqu
Thanks to Manuel Metz for the example
"""
import math
import numpy as np
import matplotlib.pyplot as plt
# first define the ratios
r1 = 0.2 # 20%
r2 = r1 + 0.4 # 40%
# define some sizes of the scatter marker
sizes = [60,80,120]
# ca... | mit |
philipbl/home-assistant | tests/util/test_distance.py | 42 | 3525 | """Test homeasssitant distance utility functions."""
import unittest
import homeassistant.util.distance as distance_util
from homeassistant.const import (LENGTH_KILOMETERS, LENGTH_METERS, LENGTH_FEET,
LENGTH_MILES)
INVALID_SYMBOL = 'bob'
VALID_SYMBOL = LENGTH_KILOMETERS
class TestDi... | mit |
msingh172/youtube-dl | youtube_dl/extractor/soundcloud.py | 23 | 17239 | # encoding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
int_or_none,
unified_strdate,
)
class SoundcloudIE(InfoExtra... | unlicense |
gdub/mysql-connector-python | examples/transaction.py | 15 | 4010 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most... | gpl-2.0 |
palladius/gcloud | packages/gsutil/boto/tests/unit/ec2/test_address.py | 10 | 1671 | import mock
import unittest
from boto.ec2.address import Address
class AddressTest(unittest.TestCase):
def setUp(self):
self.address = Address()
self.address.connection = mock.Mock()
self.address.public_ip = "192.168.1.1"
def check_that_attribute_has_been_set(self, name, value, attrib... | gpl-3.0 |
Southpaw-TACTIC/TACTIC | 3rd_party/python2/site-packages/portend.py | 2 | 5087 | # -*- coding: utf-8 -*-
"""
A simple library for managing the availability of ports.
"""
from __future__ import print_function, division
import time
import socket
import argparse
import sys
import itertools
import contextlib
import collections
import platform
from tempora import timing
def client_host(server_host... | epl-1.0 |
alxyang/mysql-5.6 | xtrabackup/test/python/testtools/tests/test_spinner.py | 62 | 13061 | # Copyright (c) 2010 testtools developers. See LICENSE for details.
"""Tests for the evil Twisted reactor-spinning we do."""
import os
import signal
from testtools import (
skipIf,
TestCase,
)
from testtools.helpers import try_import
from testtools.matchers import (
Equals,
Is,
MatchesExcepti... | gpl-2.0 |
WillisXChen/django-oscar | src/oscar/apps/voucher/reports.py | 24 | 1551 | from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class, get_model
ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator')
ReportCSVFormatter = get_class(
'dashboard.reports.reports', 'ReportCSVFormatter')
ReportHTMLFormatter = get_class(
'dashboard... | bsd-3-clause |
navodissa/python-flask | flask/lib/python2.7/site-packages/wtforms/ext/appengine/ndb.py | 174 | 17124 | """
Form generation utilities for App Engine's new ``ndb.Model`` class.
The goal of ``model_form()`` is to provide a clean, explicit and predictable
way to create forms based on ``ndb.Model`` classes. No malabarism or black
magic should be necessary to generate a form for models, and to add custom
non-model related fi... | bsd-3-clause |
opencivicdata/scrapers-ca | ca_ab_wood_buffalo/people.py | 1 | 2201 | from utils import CanadianScraper, CanadianPerson as Person
from collections import defaultdict
COUNCIL_PAGE = 'http://www.woodbuffalo.ab.ca/Municipal-Government/Mayor-and-Council/Councillor-Profiles.htm'
class WoodBuffaloPersonScraper(CanadianScraper):
def scrape(self):
seat_numbers = defaultdict(int)
... | mit |
pydanny/django-admin2 | example/blog/actions.py | 1 | 2110 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, unicode_literals
from django.contrib import messages
from django.utils.translation import ugettext_lazy, pgettext_lazy
from djadmin2 import permissions
from djadmin2.actions import BaseListAction
class CustomPublishAction(BaseListAction):
... | bsd-3-clause |
bowlofstew/bii-server | test/model/social_account_test.py | 2 | 2004 | import unittest
from biicode.server.model.social_account import SocialAccount, SocialAccountToken
from biicode.server.model.epoch.utc_datetime import UtcDatetime
import datetime
class SocialAccountTest(unittest.TestCase):
def setUp(self):
self.utc_datetime = UtcDatetime.deserialize(datetime.datetime.now()... | mit |
mmottahedi/neuralnilm_prototype | scripts/e249.py | 2 | 3897 | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import crossentropy, mse... | mit |
twz915/django | django/template/utils.py | 53 | 3665 | import functools
import os
from collections import Counter, OrderedDict
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
class InvalidTemplate... | bsd-3-clause |
mlskit/astromlskit | FRONTEND/forestfront.py | 2 | 8530 |
from PyQt4 import QtCore, QtGui
from dtree import *
import numpy as np
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.transla... | gpl-3.0 |
simonwydooghe/ansible | lib/ansible/modules/net_tools/ldap/_ldap_attr.py | 11 | 8838 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Peter Sagerson <psagers@ignorare.net>
# Copyright: (c) 2016, Jiri Tyr <jiri.tyr@gmail.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
__me... | gpl-3.0 |
disigma/depot_tools | third_party/logilab/common/configuration.py | 85 | 42160 | # copyright 2003-2012 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... | bsd-3-clause |
jagguli/intellij-community | python/helpers/python-skeletons/re.py | 45 | 7418 | """Skeleton for 're' stdlib module."""
def compile(pattern, flags=0):
"""Compile a regular expression pattern, returning a pattern object.
:type pattern: bytes | unicode
:type flags: int
:rtype: __Regex
"""
pass
def search(pattern, string, flags=0):
"""Scan through string looking for a ... | apache-2.0 |
honnibal/spaCy | examples/information_extraction/parse_subtrees.py | 1 | 2585 | #!/usr/bin/env python
# coding: utf8
"""This example shows how to navigate the parse tree including subtrees
attached to a word.
Based on issue #252:
"In the documents and tutorials the main thing I haven't found is
examples on how to break sentences down into small sub thoughts/chunks. The
noun_chunks is handy, but h... | mit |
geary/claslite | web/app/lib/dist/blinker/_saferef.py | 174 | 9223 | # extracted from Louie, http://pylouie.org/
# updated for Python 3
#
# Copyright (c) 2006 Patrick K. O'Brien, Mike C. Fletcher,
# Matthew R. Scott
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#... | unlicense |
lthurlow/Network-Grapher | proj/external/networkx-1.7/build/lib.linux-i686-2.7/networkx/algorithms/bipartite/tests/test_centrality.py | 96 | 6127 | from nose.tools import *
import networkx as nx
from networkx.algorithms import bipartite
class TestBipartiteCentrality(object):
def setUp(self):
self.P4 = nx.path_graph(4)
self.K3 = nx.complete_bipartite_graph(3,3)
self.C4 = nx.cycle_graph(4)
self.davis = nx.davis_southern_women_gr... | mit |
bsmedberg/socorro | socorro/processor/processed_transform_rules.py | 1 | 9719 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
""""
these are the rules that transform a raw crash into a processed crash
"""
from socorro.lib.ver_tools import normal... | mpl-2.0 |
horazont/aioxmpp | aioxmpp/roster/xso.py | 1 | 4970 | ########################################################################
# File name: xso.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program 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, ... | lgpl-3.0 |
tianzhidao28/pyspider | tests/test_result_worker.py | 72 | 2770 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-11-11 20:52:53
import os
import time
import unittest2 as unittest
import logging.config
logging.config.fileConfig("pyspider/logging.conf")
import shu... | apache-2.0 |
rlworkgroup/metaworld | metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_sweep_into_goal_v2.py | 1 | 7416 | import numpy as np
from gym.spaces import Box
from scipy.spatial.transform import Rotation
from metaworld.envs import reward_utils
from metaworld.envs.asset_path_utils import full_v2_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerSweepIntoGoalEnvV2(... | mit |
rosswhitfield/mantid | Framework/PythonInterface/test/python/mantid/api/FilePropertyTest.py | 3 | 2196 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 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 +
impo... | gpl-3.0 |
aguirreeng/libeng | math/rotations.py | 1 | 2992 | import numpy
def obtain_matrix_from_quaternion(q: numpy.ndarray) -> numpy.ndarray:
if q.size != 4:
raise ValueError('Wrong number of elements on the array (q.size != 4)!')
m = numpy.zeros((3, 3), dtype=numpy.float64)
m[0, 0] = 1.0 - 2.0 * q[2] * q[2] - 2.0 * q[3] * q[3]
m[0, 1] = 2.0... | mit |
tensorflow/models | official/nlp/data/tagging_data_lib.py | 1 | 15488 | # Copyright 2021 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 |
webgeodatavore/django | django/core/management/commands/migrate.py | 54 | 13145 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.core.management.sql import (
emit_post_migrate_signal, emit... | bsd-3-clause |
wlonk/python-semantic-release | tests/test_history.py | 2 | 8852 | from unittest import TestCase
import semantic_release
from semantic_release.history import (evaluate_version_bump, get_current_version, get_new_version,
get_previous_version)
from semantic_release.history.logs import generate_changelog, markdown_changelog
from . import mock
MAJO... | mit |
sinkuri256/python-for-android | python-build/python-libs/gdata/build/lib/gdata/Crypto/PublicKey/RSA.py | 228 | 6974 | #
# RSA.py : RSA encryption/decryption
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use or... | apache-2.0 |
barachka/odoo | addons/point_of_sale/report/__init__.py | 381 | 1238 | # -*- 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 |
arnaudsj/Petrel | petrel/petrel/mock.py | 2 | 6112 | from collections import deque, defaultdict, namedtuple
import storm
python_id = id
STORM_TUPLE = 0
LIST = 1
TUPLE = 2
NAMEDTUPLE = 3
class MockSpout(storm.Spout):
def __init__(self, output_fields, data):
self.output_fields = output_fields
self.data = data
self.index = 0
def declareO... | bsd-3-clause |
Demolisty24/AlexaFood-Backend | venv/Lib/site-packages/wheel/signatures/ed25519py.py | 565 | 1695 | # -*- coding: utf-8 -*-
import warnings
import os
from collections import namedtuple
from . import djbec
__all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair',
'PUBLICKEYBYTES', 'SECRETKEYBYTES', 'SIGNATUREBYTES']
PUBLICKEYBYTES=32
SECRETKEYBYTES=64
SIGNATUREBYTES=64
Keypair = n... | mit |
tima/ansible | lib/ansible/modules/network/eos/eos_vrf.py | 9 | 9171 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | gpl-3.0 |
jameswatt2008/jameswatt2008.github.io | python/Python核心编程/网络编程/截图和代码/概述、SOCKET/多进程copy文件/test-复件/symbol.py | 2 | 2093 | #! /usr/bin/python3.5
"""Non-terminal symbols of Python grammar (from "graminit.h")."""
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./python Lib/symbol.p... | gpl-2.0 |
cneill/designate-testing | designate/objects/validation_error.py | 7 | 1411 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
jackytu/newbrandx | src/oscar/apps/analytics/migrations/0002_auto_20140827_1705.py | 49 | 1091 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('analytics', '0001_initial'),
('catalogue', '0001_initial'),
migrations.swappable_dependency(... | bsd-3-clause |
prds21/barrial-movie | servers/playedto.py | 39 | 4908 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para playedto
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impo... | gpl-3.0 |
yawnosnorous/python-for-android | python-build/python-libs/ase/scripts/test.py | 64 | 5166 | import sys
import types
# Test imports.
import android
import BeautifulSoup
import gdata.docs.service
import sqlite3
import termios
import time
import xmpp
droid = android.Android()
def event_loop():
for i in range(10):
e = droid.eventPoll(1)
if e.result is not None:
return True
time.sleep(2)
... | apache-2.0 |
Facetracker-project/facetracker-core | lib/youtube-dl/youtube_dl/extractor/discovery.py | 16 | 1687 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
int_or_none,
)
class DiscoveryIE(InfoExtractor):
_VALID_URL = r'http://www\.discovery\.com\/[a-zA-Z0-9\-]*/[a-zA-Z0-9\-]*/videos/(?P<id>[a-zA-Z0-9_\-]*)(?:\.htm)?'
_TEST = {
'url': '... | gpl-2.0 |
Dandandan/wikiprogramming | jsrepl/extern/python/closured/lib/python2.7/smtpd.py | 76 | 18543 | #! /usr/bin/env python
"""An RFC 2821 smtp proxy.
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
Options:
--nosetuid
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call will fail if this program is not run as root (in
... | mit |
epitron/youtube-dl | youtube_dl/extractor/regiotv.py | 99 | 2261 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
sanitized_Request,
xpath_text,
xpath_with_ns,
)
class RegioTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?regio-tv\.de/video/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://... | unlicense |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyQt4/QtGui/QMovie.py | 2 | 5661 | # encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
class QMovie(__PyQt4_QtCore.QObject):
"""
QMovie(QObject parent=None)
QMovie(QIODevice, QByteArray format=QByteArray(), QObject paren... | gpl-2.0 |
alvin319/CarnotKE | jyhton/Lib/xml/sax/__init__.py | 117 | 3413 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | apache-2.0 |
brodeau/aerobulk | python/plot_tests/plot_station_asf.py | 1 | 9926 | #!/usr/bin/env python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Post-diagnostic of STATION_ASF / L. Brodeau, 2019
import sys
from os import path as path
#from string import replace
import math
import numpy as nmp
from netCDF4 import Dataset,num2date
import matplotlib as mpl
mpl.use... | gpl-3.0 |
florianfesti/boxes | boxes/generators/openbox.py | 1 | 1741 | #!/usr/bin/env python3
# Copyright (C) 2013-2014 Florian Festi
#
# 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.... | gpl-3.0 |
alexbruy/QGIS | python/plugins/processing/algs/qgis/Gridify.py | 1 | 7375 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Gridify.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*****************************... | gpl-2.0 |
yencarnacion/jaikuengine | .google_appengine/lib/endpoints-1.0/endpoints/users_id_token.py | 2 | 17916 | #!/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 |
whatsbcn/shellforge4 | shellforge/shellforge/cpu_i386.py | 1 | 12307 | #############################################################################
## ##
## cpu_i386.py --- Classes for i386 CPUs ##
## see http://www.secdev.org/projects/shellforge/ ##
## ... | gpl-2.0 |
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | PyFoam/Infrastructure/CTestRun.py | 1 | 41961 | # ICE Revision: $Id$
"""A wrapper to run a solver as a CTest"""
import sys
import os
from os import path
import subprocess
import shutil
import traceback
import inspect
from PyFoam.ThirdParty.six.moves import cPickle as pickle
import time
from PyFoam.Applications.CloneCase import CloneCase
from PyFoam.Applications... | gpl-2.0 |
yunli2004/OpenClos | jnpr/openclos/tests/unit/test_l3Clos.py | 1 | 20266 | '''
Created on Jul 22, 2014
@author: moloyc
'''
import os
import sys
sys.path.insert(0,os.path.abspath(os.path.dirname(__file__) + '/' + '../..')) #trick to make it run from CLI
import unittest
import shutil
from flexmock import flexmock
from jnpr.openclos.l3Clos import L3ClosMediation
from jnpr.openclos.model import... | apache-2.0 |
jhjguxin/PyCDC | Karrigell-2.3.5/Karrigell_GUI.py | 1 | 2316 | """Karrigell HTTP Server
Written by Pierre Quentel quentel.pierre@wanadoo.fr
Published under the BSD licence. See the file LICENCE.txt
This script launches Karrigell with webservers.SimpleAsyncHTTPServer.Server as web server.
It is built on the asyncore/asynchat framework (non-blocking sockets, use of
the select() f... | gpl-3.0 |
40223249-1/-w16b_test | static/Brython3.1.1-20150328-091302/Lib/_abcoll.py | 688 | 5155 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | agpl-3.0 |
atruberg/django-custom | django/contrib/gis/geos/linestring.py | 224 | 5607 | from django.contrib.gis.geos.base import numpy
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.point import Point
from django.contrib.gis.geos import prototypes as cap... | bsd-3-clause |
NicolasLM/sauna | sauna/scheduler.py | 1 | 3161 | import time
import fractions
from functools import reduce
from logging import getLogger
logger = getLogger(__name__)
class Scheduler:
def __init__(self, jobs):
"""
Create a new Scheduler.
>>> s = Scheduler([Job(1, max, 100, 200)])
>>> for jobs in s:
... time.sleep(s.t... | bsd-2-clause |
tareqalayan/ansible | lib/ansible/modules/storage/netapp/na_cdot_volume.py | 23 | 15029 | #!/usr/bin/python
# (c) 2017, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
vitorio/pygrow | grow/deployments/stats/stats.py | 1 | 1214 | import collections
import os
from protorpc import protojson
from . import messages
class Stats(object):
def __init__(self, pod, paths_to_contents=None):
self.pod = pod
if paths_to_contents is None:
paths_to_contents = pod.export()
self.paths_to_contents = paths_to_contents
def get_num_files_pe... | mit |
ridfrustum/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/decorators/tests.py | 39 | 5210 | from unittest import TestCase
from sys import version_info
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.http import HttpResponse, HttpRequest
from django.utils.functional import allow_lazy, lazy, memoize
from django.views.dec... | gpl-3.0 |
VFoteinos/e-science | tests/web/ClusterTest.py | 5 | 8011 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
unittest class used in Selenium tests. Every test_cluster_* inherits methods
from ClusterTest.
@author: Ioannis Stenos, Nick Vrionis
'''
from selenium import webdriver
import sys, os
from os.path import join, dirname, abspath
sys.path.append(join(dirname(abspath(__fi... | agpl-3.0 |
VShangxiao/tornado | demos/benchmark/gen_benchmark.py | 99 | 1189 | #!/usr/bin/env python
#
# A simple benchmark of the tornado.gen module.
# Runs in two modes, testing new-style (@coroutine and Futures)
# and old-style (@engine and Tasks) coroutines.
from timeit import Timer
from tornado import gen
from tornado.options import options, define, parse_command_line
define('num', defaul... | apache-2.0 |
m4ll0k/Infoga | recon/google.py | 1 | 1041 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name : Infoga - Email Information Gathering
# @url : http://github.com/m4ll0k
# @author : Momo Outaadi (m4ll0k)
from lib.output import *
from lib.request import *
from lib.parser import *
class Google(Request):
def __init__(self,target):
Request.... | gpl-3.0 |
efortuna/AndroidSDKClone | ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/lib-tk/Tkinter.py | 43 | 157840 | """Wrapper functions for Tcl/Tk.
Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.
... | apache-2.0 |
synth3tk/the-blue-alliance | controllers/api/api_district_controller.py | 1 | 7325 | import json
import webapp2
from controllers.api.api_base_controller import ApiBaseController
from consts.district_type import DistrictType
from consts.event_type import EventType
from datetime import datetime
from database.event_query import DistrictEventsQuery
from google.appengine.ext import ndb
from database.tea... | mit |
PostCenter/botlang | botlang/parser/s_expressions.py | 1 | 8935 | import ast as python_ast
from botlang.ast.ast import *
class SExpression(object):
"""
https://en.wikipedia.org/wiki/S-expression
"""
OPENING_PARENS = ['(', '[', '{']
CLOSING_PARENS = [')', ']', '}']
def to_ast(self):
raise NotImplementedError
def accept(self, visitor):
ra... | mit |
Zhongqilong/kbengine | kbe/src/lib/python/Tools/i18n/makelocalealias.py | 40 | 3124 | #!/usr/bin/env python3
"""
Convert the X11 locale.alias file into a mapping dictionary suitable
for locale.py.
Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.
"""
import locale
import sys
# Location of the alias file
LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'
def parse(filename):
... | lgpl-3.0 |
cuilishen/cuilishenMissionPlanner | Lib/site-packages/numpy/numarray/alter_code1.py | 102 | 9390 | """
This module converts code written for numarray to run with numpy
Makes the following changes:
* Changes import statements
import numarray.package
--> import numpy.numarray.package as numarray_package
with all numarray.package in code changed to numarray_package
import numarray --> import... | gpl-3.0 |
CharlesShang/TFFRCNN | lib/roi_data_layer/minibatch.py | 5 | 8725 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Compute minibatch blobs for training a Fast R-CNN network."""
impor... | mit |
s40523133/2016fallcp_hw | plugin/liquid_tags/img.py | 320 | 2399 | """
Image Tag
---------
This implements a Liquid-style image tag for Pelican,
based on the octopress image tag [1]_
Syntax
------
{% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %}
Examples
--------
{% img /images/ninja.png Ninja Attack! %}
{% img left half h... | agpl-3.0 |
Flamacue/pretix | src/tests/presale/test_organizer_page.py | 2 | 2634 | from datetime import timedelta
import pytest
from django.utils.timezone import now
from pretix.base.models import Event, Organizer
@pytest.fixture
def env():
o = Organizer.objects.create(name='MRMCD e.V.', slug='mrmcd')
event = Event.objects.create(
organizer=o, name='MRMCD2015', slug='2015',
... | apache-2.0 |
SantosDevelopers/sborganicos | venv/lib/python3.5/site-packages/django/core/checks/model_checks.py | 108 | 6273 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import types
from itertools import chain
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
errors = []
if app_configs is Non... | mit |
lowitty/server | libsDarwin/twisted/test/test_formmethod.py | 10 | 3650 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for formmethod module.
"""
from twisted.trial import unittest
from twisted.python import formmethod
class ArgumentTests(unittest.TestCase):
def argTest(self, argKlass, testPairs, badValues, *args, **kwargs):
arg = ... | mit |
myyyy/wiki | learn/selenium/test_sensorcmd.py | 1 | 1183 | # -*- coding:utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import time
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
driver = webdriver.Chrome()
driver.get("http://bk47.thunics.org:8888/login?next=/plat"... | mit |
drulang/foxleaf | server/server/settings.py | 1 | 2308 | """
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | gpl-2.0 |
benlaurie/certificate-transparency | python/utilities/submit_chain/submit_chain.py | 26 | 4274 | #!/usr/bin/env python
"""Submits a chain to a list of logs."""
import base64
import hashlib
import sys
import json
import logging
import gflags
from ct.client import log_client
from ct.crypto import cert
from ct.crypto import error
from ct.crypto import pem
from ct.crypto import verify
from ct.proto import client_pb... | apache-2.0 |
kordano/samba-ldb-mdb | lib/dnspython/dns/rdtypes/IN/SRV.py | 100 | 3395 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation 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 "... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/iot/v1/iot-v1-py/google/cloud/iot_v1/types/__init__.py | 1 | 3122 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
BRiAl/BRiAl | sage-brial/brial/simplebb.py | 1 | 2128 | from .PyPolyBoRi import *
from .interred import interred
def buchberger(l):
"calculates a (non minimal) Groebner basis"
l = interred(l)
#for making sure, that every polynomial has a different leading term
#needed for add_generator
if not l:
return []
g = GroebnerStrategy(l[0].ring())
... | gpl-2.0 |
LumPenPacK/NetworkExtractionFromImages | win_build/nefi2_win_amd64_msvc_2015/site-packages/networkx/linalg/tests/test_graphmatrix.py | 40 | 4292 | from nose import SkipTest
import networkx as nx
from networkx.generators.degree_seq import havel_hakimi_graph
class TestGraphMatrix(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
global assert_equal
g... | bsd-2-clause |
eoneil1942/voltdb-4.7fix | tools/lbd_lock_test/testrunner.py | 20 | 4334 | #!/usr/bin/env python
from subprocess import Popen, PIPE
import os, sys, datetime, fcntl, time
DURATION_IN_SECONDS = 240
def cmd_readlines(cmd):
"Run a shell command and get the output as a list of lines"
fd = os.popen(cmd)
retval = fd.readlines()
fd.close()
return retval
def killProcess(p):... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.