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 |
|---|---|---|---|---|---|
ufal/lindat-kontext | lib/corplib.py | 2 | 30828 | # -*- coding: utf-8 -*-
# Copyright (c) 2003-2013 Pavel Rychly, Vojtech Kovar, Milos Jakubicek, Milos Husak, Vit Baisa
# Copyright(c) 2014 Charles University in Prague, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright(c) 2014 Tomas Machalek <tomas.machalek @ gmail.com>
#
# This p... | gpl-2.0 |
gorjuce/odoo | addons/resource/__openerp__.py | 261 | 1941 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
VihreatDeGrona/redmine2github | src/settings/local_sample.py | 3 | 2038 | import getpass
from os.path import abspath, dirname, join
import sys
PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__))))
sys.path.append(PROJECT_ROOT)
#
# Redmine API information
#
REDMINE_SERVER = 'https://redmine.my-org.edu'
REDMINE_PROJECT_ID = 'PROJ_ID' # Found in project url: http://redmine.my-org.edu/... | mit |
radiasoft/sirepo | tests/lib_files_test.py | 2 | 7230 | # -*- coding: utf-8 -*-
u"""lib files interface
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
def test_elegant_upload_sdds(fc):
from pykern import pki... | apache-2.0 |
SaschaMester/delicium | tools/telemetry/telemetry/internal/actions/load_media_unittest.py | 1 | 2743 | # Copyright 2015 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.
from telemetry.core import exceptions
from telemetry import decorators
from telemetry.internal.actions.load_media import LoadMediaAction
from telemetry.unitt... | bsd-3-clause |
jtrobec/pants | contrib/go/src/python/pants/contrib/go/subsystems/fetchers.py | 1 | 26122 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import importlib
imp... | apache-2.0 |
kevkruemp/HRI_Plant_Monitor | lambda/node_modules/grpc/deps/grpc/src/boringssl/gen_build_yaml.py | 26 | 4423 | #!/usr/bin/env python2.7
# Copyright 2015 gRPC authors.
#
# 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... | mit |
yugang/crosswalk-test-suite | stability/wrt-stablonglast2d-android-tests/inst.wgt.py | 136 | 6856 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
ClusterLabs/pcs | pcs/lib/communication/corosync.py | 3 | 7280 | import json
from pcs.common.node_communicator import RequestData
from pcs.common import reports
from pcs.common.reports import ReportItemSeverity
from pcs.common.reports.item import ReportItem
from pcs.lib.communication.tools import (
AllAtOnceStrategyMixin,
AllSameDataMixin,
OneByOneStrategyMixin,
Run... | gpl-2.0 |
0rmi/BetterTyggbotKappa | models/emote.py | 1 | 1724 | import logging
import pymysql
import re
import json
import collections
log = logging.getLogger('tyggbot')
class Emote:
def __init__(self):
self.pm = 0
self.tm = 0
self.pm_record = 0
self.tm_record = 0
self.count = 0
@classmethod
def load_from_row(cls, row):
... | mit |
yanheven/horizon | openstack_dashboard/test/api_tests/cinder_rest_tests.py | 47 | 3408 | # Copyright 2015 IBM Corp.
#
# 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, sof... | apache-2.0 |
zentner-kyle/servo | tests/wpt/web-platform-tests/eventsource/resources/cors.py | 132 | 1330 | import os
from wptserve import pipes
def run_other(request, response, path):
#This is a terrible hack
environ = {"__file__": path}
execfile(path, environ, environ)
rv = environ["main"](request, response)
return rv
def main(request, response):
origin = request.GET.first("origin", request.header... | mpl-2.0 |
fernandoacorreia/DjangoWAWSLogging | DjangoWAWSLogging/env/Lib/site-packages/pip/vcs/subversion.py | 473 | 10640 | import os
import re
from pip.backwardcompat import urlparse
from pip.index import Link
from pip.util import rmtree, display_path, call_subprocess
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('committed-rev="(\d+)"')
_svn_url_r... | mit |
roshantha9/AbstractManycoreSim | src/RunSim_Exp_PSAlgoTest.py | 1 | 6431 | import sys, os, csv, pprint, math
import argparse
import numpy as np
import random
import shutil
import time
## uncomment when running under CLI only version ##
#import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import scipy.stats
from matplotlib.colors ... | gpl-3.0 |
lukw00/shogun | examples/undocumented/python_static/kernel_commwordstring.py | 22 | 1076 | from tools.load import LoadMatrix
from sg import sg
lm=LoadMatrix()
traindna=lm.load_dna('../data/fm_train_dna.dat')
testdna=lm.load_dna('../data/fm_test_dna.dat')
parameter_list=[[traindna,testdna,10,3,0,'n',False,'FULL'],
[traindna,testdna,11,4,0,'n',False,'FULL']]
def kernel_commwordstring (fm_train_dna=traindna... | gpl-3.0 |
paulosman/django-openid-auth | django_openid_auth/auth.py | 1 | 9314 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2008-2010 Canonical Ltd.
#
# 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 ... | bsd-2-clause |
andyzsf/django | django/core/cache/backends/db.py | 28 | 8779 | "Database cache backend."
import base64
from datetime import datetime
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
from django.db import connections, transacti... | bsd-3-clause |
tjanez/ansible | contrib/inventory/vmware.py | 79 | 18441 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
VMware Inventory Script
=======================
Retrieve information about virtual machines from a vCenter server or
standalone ESX host. When `group_by=false` (in the INI file), host systems
are also returned in addition to VMs.
This script will attempt to read conf... | gpl-3.0 |
jiegec/gnuradio | gr-digital/python/digital/psk_constellations.py | 20 | 7050 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
codito/pomito | pomito/task.py | 1 | 1973 | # Pomito - Pomodoro timer on steroids
"""Task concept and routines."""
import hashlib
class Task(object):
"""A Task is an activity that the user is working on during a pomodoro session."""
def __init__(self, uid, estimate, actual, tags, description):
"""Create a Task.
Args:
desc... | mit |
40223133/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/tokenize.py | 728 | 24424 | """Tokenization help for Python programs.
tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens. It decodes the bytes according to PEP-0263 for
determining source file encoding.
It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF). ... | gpl-3.0 |
labcodes/django | django/utils/numberformat.py | 44 | 2476 | from decimal import Decimal
from django.conf import settings
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Get a number (as a number or string), and return it as a string,
using formats de... | bsd-3-clause |
works-mobile/Diamond | src/collectors/openstackswiftrecon/test/testopenstackswiftrecon.py | 37 | 3013 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch, Mock
from diamond.collector import Collector
from openstackswiftrecon import Openstack... | mit |
jvassev/dd-agent | tests/checks/integration/test_rabbitmq.py | 35 | 3057 | # 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest
CONFIG = {
'init_config': {},
'instances': [
{
'rabbitmq_api_url': 'http://localhost:15672/api/',
'rabbitmq_user': 'guest',
'rabbitmq_pass': 'guest',
'queu... | bsd-3-clause |
openai/cleverhans | examples/multigpu_advtrain/test_attack_multigpu.py | 2 | 2571 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import numpy as np
import tensorflow as tf
from attacks_multigpu import MadryEtAlMultiGPU
from model import MLPnGPU
from model import LayernGPU
import ... | mit |
waalt/yowsup | yowsup/layers/protocol_contacts/protocolentities/iq_sync_result.py | 67 | 3994 | from yowsup.structs import ProtocolTreeNode
from .iq_sync import SyncIqProtocolEntity
class ResultSyncIqProtocolEntity(SyncIqProtocolEntity):
'''
<iq type="result" from="491632092557@s.whatsapp.net" id="1417046561-4">
<sync index="0" wait="166952" last="true" version="1417046548593182" sid="1.30615237617e+... | gpl-3.0 |
irmen/Pyro5 | examples/callback/server.py | 1 | 1068 | import time
from Pyro5.api import expose, oneway, serve
class Worker(object):
def __init__(self, number, callback):
self.number = number
self.callback = callback
print("Worker %d created" % self.number)
@expose
@oneway
def work(self, amount):
print("Worker %d busy..." ... | mit |
kiszk/spark | python/pyspark/tests/test_profiler.py | 20 | 3738 | #
# 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 |
SaschaMester/delicium | native_client_sdk/src/build_tools/build_paths.py | 31 | 1074 | # 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.
import os
# Create the various paths of interest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
SDK_SRC_DIR = os.path.dirname(SCRIPT_DIR)
SDK_E... | bsd-3-clause |
nox/servo | tests/wpt/web-platform-tests/tools/manifest/item.py | 29 | 6881 | import os
from six.moves.urllib.parse import urljoin
from abc import ABCMeta, abstractmethod, abstractproperty
def get_source_file(source_files, tests_root, manifest, path):
def make_new():
from .sourcefile import SourceFile
return SourceFile(tests_root, path, manifest.url_base)
if source_fi... | mpl-2.0 |
spawnedc/MeCanBlog | django/utils/termcolors.py | 417 | 6885 | """
termcolors.py
"""
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = dict([(color_names[x], '3%s' % x) for x in range(8)])
background = dict([(color_names[x], '4%s' % x) for x in range(8)])
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'rever... | bsd-3-clause |
andersk/zulip | zerver/tests/test_message_edit_notifications.py | 2 | 21638 | from typing import Any, Dict, Mapping, Union
from unittest import mock
from django.utils.timezone import now as timezone_now
from zerver.lib.actions import get_client
from zerver.lib.push_notifications import get_apns_badge_count, get_apns_badge_count_future
from zerver.lib.test_classes import ZulipTestCase
from zerv... | apache-2.0 |
2ndQuadrant/ansible | lib/ansible/modules/network/f5/bigip_traffic_selector.py | 38 | 15443 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks 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 |
mheap/ansible | test/units/module_utils/aws/test_aws_module.py | 88 | 6242 | # -*- coding: utf-8 -*-
# (c) 2017, Michael De La Rue
#
# 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 lat... | gpl-3.0 |
minhpqn/chainer | chainer/cuda.py | 9 | 14266 | """Device, context and memory management on CuPy.
Chainer uses CuPy (with very thin wrapper) to exploit the speed of GPU
computation. Following modules and classes are imported to :mod:`cuda`
module for convenience (refer to this table when reading chainer's source
codes).
============================ ===============... | mit |
DDShadoww/grab | grab/error.py | 10 | 1907 | from __future__ import absolute_import
"""
Custom exception which Grab instance could generate.
Taxonomy:
Exception
|-> GrabError
|-> GrabNetworkError <- IOError
|-> Grab*Error
Exception
| -> weblib.error.WeblibError
|-> DataNotFound <- IndexError
"""
import warnings
from weblib.error import DataNotFoun... | mit |
deep0892/jitendrachatbot | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | mit |
krischer/obspy_xh | obspy_xh/header_0_98.py | 1 | 6355 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Header definitions for XH Version 0.98.
:copyright:
Lion Krischer (lion.krischer@googlemail.com), 2015
:license:
The MIT License (MIT)
"""
import numpy as np
# Define headers.
X_VERSION = 0.98
X_HDRSIZE = 1024
I_12345678 = 12345678
F_12345678 = 12345678.0
XH... | mit |
dodaro/preasp | tests/asp/AllAnswerSetsIntensive/weight.1.gringo.test.py | 4 | 48568 | input = """
1 1 2 1 151 159
1 1 2 1 152 160
1 1 2 1 153 161
1 1 2 1 154 162
1 1 2 1 155 163
1 1 2 1 156 164
1 1 2 1 157 165
1 1 2 1 158 166
1 1 2 1 159 167
1 1 2 1 163 171
1 172 2 1 116 117
1 173 2 1 132 116
1 174 2 1 140 132
1 175 2 1 148 140
1 176 2 1 156 148
1 177 2 1 164 156
1 178 1 0 164
1 179 2 1 118 119
1 180 2 ... | apache-2.0 |
camillemonchicourt/Geotrek | geotrek/core/fields.py | 4 | 3490 | import logging
import json
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django import forms
from django.conf import settings
from django.contrib.gis.forms.fields import LineStringField
from django.contrib.gis.geos imp... | bsd-2-clause |
dawran6/zulip | zerver/lib/bugdown/__init__.py | 5 | 58803 | from __future__ import absolute_import
# Zulip's main markdown implementation. See docs/markdown.md for
# detailed documentation on our markdown syntax.
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Text, Tuple, TypeVar, Union
from typing.re import Match
import markdown
import logging
import ... | apache-2.0 |
jejimenez/django | tests/template_tests/syntax_tests/test_basic.py | 91 | 12382 | from django.template.base import Context, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SilentAttrClass, SilentGetItemClass, SomeClass, setup
basic_templates = {
'basic-syntax01': 'something cool',
'basic-syntax02': '{{ headline }}',
'basic-syntax03': '{{ first }} --- {{ s... | bsd-3-clause |
iulian787/spack | lib/spack/spack/util/compression.py | 3 | 2059 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
import os
from itertools import product
from spack.util.executable import which
# Supported archive extensions.... | lgpl-2.1 |
Technocaveman/There-is-no-Third-Step | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/functional.py | 197 | 113704 | # -*- coding: utf-8 -*-
"""
pygments.lexers.functional
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for functional languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, incl... | mit |
talishte/ctigre | env/lib/python2.7/site-packages/fabric/utils.py | 5 | 13746 | """
Internal subroutines for e.g. aborting execution with an error message,
or performing indenting on multiline output.
"""
import os
import sys
import textwrap
from traceback import format_exc
def _encode(msg, stream):
if isinstance(msg, unicode) and hasattr(stream, 'encoding') and not stream.encoding is None:
... | bsd-2-clause |
sodafree/backend | build/ipython/build/lib.linux-i686-2.7/IPython/core/magics/pylab.py | 3 | 3273 | """Implementation of magic functions for matplotlib/pylab support.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distri... | bsd-3-clause |
jeffreylu9/django-cms | cms/cache/page.py | 37 | 3319 | # -*- coding: utf-8 -*-
import hashlib
from django.conf import settings
from django.utils.cache import add_never_cache_headers
from django.utils.encoding import iri_to_uri, force_text
from django.utils.timezone import get_current_timezone_name
from cms.cache import _get_cache_version, _set_cache_version, _get_cache_ke... | bsd-3-clause |
zeinsteinz/tacker | tacker/db/sqlalchemyutils.py | 3 | 4407 | # Copyright 2011 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 req... | apache-2.0 |
gangadharkadam/frappecontribution | frappe/utils/autodoc.py | 19 | 3374 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""
frappe.utils.autodoc
~~~~~~~~~~~~~~~~~~~~
Inspect elements of a given module and return its objects
"""
import inspect, importlib, re, frappe
from frappe.model.document import get_controller
def automodule(name)... | mit |
pbrady/sympy | sympy/utilities/compilef.py | 42 | 19093 | # needs access to libtcc and math.h
# TODO: *get tcc errors (currently something like 'Unknown error 3217941984',
# this makes debugging painful)
# *currently the compiled function accepts too many arguments silently
# *implement multi-dimensional functions for frange
# *list co... | bsd-3-clause |
tronlogistics/micro | venv/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 203 | 12894 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... | bsd-3-clause |
ehsanirani/slides_postdoc_interview | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # 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 collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
ellipsis14/dolfin | test/unit/python/mesh/test_mesh_data.py | 3 | 1077 | #!/usr/bin/env py.test
"Unit tests for the MeshData class"
# Copyright (C) 2011 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN 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... | gpl-3.0 |
amaggi/bda | chapter_02/ex_05.py | 1 | 2121 | import numpy as np
import matplotlib.pyplot as plt
from scipy.misc import comb
from scipy.stats import uniform, beta
from scipy.integrate import trapz
N_THROWS = 10
NPTS = 100
k_vals = np.arange(N_THROWS+1)
def Pr_y_is_k_given_theta(k, theta):
# coin toss probability
return comb(N_THROWS, k) * theta**k * (1-... | gpl-2.0 |
bilgili/nest-simulator | pynest/examples/csa_example.py | 7 | 2046 | # -*- coding: utf-8 -*-
#
# csa_example.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or... | gpl-2.0 |
pellaeon/bsd-cloudinit | cloudbaseinit/openstack/common/rpc/serializer.py | 39 | 1612 | # Copyright 2013 IBM Corp.
#
# 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 |
MillerDix/NEChromeX | flaskTest/venv/lib/python2.7/site-packages/jinja2/exceptions.py | 222 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... | mit |
praekelt/vumi-go | go/billing/tests/test_tasks.py | 1 | 49306 | from datetime import date, datetime
from decimal import Decimal
import gzip
import json
import StringIO
from dateutil.relativedelta import relativedelta
import mock
from go.vumitools.tests.helpers import djangotest_imports
with djangotest_imports(globals()):
from django.core import mail
from go.base.s3utils... | bsd-3-clause |
martinjorge/sm | drivers/updatempppathd.py | 9 | 5021 | #!/usr/bin/env python
#
# Copyright (C) Citrix Systems Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; version 2.1 only.
#
# This program is distributed in the hope that it will ... | lgpl-2.1 |
vincent-noel/libSigNetSim | libsignetsim/model/tests/TestReduceModel.py | 1 | 1809 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 Fou... | gpl-3.0 |
da1z/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/tr/tr_provinces.py | 316 | 2191 | # -*- coding: utf-8 -*-
"""
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
PROVINCE_CHOICES = (
('01', ('Adana')),
('02', ('Adıyaman')),
('03', ('Afyonkarahisar')),
('04', ('Ağrı')),
('68', ('Aksaray')),
('05', ('Amasya')),
('06', ('An... | apache-2.0 |
stephenslab/dsc2 | src/yhat_sqldf.py | 1 | 5997 | import inspect
from contextlib import contextmanager
from pandas.io.sql import to_sql, read_sql
from sqlalchemy import create_engine
import re
from warnings import catch_warnings, filterwarnings
from sqlalchemy.exc import DatabaseError, ResourceClosedError
from sqlalchemy.pool import NullPool
from sqlalchemy.event impo... | mit |
Chilledheart/depot_tools | third_party/pylint.py | 14 | 1276 | #!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that i... | bsd-3-clause |
mcpool/p2pool-dgb | p2pool/bitcoin/networks/litecoin.py | 29 | 1199 | import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'fbc0b6db'.decode('hex')
P2P_PORT = 9333
ADDRESS_VERSION = 48
RPC_PORT = 9332
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'litecoinaddress' in (yie... | gpl-3.0 |
hpcleuven/easybuild-easyblocks | easybuild/easyblocks/s/swig.py | 2 | 2388 | ##
# Copyright 2009-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
ville-k/tensorflow | tensorflow/contrib/learn/python/learn/datasets/base.py | 125 | 6584 | # 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 |
proby/ansible-modules-core | cloud/openstack/os_auth.py | 10 | 1924 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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 version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
John-Boik/Principled-Societies-Project | leddaApp/static/brython/src/Lib/xml/dom/minidom.py | 727 | 66854 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | gpl-3.0 |
HP-Scale-out-Storage/libstoragemgmt | plugin/sim/simulator.py | 1 | 12398 | # Copyright (C) 2011-2016 Red Hat, Inc.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library is distributed in the h... | lgpl-2.1 |
SmartInfrastructures/neutron | neutron/plugins/cisco/network_plugin.py | 32 | 6921 | # Copyright 2012 Cisco Systems, 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 requir... | apache-2.0 |
forio/julia-studio | tests/system/suite_CCOM/tst_CCOM01/test.py | 1 | 1806 | source("../../shared/suites_qtta.py")
source("../../shared/qtcreator.py")
# entry of test
def main():
# prepare example project
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
proFile = "propertyanimation.pro"
if not neededFilePresent(os.path.j... | gpl-3.0 |
bolkedebruin/airflow | airflow/operators/mssql_to_hive.py | 1 | 1213 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
ingadhoc/odoo | addons/email_template/tests/__init__.py | 260 | 1093 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
dims/test-infra | gubernator/gcs_async_test.py | 20 | 3712 | # Copyright 2016 The Kubernetes Authors.
#
# 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 ... | apache-2.0 |
petrutlucian94/nova_dev | nova/api/openstack/urlmap.py | 16 | 10509 | # Copyright 2011 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 requ... | apache-2.0 |
pwong-mapr/private-hue | desktop/core/ext-py/requests-2.0.0/requests/packages/charade/codingstatemachine.py | 206 | 2379 | ######################## 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.
... | apache-2.0 |
tudennis/LeetCode---kamyu104-11-24-2015 | Python/cracking-the-safe.py | 2 | 2736 | # Time: O(k^n)
# Space: O(k^n)
# There is a box protected by a password.
# The password is n digits, where each letter can be one of the first k digits 0, 1, ..., k-1.
#
# You can keep inputting the password,
# the password will automatically be matched against the last n digits entered.
#
# For example, assuming the... | mit |
nhomar/odoo | addons/mrp_operations/report/__init__.py | 443 | 1131 | # -*- 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... | agpl-3.0 |
raycarnes/odoomrp-wip | procurement_purchase_no_grouping/__openerp__.py | 25 | 1300 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
sivakuna-aap/superdesk | server/apps/preferences.py | 1 | 10567 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from flask i... | agpl-3.0 |
zaccoz/odoo | addons/website_membership/controllers/main.py | 64 | 9496 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import unslug
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.tools.translate import _
import time
import werkzeug.urls
... | agpl-3.0 |
spiceqa/virt-test | qemu/tests/softlockup.py | 3 | 5582 | import logging
import os
import socket
import time
from autotest.client import utils
from autotest.client.shared import error
def run_softlockup(test, params, env):
"""
soft lockup/drift test with stress.
1) Boot up a VM.
2) Build stress on host and guest.
3) run heartbeat with the given options ... | gpl-2.0 |
MartinEnder/erpnext-de | erpnext/accounts/doctype/journal_entry/journal_entry.py | 3 | 32022 | # 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, json
from frappe.utils import cstr, flt, fmt_money, formatdate
from frappe import msgprint, _, scrub
from erpnext.controllers.accounts_co... | agpl-3.0 |
zjkl19/AbaqusPython | 用python设置‘sets’点(Abaqus)/2222.py | 1 | 1091 | from abaqus import *
from abaqusConstants import *
model='bb'
part='Part-2'
p = mdb.models[model].parts[part]
n = p.nodes
node=[]
for temp in range(len(n)):
node0=temp,
node1=n[temp].label,
node2=node0+node1+n[temp].coordinates
node+=[node2]
rnode=[]
for temp in range(len(n)):
rnode0=temp,
... | mit |
php-coder/kubernetes | cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py | 174 | 8576 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
EPDCenterSpain/kernel_Archos_80_Titan | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
Health123/ansible | lib/ansible/utils/module_docs_fragments/openstack.py | 15 | 4003 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | gpl-3.0 |
tellesnobrega/sahara | sahara/plugins/cdh/v5_3_0/validation.py | 3 | 6667 | # Copyright (c) 2014 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 |
opsdroid/opsdroid | conftest.py | 3 | 1092 | import pytest
def pytest_addoption(parser):
parser.addoption(
"--only-signal-tests",
action="store_true",
default=False,
help=(
"run tests that test OpsDroid signal handling. "
"When --only-signal-tests is not specified, signal tests are skipped. "
... | apache-2.0 |
blakfeld/ansible | lib/ansible/cli/galaxy.py | 20 | 21602 | ########################################################################
#
# (C) 2013, James Cammarata <jcammarata@ansible.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 ... | gpl-3.0 |
TribeMedia/sky_engine | sky/tools/webkitpy/layout_tests/servers/apache_http.py | 11 | 8877 | # 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 ... | bsd-3-clause |
schumi2004/NOT_UPDATED_Sick-Beard-Dutch | lib/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 426 | 2174 | """The match_hostname() function from Python 3.2, essential when using SSL."""
import re
__version__ = '3.2.2'
class CertificateError(ValueError):
pass
def _dnsname_to_pat(dn):
pats = []
for frag in dn.split(r'.'):
if frag == '*':
# When '*' is a fragment by itself, it matches a non-... | gpl-3.0 |
thodoris/djangoPharma | djangoPharma/env/Lib/site-packages/debug_toolbar/panels/signals.py | 6 | 3500 | from __future__ import absolute_import, unicode_literals
import weakref
from django.core.signals import (
got_request_exception, request_finished, request_started,
)
from django.db.backends.signals import connection_created
from django.db.models.signals import (
class_prepared, post_delete, post_init, post_mi... | apache-2.0 |
apuigsech/cryptohelper | cryptohelper/__init__.py | 1 | 1600 | #!/usr/bin/env python
# Generic Cryptography code utils used on matasano cryptography challenges (http://cryptopals.com/)
#
# Copyright (c) 2015 - Albert Puigsech Galicia (albert@puigsech.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentati... | gpl-3.0 |
svbergerem/fefebot | html2markdown.py | 1 | 2262 | #! /usr/bin/env python3.2
import re
def _subpre(text):
list=re.split('(<pre>|</pre>)',text)
for i in range(len(list)):
# begin of pre
if i%4==1:
list[i]='\n\n '
# in pre
elif i%4==2:
list[i]=re.sub('<p>|<br>|\n\n', '\n\n ',list[i])
# end of pre
elif i%4==3:
list[i]=... | mit |
red-hood/calendarserver | txweb2/dav/test/test_delete.py | 1 | 2715 | ##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# 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... | apache-2.0 |
peterm-itr/edx-platform | lms/djangoapps/courseware/tests/test_video_handlers.py | 3 | 30190 | # -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
from mock import patch
import os
import tempfile
import textwrap
import json
from datetime import timedelta
from webob import Request
from mock import MagicMock, Mock
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django imp... | agpl-3.0 |
dmarteau/QGIS | python/plugins/processing/algs/grass7/ext/r_proj.py | 10 | 3035 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_proj.py
---------
Date : October 2017
Copyright : (C) 2017 by Médéric Ribreux
Email : medspx at medspx dot fr
*****************************************... | gpl-2.0 |
Crystalnix/BitPop | chrome/test/functional/gtalk/test_basic.py | 2 | 11852 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Basic sanity tests for the GTalk extension.
This module contains the basic set of sanity tests run on the
GTalk extension.
"""
... | bsd-3-clause |
BryanQuigley/sos | tests/report_tests.py | 5 | 4597 | # This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.