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 |
|---|---|---|---|---|---|
jwlawson/tensorflow | tensorflow/contrib/factorization/python/kernel_tests/masked_matmul_ops_test.py | 111 | 3662 | # 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 applic... | apache-2.0 |
kidburglar/youtube-dl | youtube_dl/extractor/iqiyi.py | 10 | 13633 | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import itertools
import re
import time
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
)
from ..utils import (
clean_html,
decode_packed_codes,
get_element_by_id,
get_elem... | unlicense |
mxia/engine | third_party/libxml/src/xstc/xstc.py | 165 | 21006 | #!/usr/bin/env python
#
# This is the MS subset of the W3C test suite for XML Schemas.
# This file is generated from the MS W3c test suite description file.
#
import sys, os
import exceptions, optparse
import libxml2
opa = optparse.OptionParser()
opa.add_option("-b", "--base", action="store", type="string", dest="b... | bsd-3-clause |
gauravjns/taiga-back | taiga/projects/attachments/models.py | 10 | 3995 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | agpl-3.0 |
JSchwehn/ahmia | tools/test_hidden_services.py | 6 | 9303 | # -*- coding: utf-8 -*-
"""Test all hidden service's: HTTP GET tells if the service is online."""
import httplib
import signal # To timeout the TCP/HTTP connection
import socket
import urllib2
from urllib2 import Request
import requests
import simplejson
import socks
from bs4 import BeautifulSoup # To parse HTML
so... | bsd-3-clause |
purism/pdak | daklib/formats.py | 10 | 2635 | #!/usr/bin/python
""" Helper functions for the various changes formats
@contact: Debian FTPMaster <ftpmaster@debian.org>
@copyright: 2009, 2010 Joerg Jaspert <joerg@debian.org>
@copyright: 2009 Chris Lamb <lamby@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software... | gpl-2.0 |
liamgh/liamgreenhughes-sl4a-tf101 | python/src/Lib/plat-sunos5/TYPES.py | 75 | 5806 | # Generated by h2py from /usr/include/sys/types.h
# Included from sys/isa_defs.h
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
_LONG_ALIGNMENT = 8
_LONG_LONG_ALIGNMENT = 8
_DOUBLE_ALIGNMENT = 8
_LONG_DOUBLE_ALIGNMENT = 16
_POINTER_ALIGNMENT = 8
_MAX_ALIGNMENT = 16
_ALIGNMENT_REQUIRED = 1
_CHAR_ALIGNMENT ... | apache-2.0 |
smikes/depot_tools | gn.py | 4 | 1185 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script is a wrapper around the GN binary that is pulled from Google
Cloud Storage when you sync Chrome. The binaries go into pl... | bsd-3-clause |
bm5w/second_dataS | test_quicksort.py | 1 | 1531 | import pytest
from quicksort import quicksort
def test_quicksort_simple():
input = [1, 3, 2]
assert quicksort(input) == [1, 2, 3]
def test_quicksort():
input = [54, 26, 93, 17, 71, 31, 44, 55, 20]
assert quicksort(input) == [17, 20, 26, 31, 44, 54, 55, 71, 93]
def test_quicksort_duplicate():
... | mit |
mialwe/mngb | 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 |
avsm/lifedb-server | client/python/lifedb/tests/client.py | 1 | 5909 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import doctest
import os
import unittest
import StringIO
import time
import tempfile
from lifedb import ... | gpl-2.0 |
brahimalaya/K-OS--Konnex-Operating-System | kosek/Error.py | 2 | 3326 | # -*- coding: utf-8 -*-
__version__ = "0.9.0"
__copyright__ = """
k_os (Konnex Operating-System based on the OSEK/VDX-Standard).
(C) 2007-2013 by Christoph Schueler <github.com/Christoph2,
cpu12.gems@googlemail.com>
All Rights Reserved
This program is free softwa... | gpl-2.0 |
joeythesaint/yocto-autobuilder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/db/migrate/versions/010_fix_column_lengths.py | 4 | 2577 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
Codefans-fan/odoo | addons/l10n_multilang/__init__.py | 438 | 1082 | # -*- 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 |
bergolho1337/URI-Online-Judge | Basicos/Python/1061/main.py | 1 | 1292 | # -*- coding: utf-8 -*-
def converteString (dia, hora):
evento = []
# Parse do dia
num = dia[4:6]
evento.append(int(num))
# Parse da hora
num = hora[0:2]
evento.append(int(num))
# Parse dos minutos
num = hora[5:7]
evento.append(int(num))
# Parse dos segundos
num = hora[1... | gpl-2.0 |
daniponi/django | tests/model_package/tests.py | 380 | 2668 | from __future__ import unicode_literals
from django.db import connection, models
from django.db.backends.utils import truncate_name
from django.test import TestCase
from .models.article import Article, Site
from .models.publication import Publication
class Advertisement(models.Model):
customer = models.CharFiel... | bsd-3-clause |
google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/varLib/plot.py | 5 | 4153 | """Visualize DesignSpaceDocument and resulting VariationModel."""
from fontTools.varLib.models import VariationModel, supportScalar
from fontTools.designspaceLib import DesignSpaceDocument
from matplotlib import pyplot
from mpl_toolkits.mplot3d import axes3d
from itertools import cycle
import math
import logging
impor... | apache-2.0 |
cauchycui/scikit-learn | examples/mixture/plot_gmm_pdf.py | 284 | 1528 | """
=============================================
Density Estimation for a mixture of Gaussians
=============================================
Plot the density estimation of a mixture of two Gaussians. Data is
generated from two Gaussians with different centers and covariance
matrices.
"""
import numpy as np
import ma... | bsd-3-clause |
fernandobt8/thrift | test/crossrunner/prepare.py | 50 | 1686 | #
# 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 |
xubenben/scikit-learn | examples/manifold/plot_lle_digits.py | 181 | 8510 | """
=============================================================================
Manifold learning on handwritten digits: Locally Linear Embedding, Isomap...
=============================================================================
An illustration of various embeddings on the digits dataset.
The RandomTreesEmbed... | bsd-3-clause |
seanwestfall/django | tests/user_commands/tests.py | 205 | 7165 | import os
from django.apps import apps
from django.core import management
from django.core.management import BaseCommand, CommandError, find_commands
from django.core.management.utils import find_command, popen_wrapper
from django.db import connection
from django.test import SimpleTestCase, ignore_warnings, override_s... | bsd-3-clause |
foreni-packages/golismero | thirdparty_libs/requests/structures.py | 398 | 3575 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import os
import collections
from itertools import islice
class IteratorProxy(object):
"""docstring for IteratorProxy"""
def __init__(self, i):
self.i = i
# self.i = chain.from_iter... | gpl-2.0 |
alon/servo | tests/wpt/css-tests/tools/pywebsocket/src/example/close_wsh.py | 495 | 2835 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
mnahm5/django-estore | Lib/site-packages/botocore/vendored/requests/adapters.py | 573 | 16810 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | mit |
ShoRit/shipping-costs-sample | v2/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | apache-2.0 |
zmanji/ecryptfs | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
mrquim/repository.mrquim | repo/script.module.youtube.dl/lib/youtube_dl/extractor/roxwel.py | 73 | 1970 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate, determine_ext
class RoxwelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)'
_TEST = {
'url': 'http://www.roxwel.com/player/passi... | gpl-2.0 |
inonit/django-chemtrails | tests/testapp/migrations/0005_guild.py | 1 | 1061 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 13:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('testapp', '0004_book_view_book_permission'),
]
ope... | mit |
openstack/manila | manila/share/drivers/hitachi/hnas/ssh.py | 2 | 35481 | # Copyright (c) 2015 Hitachi Data 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
#
# U... | apache-2.0 |
carolFrohlich/nipype | nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py | 2 | 1485 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..utils import ApplyInverseDeformation
def test_ApplyInverseDeformation_inputs():
input_map = dict(bounding_box=dict(field='comp{1}.inv.comp{1}.sn2def.bb',
),
deformation=dict(field='comp{1}.inv.comp{1}.sn2def.... | bsd-3-clause |
sbuss/voteswap | lib/social/backends/classlink.py | 4 | 1487 | from social.backends.oauth import BaseOAuth2
class ClasslinkOAuth(BaseOAuth2):
"""
Classlink OAuth authentication backend.
Docs: https://developer.classlink.com/docs/oauth2-workflow
"""
name = 'classlink'
AUTHORIZATION_URL = 'https://launchpad.classlink.com/oauth2/v2/auth'
ACCESS_TOKEN_UR... | mit |
dvliman/jaikuengine | .google_appengine/lib/django-1.4/tests/regressiontests/admin_custom_urls/models.py | 42 | 1467 | from functools import update_wrapper
from django.contrib import admin
from django.db import models
class Action(models.Model):
name = models.CharField(max_length=50, primary_key=True)
description = models.CharField(max_length=70)
def __unicode__(self):
return self.name
class ActionAdmin(admin.... | apache-2.0 |
defionscode/ansible | lib/ansible/modules/cloud/amazon/efs_facts.py | 47 | 13236 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
ayesandarmoe/microblog_flask_tutorial | flask/lib/python2.7/site-packages/babel/messages/plurals.py | 29 | 6664 | # -*- coding: utf-8 -*-
"""
babel.messages.plurals
~~~~~~~~~~~~~~~~~~~~~~
Plural form definitions.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from babel.core import default_locale, Locale
from operator import itemgetter
# XXX: remove this file, dupl... | gpl-2.0 |
reinaH/osf.io | scripts/tests/test_glacier_audit.py | 54 | 2368 | # -*- coding: utf-8 -*-
from nose.tools import * # noqa
from tests.base import OsfTestCase
from website.addons.osfstorage.tests.factories import FileVersionFactory
from website.addons.osfstorage import model
from scripts.osfstorage import glacier_audit
mock_output = {
'ArchiveList': [
{
... | apache-2.0 |
samuelctabor/ardupilot | Tools/scripts/uploader.py | 11 | 39942 | #!/usr/bin/env python
############################################################################
#
# Copyright (c) 2012-2017 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are me... | gpl-3.0 |
joonro/PyTables | tables/tests/test_tree.py | 6 | 37679 | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import time
import tempfile
import warnings
import tables
from tables import Group, Leaf, Table, Array
from tables import StringCol, IntCol, Int16Col, FloatCol, Float32Col
from tables.tests import common
from tables.tests.common impor... | bsd-3-clause |
mdanielwork/intellij-community | python/helpers/py2only/docutils/parsers/rst/languages/nl.py | 128 | 3708 | # $Id: nl.py 7119 2011-09-02 13:00:23Z milde $
# Author: Martijn Pieters <mjpieters@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be... | apache-2.0 |
chouseknecht/ansible | lib/ansible/module_utils/vmware.py | 2 | 56971 | # -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, James E. King III (@jeking3) <jking@apache.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_im... | gpl-3.0 |
GuneetAtwal/kernel_n9005 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
RedhawkSDR/integration-gnuhawk | gnuradio/gnuradio-core/src/python/gnuradio/gr/hier_block2.py | 7 | 4376 | #
# Copyright 2006,2007 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)
# any later version... | gpl-3.0 |
boyuegame/kbengine | kbe/src/lib/python/Lib/test/test_keyword.py | 98 | 5840 | import keyword
import unittest
from test import support
import filecmp
import os
import sys
import subprocess
import shutil
import textwrap
KEYWORD_FILE = support.findfile('keyword.py')
GRAMMAR_FILE = os.path.join(os.path.split(__file__)[0],
'..', '..', '... | lgpl-3.0 |
mheap/ansible | lib/ansible/modules/system/ufw.py | 23 | 11228 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Ahti Kitsik <ak@ahtik.com>
# Copyright: (c) 2014, Jarno Keskikangas <jarno.keskikangas@gmail.com>
# Copyright: (c) 2013, Aleksey Ovcharenko <aleksey.ovcharenko@gmail.com>
# Copyright: (c) 2013, James Martin <jmartin@basho.com>
# GNU General Public Licens... | gpl-3.0 |
benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/cmp/cmppolicy_csvserver_binding.py | 3 | 6033 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
wkhtmltopdf/qtwebkit | Tools/Scripts/webkitpy/common/system/profiler.py | 182 | 9421 | # Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | gpl-2.0 |
alfred82santa/tarrabme2 | src/orgs/models.py | 1 | 1856 | from django.db import models
from common.models import CommonModel, AbstractContact, AbstractAddress
from django.contrib.auth.models import Group
from imagekit.models import ProcessedImageField, ImageSpecField
from imagekit.processors import ResizeToFill
class Organization(CommonModel):
name = models.CharField(max... | gpl-3.0 |
technicalpickles/zulip | zerver/migrations/0002_django_1_8.py | 125 | 2229 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name... | apache-2.0 |
hujiajie/chromium-crosswalk | tools/perf/benchmarks/session_restore.py | 7 | 2377 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from measurements import session_restore
import page_sets
from telemetry import benchmark
class _SessionRestoreTypical25(p... | bsd-3-clause |
kevinlee12/oppia | core/domain/storage_model_audit_jobs_test.py | 2 | 4211 | # Copyright 2019 The Oppia 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 applicable ... | apache-2.0 |
seanfisk/powerline | powerline/lint/markedjson/parser.py | 37 | 8124 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from powerline.lint.markedjson.error import MarkedError
from powerline.lint.markedjson import tokens
from powerline.lint.markedjson import events
class ParserError(MarkedError):
pass
class Parser:
d... | mit |
mdavid/teams | markdown/extensions/tables.py | 65 | 3229 | """
Tables Extension for Python-Markdown
====================================
Added parsing of tables to Python-Markdown.
A simple example:
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Copyright 2009 - [Waylan Limberg](http://a... | agpl-3.0 |
LLNL/spack | lib/spack/spack/test/pattern.py | 5 | 2078 | # 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 pytest
import spack.util.pattern as pattern
@pytest.fixture()
def interface():
"""Returns the interface clas... | lgpl-2.1 |
niknow/scipy | scipy/fftpack/setup.py | 102 | 1514 | #!/usr/bin/env python
# Created by Pearu Peterson, August 2002
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fftpack',parent_package, t... | bsd-3-clause |
bperez77/ensemble_colorization | server/myproject/settings.py | 2 | 3190 | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... | mit |
JioEducation/edx-platform | common/test/acceptance/pages/lms/create_mode.py | 148 | 2538 | """Mode creation page (used to add modes to courses during testing)."""
import re
import urllib
from bok_choy.page_object import PageObject
from . import BASE_URL
class ModeCreationPage(PageObject):
"""The mode creation page.
When allowed by the Django settings file, visiting this page allows modes to be
... | agpl-3.0 |
sxjscience/mxnet | python/mxnet/numpy_extension/utils.py | 3 | 7986 | # 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 |
wuhengzhi/chromium-crosswalk | build/print_python_deps.py | 8 | 3498 | #!/usr/bin/env python
# Copyright 2016 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.
"""Prints all non-system dependencies for the given module.
The primary use-case for this script is to genererate the list of python m... | bsd-3-clause |
yigong/AY250 | hw2/virt_env/virt1/lib/python2.7/distutils/__init__.py | 1211 | 3983 | import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = o... | mit |
ericbaze/continuum_code_2012 | pydata/moin/pythonenv/local/lib/python2.7/encodings/mac_farsi.py | 593 | 15426 | """ Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... | gpl-2.0 |
ppasq/geonode | geonode/themes/migrations/0001_initial.py | 3 | 3871 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-15 00:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='GeoNo... | gpl-3.0 |
pombredanne/algos-urv | django/contrib/auth/backends.py | 9 | 4446 | from django.db import connection
from django.contrib.auth.models import User, Permission
class ModelBackend(object):
"""
Authenticates against django.contrib.auth.models.User.
"""
supports_object_permissions = False
supports_anonymous_user = True
# TODO: Model, login attribute name... | bsd-3-clause |
edonyM/toolkitem | fileprocess/mergefile/packages/__init__.py | 1 | 1096 | # -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------. \ .'_ (`-')----. ,... | mit |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/mpl_toolkits/axes_grid1/anchored_artists.py | 10 | 12803 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from matplotlib import docstring
from matplotlib.offsetbox import (AnchoredOffsetbox, AnchoredText,
AnnotationBbox, AuxTransformBox, DrawingArea,
... | bsd-3-clause |
hendradarwin/VTK | Examples/Rendering/Python/assembly.py | 42 | 2694 | #!/usr/bin/env python
# This example demonstrates the use of vtkAssembly. In an assembly,
# the motion of one actor affects the position of other actors.
import vtk
# Create four parts: a top level assembly (in this case, a
# vtkCylinder) and three primitives (using vtkSphereSource,
# vtkCubeSource, and vtkConeSour... | bsd-3-clause |
anneline/Bika-LIMS | bika/lims/utils/__init__.py | 1 | 13899 | from time import time
from AccessControl import ModuleSecurityInfo, allow_module
from bika.lims import logger
from bika.lims.browser import BrowserView
from DateTime import DateTime
from email import Encoders
from email.MIMEBase import MIMEBase
from plone.memoize import ram
from plone.registry.interfaces import IRegist... | agpl-3.0 |
peterbe/peekaboo | vendor-local/lib/python/sorl/thumbnail/engines/pil_engine.py | 9 | 2767 | from cStringIO import StringIO
from sorl.thumbnail.engines.base import EngineBase
try:
from PIL import Image, ImageFile, ImageDraw
except ImportError:
import Image, ImageFile, ImageDraw
class Engine(EngineBase):
def get_image(self, source):
buf = StringIO(source.read())
return Image.open(... | mpl-2.0 |
jmighion/ansible | test/units/modules/network/eos/test_eos_user.py | 20 | 4062 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
diegoguimaraes/django | django/db/backends/mysql/client.py | 32 | 1506 | import subprocess
from django.db.backends 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_dict['NAME'])
... | bsd-3-clause |
mgerhardy/fips | colorama/win32.py | 32 | 4918 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = None
SetCon... | mit |
js0701/chromium-crosswalk | tools/grit/grit/tclib_unittest.py | 25 | 8079 | #!/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.
'''Unit tests for grit.tclib'''
import sys
import os.path
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirna... | bsd-3-clause |
alfkjartan/nvgimu | nvg/testing/inspection.py | 3 | 1156 | """
Utilities for code introspection.
"""
# Copyright (C) 2009-2011 University of Edinburgh
#
# This file is part of IMUSim.
#
# IMUSim 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 L... | gpl-3.0 |
rudij7/android_kernel_oneplus_one | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
SummerLW/Perf-Insight-Report | third_party/gsutil/third_party/boto/boto/route53/record.py | 136 | 14689 | # Copyright (c) 2010 Chris Moyer http://coredumped.org/
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation ... | bsd-3-clause |
boa19861105/android_444_KitKat_kernel_htc_B2_UHL | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
ColinIanKing/autotest | frontend/setup_test_environment.py | 3 | 1806 | import tempfile, shutil, os
from django.core import management
from django.conf import settings
try:
import autotest.common as common
except ImportError:
import common
# we need to set DATABASE_ENGINE now, at import time, before the Django database
# system gets initialized.
# django.conf.settings.LazySettings... | gpl-2.0 |
Serag8/Bachelor | google_appengine/lib/setuptools-0.6c11/setuptools/tests/__init__.py | 32 | 12345 | """Tests for the 'setuptools' package"""
from unittest import TestSuite, TestCase, makeSuite, defaultTestLoader
import distutils.core, distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
import setuptools, setuptools.dist
from setuptoo... | mit |
mtnman38/Aggregate | Executables/Aggregate 0.8.8 for Macintosh.app/Contents/Resources/lib/python2.7/requests/packages/urllib3/util.py | 41 | 20493 | # urllib3/util.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from base64 import b64encode
from binascii import hexlify, unhexlify
from collections import name... | gpl-2.0 |
zmarvel/slowboy | slowboy/util.py | 1 | 1753 |
import abc
from collections import namedtuple
Op = namedtuple('Op', ['function', 'cycles', 'description'])
class ClockListener(metaclass=abc.ABCMeta):
@abc.abstractmethod
def notify(self, clock: int, cycles: int):
"""Notify the listener that the clock has advanced.
:param clock: The new valu... | mit |
eXistenZNL/SickRage | lib/subliminal/providers/addic7ed.py | 18 | 8768 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import babelfish
import bs4
import requests
from . import Provider
from .. import __version__
from ..cache import region, SHOW_EXPIRATION_TIME
from ..exceptions import ConfigurationError, AuthenticationError, DownloadLimitExceeded, ProviderE... | gpl-3.0 |
amunk/metagoofil | hachoir_core/log.py | 86 | 4235 | import os, sys, time
import hachoir_core.config as config
from hachoir_core.i18n import _
class Log:
LOG_INFO = 0
LOG_WARN = 1
LOG_ERROR = 2
level_name = {
LOG_WARN: "[warn]",
LOG_ERROR: "[err!]",
LOG_INFO: "[info]"
}
def __init__(self):
self.__buffer = {}... | gpl-2.0 |
ColdSauce/IsSittingOnButt | server/env/lib/python2.7/site-packages/pip/locations.py | 184 | 6644 | """Locations where we look for configs, install stuff, etc"""
from __future__ import absolute_import
import getpass
import os
import os.path
import site
import sys
from distutils import sysconfig
from distutils.command.install import install, SCHEME_KEYS # noqa
from pip.compat import WINDOWS
from pip.utils import a... | apache-2.0 |
ThomasSweijen/TPF | examples/test/test_Ip2_FrictMat_CpmMat_FrictPhys.py | 10 | 1264 | from yade import *
from yade import plot,qt
import sys
young=25e9
poisson=.2
sigmaT=3e6
frictionAngle=atan(1)
density=4800 ## 4800 # twice the density, since porosity is about .5 (.62)
epsCrackOnset=1e-4
relDuctility=300
intRadius=1.5
concMat = O.materials.append(CpmMat(young=young,poisson=poisson,density=4800,sig... | gpl-2.0 |
golismero/golismero-devel | tools/sqlmap/plugins/dbms/access/__init__.py | 8 | 1049 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import DBMS
from lib.core.settings import ACCESS_SYSTEM_DBS
from lib.core.unescaper import unescaper
from plugins.dbms.access.enumeration import Enumeratio... | gpl-2.0 |
koreiklein/fantasia | ui/render/gl/distances.py | 1 | 1104 | # Copyright (C) 2013 Korei Klein <korei.klein1@gmail.com>
# Constants for gl rendering of basic are collected here.
from ui.render.gl import colors
epsilon = 0.0001
divider_spacing = 15.0
notThickness = 22.0
notShiftThickness = notThickness + 21.0
# Amount by which to shift the value contained inside a Not.
notShi... | gpl-2.0 |
andrewcmyers/tensorflow | tensorflow/contrib/training/python/training/hparam.py | 11 | 16739 | # 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 |
nach00/Test4 | setup.py | 2 | 1293 | import sys
from distutils.core import setup
#PY3 = sys.version_info.major >= 3
PY3 = sys.version_info[0] >= 3
VERSION_FILE = "pifacecad/version.py"
def get_version():
if PY3:
version_vars = {}
with open(VERSION_FILE) as f:
code = compile(f.read(), VERSION_FILE, 'exec')
ex... | gpl-3.0 |
UniMOOC/gcb-new-module | modules/usage_reporting/consent_banner.py | 5 | 2634 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
Yen-Chung-En/2015cdb_W12 | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minicompat.py | 781 | 3228 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | agpl-3.0 |
laborautonomo/poedit | deps/boost/tools/build/v2/test/project_id.py | 44 | 12454 | #!/usr/bin/python
# Copyright (C) 2012. Jurko Gospodnetic
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests Boost Build's project-id handling.
import BoostBuild
import sys
def test_assigning_project_ids()... | mit |
cherusk/ansible | lib/ansible/modules/system/facter.py | 69 | 1855 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@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... | gpl-3.0 |
dwightgunning/django | django/contrib/admin/templatetags/log.py | 499 | 2080 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | bsd-3-clause |
jmartinm/invenio | modules/bibdocfile/lib/bibdocfile_regression_tests.py | 10 | 30584 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011, 2012, 2013 CERN.
##
## Invenio 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
## Licens... | gpl-2.0 |
shakfu/start-vm | default/bin/normalize.py | 1 | 1259 | #!/usr/bin/env python
import hashlib
import os
import sys
from datetime import datetime
HASH = hashlib.md5(str(datetime.now())).hexdigest()
def normalize(path, file_func=None, dir_func=None):
''' recursive normalization of directory and file names
applies the following changes to directory and filenames... | mit |
luci/luci-py | appengine/components/components/auth/change_log_test.py | 2 | 45674 | #!/usr/bin/env vpython
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import datetime
import sys
import unittest
from test_support import test_env
test_env.setup_test_env()
from google.appeng... | apache-2.0 |
killbug2004/volatility | volatility/plugins/linux/slab_info.py | 14 | 6997 | # Volatility
#
# 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 version.
#
# Volatility is dist... | gpl-2.0 |
willingc/oh-mainline | vendor/packages/gdata/tests/atom_tests/token_store_test.py | 128 | 2896 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | agpl-3.0 |
JavML/django | django/contrib/gis/maps/google/gmap.py | 526 | 9223 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.gis.maps.google.overlays import (
GMarker, GPolygon, GPolyline,
)
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.util... | bsd-3-clause |
alikins/ansible | lib/ansible/modules/network/onyx/onyx_config.py | 23 | 8198 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
angelapper/edx-platform | lms/djangoapps/mobile_api/middleware.py | 7 | 6355 | """
Middleware for Mobile APIs
"""
from datetime import datetime
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse
from pytz import UTC
import request_cache
from mobile_api.mobile_platform import MobilePlatform
from mobile_api.models import AppVersionConfig
from... | agpl-3.0 |
gcd0318/django | tests/template_tests/syntax_tests/test_list_index.py | 521 | 2694 | from django.test import SimpleTestCase
from ..utils import setup
class ListIndexTests(SimpleTestCase):
@setup({'list-index01': '{{ var.1 }}'})
def test_list_index01(self):
"""
List-index syntax allows a template to access a certain item of a
subscriptable object.
"""
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.