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 |
|---|---|---|---|---|---|
Kapeli/PopClip-Extensions | source/Trello/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... | mit |
sahily/SDR-Flat | gr-sahil/docs/doxygen/doxyxml/generated/index.py | 344 | 1871 | #!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from xml.dom import minidom
import os
import sys
import compound
import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
supermod.DoxygenType.__init__(se... | gpl-3.0 |
zoni/errbot | errbot/cli.py | 3 | 13235 | #!/usr/bin/env python
# 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
# (at your option) any later version.
#
# This program is distributed in the hope... | gpl-3.0 |
colloquium/spacewalk | client/solaris/smartpm/smart/interfaces/gtk/interactive.py | 1 | 31919 | #
# 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 published
# by the Free Software Fou... | gpl-2.0 |
joariasl/odoo | addons/knowledge/__openerp__.py | 261 | 1738 | # -*- 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 |
qbuat/tauperf | old/eff_tools/DecisionTool.py | 1 | 2103 | from ROOT import TMVA
from array import array
from rootpy.extern import ordereddict
import logging
log = logging.getLogger('DecisionTool')
class DecisionTool:
def __init__(self,tree,name,weight_file,var_file,cutval):
""" A class to handle the decision of the BDT"""
TMVA.Tools.Instance()
s... | gpl-3.0 |
eleonrk/SickRage | lib/stevedore/enabled.py | 16 | 3569 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed u... | gpl-3.0 |
bioconda/bioconda-utils | bioconda_utils/bot/chat.py | 1 | 5842 | """
Chat with the bot via Gitter
"""
import asyncio
import logging
from typing import Any, Dict, List
import aiohttp
from .. import gitter
from ..gitter import AioGitterAPI
from .commands import command_routes
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
"""
https://webhooks.gitter.im/e/b9e... | mit |
hoatle/odoo | openerp/addons/base/res/__init__.py | 384 | 1261 | # -*- 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 |
Werkov/PyQt4 | examples/painting/transformations.py | 20 | 8601 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | gpl-2.0 |
Ledoux/ShareYourSystem | Pythonlogy/ShareYourSystem/Specials/Predicters/Predicter/tests/05_tests_oscillations/03_test_rate_multiagents_thetagamma_damp.py | 2 | 3182 | #/###################/#
# Import modules
#
#ImportModules
import ShareYourSystem as SYS
import scipy.stats
import numpy
numpy.random.seed(4)
#/###################/#
# Build the model
#
#Simulation time
SimulationTimeFloat=1000.
#SimulationTimeFloat=0.2
BrianingDebugVariable=0.1 if SimulationTimeFloat<0.5 else 25.
... | mit |
blacklin/kbengine | kbe/src/lib/python/Lib/distutils/tests/test_unixccompiler.py | 91 | 4871 | """Tests for distutils.unixccompiler."""
import os
import sys
import unittest
from test.support import EnvironmentVarGuard, run_unittest
from distutils import sysconfig
from distutils.unixccompiler import UnixCCompiler
class UnixCCompilerTestCase(unittest.TestCase):
def setUp(self):
self._backup_platform... | lgpl-3.0 |
YuepengGuo/backtrader | tests/test_data_replay.py | 2 | 1908 | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-3.0 |
srajag/nova | nova/cells/filters/__init__.py | 58 | 2117 | # Copyright (c) 2012-2013 Rackspace Hosting
# 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
#
# Unles... | apache-2.0 |
reshanie/roblox.py | roblox/asset.py | 1 | 12222 | """
Copyright (c) 2017 James Patrick Dill, reshanie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | mit |
mpercich/Calendarize | ios/dateparser/lib/python2.7/site-packages/dateparser/calendars/hijri_parser.py | 2 | 1988 | # coding: utf-8
from umalqurra.hijri_date import HijriDate as hj
from umalqurra.ummalqura_arrray import UmalqurraArray
from dateparser.calendars import non_gregorian_parser
class hijri(object):
@classmethod
def to_gregorian(cls, year=None, month=None, day=None):
h = hj(year=year, month=month, day=da... | mit |
CodigoSur/cyclope | cyclope/apps/articles/search_indexes.py | 2 | 1293 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010-2013 Código Sur Sociedad Civil.
# All rights reserved.
#
# This file is part of Cyclope.
#
# Cyclope 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 |
starimpact/fast-rcnn | lib/utils/blob.py | 63 | 1625 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Blob helper functions."""
import numpy as np
import cv2
def im_lis... | mit |
Vanova/Theano-Lights | scripts/text_tokenizer.py | 11 | 3126 | from collections import Counter
import ConfigParser
import argparse
import os
import time
import sys
import numpy
def construct_vocabulary(dataset, oov_rate, level):
filename = dataset + '_train'
fd = open(filename, 'rt')
txt = fd.read()
if level == 'words':
txt = txt.replace('\n', '<eos>')
... | mit |
jcsp/manila | manila/tests/scheduler/fakes.py | 1 | 12546 | # Copyright 2011 OpenStack LLC.
# 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 b... | apache-2.0 |
yan12125/youtube-dl | youtube_dl/extractor/inc.py | 24 | 2299 | from __future__ import unicode_literals
from .common import InfoExtractor
from .kaltura import KalturaIE
class IncIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?inc\.com/(?:[^/]+/)+(?P<id>[^.]+).html'
_TESTS = [{
'url': 'http://www.inc.com/tip-sheet/bill-gates-says-these-5-books-will-make-you-s... | unlicense |
IT-Department-Projects/OOAD-Project | Flask_App/oakcrest/lib/python2.7/site-packages/jinja2/filters.py | 117 | 33424 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from itertools import groupby
from collections import namedtuple
from jinja2.ut... | mit |
Epirex/android_external_chromium_org | tools/perf/measurements/rasterize_and_record_unittest.py | 23 | 2078 | # 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 measurements import rasterize_and_record
from telemetry.core import wpr_modes
from telemetry.page import page_measurement_unittest_base
from telemetry.un... | bsd-3-clause |
corredD/upy | transformation.py | 1 | 68489 | # -*- coding: utf-8 -*-
# transformations.py
# Copyright (c) 2006-2013, Christoph Gohlke
# Copyright (c) 2006-2013, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... | gpl-3.0 |
gpkulkarni/linux-arm64 | tools/perf/scripts/python/sctop.py | 1996 | 2102 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
mydongistiny/external_chromium_org | native_client_sdk/src/build_tools/sdk_tools/command/info.py | 160 | 1162 | # 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.
import command_common
import logging
import manifest_util
def Info(manifest, bundle_names):
valid_bundles, invalid_bundles = command_common.GetValidBu... | bsd-3-clause |
goodwinos/linux-dm | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
bepress/xavier | xavier/taskqueue.py | 1 | 2517 | """
Offline Manager for Xavier
"""
import logging
import jsonpickle
logger = logging.getLogger(__name__)
class Task(object):
def __init__(self, func):
self.func = func
self.path = '%s.%s' % (func.__name__, func.__module__)
self.publish_event = None
def __call__(self, *args, **kwargs... | mit |
HonzaKral/django | django/conf/locale/sr_Latn/formats.py | 1008 | 2011 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/lib/pyasn1_modules/rfc2314.py | 127 | 1170 | #
# PKCS#10 syntax
#
# ASN.1 source from:
# http://tools.ietf.org/html/rfc2314
#
# Sample captures could be obtained with "openssl req" command
#
from pyasn1.type import tag, namedtype, namedval, univ, constraint
from pyasn1_modules.rfc2459 import *
class Attributes(univ.SetOf):
componentType = Attribute()
class ... | apache-2.0 |
ehirt/odoo | addons/mail/tests/test_invite.py | 199 | 2591 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
don-github/edx-platform | common/djangoapps/track/tests/test_logs.py | 163 | 2712 | """Tests that tracking data are successfully logged"""
import mock
import unittest
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from track.models import TrackingLog
from track.views import user_track
@unittest.skip("TODO: these tests were not being ru... | agpl-3.0 |
HossainKhademian/FreeCivAndroid | lib/freeciv/uidialog.py | 4 | 1956 | # Copyright (C) 2011 Michal Zielinski (michal@zielinscy.org.pl)
#
# 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, or (at your option)
# any later version.
#
# This program is d... | gpl-2.0 |
tear44/Cinnamon | files/usr/lib/cinnamon-settings/modules/cs_backgrounds.py | 6 | 29466 | #!/usr/bin/env python2
import sys
sys.path.append('/usr/lib/cinnamon-settings/bin')
from SettingsWidgets import *
import os
from gi.repository import Gio, Gtk, GObject, Gdk, Pango, GLib
import imtools
import gettext
import thread
import subprocess
import tempfile
import commands
import locale
import time
from xml.etre... | gpl-2.0 |
achang97/YouTunes | lib/python2.7/site-packages/dateutil/easter.py | 80 | 2629 | # -*- coding: utf-8 -*-
"""
This module offers a generic easter computing method for any given year, using
Western, Orthodox or Julian algorithms.
"""
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year,... | mit |
KhronosGroup/COLLADA-CTS | StandardDataSets/1_5/collada/library_controllers/controller/morph/_reference/_reference_morph_one_target_relative/_reference_morph_one_target_relative.py | 29 | 3709 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | mit |
iu-parfunc/codespeed | codespeed/migrations/0003_auto__add_field_revision_branch.py | 5 | 6676 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Revision.branch'
db.add_column('codespeed_revision', 'branch', self.gf('django.db.models.f... | lgpl-2.1 |
nsat/gnuradio | gr-fec/python/fec/extended_encoder.py | 33 | 3260 | #!/usr/bin/env python
#
# Copyright 2014 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)
# ... | gpl-3.0 |
zestrada/nova-cs498cc | nova/cells/manager.py | 1 | 15722 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
synergeticsedx/deployment-wipro | lms/djangoapps/grades/migrations/0001_initial.py | 20 | 2323 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import coursewarehistoryextended.fields
import django.utils.timezone
import model_utils.fields
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
class Migration(migrations.Mi... | agpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/Django/tests/regressiontests/comment_tests/tests/templatetag_tests.py | 68 | 6721 | from __future__ import absolute_import
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.template import Template, Context
from ..models import Article, Author
from . import CommentTestCase
... | agpl-3.0 |
ducthien1490/youtube-dl | youtube_dl/extractor/common.py | 14 | 57363 | from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import re
import socket
import sys
import time
import xml.etree.ElementTree
from ..compat import (
compat_cookiejar,
compat_cookies,
compat_getpass,
compat_HTTPError,
compat_http... | unlicense |
useabode/redash | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | bsd-2-clause |
GoogleCloudPlatform/mlops-on-gcp | on_demand/tfx-caip/lab-04-tfx-metadata/labs/pipeline/config.py | 6 | 1750 | # Copyright 2021 Google LLC. 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 a... | apache-2.0 |
trietptm/volatility | volatility/plugins/machoinfo.py | 58 | 1502 | # Volatility
# Copyright (C) 2009-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 |
rapidpro/tracpro | tracpro/orgs_ext/tests/test_forms.py | 1 | 15878 | from __future__ import unicode_literals
import datetime
import mock
from django.core.exceptions import NON_FIELD_ERRORS
from django.forms import model_to_dict
from django.test import TestCase
from django.test import override_settings
from django.utils.timezone import now
from tracpro.orgs_ext.forms import FetchRunsF... | bsd-3-clause |
nmercier/linux-cross-gcc | win32/bin/Lib/random.py | 5 | 33233 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
unif... | bsd-3-clause |
sythaeryn/dogetipbot-master | src/ctb/ctb_coin.py | 3 | 8774 | """
This file is part of ALTcointip.
ALTcointip 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.
ALTcointip is distr... | gpl-2.0 |
4022321818/w16b_test | static/Brython3.1.1-20150328-091302/Lib/importlib/abc.py | 743 | 14595 | """Abstract base classes related to import."""
from . import _bootstrap
from . import machinery
try:
import _frozen_importlib
except ImportError as exc:
if exc.name != '_frozen_importlib':
raise
_frozen_importlib = None
import abc
import imp
import marshal
import sys
import tokenize
import warnings
... | gpl-3.0 |
dya2/python-for-android | python3-alpha/python3-src/Lib/encodings/cp1251.py | 272 | 13361 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.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,in... | apache-2.0 |
biodrone/plex-desk | desk/flask/lib/python3.4/site-packages/sqlalchemy/engine/url.py | 54 | 8228 | # engine/url.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
informati... | mit |
i8run/BigDL-1 | spark/dl/src/main/scala/com/intel/analytics/bigdl/example/tensorflow/loadandsave/model.py | 10 | 2210 | #
# 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 |
gitcommitpush/django-mailtrail | runtests.py | 1 | 1253 | #!/usr/bin/env python
import os
import sys
import subprocess
import django
from coverage import coverage
from django.conf import settings
from django.test.utils import get_runner
FLAKE8_ARGS = ['mailtrail', 'tests/', '--ignore=E501']
def exit_on_failure(command, message=None):
if command:
sys.exit(comma... | mit |
loopCM/chromium | tools/json_schema_compiler/dart_generator.py | 7 | 27642 | # 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.
"""
Generator language component for compiler.py that adds Dart language support.
"""
from code import Code
from model import *
from schema_util import *... | bsd-3-clause |
DarioI/DroidSec | ares/ui/question_dialog.py | 2 | 2251 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'questionsample_dialog.ui'
#
# Created: Tue Aug 4 21:12:30 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8... | apache-2.0 |
joonro/PyTables | examples/inmemory.py | 13 | 1474 | #!/usr/bin/env python
# encoding: utf-8
"""inmemory.py.
Example usage of creating in-memory HDF5 file with a specified chunksize
using PyTables 3.0.0+
See also Cookbook page
http://pytables.github.io/cookbook/inmemory_hdf5_files.html and available
drivers
http://pytables.github.io/usersguide/parameter_files.html#hdf... | bsd-3-clause |
Timeship/OnlineJudge-QDU | utils/shortcuts.py | 3 | 2897 | # coding=utf-8
import hashlib
import time
import random
from django.shortcuts import render
from django.core.paginator import Paginator
from rest_framework.response import Response
def error_page(request, error_reason):
return render(request, "utils/error.html", {"error": error_reason})
def error_response(err... | mit |
horance-liu/tensorflow | tensorflow/python/grappler/cluster.py | 8 | 3208 | # 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 |
ShaguptaS/moviepy | moviepy/video/fx/resize.py | 1 | 3276 |
resize_possible = True
try:
import cv2
resizer = lambda pic, newsize : cv2.resize(pic.astype('uint8'),
tuple(map(int, newsize)),
interpolation=cv2.INTER_AREA)
except ImportError:
try:
import Image
import numpy as np
... | mit |
ivoflipse/devide.johannes | extra/soappy-cvp/tests/testWSDL.py | 7 | 4904 | #!/usr/bin/env python
import unittest
import os, re
import sys
sys.path.insert (1, '..')
import SOAPpy
ident = '$Id: testWSDL.py,v 1.2 2003/05/09 12:46:11 warnes Exp $'
# Check for a web proxy definition in environment
try:
proxy_url=os.environ['http_proxy']
phost, pport = re.search('http://([^:]+):([0-9]+)', ... | bsd-3-clause |
raymondanthony/youtube-dl | youtube_dl/extractor/discovery.py | 18 | 1798 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
class DiscoveryIE(InfoExtractor):
_VALID_URL = r'http://www\.discovery\.com\/[a-zA-Z0-9\-]*/[a-zA-Z0-9\-]*/videos/(?P<id>[a-zA-Z0-9\-]*)(.htm)?'
_TEST = {
'url': 'http://www.discovery.com/tv-shows/mythbus... | unlicense |
luzheqi1987/nova-annotation | nova/tests/unit/integrated/v3/test_flavor_access.py | 1 | 3181 | # Copyright 2013 IBM Corp.
#
# 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 t... | apache-2.0 |
hyperized/ansible | lib/ansible/modules/cloud/amazon/aws_elasticbeanstalk_app.py | 39 | 7402 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTAT... | gpl-3.0 |
BrendanLeber/adventofcode | 2016/20-firewall_rules/firewall_rules.py | 1 | 1586 | # -*- coding: utf-8 -*-
import argparse
import pdb
import traceback
from typing import List, Tuple
def test_ip(ip: int, rules: List[Tuple[int, int]], max_addr: int) -> bool:
for (start, end) in rules:
if start <= ip <= end:
break
else:
if ip < max_addr:
return True
... | mit |
quheng/scikit-learn | examples/decomposition/plot_image_denoising.py | 181 | 5819 | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of the Lena image using firstly online :ref:`DictionaryLearning` and
various transform methods.
The dictionary is fitted o... | bsd-3-clause |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/sqlite3/dump.py | 149 | 2825 | # Mimic the sqlite3 console shell's .dump command
# Author: Paul Kippes <kippesp@gmail.com>
# Every identifier in sql is quoted based on a comment in sqlite
# documentation "SQLite adds new keywords from time to time when it
# takes on new features. So to prevent your code from being broken by
# future enhancements, y... | apache-2.0 |
uwosh/UWOshOIE | tests/testTransitionApproveForFA.py | 1 | 4225 | import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
from Products.UWOshOIE.tests.uwoshoietestcase import UWOshOIETestCase
from Products.CMFCore.WorkflowCore import WorkflowException
class TestTransitionApproveForFA(UWOshOIETestCase):
"""Ensure product is properly inst... | gpl-2.0 |
sid88in/incubator-airflow | tests/www/api/experimental/test_kerberos_endpoints.py | 3 | 3783 | # -*- 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 |
darkleons/BE | addons/purchase_analytic_plans/__openerp__.py | 52 | 1787 | # -*- 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 |
twobob/buildroot-kindle | output/build/host-python-2.7.2/Lib/test/test_coding.py | 121 | 1212 |
import test.test_support, unittest
import os
class CodingTest(unittest.TestCase):
def test_bad_coding(self):
module_name = 'bad_coding'
self.verify_bad_module(module_name)
def test_bad_coding2(self):
module_name = 'bad_coding2'
self.verify_bad_module(module_name)
def veri... | gpl-2.0 |
thinkerchan/thefuck | tests/rules/test_mvn_no_command.py | 13 | 3648 | import pytest
from thefuck.rules.mvn_no_command import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='mvn', stdout='[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<g... | mit |
pkappesser/youtube-dl | youtube_dl/extractor/freespeech.py | 165 | 1226 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
class FreespeechIE(InfoExtractor):
IE_NAME = 'freespeech.org'
_VALID_URL = r'https://www\.freespeech\.org/video/(?P<title>.+)'
_TEST = {
'add_ie': ['Youtube'],
'url': 'https://www.freespeech.o... | unlicense |
dpshelio/sunpy | sunpy/util/net.py | 2 | 6983 | """
This module provides general net utility functions.
"""
import os
import re
import sys
import shutil
from unicodedata import normalize
from email.parser import FeedParser
from urllib.parse import urljoin, urlparse
from urllib.request import urlopen
from sunpy.util import replacement_filename
__all__ = ['slugify',... | bsd-2-clause |
drawks/ansible | lib/ansible/modules/network/avi/avi_dnspolicy.py | 28 | 3851 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
msherry/PyXB-1.1.4 | tests/bugs/test-200908271556.py | 1 | 1990 | import pyxb_114.binding.generate
import pyxb_114.binding.datatypes as xs
import pyxb_114.binding.basis
import pyxb_114.utils.domutils
import gc
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="instance">
<xs:complexType>
... | apache-2.0 |
OmgOhnoes/Flexget | flexget/tests/test_abort_if_exists.py | 5 | 1032 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
from flexget.task import TaskAbort
class TestAbortIfExists(object):
config = """
templates:
global:
disable: [seen]
... | mit |
pkdevbox/stashboard | stashboard/contrib/status_images.py | 17 | 265414 | # Copyright (c) 2010 Twilio 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, including without limitation the rights
# to use, copy, modify, merge, publish, distri... | mit |
rahushen/ansible | lib/ansible/modules/network/junos/junos_netconf.py | 26 | 5364 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
marratj/ansible | lib/ansible/plugins/netconf/__init__.py | 48 | 8526 | #
# (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 d... | gpl-3.0 |
henryfjordan/django | django/db/migrations/loader.py | 89 | 17105 | from __future__ import unicode_literals
import os
import sys
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationRecorder
from django.utils import six
from .exception... | bsd-3-clause |
thomasem/nova | nova/api/openstack/compute/contrib/availability_zone.py | 56 | 5603 | # Copyright 2012 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-2.0
#
# Unless required by applicable law ... | apache-2.0 |
mortada/numpy | numpy/distutils/fcompiler/gnu.py | 26 | 15266 | from __future__ import division, absolute_import, print_function
import re
import os
import sys
import warnings
import platform
import tempfile
from subprocess import Popen, PIPE, STDOUT
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.exec_command import exec_command
from numpy.distutils.misc_uti... | bsd-3-clause |
Windy-Ground/scikit-learn | sklearn/externals/joblib/disk.py | 320 | 3280 | """
Disk management utilities.
"""
# Authors: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Copyright (c) 2010 Gael Varoquaux
# License: BSD Style, 3 clauses.
import errno
import os
import shutil
import sys
import time
def disk_used(path):
""" Return... | bsd-3-clause |
deuscoin-org/deuscoin-core | qa/rpc-tests/test_framework/authproxy.py | 1 | 6097 |
"""
Copyright 2011 Jeff Garzik
AuthServiceProxy has the following improvements over python-jsonrpc's
ServiceProxy class:
- HTTP connections persist for the life of the AuthServiceProxy object
(if server supports HTTP/1.1)
- sends protocol 'version', per JSON-RPC 1.1
- sends proper, incrementing 'id'
... | mit |
JasonLai256/plumbca | plumbca/cache.py | 1 | 2429 | # -*- coding:utf-8 -*-
"""
plumbca.cache
~~~~~~~~~~~~~
CacheHandler for the collections control.
:copyright: (c) 2015 by Jason Lai.
:license: BSD, see LICENSE for more details.
"""
import asyncio
import logging
import re
import os
from .config import DefaultConf
from .collection import IncreaseC... | bsd-3-clause |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/numpy/core/tests/test_ufunc.py | 4 | 52261 | from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.core.umath_tests as umt
import numpy.core.operand_flag_tests as opflag_tests
from numpy.core.test_rational import rational, test_add, test_add_rationals
from numpy.testing import (
TestCase, run_module_suite, assert_, ... | bsd-2-clause |
ThinkOpen-Solutions/odoo | openerp/report/render/rml2txt/__init__.py | 381 | 1351 | # -*- 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... | agpl-3.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/docutils/languages/he.py | 52 | 2649 | # Author: Meir Kriheli
# Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $
# 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
# translated for each language:... | mit |
sdrogers/lda | code/lda_utilities.py | 1 | 14058 | import numpy as np
import pickle
import jsonpickle
def match_topics_across_dictionaries(lda1 = None,lda2 = None,file1 = None,file2 = None,
same_corpus = True,copy_annotations = False,copy_threshold = 0.5,summary_file = None,
new_file2 = None,mass_tol = 5.0):
# finds the closest topic matches from lda2 to lda1
if l... | gpl-3.0 |
richm/designate | designate/storage/impl_sqlalchemy/migrate_repo/versions/007_add_parent_domain_id_col.py | 2 | 1563 | # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 r... | apache-2.0 |
our-city-app/oca-backend | src/rogerthat/models/auth/acm.py | 1 | 2211 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | apache-2.0 |
cartertech/odoo-hr-ng | hr_report_payroll_attendance_summary/report/attendance_summary.py | 1 | 14914 | #-*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 One Click Software (http://oneclick.solutions)
# and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
#
# This program is free software: you can redistribute it and/or m... | agpl-3.0 |
dhruvagarwal/django | tests/utils_tests/test_timezone.py | 170 | 7827 | import copy
import datetime
import pickle
import unittest
from django.test import override_settings
from django.utils import timezone
try:
import pytz
except ImportError:
pytz = None
requires_pytz = unittest.skipIf(pytz is None, "this test requires pytz")
if pytz is not None:
CET = pytz.timezone("Europe... | bsd-3-clause |
pombredanne/grr | checks/pam_test.py | 6 | 8672 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the PAM config checks."""
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.checks import checks_test_lib
from grr.parsers import linux_pam_parser
class PamConfigTests(checks_test_lib.HostCheckTest):
@classmethod
def setUpClass(cls):
... | apache-2.0 |
SUSE/azure-sdk-for-python | azure-mgmt-logic/azure/mgmt/logic/operations/maps_operations.py | 4 | 14735 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
anuragpapineni/Hearthbreaker-evolved-agent | neat-python-read-only/build/lib/neat/iznn/network.py | 3 | 1993 | from iznn_cpp import *
class Network(object):
""" A neural network has a list of neurons linked by synapses """
def __init__(self, neurons=[], input_neurons = [], output_neurons = [], synapses=[]):
self.__neurons = neurons
self.__input_neurons = input_neurons
self.__output_neurons = out... | mit |
reed23/lawfirm | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | 17165 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | gpl-2.0 |
adlius/osf.io | api/providers/urls.py | 1 | 5275 | from django.conf.urls import include, url
from api.providers import views
app_name = 'osf'
urlpatterns = [
url(
r'^preprints/', include(
(
[
url(r'^$', views.PreprintProviderList.as_view(), name=views.PreprintProviderList.view_name),
url... | apache-2.0 |
Dufy/wechatpy | wechatpy/client/api/merchant/shelf.py | 8 | 1207 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.base import BaseWeChatAPI
class MerchantShelf(BaseWeChatAPI):
def add(self, name, banner, shelf_data):
return self._post(
'merchant/shelf/add',
data={
'shelf_n... | mit |
tensorflow/lingvo | lingvo/tasks/punctuator/input_generator_test.py | 1 | 3305 | # Lint as: python3
# Copyright 2018 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 ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.