repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
heliortf/Google-Forum-Engine | refs/heads/master | lib/markupsafe/_native.py | 1243 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... |
mlcommons/training | refs/heads/master | compliance/mllog/mllog.py | 1 | # Copyright 2019 MLBenchmark Group. 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 l... |
gangadhar-kadam/verve_test_erp | refs/heads/v5.0 | erpnext/stock/doctype/landed_cost_purchase_receipt/__init__.py | 37694 | from __future__ import unicode_literals
|
liggitt/openshift-ansible | refs/heads/master | roles/lib_openshift/src/lib/volume.py | 64 | # pylint: skip-file
# flake8: noqa
class Volume(object):
''' Class to represent an openshift volume object'''
volume_mounts_path = {"pod": "spec.containers[0].volumeMounts",
"dc": "spec.template.spec.containers[0].volumeMounts",
"rc": "spec.template.spec.co... |
greenmoon55/google-python-exercises | refs/heads/master | babynames/solution/babynames.py | 212 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
"""Baby Names exercise
Define the extract_names() function below and c... |
Skytim/nccuTEG | refs/heads/master | pybossa/model/task.py | 1 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... |
rg3/youtube-dl | refs/heads/master | youtube_dl/extractor/internetvideoarchive.py | 63 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
from ..utils import (
determine_ext,
int_or_none,
xpath_text,
)
class InternetVideoArchiveIE(InfoExtractor):
_VALID_URL = r'https?://video\.internetvideoarchive... |
fedelemantuano/thug | refs/heads/master | thug/DOM/W3C/HTML/HTMLBRElement.py | 2 | #!/usr/bin/env python
from .HTMLElement import HTMLElement
from .attr_property import attr_property
class HTMLBRElement(HTMLElement):
def __init__(self, doc, tag):
HTMLElement.__init__(self, doc, tag)
clear = attr_property("clear")
|
solarcoin/blockchain-explorer | refs/heads/master | Abe/view_templates.py | 1 | # -*- coding: utf-8 -*-
##HEADER/FOOTER
def get_default_homepage_template():
template ="""
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css"
href="%(dotdot)s%(STATIC_PATH)sabe.css" />
<link rel="shortcut icon" href="%(dotdot)s%(STATIC_PATH)sfavicon.... |
lertech/extra-addons | refs/heads/master | account_invoice_delivery_address/model/stock_picking.py | 1 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
... |
bplancher/odoo | refs/heads/9.0 | doc/_extensions/github_link.py | 229 | import inspect
import importlib
import os.path
from urlparse import urlunsplit
"""
* adds github_link(mode) context variable: provides URL (in relevant mode) of
current document on github
* if sphinx.ext.linkcode is enabled, automatically generates github linkcode
links (by setting config.linkcode_resolve)
Settin... |
jmztaylor/android_kernel_htc_a5 | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
glogiotatidis/bedrock | refs/heads/master | tests/pages/thunderbird/thunderbird.py | 11 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.base import BasePage
from pages.regions.download_button import D... |
johankaito/fufuka | refs/heads/master | graph-tool/src/graph_tool/run_action/inline.py | 2 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2006-2015 Tiago de Paula Peixoto <tiago@skewed.de>
#
# 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 Li... |
jdugge/QGIS | refs/heads/master | python/core/additions/edit.py | 57 | # -*- coding: utf-8 -*-
"""
***************************************************************************
edit.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Denis Rouzaud
Email : denis@opengis.ch
********************************************... |
bretttegart/treadmill | refs/heads/master | tests/cli/show_test.py | 4 | """
Unit test for treadmill.cli.show
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import click
import click.testing
import mock
import requests
from treadmill import restclient
from treadmill i... |
beezee/GAE-Django-site | refs/heads/master | django/contrib/gis/maps/google/zoom.py | 327 | from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
from django.contrib.gis.maps.google.gmap import GoogleMapException
from math import pi, sin, cos, log, exp, atan
# Constants used for degree to radian conversion, and vice-versa.
DTOR = pi / 180.
RTOD = 180. / pi
class GoogleZoom(object):
... |
alfcrisci/word_cloud | refs/heads/master | wordcloud/color_from_image.py | 19 | import numpy as np
from PIL import ImageFont
class ImageColorGenerator(object):
"""Color generator based on a color image.
Generates colors based on an RGB image. A word will be colored using
the mean color of the enclosing rectangle in the color image.
After construction, the object acts as a calla... |
smmribeiro/intellij-community | refs/heads/master | python/testData/inspections/PyDunderSlotsInspection/inheritedClassAttrAssignmentAndOwnWithDictAndInheritedWithAttrSlotsPy2.py | 33 | class B(object):
attr = 'baz'
__slots__ = ['f', 'attr']
class C(B):
__slots__ = ['foo', 'bar', '__dict__']
C.attr = 'spam'
print(C.attr)
c = C()
c.attr = 'spam'
print(c.attr) |
sander76/home-assistant | refs/heads/dev | tests/components/axis/test_camera.py | 8 | """Axis camera platform tests."""
from unittest.mock import patch
from homeassistant.components import camera
from homeassistant.components.axis.const import (
CONF_STREAM_PROFILE,
DOMAIN as AXIS_DOMAIN,
)
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from homeassistant.const import STAT... |
SamuelDSR/YouCompleteMe-Win7-GVIM | refs/heads/master | python/ycm/completers/cpp/tests/flags_test.py | 9 | #!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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
# (... |
ATIX-AG/ansible | refs/heads/devel | lib/ansible/plugins/lookup/nios_next_ip.py | 30 | #
# Copyright 2018 Red Hat | Ansible
#
# 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.
#
# ... |
TorkamaniLab/metapipe | refs/heads/master | metapipe/models/command.py | 2 | """ A command model that can be easily transformed into jobs.
author: Brian Schrader
since: 2015-12-21
"""
from .tokens import Input, Output, FileToken, PathToken, alias_pattern
class Command(object):
def __init__(self, alias, parts=[]):
self.alias = alias
self.parts = parts
if len(self... |
henridwyer/scikit-learn | refs/heads/master | examples/linear_model/plot_ols_ridge_variance.py | 387 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... |
mudbungie/NetExplorer | refs/heads/master | env/lib/python3.4/site-packages/setuptools/command/egg_info.py | 40 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.util import convert_path
from distutils import log
import distutils.errors
import os
import re
import sys
from setuptools import Command
from setuptools.comma... |
essamjoubori/geojs | refs/heads/master | testing/test-runners/upload_test_cases.py | 2 | #!/usr/bin/env python
'''
This python module is a script that helps to generate test images
and upload them to the midas data store. It is dependent on a
the specific structure of the unit tests. It can be improved
in the future by using the testtools module and providing a
custom exception handler.
'''
import sys
... |
MartynShaw/audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg-sampler.lv2/waflib/Tools/d_config.py | 316 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Utils
from waflib.Configure import conf
@conf
def d_platform_flags(self):
v=self.env
if not v.DEST_OS:
v.DEST_OS=Utils.unversioned_sys_platform()
binfm... |
keithhigbee/mongo-connector | refs/heads/master | tests/__init__.py | 21 | # Copyright 2013-2014 MongoDB, 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... |
FNST-OpenStack/horizon | refs/heads/master | openstack_dashboard/dashboards/identity/users/urls.py | 57 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
Mariam118/UYR | refs/heads/master | uyr/UYRUtils.py | 2 | __author__ = 'binary'
import os
import shutil
import twitter
import ConfigParser
# Loading the required modules
try:
from LSBSteg import LSBSteg
except ImportError:
print "Hide Module: Sorry module LSBSteg not found"
try:
import cv2
except ImportError:
print "Hide Module: Sorry cv2 module not found"
... |
lordmuffin/aws-cfn-plex | refs/heads/master | functions/credstash/cryptography/x509/name.py | 17 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import six
from cryptography import utils
from cryptography.x509.oid imp... |
SAM-IT-SA/odoo | refs/heads/8.0 | addons/stock_account/stock.py | 13 | # -*- 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... |
fertozudo/umatoo | refs/heads/master | lib/django/contrib/sessions/backends/signed_cookies.py | 383 | from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.core import signing
class SessionStore(SessionBase):
def load(self):
"""
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_sess... |
serensoner/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/_base/providers/base.py | 1 | from urlparse import urlparse
import json
import re
from requests import HTTPError
import time
import traceback
import xml.etree.ElementTree as XMLTree
try:
from xml.etree.ElementTree import ParseError as XmlParseError
except ImportError:
from xml.parsers.expat import ExpatError as XmlParseError
from couchpot... |
vgupta6/Project-2 | refs/heads/master | tests/nose.py | 39 | #!/usr/bin/python
# The above line probably works for many people, but if not,
# check your python executable is correct.
# This script assumes it is in <app>/tests/ as nose.py
# and that there is a run.py sibling.
import sys
from os import system, getcwd, sep, chdir
from os.path import join, normpath, abspath, d... |
aam-at/tensorflow | refs/heads/master | tensorflow/lite/testing/op_tests/leaky_relu.py | 13 | # Copyright 2019 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... |
couchbaselabs/couchbase-cli | refs/heads/master | pump_bfd.py | 1 | #!/usr/bin/env python
import copy
import glob
import logging
import os
import simplejson as json
import string
import sys
import datetime
import time
import urllib
import fnmatch
import couchbaseConstants
import pump
import_stmts = (
'from pysqlite2 import dbapi2 as sqlite3',
'import sqlite3',
)
for status, ... |
Bilingual-Annotation-Task-Force/Scripts | refs/heads/master | Sentence Tokenization/sentence_tokenize.py | 1 | """
Eric Nordstrom
Python 3.6.0
11/15/17
"""
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s:%(levelname)s:%(message)s')
def _ap_parser():
'''set up and return the argparse parser'''
import argparse
parser = argparse.ArgumentParser(description='''\
Outputs a new TSV file with ... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/253_test_gl.py | 43 | #! /usr/bin/env python
"""Very simple test script for the SGI gl library extension module
taken mostly from the documentation.
Roger E. Masse
"""
from test.test_support import verbose, TestSkipped
import gl, GL, time
glattrs = ['RGBcolor', 'RGBcursor', 'RGBmode', 'RGBrange', 'RGBwritemask',
'__doc__', '__name_... |
simon247/omim | refs/heads/master | tools/download_statistics/aggregator.py | 53 | #!/usr/bin/env python
#coding: utf-8
from collections import defaultdict
import sys
import datetime
result = defaultdict(lambda : defaultdict(lambda :defaultdict(set)))
def print_result():
for date_key in result.iterkeys():
year, month, req_type = date_key.split('_')
for from_country in result[date_key].iter... |
hubsaysnuaa/odoo | refs/heads/8.0 | addons/account/account_invoice.py | 93 | # -*- 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... |
valentin-krasontovitsch/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_vpc_net_facts.py | 27 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... |
0jpq0/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/encodings/euc_jis_2004.py | 816 | #
# euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jis_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... |
adamncasey/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_mock.py | 496 | #!/usr/bin/env python
#
# Copyright 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... |
kotbegemot/simple-immutable-file-key-value-store | refs/heads/master | run_for_integration_tests.py | 1 | import subprocess
import inspect
import os
def path_current_dir():
return os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
def preparatory_data(path, size_for_db):
exec_pd = "".join([path_current_dir(), "/", "preparatory_data"])
arg = ''.join([exec_pd, " ", path, " ", str(size_f... |
OpenPymeMx/account-financial-tools | refs/heads/8.0 | account_credit_control/line.py | 7 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright 2012-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... |
omakk/servo | refs/heads/master | tests/wpt/web-platform-tests/css/tools/build.py | 63 | #!/usr/bin/env python
# CSS Test Suite Build Script
# Copyright 2011 Hewlett-Packard Development Company, L.P.
# Initial code by fantasai, joint copyright 2010 W3C and Microsoft
# Licensed under BSD 3-Clause: <http://www.w3.org/Consortium/Legal/2008/03-bsd-license>
import sys
import os
import json
import optparse
imp... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/gdacs/config_flow.py | 17 | """Config flow to configure the GDACS integration."""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_RADIUS,
CONF_SCAN_INTERVAL,
)
from homeassistant.helpers import config_validation as cv
from .co... |
adedayo/intellij-community | refs/heads/master | python/testData/refactoring/pushdown/multiFileImports/parent_module.py | 80 | from shared_module import module_function
class Parent(object):
def should_be_pushed(self):
module_function() |
dax/jmc | refs/heads/master | src/jmc/tests/lang.py | 1 | # -*- coding: utf-8 -*-
##
## test_lang.py
## Login : David Rousselie <david.rousselie@happycoders.org>
## Started on Fri May 20 10:46:58 2005
## $Id: test_lang.py,v 1.1 2005/07/11 20:39:31 dax Exp $
##
## Copyright (C) 2005
## This program is free software; you can redistribute it and/or modify
## it under the ter... |
Rodolfoarv/Mars-Explorer-AI-with-Python- | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/etree.py | 152 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import re
from pip._vendor.six import text_type
from . import _base
from ..utils... |
tph-thuering/vnetsource | refs/heads/master | ts_om/tests/__init__.py | 2 | from .execution_util_tests import *
from .sim_services_tests import *
from .upload_tests import *
|
alimony/django | refs/heads/master | tests/postgres_tests/migrations/0001_setup_extensions.py | 15 | from unittest import mock
from django.db import migrations
try:
from django.contrib.postgres.operations import (
BtreeGinExtension, CITextExtension, CreateExtension, CryptoExtension,
HStoreExtension, TrigramExtension, UnaccentExtension,
)
except ImportError:
BtreeGinExtension = mock.Mock()... |
rossburton/yocto-autobuilder | refs/heads/ross | lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/dialects/postgres.py | 41 | # dialects/postgres.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# backwards compat with the old name
from sqlalchemy.util import warn_deprecated
... |
cwaldbieser/treq | refs/heads/master | docs/examples/disable_redirects.py | 12 | from twisted.internet.task import react
from _utils import print_response
import treq
def main(reactor, *args):
d = treq.get('http://httpbin.org/redirect/1', allow_redirects=False)
d.addCallback(print_response)
return d
react(main, [])
|
xuxiao19910803/edx-platform | refs/heads/master | lms/djangoapps/licenses/tests.py | 78 | """Tests for License package"""
import logging
import json
from uuid import uuid4
from random import shuffle
from tempfile import NamedTemporaryFile
import factory
from factory.django import DjangoModelFactory
from django.test import TestCase
from django.test.client import Client
from django.core.management import ca... |
billygoo/dev-365 | refs/heads/master | python/flask/minitwit/venv/Lib/site-packages/werkzeug/wsgi.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import sys
import posixpath
import mimetypes
from itert... |
sinkuri256/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/apps/organization/client.py | 48 | #!/usr/bin/python2.4
#
# Copyright 2011 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 ... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.4/django/conf/locale/th/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j F Y, G:i:s'
YEAR_MONTH_... |
bashu/fluentcms-campaign | refs/heads/develop | campaign/fields.py | 1 | # -*- coding: utf-8 -*-
from django import forms
from django.db import models
from django.conf import settings
try:
from django.utils import simplejson
except ImportError:
import json as simplejson
class JSONWidget(forms.Textarea):
def render(self, name, value, attrs=None):
if not isinstance(va... |
defionscode/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigiq_application_fasthttp.py | 9 | #!/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',
... |
mahak/neutron | refs/heads/master | neutron/common/cache_utils.py | 2 | # 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
# distributed under the... |
spookey/ffflash | refs/heads/master | tests/lib/locations/test_get_basedir.py | 1 | from os import path
from ffflash.lib.locations import get_basedir
def test_get_basedir():
assert get_basedir() == path.abspath(
path.dirname(path.dirname(path.dirname(path.dirname(__file__))))
)
|
cgre-aachen/gempy | refs/heads/master | gempy/api_modules/io.py | 1 | """
The aim of this module is to encapsulate the loading functionality. Also this will enable
better error handling when some of the data files are missing
"""
import os
import pathlib
import shutil
import pandas as pn
import numpy as np
# region Save
from gempy import Project, create_model, init_data
from gempy.uti... |
ShineFan/odoo | refs/heads/8.0 | addons/website_event_track/controllers/__init__.py | 382 | import event
|
quinot/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1'... |
Peddle/hue | refs/heads/master | desktop/core/ext-py/thrift-0.9.1/src/transport/TZlibTransport.py | 210 | #
# 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... |
koparasy/gemfi | refs/heads/master | tests/configs/pc-simple-atomic.py | 64 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
etzhou/edx-platform | refs/heads/master | common/djangoapps/django_locale/tests.py | 81 | # pylint: disable=invalid-name, line-too-long, super-method-not-called
"""
Tests taken from Django upstream:
https://github.com/django/django/blob/e6b34193c5c7d117ededdab04bb16caf8864f07c/tests/regressiontests/i18n/tests.py
"""
from django.conf import settings
from django.test import TestCase, RequestFactory
from djang... |
Outernet-Project/librarian | refs/heads/master | librarian/menuitems/filemanager.py | 1 | from bottle_utils.i18n import lazy_gettext as _
from ..presentation.menu.menu import MenuItem
class FilesMenuItem(MenuItem):
name = 'files'
label = _("Files")
icon_class = 'files'
route = 'filemanager:list'
route_args = {'path': ''}
|
harlequin/sickbeard | refs/heads/master | sickbeard/providers/generic.py | 2 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... |
saurabh6790/omnitech-libs | refs/heads/master | core/page/permission_manager/permission_manager.py | 32 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
import webnotes.defaults
@webnotes.whitelist()
def get_roles_and_doctypes():
webnotes.only_for(("System Manager", "Administrator"))
return {
"doctypes": [d... |
Trixter69/BookMarka | refs/heads/master | lib/html5lib/sanitizer.py | 30 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from six.moves import urllib_parse as urlparse
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
content_type_rgx = re.compile(r'''
^
... |
eng-tools/sfsimodels | refs/heads/master | sfsimodels/exceptions.py | 1 | import warnings
class DesignError(Exception):
pass # deprecated
class AnalysisError(Exception):
pass
class ModelError(Exception):
pass
class ModelWarning(Warning):
pass
def deprecation(message):
warnings.warn(message, stacklevel=3)
|
danakj/chromium | refs/heads/master | third_party/closure_compiler/compile.py | 1 | #!/usr/bin/python
# Copyright 2014 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.
"""Runs Closure compiler on JavaScript files to check for errors and produce
minified output."""
import argparse
import os
import re
impor... |
defance/edx-platform | refs/heads/master | pavelib/utils/test/utils.py | 44 | """
Helper functions for test tasks
"""
from paver.easy import sh, task, cmdopts
from pavelib.utils.envs import Env
import os
import subprocess
MONGO_PORT_NUM = int(os.environ.get('EDXAPP_TEST_MONGO_PORT', '27017'))
MONGO_HOST = os.environ.get('EDXAPP_TEST_MONGO_HOST', 'localhost')
__test__ = False # do not collect
... |
Plain-Andy-legacy/android_external_chromium_org | refs/heads/lp-5.1r1 | tools/telemetry/telemetry/core/platform/ios_platform_backend.py | 29 | # Copyright 2014 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 logging
from telemetry.core.platform import posix_platform_backend
#TODO(baxley): Put in real values.
class IosPlatformBackend(posix_platform_backen... |
NixaSoftware/CVis | refs/heads/master | venv/lib/python2.7/site-packages/numpy/lib/tests/test_ufunclike.py | 13 | from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.core as nx
import numpy.lib.ufunclike as ufl
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_warns
)
class TestUfunclike(TestCase):
def test_ispo... |
lthurlow/Boolean-Constrained-Routing | refs/heads/master | networkx-1.8.1/build/lib/networkx/algorithms/components/biconnected.py | 35 | # -*- coding: utf-8 -*-
"""
Biconnected components and articulation points.
"""
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from itertools import chain
import networkx as nx
__author... |
svanschalkwyk/datafari | refs/heads/master | windows/python/Lib/multiprocessing/__init__.py | 134 | #
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 't... |
pleaseproject/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/distutils/text_file.py | 136 | """text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
import sys, os, io
class TextFile:
"""Provides a file-like object that takes care of all the things you
commonl... |
kstaniek/condoor | refs/heads/master | condoor/device.py | 1 | """Provides Device class representing the physical device for both target and jumphost."""
import sys
import pexpect
from condoor.exceptions import ConnectionError, CommandSyntaxError, CommandTimeoutError
from condoor.utils import parse_inventory
from condoor.fsm import FSM
class Device(object):
"""Device class... |
lzw120/django | refs/heads/master | tests/regressiontests/admin_scripts/broken_app/models.py | 259 | from django.db import modelz
|
uglyboxer/linear_neuron | refs/heads/master | net-p3/lib/python3.5/site-packages/numpy/polynomial/laguerre.py | 75 | """
Objects for dealing with Laguerre series.
This module provides a number of objects (mostly functions) useful for
dealing with Laguerre series, including a `Laguerre` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in th... |
troglobit/pyhacks | refs/heads/master | scapy_ext/__init__.py | 1 | """ Scapy extensions """
|
ghandiosm/Test | refs/heads/master | addons/procurement_jit/__openerp__.py | 24 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Just In Time Scheduling',
'version': '1.0',
'category': 'Base',
'description': """
This module will automatically reserve the picking from stock when a sale order is confirmed
================... |
chrisma/reviewer-recommender-bot | refs/heads/master | rrb/bot/test_marvin.py | 1 | import unittest, json, codecs, os
from marvin import Marvin
repo_storage_dir = '/home/christoph/git/reviewer-recommender-bot/repos'
class MarvinTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(MarvinTest, self).__init__(*args, **kwargs)
self.test_data_dir = os.path.join(os.path.dirname(os.path... |
hammerlab/cohorts | refs/heads/master | test/test_basic.py | 1 | # Copyright (c) 2016. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/quest/legacy_head_cargo.py | 85615 | import sys
def setup(core, object):
return |
erikdejonge/python_for_kids | refs/heads/master | chapter10/copying_objects1.py | 1 | import copy
class Animal:
def __init__(self, name, number_of_legs, color):
self.name = name
self.number_of_legs = number_of_legs
self.color = color
harry = Animal('hippogriff', 6, 'pink')
harriet = copy.copy(harry)
print(harry.name)
print(harriet.name) |
wavesoft/three.js | refs/heads/master | utils/converters/msgpack/msgpack/exceptions.py | 667 | class UnpackException(Exception):
pass
class BufferFull(UnpackException):
pass
class OutOfData(UnpackException):
pass
class UnpackValueError(UnpackException, ValueError):
pass
class ExtraData(ValueError):
def __init__(self, unpacked, extra):
self.unpacked = unpacked
self.extr... |
wanghongjuan/crosswalk-test-suite | refs/heads/master | apptools/apptools-android-tests/apptools/activity_name.py | 15 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
cga-harvard/hypermap | refs/heads/master | hypermap/aggregator/tests/mocks/worldmap.py | 2 | # -*- coding: utf-8 -*-
"""
Mocks for testing a WorldMap service type.
"""
from httmock import response, urlmatch
import os
NETLOC = r'(.*\.)?worldmap\.harvard\.edu$'
HEADERS = {'content-type': 'application/json'}
GET = 'get'
API_PATH = os.path.abspath(os.path.dirname(__file__))
class Resource:
""" A WorldMap... |
ronbelson/ghost-proxy-hebrew | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/pastie.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.pastie
~~~~~~~~~~~~~~~~~~~~~~
Style similar to the `pastie`_ default style.
.. _pastie: http://pastie.caboo.se/
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style impor... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/space/spacestations/shared_spacestation_neutral_01.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/space/spacestations/shared_spacestation_neutral_01.iff"
result.attr... |
snnn/tensorflow | refs/heads/master | tensorflow/python/util/tf_should_use_test.py | 9 | # 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... |
socialdevices/manager | refs/heads/master | core/migrations/0006_auto__add_field_scheduleaction_trigger_from_position.py | 1 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ScheduleAction.trigger_from_position'
db.add_column('core_scheduleaction', 'trigger_from_p... |
nwchandler/ansible | refs/heads/devel | lib/ansible/modules/database/proxysql/proxysql_manage_config.py | 58 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
gchp/django | refs/heads/master | django/db/backends/mysql/client.py | 520 | import subprocess
from django.db.backends.base.client import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
@classmethod
def settings_to_cmd_args(cls, settings_dict):
args = [cls.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_dic... |
stewartpark/django | refs/heads/master | tests/utils_tests/test_jslex.py | 153 | # -*- coding: utf-8 -*-
"""Tests for jslex."""
# originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
from django.test import SimpleTestCase
from django.utils.jslex import JsLexer, prepare_js_for_gettext
class JsTokensTest(SimpleTestCase):
LEX_CASES = [
# ids
("... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.