repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
paurosello/frappe | frappe/utils/user.py | 6 | 10447 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _dict
import frappe.share
from frappe.utils import cint
from frappe.boot import get_allowed_reports
from frappe.permissions import get_role... | mit |
2014cdbg4/2015finalexam | static/Brython3.1.1-20150328-091302/Lib/importlib/basehook.py | 608 | 1396 | from javascript import JSObject
from browser import window
import urllib.request
class TempMod:
def __init__(self, name):
self.name=name
#define my custom import hook (just to see if it get called etc).
class BaseHook:
def __init__(self, fullname=None, path=None):
self._fullname=fullname
self._p... | gpl-3.0 |
deepsrijit1105/edx-platform | openedx/core/djangoapps/theming/helpers.py | 15 | 14017 | """
Helpers for accessing comprehensive theming related variables.
"""
import re
import os
from path import Path
from django.conf import settings, ImproperlyConfigured
from django.contrib.staticfiles.storage import staticfiles_storage
from request_cache.middleware import RequestCache
from microsite_configuration imp... | agpl-3.0 |
diy19901030/lldpd | libevent/event_rpcgen.py | 81 | 55456 | #!/usr/bin/env python2
#
# Copyright (c) 2005-2007 Niels Provos <provos@citi.umich.edu>
# Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
# All rights reserved.
#
# Generates marshaling code based on libevent.
# TODO:
# 1) use optparse to allow the strategy shell to parse options, and
# to allow the instant... | gpl-2.0 |
r0e/servo | tests/wpt/css-tests/tools/pywebsocket/src/example/abort_handshake_wsh.py | 465 | 1781 | # Copyright 2012, 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... | mpl-2.0 |
sgerhart/ansible | lib/ansible/modules/source_control/git_config.py | 18 | 6941 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Marius Gedminas <marius@pov.lt>
# (c) 2016, Matthew Gamble <git@matthewgamble.net>
#
# 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
... | mit |
david415/magic-wormhole | src/wormhole/blocking/transcribe.py | 1 | 12230 | from __future__ import print_function
import os, sys, time, re, requests, json, unicodedata
from six.moves.urllib_parse import urlencode
from binascii import hexlify, unhexlify
from spake2 import SPAKE2_Symmetric
from nacl.secret import SecretBox
from nacl.exceptions import CryptoError
from nacl import utils
from .even... | mit |
mfwarren/django-mailer-2 | django_mailer/lockfile.py | 179 | 15120 |
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = FileLock('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'somefile', 'is locked alread... | mit |
weigj/django-multidb | django/utils/decorators.py | 38 | 2464 | "Functions that help with dynamically creating decorators for views."
import types
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
def decorator_from_middleware(middleware_class):
"""
Given a middleware class (not an instance)... | bsd-3-clause |
veger/ansible | lib/ansible/plugins/action/aws_s3.py | 86 | 2827 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2018, Will Thames <will@thames.id.au>
#
# 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 o... | gpl-3.0 |
robintw/scikit-image | skimage/draw/tests/test_draw.py | 10 | 28187 | from numpy.testing import assert_array_equal, assert_equal
import numpy as np
from skimage._shared.testing import test_parallel
from skimage.draw import (set_color, line, line_aa, polygon,
circle, circle_perimeter, circle_perimeter_aa,
ellipse, ellipse_perimeter,
... | bsd-3-clause |
alvin319/CarnotKE | jyhton/lib-python/2.7/test/test_py3kwarn.py | 89 | 18344 | import unittest
import sys
from test.test_support import check_py3k_warnings, CleanImport, run_unittest
import warnings
if not sys.py3kwarning:
raise unittest.SkipTest('%s must be run with the -3 flag' % __name__)
try:
from test.test_support import __warningregistry__ as _registry
except ImportError:
def ... | apache-2.0 |
krader1961/python-mode | pymode/libs/pylama/main.py | 7 | 2528 | """Pylama's shell support."""
from __future__ import absolute_import, with_statement
import sys
from os import walk, path as op
from .config import parse_options, CURDIR, setup_logger
from .core import LOGGER, run
from .async import check_async
def check_path(options, rootdir=None, candidates=None, code=None):
... | lgpl-3.0 |
glovebx/zulip | zerver/lib/rate_limiter.py | 115 | 7145 | from __future__ import absolute_import
from django.conf import settings
from zerver.lib.redis_utils import get_redis_client
import redis
import time
import logging
from itertools import izip
# Implement a rate-limiting scheme inspired by the one described here, but heavily modified
# http://blog.domaintools.com/201... | apache-2.0 |
awkspace/ansible | lib/ansible/modules/cloud/vmware/vmware_tag_manager.py | 9 | 8589 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty... | gpl-3.0 |
myRisk/dynamicDNA | setuptools-15.2/setuptools/tests/test_egg_info.py | 148 | 2744 | import os
import stat
import pytest
from . import environment
from .textwrap import DALS
from . import contexts
class TestEggInfo:
setup_script = DALS("""
from setuptools import setup
setup(
name='foo',
py_modules=['hello'],
entry_points={'console_scripts': ... | apache-2.0 |
erdincay/pyload | module/plugins/hoster/NoPremiumPl.py | 12 | 3283 | # -*- coding: utf-8 -*-
from module.common.json_layer import json_loads
from module.plugins.internal.MultiHoster import MultiHoster
class NoPremiumPl(MultiHoster):
__name__ = "NoPremiumPl"
__type__ = "hoster"
__version__ = "0.04"
__status__ = "testing"
__pattern__ = r'https?://direct\.nop... | gpl-3.0 |
guorendong/iridium-browser-ubuntu | third_party/trace-viewer/third_party/closure_linter/closure_linter/closurizednamespacesinfo.py | 135 | 18883 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
tuxfux-hlp-notes/python-batches | batch-67/12-modules/myenv/lib/python2.7/site-packages/xlrd/__init__.py | 7 | 6347 | # Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd
# This module is part of the xlrd package, which is released under a
# BSD-style licence.
from .info import __VERSION__
import sys, zipfile, pprint
from . import timemachine
from .biffh import (
XLRDError,
biff_text_from_num,
error_text_from_co... | gpl-3.0 |
PatrickJBaird/sdk | bindings/doc/java/sphinx/source/conf.py | 3 | 11620 | # -*- coding: utf-8 -*-
#
# javauserguide documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 21 21:46:23 2015.
#
# 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.... | bsd-2-clause |
llych/shadowsocks | utils/autoban.py | 1033 | 2156 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# 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 u... | apache-2.0 |
xNovax/SickRage | lib/unidecode/x05c.py | 252 | 4612 | data = (
'Po ', # 0x00
'Feng ', # 0x01
'Zhuan ', # 0x02
'Fu ', # 0x03
'She ', # 0x04
'Ke ', # 0x05
'Jiang ', # 0x06
'Jiang ', # 0x07
'Zhuan ', # 0x08
'Wei ', # 0x09
'Zun ', # 0x0a
'Xun ', # 0x0b
'Shu ', # 0x0c
'Dui ', # 0x0d
'Dao ', # 0x0e
'Xiao ', # 0x0f
'Ji ', # 0x10... | gpl-3.0 |
neonatura/crotalus | lib/libxml2/python/tests/reader2.py | 32 | 5345 | #!/usr/bin/python -u
#
# this tests the DTD validation with the XmlTextReader interface
#
import sys
import glob
import string
import libxml2
try:
import StringIO
str_io = StringIO.StringIO
except:
import io
str_io = io.StringIO
# Memory debug specific
libxml2.debugMemory(1)
err=""
expect="""../../tes... | gpl-2.0 |
Prinhotels/closure-library | closure/bin/build/depstree_test.py | 354 | 3692 | #!/usr/bin/env python
#
# Copyright 2009 The Closure Library 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
... | apache-2.0 |
barykaed/Pelican-Test | fsp_env/Lib/site-packages/setuptools/dist.py | 16 | 35330 | __all__ = ['Distribution']
import re
import os
import sys
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
Distuti... | mit |
reachtarunhere/rumal | interface/pdepend.py | 2 | 1450 | #!/usr/bin/env python
#
# pdepen.py
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | gpl-2.0 |
laurentb/weboob | weboob/capabilities/radio.py | 2 | 1725 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Romain Bignon
# Copyright(C) 2013 Pierre Mazière
#
# This file is part of weboob.
#
# weboob 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 vers... | lgpl-3.0 |
disqus/durabledict | durabledict/models.py | 1 | 6962 | from durabledict.base import DurableDict
class ModelDict(DurableDict):
"""
Dictionary-style access to a model. Populates a cache and a local in-memory
to avoid multiple hits to the database.
# Given ``Model`` that has a primary key (``pk``) column that can be
# strings:
mydict =... | apache-2.0 |
TeamHG-Memex/autologin | autologin/http_api.py | 1 | 4731 | from __future__ import absolute_import
import json
import logging
from pprint import pformat
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from scrapy.utils.log import conf... | apache-2.0 |
mhvk/astropy | astropy/io/misc/hdf5.py | 2 | 14330 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains functions for reading and writing HDF5 tables that are
not meant to be used directly, but instead are available as readers/writers in
`astropy.table`. See :ref:`astropy:table_io` for more details.
"""
import os
import warnings
i... | bsd-3-clause |
jlowin/airflow | airflow/ti_deps/deps/trigger_rule_dep.py | 22 | 8261 | # -*- 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 |
kun--hust/libcloud_with_cn | libcloud/dns/drivers/hostvirtual.py | 6 | 8965 | # 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 use ... | apache-2.0 |
deserted/letsencrypt | acme/acme/jose/jwk_test.py | 31 | 5436 | """Tests for acme.jose.jwk."""
import unittest
from acme import test_util
from acme.jose import errors
from acme.jose import json_util
from acme.jose import util
DSA_PEM = test_util.load_vector('dsa512_key.pem')
RSA256_KEY = test_util.load_rsa_private_key('rsa256_key.pem')
RSA512_KEY = test_util.load_rsa_private_ke... | apache-2.0 |
mmariani/dream | dream/simulation/Frame.py | 1 | 1523 | # ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM 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 Founda... | gpl-3.0 |
dbmi-pitt/DIKB-Micropublication | scripts/mp-scripts/Bio/Nexus/Trees.py | 1 | 30175 |
#
# Trees.py
#
# Copyright 2005 by Frank Kauff & Cymon J. Cox. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
# Tree class handles phylogenetic trees. Provides a set of method... | apache-2.0 |
saurabh6790/test-erp | erpnext/hr/doctype/employee/employee.py | 21 | 7649 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
from frappe.model.naming import make_autoname
from frappe import throw, _
imp... | agpl-3.0 |
dulems/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/measure.py | 212 | 12367 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#... | apache-2.0 |
N0NamedGuy/pyMooshak | pymooshak.py | 1 | 2189 | #!/usr/bin/env python2
#
# (C) 2011 David Miguel de Araujo Serrano
#
# This file is part of pyMooshak.
#
# pyMooshak 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 y... | gpl-3.0 |
EvanEdwards/qBittorrent | src/searchengine/nova3/engines/piratebay.py | 20 | 7600 | #VERSION: 2.11
#AUTHORS: Fabien Devaux (fab@gnux.info)
#CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org)
# Arthur (custparasite@gmx.se)
# Diego de las Heras (diegodelasheras@gmail.com)
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pro... | gpl-2.0 |
MobinRanjbar/hue | desktop/core/ext-py/Pygments-1.3.1/pygments/formatters/rtf.py | 75 | 4536 | # -*- coding: utf-8 -*-
"""
pygments.formatters.rtf
~~~~~~~~~~~~~~~~~~~~~~~
A formatter that generates RTF files.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
__all__ = ['RtfFormatter']
... | apache-2.0 |
timruffles/electron | script/lib/util.py | 12 | 4424 | #!/usr/bin/env python
import atexit
import contextlib
import errno
import shutil
import ssl
import subprocess
import sys
import tarfile
import tempfile
import urllib2
import os
import zipfile
from config import is_verbose_mode
def tempdir(prefix=''):
directory = tempfile.mkdtemp(prefix=prefix)
atexit.register(sh... | mit |
rhyolight/nupic.research | projects/sequence_prediction/discrete_sequences/plotMultiplePredictionWithErrBar.py | 12 | 6799 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
fadiga/mstock | ui/by_store.py | 1 | 5217 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# maintainer: Fad
from datetime import datetime
import peewee
from PyQt4.QtGui import (QVBoxLayout, QTableWidgetItem)
from PyQt4.QtCore import Qt
from Common.ui.common import FWidget, FPeriodHolder, FPageTitle
from models import Reports, Store
from Common.ui.table impor... | apache-2.0 |
flavour/helios | modules/hs/analysis/graph.py | 24 | 10364 | """
Healthscapes Geolytics Module
... | mit |
user-none/calibre | src/calibre/utils/ipc/server.py | 11 | 12195 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys, os, cPickle, time, tempfile, errno
from math import ceil
from threading ... | gpl-3.0 |
itai12312/workspaces | hellodjango/venv/lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/storage.py | 211 | 2794 | from datetime import datetime
from django.http import HttpRequest
from django.conf import settings
from django.utils.importlib import import_module
from django.contrib.auth.models import User
def get_request():
request = HttpRequest()
engine = import_module(settings.SESSION_ENGINE)
request.session = eng... | gpl-2.0 |
Didacti/botornado | boto/emr/tests/test_emr_responses.py | 26 | 16727 | # Copyright (c) 2010 Jeremy Thurgood <firxen+boto@gmail.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, mod... | mit |
dataxu/ansible | lib/ansible/modules/storage/netapp/sf_volume_manager.py | 7 | 11033 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
foreverfaint/scrapy | extras/scrapy-ws.py | 12 | 3710 | #!/usr/bin/env python
"""
Example script to control a Scrapy server using its JSON-RPC web service.
It only provides a reduced functionality as its main purpose is to illustrate
how to write a web service client. Feel free to improve or write you own.
Also, keep in mind that the JSON-RPC API is not stable. The recomm... | bsd-3-clause |
rubenbalde/pyafipws.web2py-app | languages/es-es.py | 24 | 16365 | # coding: utf8
{
' next->': 'próx->',
' pagesize: ': 'Registros por página: ',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN... | agpl-3.0 |
Lekensteyn/buildbot | master/buildbot/test/unit/test_process_remotetransfer.py | 10 | 2571 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
curtisstpierre/django | django/db/backends/oracle/introspection.py | 517 | 11463 | import cx_Oracle
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types.
data_types_reverse = {
cx_Oracle.... | bsd-3-clause |
teserak/peewee | pwiz.py | 13 | 6346 | #!/usr/bin/env python
import datetime
from optparse import OptionParser
import sys
from peewee import *
from peewee import print_
from peewee import __version__ as peewee_version
from playhouse.reflection import *
TEMPLATE = """from peewee import *
database = %s('%s', **%s)
class UnknownField(object):
pass
cl... | mit |
PsichiX/Ptakopysk | development/requirements/jsoncpp-src-0.5.0/scons-tools/srcdist.py | 264 | 5224 | import os
import os.path
from fnmatch import fnmatch
import targz
##def DoxyfileParse(file_contents):
## """
## Parse a Doxygen source file and return a dictionary of all the values.
## Values will be strings and lists of strings.
## """
## data = {}
##
## import shlex
## lex = shlex.shlex(instream = fil... | mit |
sysadminmatmoz/OCB | addons/website_event_sale/models/sale_order.py | 17 | 5296 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.exceptions import UserError
class sale_order(osv.Model):
_inherit = "sale.order"
def _cart_find_product_line(self, cr, uid, ids, product_id=None, line_id=None, context=None,... | agpl-3.0 |
tellesnobrega/sahara | sahara/service/periodic.py | 2 | 10589 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
rdeheele/odoo | addons/l10n_uk/__openerp__.py | 81 | 2079 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Smartmode LTD (<http://www.smartmode.co.uk>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as... | agpl-3.0 |
konstruktoid/ansible-upstream | lib/ansible/plugins/action/service.py | 29 | 3802 | # (c) 2015, Ansible 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.
#
# Ansible is di... | gpl-3.0 |
krafczyk/spack | var/spack/repos/builtin/packages/cdd/package.py | 5 | 2224 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
mobify/python-driver | cassandra/encoder.py | 8 | 7750 | # Copyright 2013-2015 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
samliu/servo | tests/wpt/css-tests/tools/py/testing/root/test_error.py | 162 | 1111 |
import py
import errno
def test_error_classes():
for name in errno.errorcode.values():
x = getattr(py.error, name)
assert issubclass(x, py.error.Error)
assert issubclass(x, EnvironmentError)
def test_picklability_issue1():
e1 = py.error.ENOENT()
s = py.std.pickle.dumps(e1)
e2... | mpl-2.0 |
xme1226/sahara | sahara/plugins/mapr/versions/version_handler_factory.py | 2 | 1690 | # Copyright (c) 2014, MapR Technologies
#
# 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 agree... | apache-2.0 |
pengdonglin137/linux-4.9 | Documentation/sphinx/cdomain.py | 146 | 5612 | # -*- coding: utf-8; mode: python -*-
# pylint: disable=W0141,C0113,C0103,C0325
u"""
cdomain
~~~~~~~
Replacement for the sphinx c-domain.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see Linux/COPYING for details.
List of customizations:
* Moved th... | gpl-2.0 |
debomatic/debomatic-webui | debomatic-modules/JSONLogger.py | 2 | 8795 | # Deb-o-Matic - JSON logger module
#
# Copyright (C) 2014 Leo Iannacone
#
# Authors: Leo Iannacone <l3on@ubuntu.com>
#
# 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; version 3 of the License.
#... | gpl-3.0 |
jamesls/boto | boto/cloudformation/template.py | 30 | 1318 | from boto.resultset import ResultSet
class Template:
def __init__(self, connection=None):
self.connection = connection
self.description = None
self.template_parameters = None
def startElement(self, name, attrs, connection):
if name == "Parameters":
self.template_par... | mit |
moijes12/oh-mainline | mysite/search/migrations/0059_add_project_homepage_url.py | 17 | 17504 | # This file is part of OpenHatch.
# Copyright (C) 2011 Jack Grigg
#
# This program 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 option) any later versio... | agpl-3.0 |
percyfal/snakemakelib-rules | snakemake_rules/core/ruleinfo.py | 2 | 1888 | # -*- coding: utf-8 -*-
# Helper functions for extracting information from rules
import os
import re
from snakemake.parser import parse
regex_name = re.compile(r"[ ]*name=\'(?P<name>[a-zA-Z_0-9]+)[ ]*'")
regex_target_list = re.compile(r"(?P<key>[a-zA-Z0-9_]+=)?(?P<target>[^,]+)")
regex_wildcard_constraints = re.compil... | mit |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/test/test_codecencodings_jp.py | 88 | 4981 | #
# test_codecencodings_jp.py
# Codec encoding tests for Japanese encodings.
#
from test import support
from test import multibytecodec_support
import unittest
class Test_CP932(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp932'
tstring = multibytecodec_support.load_teststring('shift_jis... | gpl-2.0 |
devs4v/devs4v-information-retrieval15 | project/venv/lib/python2.7/site-packages/django/db/migrations/autodetector.py | 87 | 54478 | from __future__ import unicode_literals
import datetime
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpti... | mit |
HKUST-SING/tensorflow | tensorflow/contrib/sparsemax/python/kernel_tests/sparsemax_loss_test.py | 36 | 8009 | # 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 |
dims/glance | glance/tests/functional/db/base_glare.py | 3 | 36869 | # Copyright (c) 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
allenlavoie/tensorflow | tensorflow/tools/git/gen_git_source.py | 2 | 9912 | #!/usr/bin/env python
# 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
#
# Unle... | apache-2.0 |
samabhi/pstHealth | venv/lib/python2.7/site-packages/jinja2/utils.py | 113 | 18640 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import errno
try:
from thread import allocate_lock
except ImportError:
from dummy_thread import allocate_lo... | mit |
ZachRiegel/scriptbin | pypyjs/modules/encodings/cp737.py | 593 | 34937 | """ Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.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_map)
def decode(self,input,errors='strict... | gpl-3.0 |
Defector/lu6200_kernel | 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 |
sathlan/python-rh-nexttaks | ci/bootstrap.py | 41 | 2053 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
if __name__ == "__main__":
base_path = dirname(dirname(abspath(__... | bsd-2-clause |
tupes/School | CS366/Projects/Proj3/project3.py | 1 | 1335 | from Sarsa import Sarsa
from TileCoder import TileCoder
import MountainCar
def write_results(avgs):
f = open('results.txt', 'w')
for avg in avgs:
f.write(str(avg) + '\n')
f.close()
def write_row(row, f):
for value in row:
f.write(str(value) + ',')
f.write('\n')
def objective_func... | gpl-3.0 |
simonsdave/cloudfeaster_infrastructure | cloudfeaster_services/tests/spider_metadata_cache_async_actions_unit_tests.py | 2 | 10628 | """This module contains a collection of unit tests which
validate the ..spider_metadata_cache_async_actions_unit_tests
module.
"""
import base64
import httplib
import json
import unittest
import uuid
import mock
from . import AsyncHTTPClientPatcher
from . import ConfigPatcher
from .. import spider_metadata_cache_asy... | mit |
fbossy/SickRage | lib/chardet/euctwprober.py | 53 | 1684 | ######################## 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 |
luceatnobis/youtube-dl | test/test_youtube_signature.py | 28 | 4025 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import io
import re
import string
from test.helper import FakeYDL
from youtube_dl.extractor import YoutubeIE
fro... | unlicense |
crmccreary/openerp_server | openerp/addons/event/wizard/event_make_invoice.py | 9 | 4091 | # -*- 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 |
jcharit1/Identifying-Ad-Images | code/predict_image_type.py | 1 | 5661 | #!/home/jim/anaconda2/envs/py35/bin/python
"""
Code for making predictions on new data
_Author: Jimmy Charité_
_Email: jimmy.charite@gmail.com_
_Date: January 9, 2017_
"""
# Packages
###############################################################################
import sys
import numpy as np
import pandas as pd... | mit |
wangjun/odoo | addons/crm_claim/__openerp__.py | 260 | 1939 | # -*- 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 |
Ultimate-Chimera/tgstation | tools/dmm2tgm/Source/dmm2tgm.py | 149 | 3726 |
import sys
# .dmm format converter, by RemieRichards
# Version 2.0
# Converts the internal structure of a .dmm file to a syntax
# that git can better handle conflicts-wise, it's also fairly human readable!
# Processes Boxstation (tgstation.2.1.3) almost instantly
def convert_map(map_file):
#CHECK FOR PREVIO... | agpl-3.0 |
zkraime/osf.io | website/addons/badges/tests/test_models.py | 59 | 4069 | # -*- coding: utf-8 -*-
from nose.tools import *
from website.addons.badges.model import BadgeAssertion
from utils import *
from tests.base import OsfTestCase
from tests.factories import AuthUserFactory, ProjectFactory
class TestUserSettingsModel(OsfTestCase):
def setUp(self):
super(TestUserSettingsMode... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/distutils/errors.py | 152 | 3577 | """distutils.errors
Provides exceptions used by the Distutils modules. Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).
This module is safe to use in "from ... import *" mode; it... | gpl-2.0 |
jerryhongthreefoldphotos/messagebus-python-sdk | messagebus/samples/reports/getblocklist.py | 1 | 1898 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2014 Message Bus
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 requ... | apache-2.0 |
mvillalba/homeutils | setup.py | 1 | 2395 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011, Martín Raúl Villalba
#
# 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 So... | mit |
stonebig/bokeh | examples/models/file/latex_extension.py | 1 | 3121 | """ The LaTex example was derived from: http://matplotlib.org/users/usetex.html
"""
from bokeh.models import Label
from bokeh.palettes import Spectral4
from bokeh.plotting import output_file, figure, show
from bokeh.util.compiler import TypeScript
import numpy as np
from scipy.special import jv
output_file('latex_ex... | bsd-3-clause |
perimosocordiae/scipy | scipy/special/_precompute/wright_bessel.py | 12 | 12928 | """Precompute coefficients of several series expansions
of Wright's generalized Bessel function Phi(a, b, x).
See https://dlmf.nist.gov/10.46.E1 with rho=a, beta=b, z=x.
"""
from argparse import ArgumentParser, RawTextHelpFormatter
import numpy as np
from scipy.integrate import quad
from scipy.optimize import minimize... | bsd-3-clause |
setjet/spark | python/pyspark/accumulators.py | 77 | 8142 | #
# 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 |
mistio/mist.io | docker/elasticsearch-manage/scripts/add_templates.py | 1 | 2453 | #!/usr/bin/env python
import os
import sys
import time
import json
import argparse
import traceback
import certifi
from elasticsearch import Elasticsearch
EXCLUDED = ('heapster', 'audit', ) # Templates to be excluded.
def es_client():
es = Elasticsearch(
os.getenv('ELASTIC_HOST', 'elasticsearch'),
... | agpl-3.0 |
hkhamm/django_rest_tutorial_2 | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/mbcssm.py | 982 | 19608 | ######################## 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... | mit |
Twangist/log_calls | tests/test_log_calls_log_methods.py | 1 | 8324 | __author__ = 'brianoneill'
from log_calls import log_calls
#-----------------------------------------------------
# log_calls.print, log_calls.print_exprs
# Test in methods, in functions
#-----------------------------------------------------
def test_lc_log_message__output_expected():
"""
--------------------... | mit |
luistorresm/odoo | addons/lunch/__init__.py | 440 | 1031 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
direvus/ansible | lib/ansible/modules/network/meraki/meraki_organization.py | 30 | 8344 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# 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 = {
... | gpl-3.0 |
rubikloud/gpdb | gpMgmt/bin/gppylib/parseutils.py | 31 | 19829 | #!/usr/bin/env python
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
"""
parseutils.py
Routines to parse "flexible" configuration files for tools like
gpaddmirrors, gprecoverseg, gpexpand, etc.
Copyright (c) EMC/Greenplum Inc 2011. All Rights Rese... | apache-2.0 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py | 182 | 2132 | # Copyright (C) 2011 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | apache-2.0 |
zorosteven/pip | pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## 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... | mit |
sanguinariojoe/FreeCAD | src/Mod/Draft/draftmake/make_bezcurve.py | 17 | 4287 | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.