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 |
|---|---|---|---|---|---|
bbozhev/flask-test | flask/lib/python2.7/site-packages/werkzeug/testsuite/compat.py | 146 | 1117 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.compat
~~~~~~~~~~~~~~~~~~~~~~~~~
Ensure that old stuff does not break on update.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import warnings
from werkzeug.testsuite import WerkzeugTestCase
... | mit |
sauliusl/mMass-fork | mspy/parser_mzdata.py | 2 | 27202 | # -------------------------------------------------------------------------
# Copyright (C) 2005-2013 Martin Strohalm <www.mmass.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 Foundat... | gpl-3.0 |
ychfan/tensorflow | tensorflow/contrib/learn/python/learn/ops/embeddings_ops.py | 116 | 3510 | # 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 |
costingalan/python-lab | python/solutii/anda_ungureanu/caesar.py | 7 | 2061 | #!/usr/bin/env python
# *-* coding: UTF-8 *-*
"""Împăratul a primit serie de mesaje importante pe care este
important să le descifreze cât mai repede.
Din păcate mesagerul nu a apucat să îi spună împăratul care au fost
cheile alese pentru fiecare mesaj si tu ai fost ales să descifrezi
misterul.
Informatii:
În cri... | mit |
vprime/puuuu | env/lib/python2.7/site-packages/django/contrib/sitemaps/tests/urls/http.py | 106 | 1647 | from datetime import datetime
from django.conf.urls import patterns, url
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views
from django.views.decorators.cache import cache_page
from django.contrib.sitemaps.tests.base import TestModel
class SimpleSitemap(Sitemap):
changefreq = "ne... | mit |
Craftyawesome/dolphin | Tools/find-includes-cycles.py | 157 | 2630 | #! /usr/bin/env python
'''
Run this script from Source/Core/ to find all the #include cycles.
'''
import subprocess
def get_local_includes_for(path):
lines = open(path).read().split('\n')
includes = [l.strip() for l in lines if l.strip().startswith('#include')]
return [i.split()[1][1:-1] for i in include... | gpl-2.0 |
gregerts/debian-qpid-cpp | src/tests/legacystore/jrnl/jtt/jfile_chk.py | 4 | 31827 | #!/usr/bin/env python
#
# 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 |
manishpatell/erpcustomizationssaiimpex123qwe | addons/stock_account/wizard/__init__.py | 351 | 1105 | # -*- 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 |
ClaudeZoo/volatility | volatility/plugins/malware/idt.py | 44 | 11570 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org>
#
# 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... | gpl-2.0 |
Mzero2010/MaxZone | plugin.video.Mzero/servers/videowood.py | 4 | 1962 | # -*- coding: iso-8859-1 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector for videowood.tv
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# by DrZ3r0
# ------------------------------------------------------------
import re
from core import logger
fro... | gpl-3.0 |
evamwangi/bc-7-Todo_List | venv/Lib/encodings/ptcp154.py | 647 | 8950 | """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,err... | mit |
moisedo/azure-quickstart-templates | splunk-on-ubuntu/scripts/config.py | 119 | 1408 | # The MIT License (MIT)
#
# Copyright (c) 2016 Microsoft. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | mit |
tailorian/Sick-Beard | lib/unidecode/x05a.py | 252 | 4636 | data = (
'Song ', # 0x00
'Wei ', # 0x01
'Hong ', # 0x02
'Wa ', # 0x03
'Lou ', # 0x04
'Ya ', # 0x05
'Rao ', # 0x06
'Jiao ', # 0x07
'Luan ', # 0x08
'Ping ', # 0x09
'Xian ', # 0x0a
'Shao ', # 0x0b
'Li ', # 0x0c
'Cheng ', # 0x0d
'Xiao ', # 0x0e
'Mang ', # 0x0f
'Fu ', # 0x1... | gpl-3.0 |
rajsadho/django | django/template/context_processors.py | 187 | 2463 | """
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 'context_processors' option of the configuration
of a DjangoTemplates backend and use... | bsd-3-clause |
mahim97/zulip | zerver/lib/test_classes.py | 2 | 27055 | from contextlib import contextmanager
from typing import (cast, Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional,
Sized, Tuple, Union, Text)
from django.core.urlresolvers import resolve
from django.conf import settings
from django.test import TestCase
from django.test.client import ... | apache-2.0 |
AndreyPopovNew/asuswrt-merlin-rt-n | release/src/router/samba3/examples/scripts/shares/python/modify_samba_config.py | 55 | 2452 | #!/usr/bin/env python
######################################################################
##
## Simple add/delete/change share command script for Samba
##
## Copyright (C) Gerald Carter 2004.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU Gener... | gpl-2.0 |
easytaxibr/kafka | system_test/system_test_runner.py | 66 | 15030 | # 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 |
sahiljain/catapult | third_party/gsutil/third_party/rsa/tests/test_common.py | 34 | 2280 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest2
import struct
from rsa._compat import byte, b
from rsa.common import byte_size, bit_size, _bit_size
class Test_byte(unittest2.TestCase):
def test_values(self):
self.assertEqual(byte(0), b('\x00'))
self.assertEqual(byte(255), b('\xff')... | bsd-3-clause |
avidas/festive.ly | festively/views.py | 1 | 1213 | from flask import Blueprint, render_template, jsonify, request, send_from_directory, redirect, url_for
import os
festivals = Blueprint('festivals', __name__, template_folder='templates')
@festivals.route('/')
def index():
return render_template('index.html')
@festivals.route('/search-results')
def featured():
... | mit |
blackPantherOS/packagemanagement | smartpm/smart/backends/deb/base.py | 2 | 7689 | #
# Copyright (c) 2005 Canonical
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as publi... | apache-2.0 |
Tetpay/cjdns | node_build/dependencies/libuv/build/gyp/test/generator-output/gyptest-subdir2-deep.py | 216 | 1034 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies building a target from a .gyp file a few subdirectories
deep when the --generator-output= option is used to put the build
confi... | gpl-3.0 |
recklessromeo/otm-core | opentreemap/treemap/migrations/0001_initial.py | 6 | 23222 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import re
import django.contrib.gis.db.models.fields
import django_hstore.fields
import treemap.json_field
import treemap.instance
import django.contrib.auth.models
import treemap.audit
import django.utils.timezone... | agpl-3.0 |
metabrainz/picard | picard/ui/options/interface.py | 3 | 16508 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2007-2008 Lukáš Lalinský
# Copyright (C) 2008 Will
# Copyright (C) 2009, 2019-2021 Philipp Wolfer
# Copyright (C) 2011, 2013 Michael Wiencek
# Copyright (C) 2013, 2019 Wieland Hoffmann
# Copyright (C) 2013-2014, 2018, 2020-2021... | gpl-2.0 |
ESILV-CFR-2016/ros_raspi_pkg | devel_isolated/rostestm/_setup_util.py | 2 | 12353 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, 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:
#
# * Redistrib... | gpl-3.0 |
riteshshrv/django | django/contrib/auth/views.py | 154 | 12383 | import functools
import warnings
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib.auth import (
REDIRECT_FIELD_NAME, get_user_model, login as auth_login,
logout as auth_logout, update_session_auth_hash,
)
from django.contrib.auth.decorators import log... | bsd-3-clause |
jteehan/cfme_tests | artifactor/__init__.py | 2 | 12258 | """
Artifactor
Artifactor is used to collect artifacts from a number of different plugins and put them into
one place. Artifactor works around a series of events and is geared towards unit testing, though
it is extensible and customizable enough that it can be used for a variety of purposes.
The main guts of Artifact... | gpl-2.0 |
wunderlins/learning | python/django/lib/python2.7/site-packages/django/contrib/redirects/migrations/0001_initial.py | 308 | 1561 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
... | gpl-2.0 |
TGITS/programming-workouts | exercism/python/raindrops/raindrops_test.py | 5 | 2283 | import unittest
from raindrops import convert
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
class RaindropsTest(unittest.TestCase):
def test_the_sound_for_1_is_1(self):
self.assertEqual(convert(1), "1")
def test_the_sound_for_3_is_pling(self):
self.assertEqual(... | mit |
lpirl/ansible | lib/ansible/executor/task_queue_manager.py | 1 | 14192 | # (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 |
brianjgeiger/osf.io | api_tests/actions/views/test_action_list.py | 11 | 9890 | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
PreprintFactory,
AuthUserFactory,
PreprintProviderFactory,
)
from osf.utils import permissions as osf_permissions
@pytest.mark.django_db
@pytest.mark.enable_quickfiles_creation
class TestReviewActionCreateRoot... | apache-2.0 |
CCI-Tools/ect-core | test/core/test_cdm.py | 2 | 1639 | import json
from unittest import TestCase
from cate.core.cdm import Schema
class SchemaTest(TestCase):
@staticmethod
def _test_schema() -> Schema:
return Schema('test',
dimensions=[Schema.Dimension('lon', length=720),
Schema.Dimension('lat', len... | mit |
curtisstpierre/django | tests/get_or_create/models.py | 276 | 1429 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
birthday = models.DateFiel... | bsd-3-clause |
mclois/iteexe | twisted/manhole/ui/gtk2manhole.py | 14 | 12391 | # -*- Python -*-
# $Id: gtk2manhole.py,v 1.9 2003/09/07 19:58:09 acapnotic Exp $
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Manhole client with a GTK v2.x front-end.
"""
__version__ = '$Revision: 1.9 $'[11:-2]
from twisted import copyright
from twisted.internet import react... | gpl-2.0 |
dpetzold/django | tests/utils_tests/test_baseconv.py | 326 | 1787 | from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... | bsd-3-clause |
Cadene/pretrained-models.pytorch | pretrainedmodels/models/wideresnet.py | 1 | 2830 | from __future__ import print_function, division, absolute_import
import os
from os.path import expanduser
import hickle as hkl
import torch
import torch.nn.functional as F
from torch.autograd import Variable
__all__ = ['wideresnet50']
model_urls = {
'wideresnet152': 'https://s3.amazonaws.com/pytorch/h5models/wide... | bsd-3-clause |
infoxchange/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/gis/admin/options.py | 45 | 5095 | from django.conf import settings
from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographi... | gpl-3.0 |
geodrinx/gearthview | ext-libs/twisted/trial/_dist/workerreporter.py | 43 | 3922 | # -*- test-case-name: twisted.trial._dist.test.test_workerreporter -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test reporter forwarding test results over trial distributed AMP commands.
@since: 12.3
"""
from twisted.python.failure import Failure
from twisted.python.reflect impor... | gpl-3.0 |
toenuff/treadmill | tests/services/cgroup_service_test.py | 1 | 6103 | """
Unit test for cgroup_service - Treadmill cgroup service
"""
import os
import tempfile
import unittest
import select
import shutil
# Disable W0611: Unused import
import tests.treadmill_test_deps # pylint: disable=W0611
import mock
import treadmill
from treadmill.services import cgroup_service
class CGroupServ... | apache-2.0 |
fast90/youtube-dl | youtube_dl/extractor/naver.py | 8 | 5031 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
update_url_query,
)
class NaverIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvcast\.naver\.com/v/(?P<id>\d+)'
_TESTS = [{
'url':... | unlicense |
pietroquaglio/elephant | elephant/test/test_pandas_bridge.py | 2 | 113211 | # -*- coding: utf-8 -*-
"""
Unit tests for the pandas bridge module.
:copyright: Copyright 2014-2016 by the Elephant team, see AUTHORS.txt.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division, print_function
import unittest
from itertools import chain
from neo.test.generate_data... | bsd-3-clause |
win0x86/Lab | mitm/urwid/widget.py | 8 | 60739 | #!/usr/bin/python
#
# Urwid basic widget classes
# Copyright (C) 2004-2012 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | gpl-3.0 |
ImmobilienScout24/succubus | src/main/python/succubus/daemonize.py | 1 | 7987 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import, division
from logging.handlers import SysLogHandler
import logging
import os
import signal
import sys
import time
import atexit
import psutil
from pwd import getpwnam
from grp import getgrnam
from signal import SIGT... | apache-2.0 |
NotBobTheBuilder/cairocffi | cairocffi/patterns.py | 4 | 12976 | # coding: utf8
"""
cairocffi.patterns
~~~~~~~~~~~~~~~~~~
Bindings for the various types of pattern objects.
:copyright: Copyright 2013 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
from . import ffi, cairo, _check_status, constants
from .matrix import Matrix
from .surfaces import Su... | bsd-3-clause |
leotrubach/sourceforge-allura | ForgeWiki/forgewiki/tests/test_wiki_roles.py | 3 | 1248 | from pylons import c, g
from nose.tools import assert_equal
from alluratest.controller import setup_basic_test, setup_global_objects
from allura import model as M
from allura.lib import security
from allura.tests import decorators as td
def setUp():
setup_basic_test()
setup_with_tools()
@td.with_wiki
def se... | apache-2.0 |
standage/AEGeAn | data/scripts/seq-reg.py | 2 | 1768 | #!/usr/bin/env python
# Copyright (c) 2010-2015, Daniel S. Standage and CONTRIBUTORS
#
# The AEGeAn Toolkit is distributed under the ISC License. See
# the 'LICENSE' file in the AEGeAn source code distribution or
# online at https://github.com/standage/AEGeAn/blob/master/LICENSE.
from __future__ import print_function... | isc |
ramitsurana/boto | boto/cloudformation/__init__.py | 131 | 2157 | # Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
#
# 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, includin... | mit |
vmax-feihu/hue | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/store.py | 45 | 4822 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | apache-2.0 |
ElectronicWar/obs-studio | CI/install/osx/package_util.py | 24 | 3406 | def cmd(cmd):
import subprocess
import shlex
return subprocess.check_output(shlex.split(cmd)).rstrip('\r\n')
def get_tag_info(tag):
rev = cmd('git rev-parse {0}'.format(latest_tag))
anno = cmd('git cat-file -p {0}'.format(rev))
tag_info = []
for i, v in enumerate(anno.splitlines()):
... | gpl-2.0 |
ployground/ploy_fabric | setup.py | 1 | 1176 | from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
HISTORY = open(os.path.join(here, 'HISTORY.rst')).read()
version = "1.1.2.dev0"
install_requires = [
'setuptools',
'ploy >= 1.0.0, < 2dev',
'Fabric>=1.4.0,!=1... | bsd-3-clause |
ThreatConnect-Inc/tcex | tcex/bin/validate.py | 1 | 23337 | #!/usr/bin/env python
"""TcEx Framework Validate Module."""
# standard library
import ast
import importlib
import json
import os
import sys
import traceback
from collections import deque
# third-party
import colorama as c
from jsonschema import SchemaError, ValidationError, validate
from stdlib_list import stdlib_list... | apache-2.0 |
ritchyteam/odoo | addons/website_certification/__init__.py | 385 | 1030 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
SublimeLinter/SublimeLinter3 | highlight_view.py | 1 | 32846 | from collections import defaultdict
import html
from itertools import chain
from functools import partial
import re
import textwrap
import threading
import uuid
import sublime
import sublime_plugin
from .lint import persist, events, style, util, queue, quick_fix
from .lint.const import PROTECTED_REGIONS_KEY, ERROR, W... | mit |
python/performance | pyperformance/benchmarks/bm_tornado_http.py | 1 | 2910 |
"""Test the performance of simple HTTP serving and client using the Tornado
framework.
A trivial "application" is generated which generates a number of chunks of
data as a HTTP response's body.
"""
import sys
import socket
import pyperf
from tornado.httpclient import AsyncHTTPClient
from tornado.httpserver import ... | mit |
BehavioralInsightsTeam/edx-platform | openedx/core/djangoapps/credentials/utils.py | 9 | 2901 | """Helper functions for working with Credentials."""
from __future__ import unicode_literals
from django.conf import settings
from edx_rest_api_client.client import EdxRestApiClient
from openedx.core.djangoapps.credentials.models import CredentialsApiConfig
from openedx.core.lib.edx_api_utils import get_edx_api_data
... | agpl-3.0 |
AuyaJackie/odoo | addons/base_geolocalize/models/res_partner.py | 239 | 3743 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
minhphung171093/OpenERP_V8 | openerp/addons/mail/res_partner.py | 379 | 2454 | # -*- 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 |
leogulus/pisco_pipeline | pisco_photometry_all_2019.py | 1 | 76497 | import sys, os, re, yaml, subprocess, shlex, FITS_tools
import pandas as pd
import numpy as np
import pickle
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import image
import matplotlib.cm as cm
import matplotlib.image as mpimg
from scipy.optimize import curve_fit
import scipy.integrate as integr... | mit |
jmartu/testing | venv/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py | 666 | 10553 | from __future__ import absolute_import
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
... | mit |
yiheng/BigDL | pyspark/test/bigdl/test_pickler.py | 6 | 2568 | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 |
4eek/edx-platform | common/djangoapps/third_party_auth/management/commands/saml.py | 80 | 1410 | # -*- coding: utf-8 -*-
"""
Management commands for third_party_auth
"""
from django.core.management.base import BaseCommand, CommandError
import logging
from third_party_auth.models import SAMLConfiguration
from third_party_auth.tasks import fetch_saml_metadata
class Command(BaseCommand):
""" manage.py commands ... | agpl-3.0 |
kslundberg/pants | src/python/pants/scm/scm.py | 16 | 3749 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | apache-2.0 |
dropbox/changes | changes/api/cached_snapshot_details.py | 1 | 1182 | from __future__ import absolute_import
from changes.api.base import APIView
from changes.models.snapshot import Snapshot
import changes.lib.snapshot_garbage_collection as gc
class CachedSnapshotDetailsAPIView(APIView):
def unpack_snapshot_ids(self, cluster_map):
return {cluster: [i.id.hex for i in images... | apache-2.0 |
smurfix/pybble | pybble/manager/populate.py | 1 | 12264 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This is part of Pybble, a WMS (Whatever Management System) based on
## Jinja2/Haml, Werkzeug, Flask, and Optimism.
##
## Pybble is Copyright © 2009-2014 by Matthias Urlichs <matthias@urlichs.de>,
## it is li... | gpl-3.0 |
mank319/elementaryPlus | scripts/custom/core_icon_theme.py | 2 | 1605 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# core.py core icon theme custom install script
#
# Copyright (C) 2015 Stefan Ric (cybre)
#
# 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 |
godLoveLucifer/viewfinder | backend/services/test/itunes_store_test.py | 13 | 11379 | # Copyright 2012 Viewfinder Inc. All rights reserved.
__author__ = 'ben@emailscrubbed.com (Ben Darnell)'
import base64
import datetime
import functools
import json
import time
from tornado import options
from viewfinder.backend.base import base_options, secrets
from viewfinder.backend.base.testing import BaseTestCas... | apache-2.0 |
srinathv/bokeh | examples/plotting/file/histogram.py | 43 | 3876 | # -*- coding: utf-8 -*-
import numpy as np
import scipy.special
from bokeh.plotting import figure, show, output_file, vplot
output_file('histogram.html')
p1 = figure(title="Normal Distribution (μ=0, σ=0.5)",tools="save",
background_fill="#E8DDCB")
mu, sigma = 0, 0.5
measured = np.random.normal(mu, sigma, 1... | bsd-3-clause |
chainer/chainercv | chainercv/links/model/light_head_rcnn/light_head_rcnn_resnet101.py | 2 | 10946 | from __future__ import division
import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
from chainercv.functions import ps_roi_max_align_2d
from chainercv.links.connection.conv_2d_bn_activ import Conv2DBNActiv
from chainercv.links.model.faster_rcnn.region_proposal_network import \
... | mit |
hughsie/fwupd | data/device-tests/hardware.py | 2 | 5214 | #!/usr/bin/python3
# pylint: disable=wrong-import-position,too-many-locals,unused-argument,wrong-import-order
#
# Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
import gi
import os
import requests
import time
import sys
import glob
import json
from termcolor import color... | lgpl-2.1 |
birsoyo/conan | conans/client/rest/auth_manager.py | 1 | 8686 | """
Collaborate with RestApiClient to make remote anonymous and authenticated calls.
Uses user_io to request user's login and password and obtain a token for calling authenticated
methods if receives AuthenticationException from RestApiClient.
Flow:
Directly invoke a REST method in RestApiClient, example: get_co... | mit |
kvar/ansible | test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py | 8 | 15110 | # (c) 2017 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
Suwings/Yeinw | src/Crypto/SelfTest/Random/Fortuna/test_SHAd256.py | 119 | 2419 | # -*- coding: utf-8 -*-
#
# SelfTest/Random/Fortuna/test_SHAd256.py: Self-test for the SHAd256 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the ... | gpl-3.0 |
maciekcc/tensorflow | tensorflow/contrib/timeseries/python/timeseries/state_space_models/filtering_postprocessor_test.py | 67 | 3176 | # 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 |
megakevin/single-authored-code-evolution-analysis | fix_bug_commits.py | 1 | 6318 | __author__ = 'kevin'
from datetime import datetime
from subprocess import call, check_output
import sys
import os
import csv
import copy
import tag_lists
class GitTag():
"""Represents a Tag in a git repository"""
def __init__(self, line):
raw_tag, raw_hash, raw_date, raw_timestamp = line.split("|")
... | mit |
afrolov1/nova | nova/openstack/common/report/utils.py | 79 | 1404 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
jimi-c/ansible | lib/ansible/modules/utilities/logic/assert.py | 44 | 2015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
zhengyongbo/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py | 118 | 11747 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | bsd-3-clause |
rtruxal/metagoofil | extractors/metadataMSOfficeXML.py | 16 | 7833 | import unzip
import zipfile
import sys
import re
import os
import random
import myparser
class metaInfoMS:
def __init__(self):
self.template =""
self.totalTime =""
self.pages =""
self.words =""
self.characters =""
self.application =""
self.docSecurity =""
self.lines =""
self.paragraphs =""
self.sc... | gpl-2.0 |
ogrisel/scipy | scipy/linalg/benchmarks/bench_decom.py | 18 | 2472 | """ Benchmark functions for linalg.decomp module
"""
from __future__ import division, print_function, absolute_import
import sys
from numpy import linalg as nl
from scipy import linalg as sl
from numpy.testing import measure, rand, assert_
def random(size):
return rand(*size)
def bench_eigvals():
numpy_... | bsd-3-clause |
Nick-Hall/gramps | gramps/gui/filters/sidebar/_eventsidebarfilter.py | 10 | 7167 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
catsop/CATMAID | django/applications/catmaid/apps.py | 1 | 10359 | import logging
from catmaid import history
from django.apps import AppConfig
from django.conf import settings
from django.core.checks import Warning, register
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.db.utils import ProgrammingError
from django.db.models imp... | gpl-3.0 |
jay-tyler/ansible | v1/ansible/runner/lookup_plugins/password.py | 144 | 4766 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.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... | gpl-3.0 |
JCROM-Android/jcrom_external_chromium_org | chrome/test/functional/perf.py | 47 | 107008 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Basic pyauto performance tests.
For tests that need to be run for multiple iterations (e.g., so that average
and standard devia... | bsd-3-clause |
juanjosegzl/learningpygame | ezmenu.py | 1 | 2298 | #! /usr/bin/env python
# I found this file inside Super Mario Bros python
# written by HJ https://sourceforge.net/projects/supermariobrosp/
# the complete work is licensed under GPL3 although I can not determine# license of this file
# maybe this is the original author, we can contact him/her http://www.pygame.org/pro... | gpl-3.0 |
spring-week-topos/cinder-week | cinder/api/contrib/types_manage.py | 4 | 4787 | # Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack Foundation
#
# 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-... | apache-2.0 |
2014c2g1/c2g1 | w2/static/Brython2.0.0-20140209-164925/Lib/xml/sax/saxutils.py | 730 | 11688 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
for key, val... | gpl-2.0 |
MonsieurBlutbad/furzarsch-muss-scheissen | api/vendor/doctrine/orm/docs/en/conf.py | 2448 | 6497 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# 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.
... | mit |
EUDAT-B2SHARE/invenio-old | modules/miscutil/lib/inveniocfg_dumperloader.py | 27 | 16700 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011 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 opt... | gpl-2.0 |
bradleyayers/suds-htj | suds/soaparray.py | 205 | 2262 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
Zac-HD/home-assistant | homeassistant/components/lock/nuki.py | 10 | 2093 | """
Nuki.io lock platform.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/lock.nuki/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.lock import (LockDevice, PLATFORM_SCHEMA)
from homeassistant.const... | apache-2.0 |
justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/unidecode/x081.py | 252 | 4673 | data = (
'Cheng ', # 0x00
'Tiao ', # 0x01
'Zhi ', # 0x02
'Cui ', # 0x03
'Mei ', # 0x04
'Xie ', # 0x05
'Cui ', # 0x06
'Xie ', # 0x07
'Mo ', # 0x08
'Mai ', # 0x09
'Ji ', # 0x0a
'Obiyaakasu ', # 0x0b
'[?] ', # 0x0c
'Kuai ', # 0x0d
'Sa ', # 0x0e
'Zang ', # 0x0f
'Qi ', # 0x... | gpl-3.0 |
sserrot/champion_relationships | venv/Lib/site-packages/pygments/lexers/erlang.py | 4 | 18985 | # -*- coding: utf-8 -*-
"""
pygments.lexers.erlang
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Erlang.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \
... | mit |
kobotoolbox/kobocat | onadata/apps/logger/xform_instance_parser.py | 1 | 12334 | # coding: utf-8
import logging
import re
import sys
import dateutil.parser
import six
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.utils.six import text_type
from xml.dom import minidom, Node
from onadata.libs.utils.common_tags import XFORM_ID_STRING
cla... | bsd-2-clause |
burakbayramli/classnotes | stat/stat_065_powerlaw/powerlaw.py | 2 | 106244 | #The MIT License (MIT)
#
#Copyright (c) 2013 Jeff Alstott
#
#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, me... | gpl-3.0 |
cyiops/easybuild-easyblocks | easybuild/easyblocks/s/samtools.py | 2 | 5782 | ##
# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
#
# Copyright:: Copyright 2012-2018 Uni.Lu/LCSB, NTUA
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS proj... | gpl-2.0 |
SUMPaul/dblog | dblog/settings.py | 1 | 3991 | """
Django settings for dblog project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | mit |
tomkralidis/inasafe | safe/impact_functions/base.py | 4 | 17208 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Impact Function Base Class**
Contact : ole.moller.nielsen@gmail.com
.. 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 So... | gpl-3.0 |
chennan47/osf.io | api_tests/institutions/views/test_institution_relationship_nodes.py | 8 | 22416 | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
WithdrawnRegistrationFactory,
RegistrationFactory,
InstitutionFactory,
AuthUserFactory,
NodeFactory,
)
from osf.utils import permissions
def make_payload(*node_ids):
data = [
{'type': 'node... | apache-2.0 |
marma/rdflib | examples/smushing.py | 8 | 1532 | """
A FOAF smushing example.
Filter a graph by normalizing all ``foaf:Persons`` into URIs based on
their ``mbox_sha1sum``.
Suppose I got two `FOAF <http://xmlns.com/foaf/0.1>`_ documents each
talking about the same person (according to ``mbox_sha1sum``) but they
each used a :class:`rdflib.term.BNode` for the subject.... | bsd-3-clause |
steebchen/youtube-dl | youtube_dl/extractor/bandcamp.py | 15 | 12472 | from __future__ import unicode_literals
import json
import random
import re
import time
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
KNOWN_EXTENSIONS,
parse_filesize,
unescapeHT... | unlicense |
Bachaco-ve/odoo | addons/website/models/test_models.py | 335 | 1386 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class test_converter(orm.Model):
_name = 'website.converter.test'
# disable translation export for those brilliant field labels and values
_translate = False
_columns = {
'char': fields.char(),
'integer': fields.integer(),
... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.