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 |
|---|---|---|---|---|---|
JakeLowey/HackRPI2 | django/contrib/gis/gdal/envelope.py | 94 | 7041 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | mit |
daineseh/kodi-plugin.video.ted-talks-chinese | youtube_dl/extractor/goldenmoustache.py | 159 | 1739 | from __future__ import unicode_literals
from .common import InfoExtractor
class GoldenMoustacheIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?goldenmoustache\.com/(?P<display_id>[\w-]+)-(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.goldenmoustache.com/suricate-le-poker-3700/',
'md5': '0f9... | gpl-2.0 |
saydulk/newfies-dialer | newfies/apirest/view_callrequest.py | 4 | 1568 | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2015 Star2Bil... | mpl-2.0 |
mtlynch/ndt-e2e-clientworker | client_wrapper/install_selenium_extensions.py | 1 | 3193 | import argparse
import os
import platform
import urllib
import tempfile
import names
driver_urls = {
'chrome_os_x': {
'url':
'http://chromedriver.storage.googleapis.com/2.21/chromedriver_mac32.zip',
'file_name': 'chromedriver_mac32.zip'
},
'chrome_ubuntu': {
'url':
... | apache-2.0 |
jmcarp/django | django/core/checks/security/csrf.py | 477 | 1796 | from django.conf import settings
from .. import Tags, Warning, register
W003 = Warning(
"You don't appear to be using Django's built-in "
"cross-site request forgery protection via the middleware "
"('django.middleware.csrf.CsrfViewMiddleware' is not in your "
"MIDDLEWARE_CLASSES). Enabling the middle... | bsd-3-clause |
raphui/linux | Documentation/target/tcm_mod_builder.py | 337 | 24391 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
dakcarto/QGIS | python/plugins/db_manager/sqledit.py | 18 | 6399 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptEdit.py
---------------------
Date : February 2014
Copyright : (C) 2014 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... | gpl-2.0 |
emedinaa/contentbox | third_party/openid/test/test_urinorm.py | 77 | 1298 | import os
import unittest
import openid.urinorm
class UrinormTest(unittest.TestCase):
def __init__(self, desc, case, expected):
unittest.TestCase.__init__(self)
self.desc = desc
self.case = case
self.expected = expected
def shortDescription(self):
return self.desc
... | apache-2.0 |
cwacek/python-jsonschema-objects | test/test_regression_126.py | 1 | 1829 | import pytest
import python_jsonschema_objects as pjs
import collections
@pytest.fixture
def schema():
return {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Test",
"definitions": {
"MyEnum1": {"type": "string", "enum": ["E_A", "E_B"]},
"MyEnum2": ... | mit |
Rademade/taiga-back | tests/integration/test_exporter_api.py | 3 | 3389 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
jazztpt/edx-platform | common/djangoapps/embargo/admin.py | 154 | 1315 | """
Django admin page for embargo models
"""
from django.contrib import admin
import textwrap
from config_models.admin import ConfigurationModelAdmin
from embargo.models import IPFilter, CountryAccessRule, RestrictedCourse
from embargo.forms import IPFilterForm, RestrictedCourseForm
class IPFilterAdmin(Configuration... | agpl-3.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/py-astroid/package.py | 5 | 2103 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
arcean/telepathy-sunshine | debian/telepathy-sunshine/usr/lib/python2.6/dist-packages/sunshine/capabilities.py | 4 | 10907 | # telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2009 Collabora Ltd.
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | gpl-3.0 |
nirmeshk/oh-mainline | vendor/packages/requests/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | agpl-3.0 |
sekikn/incubator-airflow | kubernetes_tests/test_kubernetes_pod_operator_backcompat.py | 3 | 26065 | # pylint: disable=unused-argument
# 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.... | apache-2.0 |
Krakn/learning | src/python/advent_of_code/2017/05/a_maze_of_twisty_trampolines_all_alike.py | 1 | 3322 | #!/usr/bin/env python3
'''
--- Day 5: A Maze of Twisty Trampolines, All Alike ---
'''
def load_input(filename):
'''
Parse input file, returning an array of maze offsets.
'''
maze = list()
with open(filename, 'r') as file_input:
for line in file_input.readlines():
maze.append(i... | isc |
winterbird-code/adbb | adbb/__init__.py | 1 | 2124 | #!/usr/bin/env python
#
# This file is part of adbb.
#
# adbb 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.
#
# adbb is distributed i... | gpl-3.0 |
ifxit/nidhogg | tests/test_get_best_volume.py | 1 | 9629 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from nidhogg import get_best_volume_by_quota, get_best_volume_by_size
from nidhogg.core import NidhoggException
from nidhogg.compatible import Volume, VolumeWithQuotaRatio
def check_volume(volume, size):
"""Helper function that is app... | mit |
andyzsf/edx | common/lib/xmodule/xmodule/capa_module.py | 3 | 7405 | """Implements basics of Capa, including class CapaModule."""
import json
import logging
import sys
from pkg_resources import resource_string
from .capa_base import CapaMixin, CapaFields, ComplexEncoder
from .progress import Progress
from xmodule.x_module import XModule, module_attr
from xmodule.raw_module import RawD... | agpl-3.0 |
vvv1559/intellij-community | python/lib/Lib/site-packages/django/contrib/webdesign/tests.py | 379 | 1054 | # -*- coding: utf-8 -*-
import unittest
from django.contrib.webdesign.lorem_ipsum import *
from django.template import loader, Context
class WebdesignTest(unittest.TestCase):
def test_words(self):
self.assertEqual(words(7), u'lorem ipsum dolor sit amet consectetur adipisicing')
def test_paragraphs... | apache-2.0 |
jcfr/mystic | examples/TEST_ffitPP2_b.py | 1 | 1429 | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE
"""
Testing the polynomial fi... | bsd-3-clause |
Aloomaio/googleads-python-lib | examples/ad_manager/v201805/creative_service/create_creative_from_template.py | 1 | 3666 | #!/usr/bin/env python
#
# 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 requir... | apache-2.0 |
hyller/CodeLibrary | python-cookbook-master/src/12/storing_thread_specific_state/example2.py | 5 | 1786 | from socket import socket, AF_INET, SOCK_STREAM
import threading
class LazyConnection:
def __init__(self, address, family=AF_INET, type=SOCK_STREAM):
self.address = address
self.family = AF_INET
self.type = SOCK_STREAM
self.local = threading.local()
def __enter__(self):
... | unlicense |
open-mmlab/mmdetection | mmdet/models/detectors/base.py | 1 | 14139 | from abc import ABCMeta, abstractmethod
from collections import OrderedDict
import mmcv
import numpy as np
import torch
import torch.distributed as dist
from mmcv.runner import BaseModule, auto_fp16
from mmdet.core.visualization import imshow_det_bboxes
class BaseDetector(BaseModule, metaclass=ABCMeta):
"""Base... | apache-2.0 |
hollabaq86/haikuna-matata | env/lib/python2.7/site-packages/nltk/tokenize/mwe.py | 7 | 3829 | # Multi-Word Expression tokenizer
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Rob Malouf <rmalouf@mail.sdsu.edu>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Multi-Word Expression Tokenizer
A ``MWETokenizer`` takes a string which has already been divided into tokens and
retokenizes ... | mit |
mikewiebe-ansible/ansible | lib/ansible/modules/cloud/amazon/iam_cert.py | 10 | 12204 | #!/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 distributed... | gpl-3.0 |
eduble/panteda | operators/map/heatmap.py | 1 | 4193 | #!/usr/bin/env python3
import numpy as np
import numpy.random
from time import time
# web mercator projection functions
# ---------------------------------
def linear_lat(lat, atanh = np.arctanh, sin = np.sin, radians = np.radians):
return atanh(sin(radians(lat)))
def inv_linear_lat(ll, asin = np.arcsin, tanh = n... | gpl-3.0 |
gangadharkadam/saloon_frappe_install | frappe/tests/test_fmt_money.py | 54 | 4016 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, cstr
def fmt_money(amount, precision=None):
"""
Convert to string with commas for thousands, millions etc
"""
... | mit |
felliott/osf.io | api_tests/base/test_parsers.py | 10 | 2696 | import pytest
from api.base.parsers import JSONAPIMultipleRelationshipsParser, JSONAPIMultipleRelationshipsParserForRegularJSON
SINGLE_RELATIONSHIP = {
'region': {
'data': {
'type': 'regions',
'id': 'us-1'
}
}
}
MULTIPLE_RELATIONSHIP = {
'affiliated_institutions':... | apache-2.0 |
TeslaProject/external_chromium_org | tools/telemetry/telemetry/core/forwarders/do_nothing_forwarder_unittest.py | 37 | 2557 | # 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 unittest
from telemetry.core import forwarders
from telemetry.core import util
from telemetry.core.forwarders import do_nothing_forwarder
class Tes... | bsd-3-clause |
mohitreddy1996/Gender-Detection-from-Signature | src/train_test/random_forests.py | 1 | 1140 | from sklearn.metrics import precision_recall_fscore_support
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import MinMaxScaler, normalize
df = pd.read_csv('../../Dataset/dataset.csv', delimiter='\t')
dataset = df.values
mask = np.random.rand(len... | mit |
aquaya/ivrhub | ivrhub/models.py | 1 | 3129 | ''' mongoengine models
'''
from mongoengine import *
class User(Document):
''' some are admins some are not
'''
admin_rights = BooleanField(required=True)
api_id = StringField()
api_key = StringField()
email = EmailField(required=True, unique=True, max_length=254)
email_confirmation_code =... | mit |
insertnamehere1/maraschino | lib/rtorrent/lib/torrentparser.py | 91 | 5653 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | mit |
tzangms/PyConTW | pycon_project/biblion/views.py | 1 | 3501 | from datetime import datetime
from django.core.urlresolvers import reverse
from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils import simplejson ... | bsd-3-clause |
devinbalkind/eden | modules/unit_tests/s3/s3aaa.py | 3 | 164800 | # -*- coding: utf-8 -*-
#
# S3AAA Unit Tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3aaa.py
#
import unittest
from gluon import *
from gluon.storage import Storage
from s3.s3aaa import S3EntityRoleManager, S3Permission
from s3.s3fields import s3_meta_field... | mit |
Kali-/android_kernel_sony_msm8660 | scripts/gcc-wrapper.py | 501 | 3410 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... | gpl-2.0 |
OMNIL-Infinity/volatility | volatility/plugins/linux/pkt_queues.py | 44 | 3171 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# 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 o... | gpl-2.0 |
AlexanderFabisch/scikit-learn | sklearn/decomposition/tests/test_pca.py | 21 | 11810 | import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... | bsd-3-clause |
servo/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_io/saferepr.py | 273 | 2483 | import py
import sys
builtin_repr = repr
reprlib = py.builtin._tryimport('repr', 'reprlib')
class SafeRepr(reprlib.Repr):
""" subclass of repr.Repr that limits the resulting size of repr()
and includes information on exceptions raised during the call.
"""
def repr(self, x):
return self._c... | mpl-2.0 |
timothyclemansinsea/smc | src/smc_pyutil/smc_pyutil/new_file.py | 2 | 1270 | #!/usr/bin/python
import os, platform, shutil, sys
PLATFORM = platform.system().lower()
def new_file(path):
if os.path.exists(path):
# nothing to do.
return
base, filename = os.path.split(path)
if base and not os.path.exists(base):
os.makedirs(base)
ext = os.path.splitext(p... | gpl-3.0 |
jseabold/statsmodels | statsmodels/sandbox/distributions/sppatch.py | 5 | 24020 | '''patching scipy to fit distributions and expect method
This adds new methods to estimate continuous distribution parameters with some
fixed/frozen parameters. It also contains functions that calculate the expected
value of a function for any continuous or discrete distribution
It temporarily also contains Bootstrap... | bsd-3-clause |
varunarya10/contrail-neutron-plugin | neutron_plugin_contrail/plugins/opencontrail/vnc_client/route_table_res_handler.py | 7 | 7374 | # Copyright 2015. 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... | apache-2.0 |
credativUK/purchase-workflow | framework_agreement/tests/test_price_list.py | 20 | 4797 | # -*- coding: utf-8 -*-
# Author: Nicolas Bessi, Leonardo Pistone
# Copyright 2013-2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of ... | agpl-3.0 |
hyperized/ansible | test/units/modules/network/netscaler/test_netscaler_nitro_request.py | 10 | 12922 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... | gpl-3.0 |
usc-isi-i2/WEDC | spark_dependencies/python_lib/nose2/plugins/prof.py | 16 | 2786 | """
Profile test execution using hotshot.
This plugin implements :func:`startTestRun` and replaces
``event.executeTests`` with :meth:`hotshot.Profile.runcall`. It
implements :func:`beforeSummaryReport` to output profiling information
before the final test summary time. Config file options ``filename``,
``sort`` and ``... | apache-2.0 |
codefisher/mozbutton_sdk | builder/restartless_button.py | 1 | 28578 | import os
import re
import json
import codecs
import lxml.etree as ET
from copy import deepcopy
from collections import namedtuple, defaultdict
try:
from PIL import Image
except ImportError:
pass
from builder.ext_button import Button, Option, ChromeString, ChromeFile
try:
basestring
except NameError:
... | mit |
soybean217/lora-python | UServer/admin_server/admin_http_api/api/api_group.py | 1 | 3730 | import json
from wtforms import ValidationError
from userver.object.application import Application
from . import api, root
from flask import request, Response
from userver.object.group import Group
from binascii import hexlify
from utils.errors import KeyDuplicateError, PatchError
from .decorators import group_filter_... | mit |
sigmunau/nav | python/nav/smidumps/extreme_vlan_mib.py | 4 | 74473 | # python version 1.0 DO NOT EDIT
#
# Generated by smidump version 0.4.8:
#
# smidump -f python EXTREME-VLAN-MIB
FILENAME = "/home/mvold/mibs/v2/extreme.mib"
MIB = {
"moduleName" : "EXTREME-VLAN-MIB",
"EXTREME-VLAN-MIB" : {
"nodetype" : "module",
"language" : "SMIv2",
"organizat... | gpl-2.0 |
meejah/crossbarexamples | xbr/teststack1/_init/check_blockchain.py | 3 | 8477 | import os
import sys
import web3
import six
import txaio
txaio.use_twisted()
from autobahn import xbr
import argparse
from binascii import a2b_hex, b2a_hex
import txaio
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
from init_data import ACCOUNTS, OWNER, MARKETS
from cfxdb import unpack_uin... | apache-2.0 |
GeekTrainer/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | apache-2.0 |
etherkit/OpenBeacon2 | client/linux-arm/venv/lib/python3.5/site-packages/setuptools/config.py | 28 | 16413 | from __future__ import absolute_import, unicode_literals
import io
import os
import sys
from collections import defaultdict
from functools import partial
from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.py26compat import import_module
from setuptools.extern.six import string_types
... | gpl-3.0 |
mnieber/shared-goal | django/goal/views.py | 2 | 4762 | from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.views.generic import View
from django.utils.decorators import method_decorator
from .models import Membe... | apache-2.0 |
1upon0/rfid-auth-system | GUI/printer/Pillow-2.7.0/build/lib.linux-x86_64-2.7/PIL/WmfImagePlugin.py | 26 | 4139 | #
# The Python Imaging Library
# $Id$
#
# WMF stub codec
#
# history:
# 1996-12-14 fl Created
# 2004-02-22 fl Turned into a stub driver
# 2004-02-23 fl Added EMF support
#
# Copyright (c) Secret Labs AB 1997-2004. All rights reserved.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on... | apache-2.0 |
mitchrule/Miscellaneous | Django_Project/django/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | mit |
syjeon/new_edx | common/djangoapps/student/management/commands/cert_restriction.py | 256 | 3879 | from django.core.management.base import BaseCommand, CommandError
import os
from optparse import make_option
from student.models import UserProfile
import csv
class Command(BaseCommand):
help = """
Sets or gets certificate restrictions for users
from embargoed countries. (allow_certificate in
userpro... | agpl-3.0 |
40223142/cda11 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testpatch.py | 739 | 53126 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest
from unittest.test.testmock import support
from unittest.test.testmock.support import SomeClass, is_instance
from unittest.mock import... | gpl-3.0 |
minhtuancn/odoo | addons/hr_timesheet/wizard/__init__.py | 381 | 1079 | # -*- 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 |
Lh4cKg/brython | www/src/Lib/errno.py | 624 | 4096 | """
This module makes available standard errno system symbols.
The value of each symbol is the corresponding integer value,
e.g., on most systems, errno.ENOENT equals the integer 2.
The dictionary errno.errorcode maps numeric codes to symbol names,
e.g., errno.errorcode[2] could be the string 'ENOENT'.
Symbols that ar... | bsd-3-clause |
Alphadelta14/ansible | lib/ansible/playbook/become.py | 150 | 4878 | # (c) 2012-2014, 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 the License, or
# (at your option) an... | gpl-3.0 |
kerr-huang/SL4A | python/src/Lib/plat-os2emx/pwd.py | 67 | 6415 | # this module is an OS/2 oriented replacement for the pwd standard
# extension module.
# written by Andrew MacIntyre, April 2001.
# updated July 2003, adding field accessor support
# note that this implementation checks whether ":" or ";" as used as
# the field separator character. Path conversions are are applied w... | apache-2.0 |
bonitadecker77/python-for-android | python3-alpha/extra_modules/gdata/sample_util.py | 47 | 10741 | #!/usr/bin/env 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 ... | apache-2.0 |
Fokko/incubator-airflow | airflow/providers/google/marketing_platform/example_dags/example_search_ads.py | 2 | 2898 | # -*- 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 |
LukeM12/samba | lib/dnspython/dns/rdtypes/ANY/ISDN.py | 100 | 3250 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
bcharlas/mytrunk | scripts/checks-and-tests/checks/checkSaveLoadClumps.py | 3 | 1963 | #!/usr/bin/env python
# encoding: utf-8
# Script generates clumps and saves them
# Then it tries to load the saved simulation
# See https://bugs.launchpad.net/bugs/1560171
# Thanks to Bettina Suhr for providing the
# minimal test script.
from yade import pack
import tempfile, shutil
import time
#define material for ... | gpl-2.0 |
zenodo/zenodo | zenodo/modules/sipstore/utils.py | 2 | 2339 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2017 CERN.
#
# Zenodo 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 v... | gpl-2.0 |
draugiskisprendimai/odoo | openerp/addons/base/res/res_lang.py | 49 | 12612 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
MrLoick/python-for-android | python-modules/twisted/twisted/python/hook.py | 90 | 5266 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I define support for hookable instance methods.
These are methods which you can register pre-call and post-call external
functions to augment their functionality. People familiar with more esoteric
languages may think of these a... | apache-2.0 |
s0930342674/pyload | module/plugins/hooks/LinkdecrypterComHook.py | 13 | 1246 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.MultiHook import MultiHook
class LinkdecrypterComHook(MultiHook):
__name__ = "LinkdecrypterComHook"
__type__ = "hook"
__version__ = "1.07"
__status__ = "testing"
__config__ = [("activated" , "bool" , "Activa... | gpl-3.0 |
spino327/sdr_testbed | DistributedTestbed/SlaveRX.py | 1 | 6293 | '''
Copyright (c) 2011, Universidad Industrial de Santander, Colombia
University of Delaware
All rights reserved.
@author: Sergio Pino
@author: Henry Arguello
Website: http://www.eecis.udel.edu/
emails : sergiop@udel.edu - henarfu@udel.edu
Date : Feb, 2011
'''
import socket
import time
import sys
from receiver.RXA... | apache-2.0 |
Pablo126/SSBW | Tarea4/tarea4/lib/python3.5/site-packages/django/core/files/base.py | 487 | 5717 | from __future__ import unicode_literals
import os
from io import BytesIO, StringIO, UnsupportedOperation
from django.core.files.utils import FileProxyMixin
from django.utils import six
from django.utils.encoding import (
force_bytes, force_str, python_2_unicode_compatible, smart_text,
)
@python_2_unicode_compat... | gpl-3.0 |
spartonia/django-oscar | src/oscar/apps/catalogue/admin.py | 14 | 3226 | from django.contrib import admin
from treebeard.admin import TreeAdmin
from treebeard.forms import movenodeform_factory
from oscar.core.loading import get_model
AttributeOption = get_model('catalogue', 'AttributeOption')
AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup')
Category = get_model('catal... | bsd-3-clause |
alanc10n/py-rau | pyrau/rau.py | 1 | 1747 | import argparse
from redis import StrictRedis
from pyrau.commands import Command
def delete(args, command):
""" Execute the delete command """
command.delete(args.pattern)
def keys(args, command):
""" Execute the keys command """
details = args.details | args.sorted
command.keys(args.pattern, de... | mit |
lanselin/pysal | pysal/core/IOHandlers/tests/test_stata_txt.py | 20 | 2086 | import unittest
import pysal
from pysal.core.IOHandlers.stata_txt import StataTextIO
import tempfile
import os
class test_StataTextIO(unittest.TestCase):
def setUp(self):
self.test_file_sparse = test_file_sparse = pysal.examples.get_path(
'stata_sparse.txt')
self.test_file_full = test_... | bsd-3-clause |
QuLogic/python-future | src/future/moves/urllib/request.py | 70 | 3525 | from __future__ import absolute_import
from future.standard_library import suspend_hooks
from future.utils import PY3
if PY3:
from urllib.request import *
# This aren't in __all__:
from urllib.request import (getproxies,
pathname2url,
proxy_b... | mit |
rhurkes/chasegame | venv/lib/python2.7/site-packages/pip/commands/uninstall.py | 395 | 2203 | from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is able to uninstall most installed packages. Known exceptions are:
- Pure distutil... | mit |
akx/shoop | shoop_tests/admin/test_views.py | 1 | 2079 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import json
import pytest
from shoop.testing.factories import (
create... | agpl-3.0 |
TerryRen/TrPython | NetLib/SuperCaptcha.py | 1 | 9743 | #python 2.7
#coding=utf-8
__author__ = "Terry.Ren"
#try:
# import Image
#except ImportError:
# from PIL import Image
from PIL import Image
from PIL import ImageDraw
import ImageEnhance
import os
import urllib
import StringIO
import uuid
import pytesseract #open source
class Captcha(object):
def __init... | apache-2.0 |
agramian/PythonExternalProgramTestFramework | jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | mit |
leohmoraes/weblate | weblate/lang/tests.py | 8 | 9069 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
batxes/4c2vhic | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models17200.py | 2 | 17581 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
kevinthesun/mxnet | tests/python/unittest/test_metric.py | 12 | 1347 | # 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 |
fmaguire/BayeHem | bayehem/rsem/detonate-1.11/ref-eval/boost/tools/build/v2/build/configure.py | 44 | 5289 | # Status: ported.
# Base revison: 64488
#
# Copyright (c) 2010 Vladimir Prus.
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
# This module defines function to help with two main tasks:
#
# ... | apache-2.0 |
maciekcc/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/affine_impl.py | 8 | 22699 | # 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 |
Freso/picard | picard/formats/wav.py | 2 | 1666 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2007 Lukáš Lalinský
#
# 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... | gpl-2.0 |
UIA-CAIR/DeepRTS | coding/test.py | 1 | 3205 | import Scenarios
import Agents
import torch
import imageio
import pygame
import os
from datetime import datetime
import numpy
action_names = {
1: "Previous Unit",
2: "Next Unit",
3: "Move Left",
4: "Move Right",
5: "Move Up",
6: "Move Down",
7: "Move Up Left",
8: "Move Up Right",
... | mit |
tfiedor/perun | perun/fuzz/randomizer.py | 1 | 1994 | """Module that simply encapsulate all the random functions that are used in fuzzing,
with only one call of function from random package."""
__author__ = 'Matus Liscinsky'
import random
def random_repeats(repeats):
"""Decorator for random number of repeats of inner function
Note that the return value of the... | gpl-3.0 |
damonkohler/sl4a | python-build/python-libs/gdata/src/gdata/tlslite/integration/TLSAsyncDispatcherMixIn.py | 237 | 4878 | """TLS Lite + asyncore."""
import asyncore
from gdata.tlslite.TLSConnection import TLSConnection
from AsyncStateMachine import AsyncStateMachine
class TLSAsyncDispatcherMixIn(AsyncStateMachine):
"""This class can be "mixed in" with an
L{asyncore.dispatcher} to add TLS support.
This class es... | apache-2.0 |
dset0x/invenio-deposit | tests/test_deposit_form.py | 7 | 15078 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 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
# License, or (at your optio... | gpl-2.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/audiodev.py | 286 | 7597 | """Classes for manipulating audio devices (currently only for Sun and SGI)"""
from warnings import warnpy3k
warnpy3k("the audiodev module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
__all__ = ["error","AudioDev"]
class error(Exception):
pass
class Play_Audio_sgi:
# Private instance variables
... | gpl-2.0 |
eramirem/astroML | book_figures/chapter9/fig_photoz_tree.py | 3 | 3637 | """
Photometric Redshifts by Decision Trees
---------------------------------------
Figure 9.14
Photometric redshift estimation using decision-tree regression. The data is
described in Section 1.5.5. The training set consists of u, g , r, i, z
magnitudes of 60,000 galaxies from the SDSS spectroscopic sample.
Cross-val... | bsd-2-clause |
stacywsmith/ansible | lib/ansible/plugins/callback/actionable.py | 105 | 2683 | # (c) 2015, Andrew Gaffney <andrew@agaffney.org>
#
# 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 ve... | gpl-3.0 |
weggert/calendar_sync | calendar_sync.py | 1 | 6753 | #!/usr/bin/python
import fileinput
import os
class CalendarManager:
def __init__(self, calendar_name, dry_run, include_descriptions):
self.calendar_name = calendar_name
self.dry_run = dry_run
self.include_descriptions = include_descriptions
def clear_calendar(self):
command =... | apache-2.0 |
Goclis/pelican-blog | plugins/extract_toc/extract_toc.py | 28 | 1805 | # -*- coding: utf-8 -*-
"""
Extract Table of Content
========================
A Pelican plugin to extract table of contents (ToC) from `article.content` and
place it in its own `article.toc` variable for use in templates.
"""
from os import path
from bs4 import BeautifulSoup
from pelican import signals, readers, cont... | mit |
MattDevo/stk-code | tools/nightbuilder/utils.py | 20 | 3226 | #!/bin/python
# From Supertuxkart SVN revision $Revision$
# Copyright (C) 2012 Jean-manuel clemencon (samuncle)
################################################################################
import os
import sys
from time import gmtime, strftime
# import config
from config import *
class Cdir:
"""
A class... | gpl-3.0 |
coastmap/geonode | geonode/people/utils.py | 33 | 3269 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 License, or
#... | gpl-3.0 |
dirkmueller/qemu | scripts/tracetool/backend/dtrace.py | 94 | 2484 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
DTrace/SystemTAP backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__e... | gpl-2.0 |
allenai/allennlp | allennlp/modules/text_field_embedders/basic_text_field_embedder.py | 1 | 5232 | from typing import Dict
import inspect
import torch
from overrides import overrides
from allennlp.common.checks import ConfigurationError
from allennlp.data import TextFieldTensors
from allennlp.modules.text_field_embedders.text_field_embedder import TextFieldEmbedder
from allennlp.modules.time_distributed import Tim... | apache-2.0 |
ptemplier/ansible | lib/ansible/modules/database/misc/riak.py | 29 | 7451 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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_METAD... | gpl-3.0 |
sri85/selenium | py/test/selenium/webdriver/common/page_loading_tests.py | 53 | 5014 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
vovojh/gem5 | ext/ply/test/yacc_uprec2.py | 174 | 1430 | # -----------------------------------------------------------------------------
# yacc_uprec2.py
#
# A grammar with a bad %prec specifier
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex imp... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.