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 |
|---|---|---|---|---|---|
claudep/pootle | tests/views/timeline.py | 1 | 9375 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from hashlib import md5
from itertools impor... | gpl-3.0 |
jorik041/MITMf | core/responder/fingerprinter/RelayPackets.py | 9 | 19989 | # NBT-NS/LLMNR Responder
# Created by Laurent Gaffie
# Copyright (C) 2014 Trustwave Holdings, 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 License, or
# (at you... | gpl-3.0 |
Lemma1/MAC-POSTS | doc_builder/sphinx-contrib/matlabdomain/tests/test_mat_types.py | 1 | 4777 | #! /usr/bin/env python
from sphinxcontrib import mat_documenters as doc
from nose.tools import eq_, ok_
import os
from pprint import pprint
DIRNAME = doc.MatObject.basedir = os.path.abspath(os.path.dirname(__file__))
def test_ellipsis_after_equals():
"""
test function with ellipsis after equals
... | mit |
spicykaiju/pyvmomi | pyVmomi/SoapAdapter.py | 7 | 61763 | # VMware vSphere Python SDK
# Copyright (c) 2008-2015 VMware, 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
#
# Unle... | apache-2.0 |
airbnb/caravel | superset/sql_parse.py | 1 | 7283 | # 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 |
gnowxilef/youtube-dl | youtube_dl/extractor/msn.py | 17 | 4643 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
unescapeHTML,
)
class MSNIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?msn\.com/(?:[^/]+/)+... | unlicense |
rockneurotiko/django | tests/fixtures/tests.py | 113 | 35712 | from __future__ import unicode_literals
import os
import sys
import tempfile
import unittest
import warnings
from django.apps import apps
from django.contrib.sites.models import Site
from django.core import management
from django.core.serializers.base import ProgressBar
from django.db import IntegrityError, connectio... | bsd-3-clause |
mehdidc/scikit-learn | sklearn/neighbors/tests/test_kde.py | 17 | 5626 | import numpy as np
from sklearn.utils.testing import (assert_allclose, assert_raises,
assert_equal)
from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors
from sklearn.neighbors.ball_tree import kernel_norm
from sklearn.pipeline import make_pipeline
from sklearn.dataset... | bsd-3-clause |
paulcalabro/zato | code/zato-cli/src/zato/cli/__init__.py | 6 | 26469 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
# stdlib
import json, shutil
from cStringIO import StringIO
from getpass import getpass, getuser
from socket import gethostname
# stdlib
import logging, os, sys, te... | gpl-3.0 |
moijes12/oh-mainline | vendor/packages/python-social-auth/social/backends/professionali.py | 73 | 1907 | # -*- coding: utf-8 -*-
"""
Professionaly OAuth 2.0 support.
This contribution adds support for professionaly.ru OAuth 2.0.
Username is retrieved from the identity returned by server.
"""
from time import time
from social.utils import parse_qs
from social.backends.oauth import BaseOAuth2
class ProfessionaliOAuth2(B... | agpl-3.0 |
KelvinLu/ping-at-me | ping_at_me/pingapp/users.py | 1 | 1481 | from django.contrib.auth import authenticate, login, logout
from pingapp import models, ping
def user_login(request, username, password):
user = authenticate(username = username, password = password)
if user is not None:
login(request, user)
return True
return False
def user_logout(request):
logout(request... | agpl-3.0 |
rfleschenberg/djangocms-cascade | tests/test_image.py | 2 | 5295 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from bs4 import BeautifulSoup
from django.core.files import File as DjangoFile
from django.http import QueryDict
from filer.models.foldermodels import Folder
from filer.models.imagemodels import Image
from cms.api import add_plugin
from cms.utils... | mit |
dkillick/iris | lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py | 17 | 3899 | # (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
person142/scipy | scipy/special/_mptestutils.py | 8 | 14477 | import os
import sys
import time
import numpy as np
from numpy.testing import assert_
import pytest
from scipy.special._testutils import assert_func_equal
try:
import mpmath # type: ignore[import]
except ImportError:
pass
# ------------------------------------------------------------------------------
# M... | bsd-3-clause |
jhawkesworth/ansible | lib/ansible/plugins/lookup/aws_ssm.py | 14 | 10482 | # (c) 2016, Bill Wang <ozbillwang(at)gmail.com>
# (c) 2017, Marat Bakeev <hawara(at)gmail.com>
# (c) 2018, Michael De La Rue <siblemitcom.mddlr(at)spamgourmet.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_im... | gpl-3.0 |
GuoshunWu/googlemock | scripts/generator/cpp/gmock_class_test.py | 395 | 11356 | #!/usr/bin/env python
#
# Copyright 2009 Neal Norwitz All Rights Reserved.
# Portions Copyright 2009 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
#
# ... | bsd-3-clause |
ChristfriedBalizou/jeamsql | adapters/tabulate/benchmark.py | 1 | 3028 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from timeit import timeit
import tabulate
import asciitable
import prettytable
import texttable
import sys
import codecs
setup_code = r"""
from csv import writer
try: # Python 2
from StringIO import StringIO
excep... | mit |
phalax4/CarnotKE | jyhton/ast/spark.py | 8 | 26973 | # Copyright (c) 1998-2002 John Aycock
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publis... | apache-2.0 |
jbloom/mutpath | src/plot.py | 1 | 10257 | """Module for performing plotting for ``mutpath`` package.
This module uses ``pylab`` and ``matplotlib`` to make plots. These plots will
fail if ``pylab`` and ``matplotlib`` are not available for importation. Before
running any function in this module, you can run the *PylabAvailable*
function to determine if ``pylab`... | gpl-3.0 |
todaychi/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/mcache.py | 34 | 7053 | #!/usr/bin/env python
import logging
import memcache
from saml2 import time_util
from saml2.cache import ToOld, CacheError
# The assumption is that any subject may consist of data
# gathered from several different sources, all with their own
# timeout time.
logger = logging.getLogger(__name__)
def _key(prefix, name... | apache-2.0 |
samthor/intellij-community | python/lib/Lib/site-packages/django/contrib/admin/options.py | 69 | 56318 | from django import forms, template
from django.forms.formsets import all_valid
from django.forms.models import modelform_factory, modelformset_factory, inlineformset_factory
from django.forms.models import BaseInlineFormSet
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin import widg... | apache-2.0 |
frostidaho/qtile | libqtile/widget/moc.py | 6 | 4530 | # -*- coding: utf-8 -*-
# Copyright (C) 2015, zordsdavini
#
# 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.
#
# This pro... | mit |
usc-isi-i2/lsh-linking | swoosh/evaluate.py | 1 | 1496 | from evaluator import evaluator
class evaluate:
def __init__(self, num, lencora, resultfile, answerfile):
self.num = num
self.lencora = lencora
fp = open('logs/merge_log.txt')
self.pairs = [line.strip().split('-') for line in fp]
self.marks = [0 for _ in xrange(lencora)]
self.clusters = [set() for _ in ... | apache-2.0 |
davipeterlini/routeflow_oficial | pox/pox/lib/graph/graph.py | 26 | 17844 | # Copyright 2011 James McCauley
# Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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 ... | apache-2.0 |
yongshengwang/hue | desktop/core/ext-py/requests-2.6.0/build/lib/requests/packages/urllib3/fields.py | 1007 | 5833 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... | apache-2.0 |
gimite/personfinder | app/vendors/unidecode/x0b6.py | 253 | 4996 | data = (
'ddyels', # 0x00
'ddyelt', # 0x01
'ddyelp', # 0x02
'ddyelh', # 0x03
'ddyem', # 0x04
'ddyeb', # 0x05
'ddyebs', # 0x06
'ddyes', # 0x07
'ddyess', # 0x08
'ddyeng', # 0x09
'ddyej', # 0x0a
'ddyec', # 0x0b
'ddyek', # 0x0c
'ddyet', # 0x0d
'ddyep', # 0x0e
'ddyeh', # 0x0f
... | apache-2.0 |
kunallillaney/thunder | test/test_seriesloader.py | 7 | 10333 | import glob
import json
import os
import struct
import unittest
from nose.tools import assert_almost_equal, assert_equals, assert_true, assert_raises
from numpy import allclose, arange, array, array_equal
from numpy import dtype as dtypeFunc
from thunder.rdds.fileio.seriesloader import SeriesLoader
from thunder.utils... | apache-2.0 |
hellhovnd/django | tests/model_forms/tests.py | 2 | 67705 | from __future__ import absolute_import, unicode_literals
import datetime
import os
from decimal import Decimal
from django import forms
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import ValidationError
from django.db import connection
from django.db.models.query import E... | bsd-3-clause |
Garvys/PingPongSkill | pingpongskill/text2num.py | 1 | 2798 | # This library is a simple implementation of a function to convert textual
# numbers written in English into their integer representations.
#
# This code is open source according to the MIT License as follows.
#
# Copyright (c) 2008 Greg Hewgill
#
# Permission is hereby granted, free of charge, to any person obtaining ... | mit |
adoosii/edx-platform | common/lib/xmodule/xmodule/seq_module.py | 11 | 12219 | """
xModule implementation of a learning sequence
"""
# pylint: disable=abstract-method
import json
import logging
import warnings
from lxml import etree
from xblock.core import XBlock
from xblock.fields import Integer, Scope, Boolean
from xblock.fragment import Fragment
from pkg_resources import resource_string
f... | agpl-3.0 |
AndroidOpenDevelopment/android_external_chromium_org | tools/telemetry/telemetry/core/platform/profiler/trace_profiler.py | 14 | 1966 | # Copyright 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.
import codecs
from telemetry.core.platform import profiler
class TraceProfiler(profiler.Profiler):
def __init__(self, browser_backend, platform_backend... | bsd-3-clause |
Southpaw-TACTIC/TACTIC | src/context/client/pyasm/application/common/session_builder.py | 2 | 16991 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
aljscott/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py | 123 | 8022 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
BlindHunter/django | django/utils/ipv6.py | 208 | 7967 | # This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. https://github.com/google/ipaddr-py
# Licensed under the Apache License, Version 2.0 (the "License").
from django.core.exceptions import ValidationError
from django.utils.six.moves import range
from django.utils.translation import ugettext_lazy as _... | bsd-3-clause |
mverrilli/kombu | kombu/tests/test_common.py | 5 | 13802 | from __future__ import absolute_import
import socket
from amqp import RecoverableConnectionError
from kombu import common
from kombu.common import (
Broadcast, maybe_declare,
send_reply, collect_replies,
declaration_cached, ignore_errors,
QoS, PREFETCH_COUNT_MAX,
)
from .case import Case, ContextMoc... | bsd-3-clause |
Boussadia/weboob | weboob/applications/qvideoob/qvideoob.py | 2 | 1602 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | agpl-3.0 |
olasitarska/django | django/contrib/auth/tests/custom_user.py | 37 | 6464 | from django.db import models
from django.contrib.auth.models import (
BaseUserManager,
AbstractBaseUser,
AbstractUser,
UserManager,
PermissionsMixin,
Group,
Permission,
)
# The custom User uses email as the unique identifier, and requires
# that every user provide a date of birth. This let... | bsd-3-clause |
matthewrmshin/rose | metomi/rose/env.py | 4 | 5952 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (C) 2012-2019 British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under th... | gpl-3.0 |
Kevin-Roberts/coinbase_trader | trader.py | 1 | 16564 | """
Coinbase Python Client Library
AUTHOR
Kevin Roberts
Github: Kevin-Roberts
Started on: 12-11-2013
LICENSE (The MIT License)
Copyright (c) 2013 Kevin Roberts "kr0b1486@hotmail.com"
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (t... | mit |
40223201/w16b_test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/compat.py | 603 | 3054 | """Python 2.x/3.x compatibility tools"""
import sys
__all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_',
'unicode_', 'raw_input_', 'as_bytes', 'as_unicode']
def geterror ():
return sys.exc_info()[1]
try:
long_ = long
except NameError:
long_ = int
try:
xrange_ = xrange
except Nam... | agpl-3.0 |
timopulkkinen/BubbleFish | third_party/libxml/src/check-relaxng-test-suite2.py | 343 | 10578 | #!/usr/bin/python
import sys
import time
import os
import string
import StringIO
sys.path.insert(0, "python")
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
debug = 0
quiet = 1
#
# the testsuite description
#
CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/testsuite.xml")
LOG="check-relaxng-... | bsd-3-clause |
duramato/SickRage | lib/hachoir_parser/misc/pcf.py | 95 | 5994 | """
X11 Portable Compiled Font (pcf) parser.
Documents:
- Format for X11 pcf bitmap font files
http://fontforge.sourceforge.net/pcf-format.html
(file is based on the X11 sources)
Author: Victor Stinner
Creation date: 2007-03-20
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, Enum,... | gpl-3.0 |
pgielda/linux-zynq | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
adoosii/edx-platform | common/test/acceptance/tests/test_ora.py | 118 | 15617 | """
Tests for ORA (Open Response Assessment) through the LMS UI.
"""
import json
from unittest import skip
from bok_choy.promise import Promise, BrokenPromise
from ..pages.lms.peer_confirm import PeerConfirmPage
from ..pages.lms.auto_auth import AutoAuthPage
from ..pages.lms.course_info import CourseInfoPage
from ..p... | agpl-3.0 |
StephenKing/ryu | ryu/controller/tunnels.py | 50 | 6952 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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 |
campenberger/boto | boto/s3/prefix.py | 237 | 1661 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
pgraziano/ursula | plugins/callbacks/timestamp.py | 20 | 3585 | # 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) any later version.
#
# Ansible is distributed in the hope that ... | mit |
haoqili/MozSecWorld | vendor-local/lib/python/PIL/ImagePath.py | 40 | 1342 | #
# The Python Imaging Library
# $Id$
#
# path interface
#
# History:
# 1996-11-04 fl Created
# 2002-04-14 fl Added documentation stub class
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on usage and redistribution.
#
import Image
##
# Path wrap... | bsd-3-clause |
vsfly/ucore_lab | related_info/ostep/ostep4-paging-linear-translate.py | 54 | 6658 | #! /usr/bin/env python
import sys
from optparse import OptionParser
import random
import math
def mustbepowerof2(bits, size, msg):
if math.pow(2,bits) != size:
print 'Error in argument: %s' % msg
sys.exit(1)
def mustbemultipleof(bignum, num, msg):
if (int(float(bignum)/float(num)) != (int(big... | gpl-2.0 |
roadmapper/ansible | test/lib/ansible_test/_internal/cloud/fallaxy.py | 7 | 5719 | """Fallaxy (ansible-galaxy) plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import uuid
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..util import (
find_executable,
display,
)
f... | gpl-3.0 |
wbond/certbuilder | dev/_task.py | 7 | 4196 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import ast
import _ast
import os
import sys
from . import package_root, task_keyword_args
from ._import import _import_from
if sys.version_info < (3,):
byte_cls = str
else:
byte_cls = bytes
def _list_tasks()... | mit |
Lujeni/ansible | test/units/modules/network/nos/nos_module.py | 52 | 2511 | # (c) 2018 Extreme Networks Inc.
#
# 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) any later version.
#
# Ansib... | gpl-3.0 |
ageron/tensorflow | tensorflow/python/data/kernel_tests/multi_device_iterator_test.py | 5 | 14657 | # Copyright 2018 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 |
madjar/cython | tests/run/decorators_py_T593.py | 30 | 1447 | # mode: run
# ticket: 593
# tag: property, decorator
"""
>>> am_i_buggy
False
"""
def testme(func):
try:
am_i_buggy
return True
except NameError:
return False
@testme
def am_i_buggy():
pass
def called_deco(a,b,c):
a.append( (1,b,c) )
def count(f):
a.append( (2,b,c... | apache-2.0 |
yujikato/DIRAC | src/DIRAC/Core/Utilities/MJF.py | 2 | 6755 | """ The MJF utility calculates the amount of wall clock time
left for a given batch system slot or VM. This is essential for the
'Filling Mode' where several jobs may be executed in the same slot.
Machine Job/Features are used following HSF-TN-2016-02 if available.
Otherwise values are filled in using ... | gpl-3.0 |
qzhan15/mydpdk | test/test/autotest_runner.py | 12 | 14886 | # BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 ... | gpl-2.0 |
jimsimon/sky_engine | sky/tools/webkitpy/common/checkout/diff_test_data.py | 11 | 3643 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
frosenberg/kubernetes | examples/cluster-dns/images/frontend/client.py | 468 | 1227 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
mlassnig/pilot | SiteMover.py | 3 | 121268 | # Base class of site movers
# All site movers inherit from this class
import os
import commands
import re
import time
from urllib import urlopen, urlencode
from urllib2 import Request, urlopen
from futil import *
from pUtil import tolog, readpar, dumpOrderedItems, getDirectAccessDic, getSiteInformation
from PilotErro... | apache-2.0 |
ppries/tensorflow | tensorflow/python/util/deprecation_test.py | 3 | 27171 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
toddeye/home-assistant | homeassistant/components/group.py | 2 | 7588 | """
homeassistant.components.group
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to group devices that can be turned on or off.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/group/
"""
import homeassistant.core as ha
from homeassistant.helpers.... | mit |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/filecmp.py | 63 | 9577 | """Utilities for comparing files and directories.
Classes:
dircmp
Functions:
cmp(f1, f2, shallow=1) -> int
cmpfiles(a, b, common) -> ([], [], [])
"""
import os
import stat
from itertools import ifilter, ifilterfalse, imap, izip
__all__ = ["cmp","dircmp","cmpfiles"]
_cache = {}
BUFSIZE=8*1024
def cmp(... | apache-2.0 |
kirca/OpenUpgrade | addons/purchase/stock.py | 5 | 14452 | # -*- 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 |
CopeX/odoo | addons/l10n_sg/__openerp__.py | 331 | 2380 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
FrankBian/kuma | vendor/packages/translate-toolkit/translate/storage/php.py | 6 | 9390 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2008 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... | mpl-2.0 |
kamitchell/py2app | examples/wxPython/2.4/doodle/superdoodle.py | 3 | 12982 | # superdoodle.py
"""
This module implements the SuperDoodle demo application. It takes the
DoodleWindow previously presented and reuses it in a much more
intelligent Frame. This one has a menu and a statusbar, is able to
save and reload doodles, clear the workspace, and has a simple control
panel for setting color a... | mit |
xwu/swift | utils/gyb_syntax_support/Traits.py | 39 | 1558 | from Child import Child
class Trait(object):
def __init__(self, trait_name, description=None, children=None):
self.trait_name = trait_name
self.children = children
self.description = description
TRAITS = [
Trait('DeclGroup',
children=[
Child('Attributes', kind... | apache-2.0 |
fabianvaccaro/pygums | pythonLibs/mahotas-1.1.0/mahotas/stretch.py | 2 | 5388 | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2013, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# 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 Softwar... | gpl-2.0 |
havard024/prego | venv/lib/python2.7/site-packages/django/utils/feedgenerator.py | 73 | 15643 | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title="Poynter E-Media Tidbits",
... link="http://www.poynter.org/column.asp?id=31",
... description="A group Weblog by the sharpes... | mit |
elfnor/sverchok | node_scripts/templates/zeffii/spline_utils.py | 4 | 1467 | import mathutils
from mathutils import Vector
import math
# this file would be placed directly into the sverchokmaster directory when used.
def get_length(verts):
summed = 0
lengths = []
lengths_add = lengths.append
for idx in range(len(verts)-1):
segment = (verts[idx]-verts[idx+1]).length
... | gpl-3.0 |
eicher31/compassion-switzerland | partner_communication_switzerland/wizards/end_contract_wizard.py | 3 | 1099 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | agpl-3.0 |
fxb22/BioGUI | Utils/GetMotifs.py | 1 | 5020 | import CirclePlotClass as cpc
class GetMotifs():
def DefineColLists(self):
self.colList = []
r = 0
while r < self.total_length:
self.colList.append(-1)
r += 1
self.sse = self.cpss.GetSSE()
self.secLinks = self.cpss.GetSecLinks()
for s in self.... | gpl-2.0 |
apache/spark | examples/src/main/python/ml/tf_idf_example.py | 27 | 1863 | #
# 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 |
rgeleta/odoo | openerp/tools/test_config.py | 456 | 1418 | # -*- coding: utf-8 -*-
""" Tests for the configuration file/command-line arguments. """
# This test should be run from its directory.
# TODO A configmanager object cannot parse multiple times a config file
# and/or the command line, preventing to 'reload' a configuration.
import os
import config
config_file_00 =... | agpl-3.0 |
navodissa/python-flask | flask/lib/python2.7/site-packages/openid/dh.py | 168 | 1608 | from openid import cryptutil
from openid import oidutil
def strxor(x, y):
if len(x) != len(y):
raise ValueError('Inputs to strxor must have the same length')
xor = lambda (a, b): chr(ord(a) ^ ord(b))
return "".join(map(xor, zip(x, y)))
class DiffieHellman(object):
DEFAULT_MOD = 15517289818147... | bsd-3-clause |
wkoathp/glance | glance/tests/unit/test_store_location.py | 19 | 3200 | # Copyright 2011-2013 OpenStack Foundation
# 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... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/test/test_robotparser.py | 32 | 6980 | import unittest, StringIO, robotparser
from test import test_support
from urllib2 import urlopen, HTTPError
HAVE_HTTPS = True
try:
from urllib2 import HTTPSHandler
except ImportError:
HAVE_HTTPS = False
class RobotTestCase(unittest.TestCase):
def __init__(self, index, parser, url, good, agent):
un... | gpl-2.0 |
michael-dev2rights/ansible | lib/ansible/modules/cloud/openstack/os_image.py | 4 | 6999 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... | gpl-3.0 |
czpython/django-cms | cms/test_utils/project/placeholderapp/views.py | 4 | 3780 | from django.http import HttpResponse
from django.shortcuts import render
from django.template import RequestContext
from django.template.engine import Engine
from django.views.generic import DetailView
from cms.test_utils.project.placeholderapp.models import (
Example1, MultilingualExample1, CharPksExample)
from cm... | bsd-3-clause |
mgoral/subconvert | src/subconvert/cli/syncparse.py | 1 | 5412 | #-*- coding: utf-8 -*-
"""
Copyright (C) 2016 Michal Goral.
This file is part of Subconvert
Subconvert 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 la... | gpl-3.0 |
ederfmartins/spojrec | crawler/util.py | 1 | 1390 | # -*- coding: utf-8 -*-
import sys
from lxml.html import parse
from lxml.html import tostring
from urllib2 import urlopen
from constants import SPOJ_URLS
from crawler.dataExtractor.extractor import extract_problem_data, extract_user_data, extract_submissions_data
from crawler.dataExtractor.signedlistParser import pars... | apache-2.0 |
ZhangXinNan/tensorflow | tensorflow/python/estimator/export/export_output.py | 5 | 13561 | # 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 |
kriberg/stationspinner | stationspinner/corporation/views.py | 1 | 1853 | from django.core.cache import cache
from rest_framework import viewsets, views
from rest_framework.response import Response
from stationspinner.corporation.serializers import CorporationSheetSerializer, \
CorporationSheetListSerializer
from stationspinner.corporation.models import CorporationSheet, Asset
from stati... | agpl-3.0 |
4Quant/tensorflow | tensorflow/tensorboard/backend/float_wrapper.py | 27 | 1776 | # Copyright 2015 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 |
seanfisk/buzzword-bingo-server | django/contrib/sessions/backends/cache.py | 268 | 1881 | from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import cache
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
def __init__(self, session_key=None):
self._cache = cache
super(SessionStore, self).__init__(session_key)
... | bsd-3-clause |
cdgallahue/atomic-turbine | web/lib/python2.7/site-packages/pip/_vendor/html5lib/constants.py | 354 | 83387 | from __future__ import absolute_import, division, unicode_literals
import string
EOF = None
E = {
"null-character":
"Null character in input stream, replaced with U+FFFD.",
"invalid-codepoint":
"Invalid codepoint in stream.",
"incorrectly-placed-solidus":
"Solidus (/) incorrectly ... | mit |
subutai/nupic.research | tests/unit/frameworks/vernon/self_supervised_learning_test.py | 2 | 3768 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
fo0nikens/shadowsocks | shadowsocks/crypto/sodium.py | 1032 | 3778 | #!/usr/bin/env python
#
# Copyright 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 law or ... | apache-2.0 |
betoesquivel/fil2014 | filenv/lib/python2.7/site-packages/haystack/fields.py | 10 | 13072 | from __future__ import unicode_literals
import re
from django.utils import datetime_safe
from django.utils import six
from django.template import loader, Context
from haystack.exceptions import SearchFieldError
class NOT_PROVIDED:
pass
DATETIME_REGEX = re.compile('^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2}... | mit |
matmutant/sl4a | python/src/Lib/ntpath.py | 60 | 17131 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import sys
import stat
import genericpath
import warnings
from genericpath import *
__all__ ... | apache-2.0 |
shortbloke/home_assistant_config | custom_components/badnest/sensor.py | 1 | 3535 | import logging
from homeassistant.helpers.entity import Entity
from .const import DOMAIN
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
DEVICE_CLASS_TEMPERATURE,
TEMP_CELSIUS
)
_LOGGER = logging.getLogger(__name__)
PROTECT_SENSOR_TYPES = [
"co_status",
"smoke_status",
"battery_health... | mit |
louyihua/edx-platform | common/djangoapps/util/tests/test_db.py | 7 | 8019 | """Tests for util.db module."""
import ddt
import threading
import time
import unittest
from unittest import skipIf
from django.contrib.auth.models import User
from django.core.management import call_command
from django.conf import settings
from django.db import connection, IntegrityError
from django.db.transaction i... | agpl-3.0 |
caesar2164/edx-platform | openedx/core/djangoapps/contentserver/admin.py | 27 | 1455 | """
Django admin page for CourseAssetCacheTtlConfig, which allows you to configure the TTL
that gets used when sending cachability headers back with request course assets.
"""
from django.contrib import admin
from config_models.admin import ConfigurationModelAdmin
from .models import CourseAssetCacheTtlConfig, CdnUserA... | agpl-3.0 |
40223145c2g18/40223145 | static/Brython3.1.0-20150301-090019/Lib/multiprocessing/dummy/connection.py | 707 | 3049 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | gpl-3.0 |
crateio/crate.web | crate/web/packages/admin.py | 1 | 3016 | from django.contrib import admin
from crate.web.packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI
from crate.web.packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI, ChangeLog
from crate.web.packages.models import DownloadDelta, ReadTheDocsPackageSlug
cl... | bsd-2-clause |
Nic30/hwtHls | hwtHls/hls.py | 1 | 9330 | from hwt.code import If
from hwt.hdl.assignment import Assignment
from hwt.hdl.operator import Operator
from hwt.hdl.types.defs import BIT
from hwt.hdl.types.struct import HStruct
from hwt.hdl.value import HValue
from hwt.synthesizer.interfaceLevel.unitImplHelpers import getSignalName
from hwt.synthesizer.rtlLevel.netl... | mit |
WSDC-NITWarangal/gunicorn | gunicorn/http/_sendfile.py | 86 | 2256 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import errno
import os
import sys
try:
import ctypes
import ctypes.util
except MemoryError:
# selinux execmem denial
# https://bugzilla.redhat.com/show_bug.cgi?id=488396
r... | mit |
Pikecillo/genna | external/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/dc_20001112.py | 1 | 1722 | #David Carlisle <davidc@nag.co.uk> plays nifty tricks with xsl:key
from Xml.Xslt import test_harness
sheet_1 = """<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="xml" indent="yes"/>
<xsl:key name="items-by-itemid"
match="i... | gpl-2.0 |
xodus7/tensorflow | tensorflow/contrib/quantize/python/fold_batch_norms.py | 2 | 39652 | # 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 |
kuri65536/python-for-android | python-modules/twisted/twisted/test/test_persisted.py | 60 | 8648 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
# System Imports
import sys
from twisted.trial import unittest
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# Twisted Imports
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.