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 |
|---|---|---|---|---|---|
psawaya/Mental-Ginger | django/utils/numberformat.py | 290 | 1632 | from django.conf import settings
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos, grouping=0, thousand_sep=''):
"""
Gets a number (as a number or string), and returns it as a string,
using formats definied as arguments:
* decimal_sep: Decimal separator symbol... | bsd-3-clause |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/nose-0.10.1-py2.5.egg/nose/plugins/isolate.py | 1 | 3674 | """Use the isolation plugin with --with-isolation or the
NOSE_WITH_ISOLATION environment variable to clean sys.modules after
each test module is loaded and executed.
The isolation module is in effect similar to wrapping the following
functions around the import and execution of each test module::
def setup(module... | bsd-3-clause |
nedlowe/amaas-core-sdk-python | amaascore/asset_managers/relationship.py | 3 | 1737 | from __future__ import absolute_import, division, print_function, unicode_literals
from amaascore.core.amaas_model import AMaaSModel
from amaascore.asset_managers.enums import RELATIONSHIP_TYPES
class Relationship(AMaaSModel):
def __init__(self, asset_manager_id, related_id, relationship_id, relationship_type,... | apache-2.0 |
2014c2g9/c2g9 | w2/static/Brython2.0.0-20140209-164925/Lib/functools.py | 730 | 13596 | """functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>
# and Raymond Hettinger <python at rcn.com>
# Copyright (C) 2006-2... | gpl-2.0 |
edx/edx-platform | openedx/core/djangoapps/user_authn/signals.py | 3 | 1507 | """
Signals for user_authn
"""
from typing import Any, Dict, Optional, Tuple
from common.djangoapps.student.models import UserProfile
from common.djangoapps.track import segment
def user_fields_changed(
user=None,
table=None,
changed_fields: Optional[Dict[str, Tuple[Any, Any]]] = None,
**_kwargs,
):... | agpl-3.0 |
solin319/incubator-mxnet | example/speech_recognition/stt_metric.py | 43 | 8010 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
plumgrid/plumgrid-nova | nova/tests/cells/fakes.py | 45 | 7018 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
graik/labhamster | labhamster/admin.py | 1 | 12409 | ## Copyright 2016 - 2018 Raik Gruenberg
## This file is part of the LabHamster project (https://github.com/graik/labhamster).
## LabHamster is released under the MIT open source license, which you can find
## along with this project (LICENSE) or at <https://opensource.org/licenses/MIT>.
from __future__ import unicode... | mit |
fdudatamining/framework | tests/draw/test_simple.py | 1 | 1233 | import numpy as np
import pandas as pd
from unittest import TestCase
from framework import draw
X = np.array([1, 2, 3, 4, 5])
class TestSimplePlots(TestCase):
def test_kinds(self):
self.assertIsNotNone(draw.draw_kinds)
def test_line(self):
draw.draw(clear=True, kind='line', x=X, y=X)
draw.draw(clear=... | gpl-2.0 |
nielsbuwen/ilastik | ilastik/applets/splitBodyCarving/bodySplitInfoWidget.py | 4 | 16852 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | gpl-3.0 |
scizen9/kpy | SEDM/Extract.py | 2 | 12501 | # Code by Nick Konidaris
# (c) 2014
#
# nick.konidaris@gmail.com
# For the SED Machine Spectrograph
#
import IO
import numpy as np
import scipy as sp
import pylab as pl
import scipy.signal
import scipy.spatial
from scipy.interpolate import interp1d
from SEDM import Flexure as FF
reload (IO)
def lambda_to_dlambda(l... | gpl-2.0 |
wa3l/mailr | email_model.py | 1 | 1590 | from flask.ext.sqlalchemy import SQLAlchemy
import html2text as convert
import time
db = SQLAlchemy()
class Email(db.Model):
"""
Email model
Store emails going through the app in a database.
"""
id = db.Column(db.Integer, primary_key=True)
to_email = db.Column(db.String(254))
to_name ... | mit |
manveru0/FeaCore_Phoenix_S3 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
ragnarstroberg/imsrg | src/pybind11/tests/test_call_policies.py | 4 | 5118 | import pytest
def test_keep_alive_argument(capture):
from pybind11_tests import Parent, Child, ConstructorStats
n_inst = ConstructorStats.detail_reg_inst()
with capture:
p = Parent()
assert capture == "Allocating parent."
with capture:
p.addChild(Child())
assert Constructo... | gpl-2.0 |
ronaldsantos63/Gera_SPED_SysPDV | resources_rc.py | 1 | 125636 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: ter 29. set 21:52:13 2015
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x01\x57\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\... | mit |
ewmoore/numpy | numpy/_import_tools.py | 13 | 12896 | import os
import sys
__all__ = ['PackageLoader']
class PackageLoader(object):
def __init__(self, verbose=False, infunc=False):
""" Manages loading packages.
"""
if infunc:
_level = 2
else:
_level = 1
self.parent_frame = frame = sys._getframe(_level)... | bsd-3-clause |
hgl888/chromium-crosswalk | build/android/pylib/base/base_test_result.py | 40 | 6134 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing base test results classes."""
class ResultType(object):
"""Class enumerating test types."""
PASS = 'PASS'
SKIP = 'SKIP'
FAI... | bsd-3-clause |
lzw120/django | django/contrib/localflavor/cz/forms.py | 9 | 4488 | """
Czech-specific form helpers
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.cz.cz_regions import REGION_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Select, RegexField, Field
from django.utils... | bsd-3-clause |
wetek-enigma/enigma2 | lib/python/Screens/Console.py | 33 | 2566 | from enigma import eConsoleAppContainer
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.ScrollLabel import ScrollLabel
from Components.Sources.StaticText import StaticText
class Console(Screen):
def __init__(self, session, title = "Console", cmdlist = None, finishedCallbac... | gpl-2.0 |
dessHub/bc-14-online-store-application | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/_inputstream.py | 328 | 32532 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, binary_type
from pip._vendor.six.moves import http_client, urllib
import codecs
import re
from pip._vendor import webencodings
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .con... | gpl-3.0 |
QualiSystems/AWS-Shell | package/tests/test_domain_services/test_instance_waiter.py | 1 | 6035 | from unittest import TestCase
from mock import Mock, patch
from cloudshell.cp.aws.domain.services.waiters.instance import InstanceWaiter
instance = Mock()
instance.state = {'Name': ''}
class helper:
@staticmethod
def change_to_terminate(a):
instance.state['Name'] = InstanceWaiter.TERMINATED
@st... | isc |
Quarx2k/android_kernel_asus_padfone_s | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
brakhane/python-mode | pymode/environment.py | 2 | 6239 | """ Define interfaces. """
from __future__ import print_function
import vim
import json
import time
import os.path
from ._compat import PY2
class VimPymodeEnviroment(object):
""" Vim User interface. """
prefix = '[Pymode]'
def __init__(self):
""" Init VIM environment. """
self.curren... | lgpl-3.0 |
xuxiandi/picasso-graphic | tools/gyp/pylib/gyp/generator/ninja.py | 25 | 73934 | # Copyright (c) 2013 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.
import copy
import hashlib
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
import gyp.common
import gyp.msvs_... | bsd-3-clause |
hanselke/erpnext-1 | erpnext/config/manufacturing.py | 38 | 2674 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
"type": "doctype",
"name": "BOM",
"description": _("Bill of Materials (BOM)"),
"label": _("Bill of Material")
},
{
"type": ... | agpl-3.0 |
sthirugn/robottelo | robottelo/ui/architecture.py | 2 | 1561 | # -*- encoding: utf-8 -*-
"""Implements Architecture UI"""
from robottelo.constants import FILTER
from robottelo.ui.base import Base
from robottelo.ui.locators import common_locators, locators
from robottelo.ui.navigator import Navigator
class Architecture(Base):
"""Manipulates architecture from UI"""
def n... | gpl-3.0 |
jjingrong/PONUS-1.2 | venv/Lib/encodings/aliases.py | 418 | 14848 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... | mit |
stevertaylor/NX01 | newcmaps.py | 28 | 50518 | # New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
# and (in the case of viridis) Eric Firing.
#
# This file and the colormaps in it are released under the CC0 license /
# public domain dedication. We would appreciate credit if you use or
# redistribute these colormaps, but do not impose any legal r... | mit |
juju/juju-gui-charm | hooks/charmhelpers/core/templating.py | 1 | 3186 | # Copyright 2014-2015 Canonical Limited.
#
# This file is part of charm-helpers.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the hope ... | agpl-3.0 |
google-research/ssl_detection | third_party/tensorpack/tensorpack/dataflow/imgaug/crop.py | 2 | 6674 | # -*- coding: utf-8 -*-
# File: crop.py
import numpy as np
import cv2
from ...utils.argtools import shape2d
from ...utils.develop import log_deprecated
from .base import ImageAugmentor, ImagePlaceholder
from .transform import CropTransform, TransformList, ResizeTransform, PhotometricTransform
from .misc import Resize... | apache-2.0 |
nathanielmanistaatgoogle/grpc | src/python/src/grpc/framework/base/exceptions.py | 44 | 1716 | # 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 |
Oi-Android/android_kernel_xiaomi_ferrari-mr | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
losywee/rethinkdb | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-deffile.py | 344 | 1252 | #!/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.
"""
Make sure a .def file is handled in the link.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(form... | agpl-3.0 |
aviciimaxwell/odoo | addons/purchase/edi/purchase_order.py | 439 | 9703 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
lfblogs/aio2py | aio2py/db/field.py | 2 | 1321 | # -*- coding: UTF-8 -*-
__author__ = "Liu Fei"
__github__ = "http://github.com/lfblogs"
__all__ = [
"Field",
"StringField",
"BooleanField",
"IntegerField",
"FloatField",
"TextField",
]
"""
Define field
"""
class Field(object):
def __init__(self, name, column_type, primary_key, default... | apache-2.0 |
idrogeno/FusionOE | lib/python/Screens/LocationBox.py | 23 | 15370 | #
# Generic Screen to select a path/filename combination
#
# GUI (Screens)
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.HelpMenu import HelpableScreen
from Screens.ChoiceBox import ChoiceBox
# Generic
from Tools.BoundFunction import bou... | gpl-2.0 |
danduggan/hltd | lib/urllib3-1.10/urllib3_hltd/response.py | 243 | 11686 | import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import ProtocolError, DecodeError, ReadTimeoutError
from .packages.six import string_types as basestring, binary_type
from .connection import HTTPException, BaseSSLError
from .util.response impor... | lgpl-3.0 |
marscher/PyEMMA | pyemma/_base/progress/test_progress.py | 3 | 3522 | # This file is part of PyEMMA.
#
# Copyright (c) 2017 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 o... | lgpl-3.0 |
vktr/CouchPotatoServer | libs/subliminal/tasks.py | 170 | 2328 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | gpl-3.0 |
nkalodimas/invenio | modules/bibupload/lib/bibupload.py | 1 | 143104 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 ... | gpl-2.0 |
kivy/plyer | plyer/facades/wifi.py | 1 | 4169 | '''
Wifi Facade.
=============
The :class:`Wifi` is to provide access to the wifi of your mobile/ desktop
devices.
It currently supports `connecting`, `disconnecting`, `scanning`, `getting
available wifi network list` and `getting network information`.
Simple examples
---------------
To enable/ turn on wifi scannin... | mit |
karllessard/tensorflow | tensorflow/python/autograph/converters/break_statements.py | 14 | 5865 | # 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 |
tomdee/calico-docker | tests/st/test_diags.py | 15 | 1378 | # Copyright 2015 Metaswitch Networks
#
# 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 w... | apache-2.0 |
jbonofre/beam | sdks/python/apache_beam/io/avroio.py | 9 | 17237 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
rogerscristo/BotFWD | env/lib/python3.6/site-packages/telegram/vendor/ptb_urllib3/urllib3/exceptions.py | 8 | 6849 | from __future__ import absolute_import
from .packages.six.moves.http_client import (
IncompleteRead as httplib_IncompleteRead
)
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
p... | mit |
burzillibus/RobHome | venv/lib/python2.7/site-packages/zmq/tests/test_imports.py | 9 | 1791 | # Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import sys
from unittest import TestCase
class TestImports(TestCase):
"""Test Imports - the quickest test to ensure that we haven't
introduced version-incompatible syntax errors."""
def test_toplevel(self):
... | mit |
Yannig/ansible | lib/ansible/__init__.py | 301 | 1224 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
jakevdp/lombscargle | lombscargle/implementations/utils.py | 1 | 5934 | from __future__ import print_function, division
import numpy as np
try:
from scipy import special as scipy_special
except ImportError:
scipy_special = None
# Precomputed factorials
FACTORIALS = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800,
39916800, 479001600, 6227020800, 8717829120... | bsd-3-clause |
GNOME/orca | test/keystrokes/oobase/bug_463172.py | 4 | 4082 | #!/usr/bin/python
"""Test to verify bug #463172 is still fixed.
OOo sbase application crashes when entering a database record.
"""
from macaroon.playback import *
sequence = MacroSequence()
######################################################################
# 1. Start oobase. Wait for the first screen of the ... | lgpl-2.1 |
todaychi/hue | desktop/core/ext-py/boto-2.46.1/boto/mws/connection.py | 135 | 49808 | # Copyright (c) 2012-2014 Andy Davidoff http://www.disruptek.com/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy... | apache-2.0 |
gabrielfalcao/lettuce | tests/integration/lib/Django-1.3/django/contrib/admin/sites.py | 70 | 17393 | import re
from django import http, template
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.contenttypes import views as contenttype_views
from django.views.decorators.csrf import ... | gpl-3.0 |
17zuoye/luigi | luigi/contrib/hdfs/snakebite_client.py | 1 | 10933 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
johnkitten/FinalProject | tailbone/geoip/__init__.py | 34 | 1044 | # 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 a... | apache-2.0 |
hryamzik/ansible | lib/ansible/modules/system/make.py | 30 | 4659 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | gpl-3.0 |
smaty1/shadowsocks | shadowsocks/encrypt.py | 990 | 5180 | #!/usr/bin/env python
#
# Copyright 2012-2015 clowwindy
#
# 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 la... | apache-2.0 |
a25kk/biobee | docs/conf.py | 1 | 5997 | # -*- coding: utf-8 -*-
# Build configuration file.
# This file is execfile()d with the current directory set to its
# containing dir.
# Note that not all possible configuration values are present in this
# autogenerated file.
# All configuration values have a default; values that are commented out
# serve to show the ... | mit |
arun6582/django | django/contrib/postgres/aggregates/statistics.py | 9 | 1970 | from django.db.models import FloatField, IntegerField
from django.db.models.aggregates import Aggregate
__all__ = [
'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept',
'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate',
]
class StatAggregate(Aggregate):
def __in... | bsd-3-clause |
fzadow/CATMAID | django/applications/catmaid/control/circles.py | 2 | 5431 | import json
import networkx as nx
from itertools import combinations
from collections import defaultdict
from functools import partial
from django.db import connection
from django.http import HttpResponse
from catmaid.models import UserRole
from catmaid.control.authentication import requires_user_role
from catmaid.c... | agpl-3.0 |
niranjan94/open-event-orga-server | tests/unittests/api/test_get_list_queries.py | 8 | 5466 | import json
import unittest
from app import current_app as app
from app.helpers.data import update_role_to_admin
from tests.unittests.api.utils import get_path, create_event
from tests.unittests.auth_helper import register, login
from tests.unittests.setup_database import Setup
from tests.unittests.utils import OpenEv... | gpl-3.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/scipy/special/tests/test_spence.py | 26 | 1165 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import sqrt, log, pi
from scipy.special._testutils import FuncData
from scipy.special import spence
def test_consistency():
# Make sure the implementation of spence for real arguments
# agrees with the implementati... | mit |
timduru/platform-external-chromium_org | tools/python/google/platform_utils_mac.py | 183 | 5676 | # Copyright (c) 2011 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.
"""Platform-specific utility methods shared by several scripts."""
import os
import subprocess
import google.path_utils
class PlatformUtility(object)... | bsd-3-clause |
KJin99/zulip | zerver/templatetags/minified_js.py | 118 | 1402 | from __future__ import absolute_import
from django.template import Node, Library, TemplateSyntaxError
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
register = Library()
class MinifiedJSNode(Node):
def __init__(self, sourcefile):
self.sourcefile = sour... | apache-2.0 |
ricardogsilva/QGIS | python/testing/__init__.py | 12 | 21650 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Matthias Kuhn
Email : matthias@opengis.ch
*********************************... | gpl-2.0 |
xflows/rdm | rdm/wrappers/rsd/rsd.py | 2 | 7509 | # Python interface to RSD.
#
# author: Anze Vavpetic <anze.vavpetic@ijs.si>, 2012
#
import os.path
import shutil
import logging
import re
import tempfile
from stat import S_IREAD, S_IEXEC
from subprocess import PIPE
try:
from ..security import SafePopen
except:
import os
parent_dir = os.path.dirname(os.pat... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/celery/utils/imports.py | 9 | 2914 | # -*- coding: utf-8 -*-
"""
celery.utils.import
~~~~~~~~~~~~~~~~~~~
Utilities related to importing modules and symbols by name.
"""
from __future__ import absolute_import
import imp as _imp
import importlib
import os
import sys
from contextlib import contextmanager
from kombu.utils import symbol_by_nam... | agpl-3.0 |
elkingtonmcb/h2o-2 | py/testdir_release/c2/test_c2_nongz_fvec.py | 9 | 5382 | import unittest, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_glm, h2o_common, h2o_exec as h2e
import h2o_print
DO_GLM = False
LOG_MACHINE_STATS = True
print "Assumes you ran ../build_for_clone.py in this directory"
print "Using h2o-nodes.json. Also the sandbox dir"
c... | apache-2.0 |
jarodwilson/linux-muck | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
zmathew/django-backbone | backbone/tests/tests.py | 1 | 28973 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
import json
from django.contrib.auth.models import User, Permission
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.translation import ugettext as _
from backbone.tests.models import Pr... | bsd-3-clause |
ceelian/callme | callme/protocol.py | 3 | 2625 | # Copyright (c) 2009-2014, Christian Haintz
# 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 ... | bsd-3-clause |
Tao-Ma/gpdb | gpMgmt/bin/gppylib/test/regress/test_regress_pygresql.py | 12 | 4162 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
""" Unittesting for pygres module
"""
import logging
import unittest
from pygresql import pg
from pygresql import pgdb
from gppylib import gplog
from gppylib.db.dbconn import *
from gppylib.db.test import skipIfDatabaseDown
logger=... | apache-2.0 |
gylian/sickbeard | lib/requests/packages/chardet2/euckrprober.py | 63 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
piffey/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_alert_profiles.py | 59 | 11282 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
gusai-francelabs/datafari | windows/python/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | apache-2.0 |
kapilt/cloud-custodian | c7n/resources/s3.py | 1 | 112011 | # Copyright 2015-2017 Capital One Services, 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 ... | apache-2.0 |
leighpauls/k2cro4 | third_party/android_testrunner/run_command.py | 23 | 5845 | #!/usr/bin/python2.4
#
#
# Copyright 2007, The Android Open Source Project
#
# 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... | bsd-3-clause |
jonathanstrong/functor | setup.py | 1 | 1091 | #!/usr/bin/env python
# Bootstrap installation of Distribute
import distribute_setup
distribute_setup.use_setuptools()
import os
from setuptools import setup
PROJECT = u'Functor'
VERSION = '0.1'
URL = ''
AUTHOR = u'Jonathan Strong'
AUTHOR_EMAIL = u'jonathan.strong@gmail.com'
DESC = "Implements a function-object pa... | mit |
joebowen/LogMyRocket_API | LogMyRocket/libraries/sys_packages/pycparser/pycparser/ply/lex.py | 482 | 40739 | # -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2011,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... | gpl-3.0 |
fusic-com/flask-webcache | tests/test_storage.py | 1 | 12927 | from __future__ import unicode_literals
import unittest
from datetime import timedelta, datetime
from six.moves.cPickle import dumps, loads
from six import iteritems
from flask import Flask, send_file
from werkzeug.wrappers import Response
from werkzeug.datastructures import HeaderSet
from werkzeug.contrib.cache impor... | mit |
qtekfun/htcDesire820Kernel | external/chromium_org/third_party/jinja2/sandbox.py | 637 | 13445 | # -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... | gpl-2.0 |
dralves/nixysa | third_party/ply-3.1/test/yacc_inf.py | 174 | 1278 | # -----------------------------------------------------------------------------
# yacc_inf.py
#
# Infinite recursion
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# Parsing... | apache-2.0 |
tkolhar/robottelo | robottelo/cli/location.py | 16 | 5994 | # -*- encoding: utf-8 -*-
# (Too many public methods) pylint: disable=R0904
"""
Usage::
hammer location [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
add-compute-resource Associate a com... | gpl-3.0 |
sarvex/tensorflow | tensorflow/lite/ios/extract_object_files.py | 9 | 6276 | # 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 |
atdaemon/pip | pip/_vendor/lockfile/mkdirlockfile.py | 536 | 3096 | from __future__ import absolute_import, division
import time
import os
import sys
import errno
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class MkdirLockFile(LockBase):
"""Lock file by creating a directory."""
def __init__(self, path, threaded=True,... | mit |
mrquim/repository.mrquim | repo/script.module.unidecode/lib/unidecode/__init__.py | 36 | 1882 | # -*- coding: utf-8 -*-
# vi:tabstop=4:expandtab:sw=4
"""Transliterate Unicode text into plain 7-bit ASCII.
Example usage:
>>> from unidecode import unidecode:
>>> unidecode(u"\u5317\u4EB0")
"Bei Jing "
The transliteration uses a straightforward map, and doesn't have alternatives
for the same character based on langu... | gpl-2.0 |
GauriGNaik/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/serializer/htmlserializer.py | 423 | 12897 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import gettext
_ = gettext.gettext
try:
from functools import reduce
except ImportError:
pass
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements, entities,... | mpl-2.0 |
JTarball/docker-django-polymer-starter-kit | docker/app/app/backend/apps/_archive/content/templatetags/navbar_tags.py | 8 | 6027 | from __future__ import unicode_literals
import logging
from inspect import ismethod
from django.core.urlresolvers import (reverse, resolve, NoReverseMatch,
Resolver404)
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.encoding i... | isc |
e1ven/Waymoot | libs/tornado-2.2/build/lib/tornado/test/testing_test.py | 10 | 1318 | #!/usr/bin/env python
import unittest
from tornado.testing import AsyncTestCase, LogTrapTestCase
class AsyncTestCaseTest(AsyncTestCase, LogTrapTestCase):
def test_exception_in_callback(self):
self.io_loop.add_callback(lambda: 1/0)
try:
self.wait()
self.fail("did not get expe... | mit |
eroicaleo/LearningPython | interview/leet/124_Binary_Tree_Maximum_Path_Sum.py | 1 | 1054 | #!/usr/bin/env python
from tree import *
class Solution:
def maxPathSum(self, root):
"""
:type root: TreeNode
:rtype: int
"""
if root == None:
return 0
self.maxSum = root.val
self.maxPathSumNode(root)
return self.maxSum
def maxPathSu... | mit |
jetskijoe/SickGear | lib/sqlalchemy/schema.py | 75 | 1103 | # schema.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
"""Compatiblity namespace for sqlalchemy.sql.schema and related.
"""
from .sql.base import... | gpl-3.0 |
ChileanVirtualObservatory/flask_endpoint | endpoint/run.py | 1 | 1314 | #This file is part of ChiVO, the Chilean Virtual Observatory
#A project sponsored by FONDEF (D11I1060)
#Copyright (C) 2015 Universidad Tecnica Federico Santa Maria Mauricio Solar
# Marcelo Mendoza
# Universidad de Chile Die... | gpl-3.0 |
neumerance/deploy | .venv/lib/python2.7/site-packages/django/contrib/localflavor/ca/forms.py | 100 | 4953 | """
Canada-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, CharField, Select
from django.utils.encoding import smart_text
from django.utils.tran... | apache-2.0 |
ddebrunner/streamsx.topology | test/python/spl/testtkpy/opt/python/streams/test_ec.py | 2 | 4678 | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
# Import the SPL decorators
from streamsx.spl import spl
import streamsx.ec as ec
import pickle
#------------------------------------------------------------------
# Test Execution Context (streamsx.ex) functions
#-----------------------... | apache-2.0 |
Vixionar/django | django/test/testcases.py | 9 | 57187 | from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util... | bsd-3-clause |
szarroug3/X-Ray_Calibre_Plugin | lib/status_info.py | 2 | 4261 | #status_info.py
'''Holds status information'''
class StatusInfo(object):
'''Class to hold book status information'''
# Status
SUCCESS = 0
IN_PROGRESS = 1
FAIL = 2
# Status Messages
F_BASIC_INFORMATION_MISSING = 'Missing title and/or author.'
F_COULD_NOT_FIND_ASIN = 'Could... | gpl-3.0 |
mollel/bank | Admin/assets/jquery-file-upload/server/gae-python/main.py | 223 | 5173 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appeng... | apache-2.0 |
jtyr/ansible-modules-core | cloud/docker/docker_login.py | 14 | 10768 | #!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@redhat.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 ... | gpl-3.0 |
Lingotek/filesystem-connector | python3/ltk/git_auto.py | 2 | 3755 | # Python 2
# from ConfigParser import ConfigParser, NoOptionError
# End Python 2
# Python 3
from configparser import ConfigParser, NoOptionError
# End Python 3
from ltk.constants import CONF_DIR, CONF_FN, SYSTEM_FILE, ERROR_FN
import sys
import os.path
import codecs
from git import Repo
from git import RemoteProgress
i... | mit |
arnedesmedt/dotfiles | .config/sublime-text-3/Packages.symlinkfollow/python-markdown/st3/markdown/extensions/wikilinks.py | 123 | 2872 | '''
WikiLinks Extension for Python-Markdown
======================================
Converts [[WikiLinks]] to relative links.
See <https://pythonhosted.org/Markdown/extensions/wikilinks.html>
for documentation.
Original code Copyright [Waylan Limberg](http://achinghead.com/).
All changes Copyright The Python Markdow... | mit |
anntzer/scikit-learn | sklearn/ensemble/__init__.py | 12 | 1655 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification, regression and anomaly detection.
"""
import typing
from ._base import BaseEnsemble
from ._forest import RandomForestClassifier
from ._forest import RandomForestRegressor
from ._forest import RandomTreesEmbedding
from ._forest i... | bsd-3-clause |
dstiert/Wox | PythonHome/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 304 | 15086 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.