repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
eharney/cinder | cinder/api/v3/attachments.py | 1 | 11362 | # 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
# d... | apache-2.0 |
davidmueller13/android_kernel_lge_g3-2 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
travellhyne/f2py | fparser/parsefortran.py | 3 | 5789 | #!/usr/bin/env python
"""Provides FortranParser.
"""
#Author: Pearu Peterson <pearu@cens.ioc.ee>
#Created: May 2006
__autodoc__ = ['FortranParser']
__all__ = ['FortranParser']
import re
import sys
import traceback
import logging
from numpy.distutils.misc_util import yellow_text, red_text
from readfortran import Fort... | bsd-3-clause |
laszlocsomor/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/permute_test.py | 26 | 3206 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
timm/timmnix | pypy3-v5.5.0-linux64/lib-python/3/test/test_strtod.py | 4 | 20594 | # Tests for the correctly-rounded string -> float conversions
# introduced in Python 2.7 and 3.1.
import random
import unittest
import re
import sys
import test.support
if getattr(sys, 'float_repr_style', '') != 'short':
raise unittest.SkipTest('correctly-rounded string->float conversions '
... | mit |
arbrandes/edx-platform | openedx/core/djangoapps/content/course_overviews/tests/test_tasks.py | 4 | 1982 | # lint-amnesty, pylint: disable=missing-module-docstring
from unittest import mock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from ..tasks import enqueue_async_course_overview_upd... | agpl-3.0 |
jluissandovalm/smd_lammps | python/examples/pizza/vmd.py | 31 | 8758 | # Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html
# Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
#
# Copyright (2005) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
# certain rights in this software. This software is... | gpl-2.0 |
YangChihWei/w16b_test | static/Brython3.1.1-20150328-091302/Lib/os.py | 635 | 35582 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or... | agpl-3.0 |
turbokongen/home-assistant | homeassistant/components/plex/config_flow.py | 1 | 15991 | """Config flow for Plex."""
import copy
import logging
from aiohttp import web_response
import plexapi.exceptions
from plexapi.gdm import GDM
from plexauth import PlexAuth
import requests.exceptions
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.http.view import HomeAs... | apache-2.0 |
gangadharkadam/v6_frappe | frappe/api.py | 27 | 3521 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import json
import frappe
import frappe.handler
import frappe.client
import frappe.desk.reportview
from frappe.utils.response import build_response
from frappe import _
def handl... | mit |
vtapia/sssd | src/tests/python-test.py | 4 | 16953 | #!/usr/bin/env python
# coding=utf-8
# Authors:
# Jakub Hrozek <jhrozek@redhat.com>
#
# Copyright (C) 2009 Red Hat
# see file 'COPYING' for use and warranty information
# 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... | gpl-3.0 |
ericbaze/continuum_code_2012 | pydata/moin/pythonenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/search.py | 60 | 4523 | import sys
import textwrap
import pkg_resources
import pip.download
from pip.basecommand import Command, SUCCESS
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
f... | gpl-2.0 |
dagwieers/ansible | lib/ansible/modules/network/cloudengine/ce_mlag_interface.py | 31 | 35442 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
sid88in/incubator-airflow | airflow/contrib/operators/winrm_operator.py | 13 | 5811 | # -*- 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 |
google/contentbox | third_party/django/contrib/gis/db/models/sql/query.py | 209 | 5406 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... | apache-2.0 |
italomaia/turtle-linux | games/Dynamite/pgu/test.py | 1 | 1624 | import pygame
from pygame.locals import *
import gui
screen = pygame.display.set_mode(
(640, 480), FULLSCREEN ) # try adding DOUBLEBUF | HWSURFACE
# pygame.mouse.set_visible(0)
app = gui.App()
c = gui.Container(width=640,height=480)
##
## dialog 1
##
t1 = gui.Table()
t1.tr()
t1.add(gui.Label("Gal Test"))
... | gpl-3.0 |
Sixshaman/networkx | networkx/utils/random_sequence.py | 10 | 6411 | """
Utilities for generating random numbers, random sequences, and
random selections.
"""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import random
import sys
import networkx as... | bsd-3-clause |
ezbake/ezbake-common-python | thrift/thrift-utils/lib/ezbake/thrift/utils/ezthrifttest.py | 1 | 3296 | # Copyright (C) 2013-2014 Computer Sciences Corporation
#
# 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 a... | apache-2.0 |
softliumin/redis-py | redis/client.py | 22 | 100985 | from __future__ import with_statement
from itertools import chain
import datetime
import sys
import warnings
import time
import threading
import time as mod_time
from redis._compat import (b, basestring, bytes, imap, iteritems, iterkeys,
itervalues, izip, long, nativestr, unicode,
... | mit |
slagle/ansible-modules-extras | packaging/os/yum_repository.py | 8 | 24683 | #!/usr/bin/python
# encoding: utf-8
# (c) 2015-2016, Jiri Tyr <jiri.tyr@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | gpl-3.0 |
wfx/epack | epack/libarchive/ffi.py | 1 | 7623 | # This file is part of a program licensed under the terms of the GNU Lesser
# General Public License version 2 (or at your option any later version)
# as published by the Free Software Foundation: http://www.gnu.org/licenses/
from __future__ import division, print_function, unicode_literals
from ctypes import (
... | gpl-3.0 |
vlachoudis/sl4a | python/src/Lib/ast.py | 139 | 11347 | # -*- coding: utf-8 -*-
"""
ast
~~~
The `ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with
each Python release; this module helps to find out programmatically what
the current grammar looks like and allows... | apache-2.0 |
gtko/Sick-Beard | lib/hachoir_parser/image/xcf.py | 90 | 10369 | """
Gimp image parser (XCF file, ".xcf" extension).
You can find informations about XCF file in Gimp source code. URL to read
CVS online:
http://cvs.gnome.org/viewcvs/gimp/app/xcf/
\--> files xcf-read.c and xcf-load.c
Author: Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field im... | gpl-3.0 |
vladmm/intellij-community | python/helpers/python-skeletons/multiprocessing/__init__.py | 40 | 4217 | """Skeleton for 'multiprocessing' stdlib module."""
from multiprocessing.pool import Pool
class Process(object):
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
self.name = ''
self.daemon = False
self.authkey = None
self.exitcode = None
self.id... | apache-2.0 |
dzz007/photivo | scons-local-2.2.0/SCons/Platform/darwin.py | 14 | 2578 | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008... | gpl-3.0 |
gilessbrown/wextracto | wex/composed.py | 3 | 4382 | """
Wextracto uses `Function composition <http://en.wikipedia.org/wiki/Function_composition_%28computer_science%29>`_
as an easy way to build new functions from existing ones:
.. code-block:: pycon
>>> from wex.composed import compose
>>> def add1(x):
... return x + 1
...
>>> def mult2(x):
... | bsd-3-clause |
aljscott/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/runtests_unittest.py | 123 | 3157 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
zlaja/android_kernel_lge_msm8610 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
NewpTone/stacklab-nova | debian/tmp/usr/lib/python2.7/dist-packages/nova/tests/test_quota.py | 6 | 74369 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
AustereCuriosity/astropy | astropy/io/fits/verify.py | 4 | 5728 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
from __future__ import unicode_literals
import operator
import warnings
from ...extern.six import next
from ...utils import indent
from ...utils.exceptions import AstropyUserWarning
class VerifyError(Exception):
"""
Verify exception class.
"... | bsd-3-clause |
MTechLLC/nica | web/themes/custom/nica_theme/bootstrap/test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | gpl-2.0 |
philippeback/volatility | volatility/plugins/addrspaces/macho.py | 44 | 6621 | # Volatility
#
# Authors:
# Mike Auty
#
# This file is part of Volatility.
#
# Volatility 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 versio... | gpl-2.0 |
robbiet480/home-assistant | tests/auth/test_init.py | 13 | 32299 | """Tests for the Home Assistant auth module."""
from datetime import timedelta
import jwt
import pytest
import voluptuous as vol
from homeassistant import auth, data_entry_flow
from homeassistant.auth import auth_store, const as auth_const, models as auth_models
from homeassistant.auth.const import MFA_SESSION_EXPIRA... | apache-2.0 |
chintak/scikit-image | skimage/feature/util.py | 1 | 4726 | import numpy as np
from skimage.util import img_as_float
class FeatureDetector(object):
def __init__(self):
self.keypoints_ = np.array([])
def detect(self, image):
"""Detect keypoints in image.
Parameters
----------
image : 2D array
Input image.
... | bsd-3-clause |
mbrukman/delayed-replay | tests/proxy_test.py | 1 | 1244 | #!/usr/bin/python
#
# Copyright 2014 Google 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 a... | apache-2.0 |
rpatterson/test-har | test_har/tests/test_requests.py | 1 | 3214 | """
Test using HAR files in Python tests against the requests library.
"""
import json
import requests
import requests_mock
from test_har import requests_har as test_har
from test_har import tests
class HARDogfoodRequestsTests(tests.HARDogfoodTestCase, test_har.HARTestCase):
"""
Test using HAR files in Pyt... | gpl-3.0 |
pavlov99/jsonapi | jsonapi/utils.py | 1 | 2220 | """ JSON:API utils."""
class _classproperty(property):
""" Implement property behaviour for classes.
class A():
@_classproperty
@classmethod
def name(cls):
return cls.__name__
"""
def __get__(self, obj, type_):
return self.fget.__get__(None, type_)()
... | mit |
NicWayand/xray | xarray/plot/utils.py | 1 | 6442 | import pkg_resources
import numpy as np
import pandas as pd
from ..core.pycompat import basestring
def _load_default_cmap(fname='default_colormap.csv'):
"""
Returns viridis color map
"""
from matplotlib.colors import LinearSegmentedColormap
# Not sure what the first arg here should be
f = p... | apache-2.0 |
Eseoghene/bite-project | deps/gdata-python-client/src/gdata/geo/data.py | 132 | 2385 | #!/usr/bin/python
#
# Copyright (C) 2009 Google 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 ... | apache-2.0 |
j5shi/Thruster | pylibs/test/test_mutex.py | 4 | 1034 | import unittest
import test.test_support
mutex = test.test_support.import_module("mutex", deprecated=True)
class MutexTest(unittest.TestCase):
def test_lock_and_unlock(self):
def called_by_mutex(some_data):
self.assertEqual(some_data, "spam")
self.assertTrue(m.test(), ... | gpl-2.0 |
ehashman/oh-mainline | vendor/packages/Pygments/pygments/formatters/svg.py | 362 | 5867 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | agpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/views/decorators/csrf.py | 586 | 2202 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import available_attrs, decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds... | mit |
zofuthan/edx-platform | common/lib/xmodule/xmodule/video_module/video_module.py | 47 | 37504 |
# -*- coding: utf-8 -*-
# pylint: disable=abstract-method
"""Video is ungraded Xmodule for support video content.
It's new improved video module, which support additional feature:
- Can play non-YouTube video sources via in-browser HTML5 video player.
- YouTube defaults to HTML5 mode from the start.
- Speed changes in... | agpl-3.0 |
rynomad/CCNx-Federated-Wiki-Prototype | server/express/node_modules/npm/node_modules/node-gyp/gyp/test/configurations/invalid/gyptest-configurations.py | 57 | 1029 | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
# Keys that do not belong inside a configuration... | mit |
shifter/grr | gui/api_value_renderers.py | 4 | 12620 | #!/usr/bin/env python
"""Renderers that render RDFValues into JSON compatible data structures."""
import base64
import inspect
import numbers
import logging
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import type_info
from grr.lib import utils
from grr.lib.rdfva... | apache-2.0 |
xozzo/pyfootball | setup.py | 1 | 1257 | from setuptools import setup, find_packages
import os
if os.path.exists('README.rst'):
readme_path = 'README.rst'
else:
readme_path = 'README.md'
setup(
name='pyfootball',
version='1.0.1',
description='A client library for the football-data.org REST API',
long_description=open(readme_path).re... | mit |
natefoo/ansible-modules-extras | network/a10/a10_service_group.py | 117 | 13447 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb service-group objects
(c) 2014, Mischa Peters <mpeters@a10networks.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 publishe... | gpl-3.0 |
feroda/django | tests/template_tests/templatetags/custom.py | 42 | 4823 | import operator
import warnings
from django import template
from django.template.defaultfilters import stringfilter
from django.utils import six
register = template.Library()
@register.filter
@stringfilter
def trim(value, num):
return value[:num]
@register.filter
def noop(value, param=None):
"""A noop fil... | bsd-3-clause |
frankk00/realtor | oauth_provider/oauth.py | 1 | 23473 | """
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | bsd-3-clause |
lakshayg/tensorflow | tensorflow/contrib/testing/python/framework/fake_summary_writer.py | 75 | 5053 | # Copyright 2015 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 |
mauelsha/linux | scripts/gdb/linux/dmesg.py | 630 | 1991 | #
# gdb helper commands and functions for Linux kernel debugging
#
# kernel log buffer dump
#
# Copyright (c) Siemens AG, 2011, 2012
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
class LxDmesg(gdb.Command... | gpl-2.0 |
fsschneider/DeepOBS | deepobs/tensorflow/datasets/two_d.py | 1 | 4790 | # -*- coding: utf-8 -*-
"""2D DeepOBS dataset."""
import numpy as np
import tensorflow as tf
from . import dataset
class two_d(dataset.DataSet):
"""DeepOBS data set class to create two dimensional stochastic testproblems.
This toy data set consists of a fixed number (``train_size``) of iid draws
from tw... | mit |
oberlin/django | django/contrib/postgres/fields/jsonb.py | 341 | 2994 | import json
from psycopg2.extras import Json
from django.contrib.postgres import forms, lookups
from django.core import exceptions
from django.db.models import Field, Transform
from django.utils.translation import ugettext_lazy as _
__all__ = ['JSONField']
class JSONField(Field):
empty_strings_allowed = False
... | bsd-3-clause |
af1rst/bite-project | deps/gdata-python-client/tests/gdata_tests/codesearch_test.py | 133 | 1930 | #!/usr/bin/python
#
# Copyright (C) 2007 Google 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 ... | apache-2.0 |
rspavel/spack | lib/spack/external/py/_log/warning.py | 218 | 2542 | import py, sys
class DeprecationWarning(DeprecationWarning):
def __init__(self, msg, path, lineno):
self.msg = msg
self.path = path
self.lineno = lineno
def __repr__(self):
return "%s:%d: %s" %(self.path, self.lineno+1, self.msg)
def __str__(self):
return self.msg
d... | lgpl-2.1 |
googleinterns/learnbase | learnbase/src/main/webapp/WEB-INF/Lib/distutils/extension.py | 250 | 10904 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""
__revision__ = "$Id$"
import os, string, sys
from types import *
try:
import warnings
except ImportError:
warnings = None
# This class is really only used by the "build_ext" command, so it mig... | apache-2.0 |
agusc/scrapy | scrapy/extensions/logstats.py | 127 | 1715 | import logging
from twisted.internet import task
from scrapy.exceptions import NotConfigured
from scrapy import signals
logger = logging.getLogger(__name__)
class LogStats(object):
"""Log basic scraping stats periodically"""
def __init__(self, stats, interval=60.0):
self.stats = stats
self... | bsd-3-clause |
keithroe/vtkoptix | IO/XML/Testing/Python/TestXMLUnstructuredGridIO.py | 23 | 2784 | #!/usr/bin/env python
import os
import vtk
from vtk.util.misc import vtkGetDataRoot
from vtk.util.misc import vtkGetTempDir
VTK_DATA_ROOT = vtkGetDataRoot()
VTK_TEMP_DIR = vtkGetTempDir()
file0 = VTK_TEMP_DIR + '/ugFile0.vtu'
file1 = VTK_TEMP_DIR + '/ugFile1.vtu'
file2 = VTK_TEMP_DIR + '/ugFile2.vtu'
# read in some... | bsd-3-clause |
foursquare/pants | contrib/go/src/python/pants/contrib/go/tasks/go_test.py | 1 | 2117 | # 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, print_function, unicode_literals
from builtins import filter
from pants.base.exceptions import TaskError
from pants.base.... | apache-2.0 |
gorjuce/odoo | openerp/addons/test_converter/tests/test_html.py | 257 | 13533 | # -*- encoding: utf-8 -*-
import json
import os
import datetime
from lxml import etree
from openerp.tests import common
from openerp.tools import html_escape as e
from openerp.addons.base.ir import ir_qweb
directory = os.path.dirname(__file__)
class TestExport(common.TransactionCase):
_model = None
def set... | agpl-3.0 |
VishvajitP/django-extensions | django_extensions/utils/validatingtemplatetags.py | 26 | 2469 | from django.template import defaulttags
from django.template.base import Library, Node
from django.templatetags import future
register = Library()
error_on_old_style_url_tag = False
new_style_url_tag = False
errors = []
def before_new_template(force_new_urls):
"""Reset state ready for new template"""
global... | mit |
mxOBS/deb-pkg_trusty_chromium-browser | tools/telemetry/telemetry/core/discover.py | 12 | 4024 | # Copyright 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.
import fnmatch
import inspect
import os
import re
from telemetry import decorators
from telemetry.core import camel_case
@decorators.Cache
def DiscoverMod... | bsd-3-clause |
bodylabs/blmath | blmath/geometry/transform/correspondence.py | 1 | 2095 | # FIXME -- move back to core
def apply_correspondence(correspondence_src, correspondence_dst, vertices):
"""
Apply a correspondence defined between two vertex sets to a new set.
Identifies a correspondence between `correspondence_src` and
`correspondence_dst` then applies that correspondence to `verti... | bsd-2-clause |
seanwestfall/django | django/utils/deconstruct.py | 502 | 2047 | from importlib import import_module
from django.utils.version import get_docs_version
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsystem.
Accepts an optional kwarg `path` to specify the import path.
"""
path =... | bsd-3-clause |
christiantroy/xbmc | tools/EventClients/Clients/PS3 Sixaxis Controller/ps3d.py | 168 | 12019 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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) ... | gpl-2.0 |
shadyueh/pyranking | env/lib/python2.7/site-packages/setuptools/sandbox.py | 259 | 13925 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import pkg_resources
if sys.platform.startswith('java'):
import org.python.modules.posix.PosixModule as _os
else:
_os = sys.modules[os.name]
try:
_file = file
except NameError:
... | mit |
flavour/helios | controllers/org.py | 3 | 5103 | # -*- coding: utf-8 -*-
"""
Organization Registry - Controllers
@author: Fran Boon
@author: Michael Howden
"""
module = request.controller
resourcename = request.function
if not deployment_settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# Options Menu (available in... | mit |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
gerrit-review/gerrit | tools/js/bowerutil.py | 1 | 1488 | # Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
felixfontein/ansible | test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/restconf/restconf.py | 47 | 2617 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
yugang/web-testing-service | wts/tests/csp/csp_sandbox_empty_int-manual.py | 30 | 2669 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "sandbox "
respons... | bsd-3-clause |
sharma1nitish/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py | 638 | 9836 | # 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 of conditions and the f... | bsd-3-clause |
reminisce/mxnet | benchmark/opperf/utils/op_registry_utils.py | 2 | 13293 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
sinhrks/seaborn | seaborn/matrix.py | 5 | 40890 | """Functions to visualize matrices of data."""
import itertools
import colorsys
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy as np
import pandas as pd
from scipy.spatial import distance
from scipy.cluster import hierarchy
from .axisgrid import Grid
from .palett... | bsd-3-clause |
lepinkainen/pyfibot | pyfibot/modules/module_geoip.py | 1 | 1389 | from __future__ import unicode_literals, print_function, division
import pygeoip
import os.path
import sys
import socket
try:
from modules.module_usertrack import get_table
user_track_available = True
except ImportError:
user_track_available = False
# http://dev.maxmind.com/geoip/legacy/geolite/
DATAFIL... | bsd-3-clause |
valurhrafn/chrome-sync-server | google/protobuf/protobuf_lite_java_parse_pom.py | 88 | 1834 | #!/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.
"""Parses the Maven pom.xml file for which files to include in a lite build.
Usage:
protobuf_lite_java_parse_pom.py {path to p... | mit |
jspargo/AneMo | django/lib/python2.7/site-packages/django/core/context_processors.py | 80 | 2274 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from __future__ i... | gpl-2.0 |
leighpauls/k2cro4 | tools/gyp/pylib/gyp/MSVSVersion.py | 122 | 13527 | # 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
class VisualStudioVersion(obj... | bsd-3-clause |
fanquake/bitcoin | test/functional/feature_maxuploadtarget.py | 35 | 6653 | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of -maxuploadtarget.
* Verify that getdata requests for old blocks (>1week) are dropped
... | mit |
llou/panopticon | panopticon/core/database.py | 1 | 7145 | # database.py is part of Panopticon.
# Panopticon 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.
# Panopticon is distributed in the ... | gpl-3.0 |
i-namekawa/TopSideMonitor | plotting.py | 1 | 37323 | import os, sys, time
from glob import glob
import cv2
from pylab import *
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.backends.backend_pdf import PdfPages
matplotlib.rcParams['figure.facecolor'] = 'w'
from scipy.signal import argrelextrema
import scipy.stats as stats
import scipy.io as sio
from scipy imp... | bsd-3-clause |
RapidApplicationDevelopment/tensorflow | tensorflow/contrib/metrics/python/kernel_tests/histogram_ops_test.py | 12 | 9744 | # 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 |
DavidNorman/tensorflow | tensorflow/python/ops/weights_broadcast_ops.py | 133 | 7197 | # 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 |
ecederstrand/django | django/db/backends/base/features.py | 193 | 9883 | from django.db.models.aggregates import StdDev
from django.db.utils import ProgrammingError
from django.utils.functional import cached_property
class BaseDatabaseFeatures(object):
gis_enabled = False
allows_group_by_pk = False
allows_group_by_selected_pks = False
empty_fetchmany_value = []
update_... | bsd-3-clause |
kubeup/archon | vendor/github.com/influxdata/influxdb/build.py | 21 | 41033 | #!/usr/bin/python2.7 -u
import sys
import os
import subprocess
import time
from datetime import datetime
import shutil
import tempfile
import hashlib
import re
import logging
import argparse
################
#### InfluxDB Variables
################
# Packaging variables
PACKAGE_NAME = "influxdb"
INSTALL_ROOT_DIR = "... | apache-2.0 |
loco-odoo/localizacion_co | openerp/addons-extra/odoo-pruebas/odoo-server/addons/hr_expense/report/__init__.py | 380 | 1071 | # -*- 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 |
prymatex/SublimeCodeIntel | libs/codeintel2/perlcile.py | 7 | 8773 | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozil... | gpl-2.0 |
postlund/home-assistant | script/scaffold/templates/config_flow_oauth2/integration/__init__.py | 9 | 2558 | """The NEW_NAME integration."""
import asyncio
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
aiohttp_client,
config_entry_oauth2_f... | apache-2.0 |
vaygr/ansible | contrib/inventory/stacki.py | 39 | 6286 | #!/usr/bin/env python
# Copyright (c) 2016, Hugh Ma <hugh.ma@flextronics.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | gpl-3.0 |
melund/wcwidth | wcwidth/table_zero.py | 7 | 20001 | """Zero_Width table. Created by setup.py."""
# Generated: 2015-09-14T01:48:19.532217
# Source: DerivedGeneralCategory-8.0.0.txt
# Date: 2015-02-13, 13:47:11 GMT [MD]
ZERO_WIDTH = (
(0x0300, 0x036f,), # Combining Grave Accent ..Combining Latin Small Le
(0x0483, 0x0489,), # Combining Cyrillic Titlo..Combining... | mit |
vnsofthe/odoo | addons/hr_attendance/report/__init__.py | 375 | 1071 | # -*- 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 |
jkunimune15/Map-Projections | src/zupplemental/compose_maps.py | 1 | 5115 | #compose_maps.py
#make ALL the maps
import math
from generate_borders import generate_borders
from generate_graticule import generate_graticule, generate_backdrop
from generate_indicatrices import generate_indicatrices
from generate_orthodromes import generate_orthodromes
from generate_shape import plot_shapes
from g... | mit |
sarvex/tensorflow | tensorflow/python/keras/preprocessing/image_dataset.py | 6 | 11428 | # Copyright 2020 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 |
ricardogsilva/QGIS | tests/src/python/test_qgsimagecache.py | 41 | 5431 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsImageCache.
.. note:: 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.
"""
__a... | gpl-2.0 |
saurabhjn76/sympy | examples/advanced/curvilinear_coordinates.py | 96 | 3691 | #!/usr/bin/env python
"""
This example shows how to work with coordinate transformations, curvilinear
coordinates and a little bit with differential geometry.
It takes polar, cylindrical, spherical, rotating disk coordinates and others
and calculates all kinds of interesting properties, like Jacobian, metric
tensor, ... | bsd-3-clause |
Eric-Zhong/odoo | addons/account_asset/account_asset_invoice.py | 141 | 3088 | # -*- encoding: 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 G... | agpl-3.0 |
Juniper/contrail-dev-neutron | neutron/plugins/embrane/common/constants.py | 11 | 2821 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Embrane, 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/... | apache-2.0 |
michaelmior/lemur | docs/conf.py | 8 | 8204 | # -*- coding: utf-8 -*-
#
# lemur documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 7 18:43:48 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | apache-2.0 |
stevenbaker/dotfiles | .vim/bundle/jedi-vim/jedi/jedi/modules.py | 2 | 14663 | """
Don't confuse these classes with :mod:`parsing_representation` modules, the
modules here can access these representation with ``module.parser.module``.
``Module`` exists mainly for caching purposes.
Basically :mod:`modules` offers the classes:
- ``CachedModule``, a base class for Cachedmodule.
- ``Module`` the cl... | mit |
lanen/youtube-dl | test/test_utils.py | 34 | 31908 | #!/usr/bin/env python
# coding: utf-8
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__))))
# Various small unit tests
import io
import json
import xml.etree.ElementTree
from youtube_dl.u... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.