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 |
|---|---|---|---|---|---|
voriux/Flexget | tests/test_lazy_fields.py | 10 | 1671 | from __future__ import unicode_literals, division, absolute_import
from flexget.entry import Entry
class TestLazyFields(object):
def test_lazy_queue(self):
"""Tests behavior when multiple plugins register lazy lookups for the same field"""
def lazy_a(entry, field):
if field == 'a_fai... | mit |
dfunckt/django | tests/view_tests/generic_urls.py | 28 | 1377 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle
date_based_info_dict = {
'queryset': Article.objects.all()... | bsd-3-clause |
SeaFalcon/Musicool_Pr | lib/sqlalchemy/sql/default_comparator.py | 32 | 13132 | # sql/default_comparator.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Default implementation of SQL comparison operations.
"""
from .. impor... | apache-2.0 |
oceanobservatories/mi-dataset | mi/dataset/parser/test/test_dosta_abcdjm_ctdbp.py | 7 | 4141 | #!/usr/bin/env python
"""
@package mi.dataset.parser.test
@file mi-dataset/mi/dataset/parser/test/test_dosta_abcdjm_ctdbp.py
@author Jeff Roy
@brief Test code for dosta_abcdjm_ctdbp data parser
Files used for testing:
"""
import os
from nose.plugins.attrib import attr
from mi.core.log import get_logger
from mi.da... | bsd-2-clause |
MwanzanFelipe/rockletonfortune | lib/django/db/backends/sqlite3/base.py | 323 | 18115 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
Salat-Cx65/python-for-android | python3-alpha/python3-src/Lib/test/test_pep3120.py | 49 | 1280 | # This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
import unittest
from test import support
class PEP3120Test(unittest.TestCase):
def test_pep3120(self):
self.assertEqual(
"Питон".encode("utf-8"),
b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
)
... | apache-2.0 |
cherry-wb/pyew | envi/archs/i386/disasm.py | 16 | 35078 |
"""
The guts for the i386 envi opcode disassembler.
"""
import struct
import envi
import envi.bits as e_bits
import opcode86
all_tables = opcode86.tables86
# Grab our register enums etc...
from envi.archs.i386.regs import *
# Our instruction prefix masks
# NOTE: table 3-4 (section 3.6) of intel 1... | gpl-2.0 |
nmerad/dejavu | dejavu.py | 16 | 3086 | #!/usr/bin/python
import os
import sys
import json
import warnings
import argparse
from dejavu import Dejavu
from dejavu.recognize import FileRecognizer
from dejavu.recognize import MicrophoneRecognizer
from argparse import RawTextHelpFormatter
warnings.filterwarnings("ignore")
DEFAULT_CONFIG_FILE = "dejavu.cnf.SAM... | mit |
kuku940/flask | scripts/make-release.py | 145 | 4037 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import re
from dat... | bsd-3-clause |
release-engineering/fedmsg_meta_umb | fedmsg_meta_umb/rpmdiff.py | 1 | 2379 | # Copyright (C) 2017 Red Hat, Inc.
#
# fedmsg_meta_umb 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 2.1 of the License, or (at your option) any later version.
#
# fedmsg_meta_umb is ... | lgpl-2.1 |
YOTOV-LIMITED/kuma | vendor/packages/translate/tools/pretranslate.py | 24 | 9272 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of translate.
#
# 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 o... | mpl-2.0 |
boneyao/sentry | src/sentry/migrations/0119_auto__add_field_projectkey_label.py | 36 | 22691 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ProjectKey.label'
db.add_column('sentry_projectkey', 'label',
self.gf(... | bsd-3-clause |
kiyoto/statsmodels | statsmodels/regression/_prediction.py | 27 | 6035 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 19 11:29:18 2014
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
# this is similar to ContrastResults after t_test, partially copied and adjusted
class PredictionResults(object):
def __init__(self, predicted_mean, var_pred_mean... | bsd-3-clause |
jesuscript/topo-mpi | param/external.py | 1 | 68357 | """
External code required for param/tkinter interface.
* odict: an ordered dictionary
* tilewrapper: a wrapper for Tile/ttk widgets
Note that an ordered dictionary and a wrapper for ttk widgets are both
available in Python 2.7.
"""
from __future__ import generators
# odict.py
# An Ordered Dictionary object
# Copyr... | bsd-3-clause |
saurabh6790/trufil_app | startup/webutils.py | 30 | 1121 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
from webnotes.utils import cint
def get_website_settings(context):
post_login = []
cart_enabled = cint(webnotes.conn.get_default("shopping_cart_enabled"))
if cart_enable... | agpl-3.0 |
andrecunha/idd3 | examine.py | 1 | 2041 | # -*- coding: utf-8 -*-
# IDD3 - Propositional Idea Density from Dependency Trees
# Copyright (C) 2014-2015 Andre Luiz Verucci da Cunha
#
# 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 ... | gpl-3.0 |
HLFH/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/drtv.py | 21 | 3120 | from __future__ import unicode_literals
from .subtitles import SubtitlesInfoExtractor
from .common import ExtractorError
from ..utils import parse_iso8601
class DRTVIE(SubtitlesInfoExtractor):
_VALID_URL = r'http://(?:www\.)?dr\.dk/tv/se/(?:[^/]+/)+(?P<id>[\da-z-]+)(?:[/#?]|$)'
_TEST = {
'url': 'htt... | gpl-3.0 |
sgraham/nope | tools/code_coverage/croc_html.py | 169 | 13455 | # 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.
"""Crocodile HTML output."""
import os
import shutil
import time
import xml.dom
class CrocHtmlError(Exception):
"""Coverage HTML error."""
class H... | bsd-3-clause |
mbauskar/alec_frappe5_erpnext | erpnext/hub_node/doctype/hub_settings/hub_settings.py | 24 | 3085 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, requests, json
from frappe.model.document import Document
from frappe.utils import cint, expand_relative_urls
from frappe import... | agpl-3.0 |
postlund/home-assistant | tests/components/geonetnz_quakes/test_geo_location.py | 3 | 7356 | """The tests for the GeoNet NZ Quakes Feed integration."""
import datetime
from asynctest import CoroutineMock, patch
from homeassistant.components import geonetnz_quakes
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.geonetnz_quakes import DEFAULT_SCAN_INTERVAL
from homea... | apache-2.0 |
sherlockcoin/summercoinv2 | share/qt/extract_strings_qt.py | 1294 | 1784 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
Ret... | mit |
xiaozhuchacha/OpenBottle | grammar_induction/earley_parser/nltk/corpus/reader/__init__.py | 5 | 6140 | # Natural Language Toolkit: Corpus Readers
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
NLTK corpus readers. The modules in this package provide functions
that ... | mit |
areitz/pants | src/python/pants/backend/codegen/tasks/ragel_gen.py | 8 | 4162 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | apache-2.0 |
JMSwag/jms-utils | jms_utils/terminal.py | 1 | 8327 | # --------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2014-2016 Digital Sapphire
#
# 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 Soft... | mit |
f5devcentral/f5-cccl | f5_cccl/resource/net/fdb/record.py | 1 | 1541 | """Provides a class for managing BIG-IP FDB tunnel record resources."""
# coding=utf-8
#
# Copyright (c) 2017-2021 F5 Networks, 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
#
# htt... | apache-2.0 |
brettlangdon/dd-agent | checks.d/disk.py | 9 | 10686 | # stdlib
import os
import re
# 3p
try:
import psutil
except ImportError:
psutil = None
# project
from checks import AgentCheck
from config import _is_affirmative
from util import Platform
from utils.subprocess_output import get_subprocess_output
class Disk(AgentCheck):
""" Collects metrics about the mac... | bsd-3-clause |
loco-odoo/localizacion_co | openerp/addons-extra/asset_sale/__init__.py | 10 | 1055 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 CodUP (<http://codup.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... | agpl-3.0 |
ccheaton/useful-scripts | multi_process.py | 3 | 3261 | # multi_process.py
# v.1
# 15 JAN 2014
# Adapted from code found on StackOverflow.com for this question:
# http://stackoverflow.com/questions/18204782/runtimeerror-on-windows-trying-python-multiprocessing
import multiprocessing
from multiprocessing import Process
import threading
# ==================================... | unlicense |
Zenfone2-Dev/Kernel-for-Asus-Zenfone-2 | drivers/scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
darrenbilby/grr | lib/output_plugins/csv_plugin.py | 6 | 2894 | #!/usr/bin/env python
"""CSV single-pass output plugin."""
import csv
from grr.lib import export
from grr.lib import output_plugin
from grr.lib import rdfvalue
from grr.lib import utils
from grr.lib.rdfvalues import structs as rdf_structs
from grr.proto import output_plugin_pb2
class CSVOutputPluginArgs(rdf_struc... | apache-2.0 |
adoosii/edx-platform | common/djangoapps/microsite_configuration/templatetags/microsite.py | 27 | 2142 | """
Template tags and helper functions for displaying breadcrumbs in page titles
based on the current micro site.
"""
from django import template
from django.conf import settings
from microsite_configuration import microsite
from django.templatetags.static import static
from django.contrib.staticfiles.storage import st... | agpl-3.0 |
sysalexis/kbengine | kbe/res/scripts/common/Lib/encodings/iso8859_3.py | 272 | 13089 | """ Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | lgpl-3.0 |
djphan/c410-Repo | c410-Lab4_5_Flask/env-lab4/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/install_scripts.py | 63 | 2007 | from distutils.command.install_scripts import install_scripts \
as _install_scripts
from pkg_resources import Distribution, PathMetadata, ensure_directory
import os
from distutils import log
class install_scripts(_install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def ini... | gpl-3.0 |
catapult-project/catapult | third_party/gsutil/third_party/apitools/apitools/base/protorpclite/util.py | 8 | 9287 | #!/usr/bin/env python
#
# Copyright 2010 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... | bsd-3-clause |
izonder/intellij-community | python/helpers/coverage/misc.py | 160 | 4376 | """Miscellaneous stuff for Coverage."""
import errno
import inspect
import os
import sys
from coverage.backward import md5, sorted # pylint: disable=W0622
from coverage.backward import string_class, to_bytes
def nice_pair(pair):
"""Make a nice string representation of a pair of numbers.
If the number... | apache-2.0 |
thelac/crazyflie | lib/cfclient/ui/dialogs/logconfigdialogue.py | 21 | 10441 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
kyleam/seaborn | examples/elaborate_violinplot.py | 30 | 1055 | """
Violinplot from a wide-form dataset
===================================
_thumb: .6, .45
"""
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="whitegrid")
# Load the example dataset of brain network correlations
df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0)
# Pull out a... | bsd-3-clause |
RussianCraft/rcse | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | 10585 | # Copyright (c) 2014 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... | gpl-3.0 |
837468220/python-for-android | python-build/python-libs/xmpppy/xmpp/__init__.py | 212 | 1795 | # $Id: __init__.py,v 1.9 2005/03/07 09:34:51 snakeru Exp $
"""
All features of xmpppy library contained within separate modules.
At present there are modules:
simplexml - XML handling routines
protocol - jabber-objects (I.e. JID and different stanzas and sub-stanzas) handling routines.
debug - Jacob Lundquist's debugg... | apache-2.0 |
emilkjer/django-model-utils | model_utils/managers.py | 1 | 8414 | from types import ClassType
import warnings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.fields.related import OneToOneField
from django.db.models.manager import Manager
from django.db.models.query import QuerySet
import django
class InheritanceQuerySe... | bsd-3-clause |
baris/fullerite | src/diamond/collectors/puppetdashboard/puppetdashboard.py | 4 | 1727 | # coding=utf-8
"""
Collect metrics from Puppet Dashboard
#### Dependencies
* urllib2
"""
import urllib2
import re
import diamond.collector
class PuppetDashboardCollector(diamond.collector.Collector):
def get_default_config_help(self):
config_help = super(PuppetDashboardCollector,
... | apache-2.0 |
40223151/2014c2g9 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/testmock/testmock.py | 737 | 40047 | import copy
import sys
import unittest
from unittest.test.testmock.support import is_instance
from unittest import mock
from unittest.mock import (
call, DEFAULT, patch, sentinel,
MagicMock, Mock, NonCallableMock,
NonCallableMagicMock, _CallList,
create_autospec
)
class Iter(object):
def __init__... | gpl-2.0 |
AZMAG/urbansim | urbansim/utils/logutil.py | 9 | 3327 | import contextlib
import logging
US_LOG_FMT = ('%(asctime)s|%(levelname)s|%(name)s|'
'%(funcName)s|%(filename)s|%(lineno)s|%(message)s')
US_LOG_DATE_FMT = '%Y-%m-%d %H:%M:%S'
US_FMT = logging.Formatter(fmt=US_LOG_FMT, datefmt=US_LOG_DATE_FMT)
@contextlib.contextmanager
def log_start_finish(msg, logger,... | bsd-3-clause |
easytaxibr/airflow | tests/models.py | 1 | 29842 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
nickster5001/ctracker | flask/lib/python3.4/site-packages/sqlalchemy/dialects/sybase/pyodbc.py | 33 | 2102 | # sybase/pyodbc.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sybase+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstr... | mit |
kaedroho/wagtail | wagtail/admin/widgets/tags.py | 7 | 1443 | import json
from django.conf import settings
from django.urls import reverse
from taggit.forms import TagWidget
from taggit.models import Tag
class AdminTagWidget(TagWidget):
template_name = 'wagtailadmin/widgets/tag_widget.html'
def __init__(self, *args, **kwargs):
self.tag_model = kwargs.pop('tag_... | bsd-3-clause |
cyberphox/MissionPlanner | Lib/site-packages/scipy/stats/tests/test_morestats.py | 57 | 10975 | # Author: Travis Oliphant, 2002
#
# Further enhancements and tests added by numerous SciPy developers.
#
import warnings
from numpy.testing import TestCase, run_module_suite, assert_array_equal, \
assert_almost_equal, assert_array_less, assert_array_almost_equal, \
assert_raises
import scipy.stats as stats
... | gpl-3.0 |
onejay09/runnymede-kitkat_3.0.101-wip | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/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
import sh... | gpl-2.0 |
AuyaJackie/odoo | addons/crm_partner_assign/report/crm_partner_report.py | 264 | 3374 | # -*- 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 |
MERegistro/meregistro | meregistro/apps/backend/views/__init__.py | 1 | 2562 | # -*- coding: UTF-8 -*-
from meregistro.shortcuts import my_render
from apps.seguridad.decorators import credential_required
from apps.backend.forms import ConfiguracionSolapasEstablecimientoForm
from apps.backend.models import ConfiguracionSolapasEstablecimiento
from apps.backend.forms import ConfiguracionSolapasAnex... | bsd-3-clause |
c86j224s/snippet | Python_asyncio_binary_echo/pyclient2/Lib/site-packages/setuptools/command/install_lib.py | 431 | 3840 | import os
import imp
from itertools import product, starmap
import distutils.command.install_lib as orig
class install_lib(orig.install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def run(self):
self.build()
outfiles = self.install()
if outfiles is not None:
... | apache-2.0 |
c2theg/DDoS_Information_Sharing | libraries/suds-jurko-0.6/suds/metrics.py | 18 | 1993 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... | mit |
hasecbinusr/pysal | pysal/spatial_dynamics/tests/test_util.py | 20 | 1117 | import unittest
import pysal
from pysal.spatial_dynamics import util
import numpy as np
class ShuffleMatrix_Tester(unittest.TestCase):
def setUp(self):
self.X = np.arange(16)
self.X.shape = (4, 4)
def test_shuffle_matrix(self):
np.random.seed(10)
obs = util.shuffle_matrix(self... | bsd-3-clause |
anryko/ansible | lib/ansible/modules/cloud/vmware/vmware_datacenter.py | 23 | 6554 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
... | gpl-3.0 |
syagev/kaggle_dsb | luna16/src/conv_net/data.py | 1 | 2668 | from __future__ import division
import numpy as np
import os
import pickle
import glob
import Image
from skimage.io import imread
from sklearn.cross_validation import train_test_split
dataset_dir = "../../data/samples"
def load():
tps = glob.glob(dataset_dir+"/*true.jpg")
fps_2 = glob.glob(dataset_dir+"/*fal... | apache-2.0 |
cpollard1001/FreeCAD_sf_master | src/Mod/Path/PathScripts/comparams_post.py | 23 | 4161 | # -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> *
#* ... | lgpl-2.1 |
cntnboys/410Lab6 | v1/lib/python2.7/site-packages/django/contrib/auth/tests/test_handlers.py | 88 | 2999 | from __future__ import unicode_literals
from django.contrib.auth.handlers.modwsgi import check_password, groups_for_user
from django.contrib.auth.models import User, Group
from django.contrib.auth.tests.custom_user import CustomUser
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import T... | apache-2.0 |
ace3df/ImageTweet | plugins/safebooru.py | 1 | 9578 | # -*- coding: utf-8 -*-
import random
import time
import sys
import os
import re
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
import utils
def delete_image(image):
import time
time.sleep(10)
os.remove(image)
def tag_clean(tag_html):
text = tag_html.t... | mit |
basicthinker/ThyNVM | src/arch/x86/isa/insts/simd64/integer/shift/left_logical_shift.py | 91 | 3272 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
sreejithr/emacs.d | pyenv/emacs/lib/python2.7/site-packages/rope/base/pyobjects.py | 102 | 8874 | from rope.base.fscommands import _decode_data
from rope.base import ast, exceptions, utils
class PyObject(object):
def __init__(self, type_):
if type_ is None:
type_ = self
self.type = type_
def get_attributes(self):
if self.type is self:
return {}
ret... | mit |
davebridges/mousedb | mousedb/veterinary/views.py | 1 | 7047 | '''This module generates the views for the veterinary app.
There is one generic home view for the entire app as well as detail, create update and delete views for these models:
* :class:`~mousedb.veterinary.models.MedicalIssue`
* :class:`~mousedb.veterinary.models.MedicalCondition`
* :class:`~mousedb.veterinary.model... | bsd-3-clause |
streeter/django-haystack | test_haystack/test_managers.py | 13 | 9147 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
from django.test import TestCase
from test_haystack.core.models import MockModel
from haystack import connections
from haystack.manager import SearchIndexManager
from haystack.models import SearchRes... | bsd-3-clause |
DexterInd/sockjs-tornado | sockjs/tornado/transports/pollingbase.py | 9 | 2119 | # -*- coding: utf-8 -*-
"""
sockjs.tornado.transports.pollingbase
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Polling transports base
"""
from sockjs.tornado import basehandler
from sockjs.tornado.transports import base
class PollingTransportBase(basehandler.PreflightHandler, base.BaseTransportMixin):
"""... | mit |
ANR-DIADEMS/timeside-diadems | timeside/plugins/diadems/irit_singings.py | 1 | 7234 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Maxime Le Coz <lecoz@irit.fr>
# This file is part of TimeSide.
# TimeSide 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
# ... | gpl-2.0 |
Xpray/flink | flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/functions/FlatMapFunction.py | 22 | 1727 | # ###############################################################################
# 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 thi... | apache-2.0 |
WholeGrainGoats/servo | tests/wpt/harness/wptrunner/executors/executorservodriver.py | 59 | 8838 | # 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/.
import json
import os
import socket
import threading
import time
import traceback
from .base import (Protocol,
... | mpl-2.0 |
axinging/sky_engine | sky/engine/build/scripts/make_token_matcher_unittest.py | 75 | 7486 | #!/usr/bin/env python
# Copyright (C) 2013 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 ... | bsd-3-clause |
go-bears/rally | rally/common/sshutils.py | 10 | 10374 | # Copyright 2013: Mirantis 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 b... | apache-2.0 |
SnapSearch/SnapSearch-Client-Python | src/SnapSearch/detector.py | 1 | 11166 | # -*- coding: utf-8 -*-
"""
SnapSearch.detector
~~~~~~~~~~~~~~~~~~~
:copyright: 2014 by `SnapSearch <https://snapsearch.io/>`_
:license: MIT, see LICENSE for more details.
:author: `LIU Yu <liuyu@opencps.net>`_
:date: 2014/03/08
"""
# future import should come first
from __future__ import wi... | mit |
phoebe-project/phoebe2-docs | 2.2/tutorials/irrad_method_horvat.py | 1 | 3005 | #!/usr/bin/env python
# coding: utf-8
# Lambert Scattering (irrad_method='horvat')
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't wa... | gpl-3.0 |
rcatwood/Savu | savu/test/jenkins/process_list_tests/i18_xrd_pipeline_test.py | 1 | 1440 | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | gpl-3.0 |
FrozenH2O/Bibliotheca | cherrypy/lib/httpauth.py | 40 | 12835 | """
This module defines functions to implement HTTP Digest Authentication (:rfc:`2617`).
This has full compliance with 'Digest' and 'Basic' authentication methods. In
'Digest' it supports both MD5 and MD5-sess algorithms.
Usage:
First use 'doAuth' to request the client authentication for a
certain resource. Yo... | gpl-2.0 |
kreatorkodi/repository.torrentbr | plugin.video.youtube/resources/lib/youtube_plugin/kodion/items/audio_item.py | 3 | 1805 | __author__ = 'bromix'
from .base_item import BaseItem
class AudioItem(BaseItem):
def __init__(self, name, uri, image=u'', fanart=u''):
BaseItem.__init__(self, name, uri, image, fanart)
self._duration = None
self._track_number = None
self._year = None
self._genre = None
... | gpl-2.0 |
afodor/pythonExamples | src/viterbi/viterbiExample.py | 1 | 2894 | import random
class MarkovState:
def __init__(self,charsToEmit, emissionProbs,transitionProbs):
self.charsToEmit = charsToEmit
self.emissionProbs = emissionProbs
self.transitionProbs = transitionProbs
def getEmissionIndex(self):
aRand = random.random()
cumulative = 0
index =0
for val ... | gpl-2.0 |
ZHAW-INES/rioxo-uClinux-dist | user/python/python-2.4.4/Lib/test/test_decorators.py | 34 | 8985 | import unittest
from test import test_support
def funcattrs(**kwds):
def decorate(func):
func.__dict__.update(kwds)
return func
return decorate
class MiscDecorators (object):
@staticmethod
def author(name):
def decorate(func):
func.__dict__['author'] = name
... | gpl-2.0 |
salazardetroya/libmesh | doc/statistics/libmesh_citations.py | 1 | 2340 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Number of "papers using libmesh" by year.
#
# Note 1: this does not count citations "only," the authors must have actually
# used libmesh in part of their work. Therefore, these counts do not include
# things like Wolfgang citing us in his pap... | lgpl-2.1 |
oopy/micropython | tests/wipy/i2c.py | 68 | 4201 | '''
I2C test for the CC3200 based boards.
A MPU-9150 sensor must be connected to the I2C bus.
'''
from machine import I2C
import os
import time
mch = os.uname().machine
if 'LaunchPad' in mch:
i2c_pins = ('GP11', 'GP10')
elif 'WiPy' in mch:
i2c_pins = ('GP15', 'GP10')
else:
raise Exception('Board not suppo... | mit |
bsipocz/statsmodels | statsmodels/sandbox/archive/linalg_covmat.py | 33 | 8760 | from __future__ import print_function
import math
import numpy as np
from scipy import linalg, stats
from .linalg_decomp_1 import tiny2zero
#univariate standard normal distribution
#following from scipy.stats.distributions with adjustments
sqrt2pi = math.sqrt(2 * np.pi)
logsqrt2pi = math.log(sqrt2pi)
class StandardN... | bsd-3-clause |
amwelch/a10sdk-python | a10sdk/core/cgnv6/cgnv6_l4.py | 2 | 8059 | from a10sdk.common.A10BaseClass import A10BaseClass
class SamplingEnable(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param counters1: {"enum": ["all", "no-fwd-route", "no-rev-route", "out-of-session-memory", "tcp-rst-sent", "ipip-icmp-reply-sent", "icmp-filtered-sen... | apache-2.0 |
2947721120/thumbor | thumbor/loaders/http_loader.py | 1 | 4393 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import re
from functools import partial
from urllib import unquote, q... | mit |
kokoar/zulip | puppet/zulip_internal/files/postgresql/pg_backup_and_purge.py | 114 | 1575 | #!/usr/bin/python
import subprocess
import sys
import logging
import dateutil.parser
import pytz
from datetime import datetime, timedelta
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s")
logger = logging.getLogger(__name__)
def run(args, dry_run=False):
if dry_run:
print "Would have r... | apache-2.0 |
zachomedia/xml-parsing-testing | libs-src/libxml2-2.9.1/doc/apibuild.py | 21 | 81665 | #!/usr/bin/python -u
#
# This is the API builder, it parses the C sources and build the
# API formal description in XML.
#
# See Copyright for the status of this software.
#
# daniel@veillard.com
#
import os, sys
import string
import glob
debug=0
#debugsym='ignorableWhitespaceSAXFunc'
debugsym=None
#
# C parser analy... | mit |
Strangemother/python-state-machine | scratch/machine_4/integration.py | 1 | 4183 | from tools import color_print as cl
class ConditionIntegrate(object):
def read_node(self, node):
'''
Read the conditions of a node.
'''
if hasattr(node, 'conditions') is False:
return
cnds = node.conditions()
# cl('yellow', 'get conditions for node', no... | mit |
cycotech/WAR-app | env/lib/python3.5/site-packages/pip/_vendor/progress/bar.py | 510 | 2685 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and 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 P... | mit |
DualSpark/ansible | lib/ansible/parsing/vault/__init__.py | 18 | 19977 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed i... | gpl-3.0 |
ujenmr/ansible | lib/ansible/modules/network/aci/aci_aaa_user_certificate.py | 27 | 7876 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.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_ver... | gpl-3.0 |
hperala/kontuwikibot | pywikibot/families/wikipedia_family.py | 1 | 24229 | # -*- coding: utf-8 -*-
"""Family module for Wikipedia."""
from __future__ import unicode_literals
from pywikibot import family
__version__ = '$Id: 3f958b3aee3b7b6794546f2ee7f13757d36b0a30 $'
# The Wikimedia family that is known as Wikipedia, the Free Encyclopedia
class Family(family.WikimediaFamily):
"""Fami... | mit |
abhattad4/Digi-Menu | build/lib.linux-x86_64-2.7/django/conf/__init__.py | 46 | 7058 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time # Needed for Windows... | bsd-3-clause |
Fafou/Sick-Beard | sickbeard/config.py | 35 | 14603 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
vallsv/pyqtgraph | pyqtgraph/graphicsItems/GridItem.py | 50 | 4550 | from ..Qt import QtGui, QtCore
from .UIGraphicsItem import *
import numpy as np
from ..Point import Point
from .. import functions as fn
__all__ = ['GridItem']
class GridItem(UIGraphicsItem):
"""
**Bases:** :class:`UIGraphicsItem <pyqtgraph.UIGraphicsItem>`
Displays a rectangular grid of lines indicat... | mit |
CI-WATER/TethysCluster | utils/scimage_12_04.py | 2 | 17224 | #!/usr/bin/env python
"""
This script is meant to be run inside of a ubuntu cloud image available at
uec-images.ubuntu.com::
$ EC2_UBUNTU_IMG_URL=http://uec-images.ubuntu.com/precise/current
$ wget $EC2_UBUNTU_IMG_URL/precise-server-cloudimg-amd64.tar.gz
or::
$ wget $EC2_UBUNTU_IMG_URL/precise-server-clo... | gpl-3.0 |
versae/neo4j-rest-client | neo4jrestclient/tests/test_pickle.py | 3 | 1053 | # -*- coding: utf-8 -*-
try:
import cPickle as pickle
except:
import pickle
import unittest
import os
from neo4jrestclient import client
NEO4J_URL = os.environ.get('NEO4J_URL', "http://localhost:7474/db/data/")
NEO4J_VERSION = os.environ.get('NEO4J_VERSION', None)
class GraphDatabaseTesCase(unittest.TestCa... | gpl-3.0 |
caio1982/capomastro | jenkins/utils.py | 1 | 4525 | from urlparse import urljoin
import xml.etree.ElementTree as ET
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.utils import timezone
from django.utils.text import slugify
PARAMETERS = ".//properties/hudson.model.ParametersDefini... | mit |
dikshyam/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/gluesemantics/linearlogic.py | 9 | 31769 | # Natural Language Toolkit: Linear Logic
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from nltk.internals import Counter
import glue
import drt_glue
class Error(Exception): pass
class UnificationError(Exception): pass
class Variable:
... | gpl-3.0 |
dset0x/invenio | invenio/modules/editor/config.py | 5 | 10743 | # This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2015 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
# License, or (at your option)... | gpl-2.0 |
nikhilm/muzicast | muzicast/web/principal.py | 2 | 13073 | # -*- coding: utf-8 -*-
"""
flaskext.principal
~~~~~~~~~~~~~~~~~~
Identity management for Flask.
:copyright: (c) 2010 by Ali Afshar.
:license: MIT, see LICENSE for more details.
"""
import sys
from functools import partial, wraps
from collections import namedtuple, deque
from flask import g, s... | mit |
songmonit/CTTMSONLINE_V8 | addons/hr_recruitment/wizard/__init__.py | 381 | 1095 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
mclois/iteexe | exe/jsui/idevicepane.py | 7 | 7549 | # -- coding: utf-8 --
# ===========================================================================
# eXe
# Copyright 2012, Pedro Peña Pérez, Open Phoenix IT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwar... | gpl-2.0 |
koomik/CouchPotatoServer | couchpotato/core/plugins/log/main.py | 1 | 4216 | import os
import traceback
from couchpotato.api import addApiView
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.environment import Env
log = CPLog... | gpl-3.0 |
alisaifee/AutobahnPython | examples/twisted/websocket/echo_compressed/client_advanced.py | 18 | 4393 | ###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.