repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
ptisserand/ansible | test/units/template/test_tests_as_filters_warning.py | 4 | 1303 | from ansible.template import Templar, display
from units.mock.loader import DictDataLoader
from jinja2.filters import FILTERS
from os.path import isabs
def test_tests_as_filters_warning(mocker):
fake_loader = DictDataLoader({
"/path/to/my_file.txt": "foo\n",
})
templar = Templar(loader=fake_loader... | gpl-3.0 |
Thor77/youtube-dl | youtube_dl/extractor/pandoratv.py | 28 | 2732 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
float_or_none,
parse_duration,
str_to_int,
)
class PandoraTVIE(InfoExtractor):
IE_NAME = 'pandora.tv'
... | unlicense |
sugartom/tensorflow-alien | tensorflow/contrib/nccl/python/ops/nccl_ops.py | 83 | 5439 | # 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 |
robpvn/Vector-Tile-Research | scripts/tilestache-clean.py | 9 | 7955 | #!/usr/bin/env python
"""tilestache-clean.py will flush your cache.
This script is intended to be run directly. This example cleans the area around
West Oakland (http://sta.mn/ck) in the "osm" layer, for zoom levels 12-15:
tilestache-clean.py -c ./config.json -l osm -b 37.79 -122.35 37.83 -122.25 -e png 12 13 14 ... | bsd-3-clause |
manastech/de-bee | orderParser.py | 1 | 4209 | from i18n import getLanguage
from i18n import _
class Debt:
member = None
reason = None
money = None
class Transaction:
payer = None
debts = []
cancel = False
error = None
class OrderParser:
def getMember(self, members, name):
i = 0
for member in members:
if (member.use... | mit |
jpuigcerver/allen-oracle | modules/flask/globals.py | 783 | 1137 | # -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, ... | mit |
Foxfanmedium/python_training | OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/prompt_toolkit/contrib/regular_languages/validation.py | 23 | 2059 | """
Validator for a regular langage.
"""
from __future__ import unicode_literals
from prompt_toolkit.validation import Validator, ValidationError
from prompt_toolkit.document import Document
from .compiler import _CompiledGrammar
__all__ = (
'GrammarValidator',
)
class GrammarValidator(Validator):
"""
... | apache-2.0 |
swidbsk/freeopcua | tests/gtest/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | lgpl-3.0 |
SnappleCap/oh-mainline | vendor/packages/gdata/tests/gdata_tests/calendar_resource/live_client_test.py | 16 | 5652 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | agpl-3.0 |
danakj/chromium | third_party/logilab/logilab/astroid/exceptions.py | 87 | 1814 | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... | bsd-3-clause |
druffolo/druffolo_mblComputing_Assign1 | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 1361 | 45045 | # 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.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | mit |
motion2015/a3 | lms/djangoapps/courseware/student_field_overrides.py | 13 | 2984 | """
API related to providing field overrides for individual students. This is used
by the individual due dates feature.
"""
import json
from .field_overrides import FieldOverrideProvider
from .models import StudentFieldOverride
class IndividualStudentOverrideProvider(FieldOverrideProvider):
"""
A concrete i... | agpl-3.0 |
Bismarrck/tensorflow | tensorflow/contrib/eager/python/examples/revnet/ops_test.py | 31 | 3160 | # 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 required by applica... | apache-2.0 |
yatinkumbhare/openstack-nova | nova/availability_zones.py | 13 | 6585 | # Copyright (c) 2012 OpenStack Foundation
# 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 |
nhomar/odoo-mirror | addons/hw_escpos/escpos/printer.py | 68 | 3777 | #!/usr/bin/python
'''
@author: Manuel F Martinez <manpaz@bashlinux.com>
@organization: Bashlinux
@copyright: Copyright (c) 2012 Bashlinux
@license: GPL
'''
import usb.core
import usb.util
import serial
import socket
from escpos import *
from constants import *
from exceptions import *
class Usb(Escpos):
""" Defi... | agpl-3.0 |
ibmibmibm/beets | beetsplug/importfeeds.py | 7 | 4507 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte.
#
# 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 ... | mit |
faush01/xbmc | lib/gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | gpl-2.0 |
SUSE/azure-sdk-for-python | azure-batch/azure/batch/models/batch_error_detail.py | 4 | 1061 | # 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 |
wilebeast/FireFox-OS | B2G/gecko/media/webrtc/trunk/build/android/pylib/apk_info.py | 12 | 5343 | # 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.
"""Gathers information about APKs."""
import collections
import os
import re
import cmd_helper
class ApkInfo(object):
"""Helper class for inspectin... | apache-2.0 |
dlazz/ansible | lib/ansible/plugins/test/mathstuff.py | 106 | 1561 | # (c) 2016, Ansible, 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 di... | gpl-3.0 |
kleskjr/scipy | scipy/io/arff/arffread.py | 25 | 19838 | #! /usr/bin/env python
# Last Change: Mon Aug 20 08:00 PM 2007 J
from __future__ import division, print_function, absolute_import
import re
import itertools
import datetime
from functools import partial
import numpy as np
from scipy._lib.six import next
"""A module to read arff files."""
__all__ = ['MetaData', 'lo... | bsd-3-clause |
ImageEngine/gaffer | doc/source/WorkingWithScenes/Camera/screengrab.py | 1 | 14698 | # BuildTarget: images/interfaceCameraVisualizer.png
import os
import subprocess32 as subprocess
import tempfile
import time
import imath
import IECore
import Gaffer
import GafferScene
import GafferUI
import GafferSceneUI
scriptWindow = GafferUI.ScriptWindow.acquire( script )
viewer = scriptWindow.getLayout().editors... | bsd-3-clause |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/raw/GL/SGIS/texture_select.py | 3 | 2252 | '''OpenGL extension SGIS.texture_select
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_SGIS_texture_select'
_DEPRECATED = False
GL_DUAL_ALPHA4... | mit |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/autograph/core/naming_test.py | 11 | 2899 | # 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 |
antepsis/anteplahmacun | sympy/stats/crv.py | 38 | 15024 | """
Continuous Random Variables Module
See Also
========
sympy.stats.crv_types
sympy.stats.rv
sympy.stats.frv
"""
from __future__ import print_function, division
from sympy.stats.rv import (RandomDomain, SingleDomain, ConditionalDomain,
ProductDomain, PSpace, SinglePSpace, random_symbols, ProductPSpace,
... | bsd-3-clause |
j0nathan33/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/la7.py | 41 | 1922 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
)
class LA7IE(InfoExtractor):
IE_NAME = 'la7.tv'
_VALID_URL = r'''(?x)
https?://(?:www\.)?la7\.tv/
(?:
richplayer/\?assetid=|
\?contentId=
... | gpl-3.0 |
jonmcoe/TextBlob | textblob/_text.py | 16 | 61510 | # -*- coding: utf-8 -*-
"""This file is adapted from the pattern library.
URL: http://www.clips.ua.ac.be/pages/pattern-web
Licence: BSD
"""
from __future__ import unicode_literals
import string
import codecs
from itertools import chain
import types
import os
import re
from xml.etree import cElementTree
from .compat i... | mit |
PlushBeaver/FanFicFare | fanficfare/writers/writer_mobi.py | 2 | 6615 | # -*- coding: utf-8 -*-
# Copyright 2011 Fanficdownloader team, 2015 FanFicFare team
#
# 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
#
# Un... | gpl-3.0 |
CSNoyes/kademlia | kademlia/tests/utils.py | 4 | 3368 | """
Utility functions for tests.
"""
import random
import hashlib
from struct import pack
from kademlia.node import Node
from kademlia.routing import RoutingTable
def mknode(id=None, ip=None, port=None, intid=None):
"""
Make a node. Created a random id if not specified.
"""
if intid is not None:
... | mit |
yxl/emscripten-calligra-mobile | 3rdparty/google-breakpad/src/testing/gtest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
eclipse-ease-addons/engines | jython/org.jython/Lib/locale.py | 94 | 89428 | """ Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for pass... | epl-1.0 |
kennethgillen/ansible | lib/ansible/utils/module_docs_fragments/infinibox.py | 210 | 1564 | #
# (c) 2016, Gregory Shulov <gregory.shulov@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) any l... | gpl-3.0 |
mccheung/kbengine | kbe/src/lib/python/Lib/html/__init__.py | 142 | 4756 | """
General functions for HTML manipulation.
"""
import re as _re
from html.entities import html5 as _html5
__all__ = ['escape', 'unescape']
def escape(s, quote=True):
"""
Replace special characters "&", "<" and ">" to HTML-safe sequences.
If the optional flag quote is true (the default), the quotation... | lgpl-3.0 |
darkleons/BE | addons/account/wizard/__init__.py | 362 | 2345 | # -*- 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 |
rrooij/youtube-dl | youtube_dl/extractor/konserthusetplay.py | 23 | 4505 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
url_or_none,
)
class KonserthusetPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:konserthusetplay|rspoplay)\.se/\?.*\bm=(?P<id>[^&... | unlicense |
fstagni/DIRAC | tests/Jenkins/dirac-test-job.py | 1 | 1855 | #!/usr/bin/env python
""" Submission of test jobs for use by Jenkins
"""
# pylint: disable=wrong-import-position,unused-wildcard-import,wildcard-import
import os.path
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()
from DIRAC import gLogger
from DIRAC.tests.Utilities.utils import find_all
f... | gpl-3.0 |
imxiaohui/django-todolist-1 | api/views.py | 1 | 1774 | from django.contrib.auth.models import User
from rest_framework import permissions, viewsets
from api.serializers import UserSerializer, TodoListSerializer, TodoSerializer
from lists.models import TodoList, Todo
class IsCreatorOrReadOnly(permissions.BasePermission):
"""
Object-level permission to only allow... | mit |
dharmabumstead/ansible | test/runner/lib/docker_util.py | 16 | 5429 | """Functions for accessing docker via the docker cli."""
from __future__ import absolute_import, print_function
import json
import os
import time
from lib.executor import (
SubprocessError,
)
from lib.util import (
ApplicationError,
run_command,
common_environment,
display,
)
from lib.config im... | gpl-3.0 |
chriskmanx/qmole | QMOLEDEV/node/tools/scons/scons-local-1.2.0/SCons/Tool/Perforce.py | 12 | 3544 | """SCons.Tool.Perforce.py
Tool-specific initialization for Perforce Source Code Management system.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, ... | gpl-3.0 |
sirech/deliver | deliver/converter/simple.py | 1 | 5674 | import email
import re
from cStringIO import StringIO
from email.charset import add_charset, Charset, QP
from email.generator import Generator
from email.header import decode_header, Header
from utils import to_unicode
# Globally replace base64 with quoted-printable
add_charset('utf-8', QP, QP, 'utf-8')... | mit |
alfred-huangjian/kubernetes | examples/cluster-dns/images/frontend/client.py | 468 | 1227 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
ravi-teja-mullapudi/Halide | apps/fig8-ingest.py | 1 | 2527 | #!/usr/bin/env python
from pandas import DataFrame
from ConfigParser import ConfigParser
from sqlalchemy import create_engine
import os.path
import math
import argparse, sys
def parse_runtime(run_str):
return run_str.split()[1]
def get_runtimes(fname):
lines = []
runtimes = {}
for line in fname:
... | mit |
BT-csanchez/l10n-switzerland | l10n_ch_zip/migrations/8.0.2.0.0/post-migration.py | 3 | 2344 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Mathias Neef
# Copyright 2015 copadoMEDIA UG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 |
petrutlucian94/nova | nova/tests/unit/scheduler/filters/test_pci_passthrough_filters.py | 41 | 3343 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
Eric89GXL/mne-python | mne/io/proc_history.py | 6 | 12108 | # -*- coding: utf-8 -*-
# Authors: Denis A. Engemann <denis.engemann@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# License: Simplified BSD
import numpy as np
from scipy.sparse import csc_matrix
from .open import read_tag, fiff_open
from .tree import dir_tree_find
from .write import (start_block, end_b... | bsd-3-clause |
gitaarik/django | tests/generic_views/test_base.py | 26 | 19863 | from __future__ import unicode_literals
import time
import unittest
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import require_jinja2
from django.urls import resolve
from d... | bsd-3-clause |
gbrammer/pygrism | marshall.py | 2 | 25277 | import os
import glob
import pyfits
import matplotlib.pyplot as plt
import threedhst
import unicorn
import threedhst.prep_flt_files
from threedhst.prep_flt_files import process_3dhst_pair as pair
def SN_MARSHALL():
####********************************************####
#### SN-MARSHALL (UDS)
##... | mit |
Vamshi99/coala-bears | tests/python/PyUnusedCodeBearTest.py | 19 | 1923 | from bears.python.PyUnusedCodeBear import PyUnusedCodeBear
from coalib.testing.LocalBearTestHelper import verify_local_bear
invalid_imports = """
import sys
import os
import mymodule
print("Hello World")
"""
valid_import = """
import sys
sys.exit()
"""
invalid_from_import = """
import sys
from os import name
sys.ex... | agpl-3.0 |
carlosdiazsuarez/movierecommender | MovieRecommender/recommender_algorithm/collaboratory_filtering_UserBased.py | 1 | 4798 | '''
Created on May 10, 2015
@author: Jaime
'''
from math import sqrt
import json
class collaboratory_filtering_UserBased(object):
'''
classdocs
'''
def __init__(self, ):
print
# Returns the Pearson correlation coefficient for p1 and p2
def sim_pearson(self, pre... | gpl-2.0 |
kajgan/stbgui | lib/python/Components/Renderer/Volume2Text.py | 6 | 1555 | #######################################################################
#
#
# Volume Text Renderer for Dreambox/Enigma-2
# Coded by Vali (c)2010
# Support: www.dreambox-tools.info
#
#
# This plugin is licensed under the Creative Commons
# Attribution-NonCommercial-ShareAlike 3.0 Unported License.
# To view... | gpl-2.0 |
opennode/nodeconductor-assembly-waldur | src/waldur_mastermind/marketplace/tests/test_orders.py | 1 | 22493 | from unittest import mock
from ddt import data, ddt
from rest_framework import status, test
from waldur_core.structure.models import CustomerRole
from waldur_core.structure.tests import factories as structure_factories
from waldur_core.structure.tests import fixtures
from waldur_mastermind.marketplace.tests.factories... | mit |
whummer/moto | tests/test_autoscaling/test_autoscaling.py | 1 | 49310 | from __future__ import unicode_literals
import boto
import boto3
import boto.ec2.autoscale
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.autoscale.group import AutoScalingGroup
from boto.ec2.autoscale import Tag
import boto.ec2.elb
import sure # noqa
from botocore.exceptions import Clie... | apache-2.0 |
NullSoldier/django | tests/admin_changelist/tests.py | 155 | 40267 | from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminS... | bsd-3-clause |
monkeysecurity/npyscreen | build/lib/npyscreen/fmFormMuttActive.py | 15 | 8938 | import weakref
import re
import curses
import collections
from . import fmFormMutt
from . import fmFormWithMenus
from . import npysNPSFilteredData
from . import wgtextbox
# This file defines Action Controllers
# and Widgets
# and Forms
#################################################################################... | bsd-2-clause |
TangXT/GreatCatMOOC | lms/djangoapps/staticbook/views.py | 5 | 4948 | """
Views for serving static textbooks.
"""
from django.contrib.auth.decorators import login_required
from django.http import Http404
from edxmako.shortcuts import render_to_response
from courseware.access import has_access
from courseware.courses import get_course_with_access
from notes.utils import notes_enabled_fo... | agpl-3.0 |
rhololkeolke/apo-website | src/flask/testsuite/deprecations.py | 57 | 1074 | # -*- coding: utf-8 -*-
"""
flask.testsuite.deprecations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests deprecation support.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import flask
import unittest
from flask.testsuite import... | bsd-3-clause |
borysf/SublimeGerrit | core/commands.py | 1 | 19936 | """
SublimeGerrit - full-featured Gerrit Code Review for Sublime Text
Copyright (C) 2015 Borys Forytarz <borys.forytarz@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 the Free Software Foundation; either version 2
of... | gpl-2.0 |
mdmdmdmdmd/plugin.video.youtube | resources/lib/youtube/helper/subtitles.py | 1 | 9058 | # -*- coding: utf-8 -*-
import xbmcvfs
import re
import HTMLParser
from resources.lib.kodion import simple_requests as requests
class Subtitles(object):
LANG_NONE = 0
LANG_ALL = 1
LANG_CURR = 2
LANG_CURR_EN = 3
LANG_EN = 4
LANG_PROMPT = 5
SUBTITLE_LIST_URL = 'http://www.youtube.com/api/ti... | gpl-2.0 |
tengyifei/grpc | tools/distrib/python/grpcio_tools/grpc/tools/protoc.py | 13 | 2137 | #!/usr/bin/env python
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
bsmedberg/socorro | socorro/cron/jobs/suspicious_crashes.py | 11 | 12782 | # 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/.
from __future__ import division
import datetime
from math import sqrt, log, pi, cos, sin, exp
from configman import Na... | mpl-2.0 |
magicrub/MissionPlanner | Lib/this.py | 70 | 1030 | s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygu... | gpl-3.0 |
cwisecarver/osf.io | framework/auth/oauth_scopes.py | 8 | 14280 | """
Define a set of scopes to be used by COS Internal OAuth implementation, specifically tailored to work with APIv2.
List of scopes, nomenclature, and rationale can be found in the relevant "Login as OSF- phase 2" proposal document
"""
from collections import namedtuple
from website import settings
# Public scopes... | apache-2.0 |
RoozbehFarhoodi/McNeuron | models_generate_parents.py | 1 | 26892 | """Collection of Keras models for hierarchical GANs."""
# Imports
from keras.layers.core import Dense, Reshape, RepeatVector, Lambda, Dropout
from keras.layers import Input, merge
from keras.models import Model
from keras.layers.wrappers import TimeDistributed
from keras.layers.recurrent import LSTM
from keras.layers.... | mit |
INM-6/Python-Module-of-the-Week | session01_Decorators/test_logger.py | 1 | 2330 | #!/usr/bin/env python3
import contextlib, io, sys
def test_we_can_import_module():
import logger
def test_decorator_exists():
import logger
logger.logger
def test_wrapped_function_is_callable():
import logger
@logger.logger
def f(): pass
assert callable(f)
def test_function_can_be_call... | mit |
sebrandon1/neutron | neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py | 4 | 19507 | # Copyright 2014 Mellanox Technologies, Ltd
#
# 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 |
SravanthiSinha/edx-platform | common/lib/xmodule/xmodule/modulestore/django.py | 17 | 10547 | """
Module that provides a connection to the ModuleStore specified in the django settings.
Passes settings.MODULESTORE as kwargs to MongoModuleStore
"""
from __future__ import absolute_import
from importlib import import_module
import logging
import re
from django.conf import settings
# This configuration must be ... | agpl-3.0 |
Nuevosmedios/django-generic-ratings | setup.py | 4 | 1467 | from distutils.core import setup
import os
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
data_files = []
for dirpath, dirnames, filenames in os.walk('ratings'):
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'): del dirnames[i]
if '__init__.py' in filenames:
... | mit |
ajayaa/keystone | keystone/identity/controllers.py | 2 | 14660 | # 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 or agreed to in... | apache-2.0 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/email/message.py | 235 | 30720 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Basic message object for the email package object model."""
__all__ = ['Message']
import re
import uu
import binascii
import warnings
from cStringIO import StringIO
# Intrapackage imports
import email.char... | gpl-2.0 |
laslabs/vertical-medical | sale_medical_prescription/wizards/medical_sale_wizard.py | 1 | 7112 | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
from collections import defaultdict
import logging
_logger = logging.getLogger(__name__)
class MedicalSaleWizard(models.TransientModel):
_name = 'medica... | agpl-3.0 |
wakiyamap/electrum-mona | electrum_mona/lnsweep.py | 3 | 26747 | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
from typing import Optional, Dict, List, Tuple, TYPE_CHECKING, NamedTuple, Callable
from enum import Enum, auto
from .util import bfh, bh... | mit |
sbreen94/Zeus_S4_r3 | build-all.py | 72 | 9398 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# ... | gpl-2.0 |
AndyHuu/flocker | flocker/node/test/test_docker.py | 6 | 17113 | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for :module:`flocker.node._docker`.
"""
from zope.interface.verify import verifyObject
from pyrsistent import pset, pvector
from docker.errors import APIError
from twisted.trial.unittest import TestCase
from twisted.python.filepath import FileP... | apache-2.0 |
brandond/ansible | lib/ansible/plugins/cliconf/dellos9.py | 16 | 3042 | #
# (c) 2017 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 |
ray-zhong/github_trend_spider | ENV/Lib/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1777 | 3764 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
hashworks/CouchPotatoServer | couchpotato/core/downloaders/pneumatic.py | 15 | 4439 | from __future__ import with_statement
import os
import traceback
from couchpotato.core._base.downloader.main import DownloaderBase
from couchpotato.core.helpers.encoding import sp
from couchpotato.core.logger import CPLog
log = CPLog(__name__)
autoload = 'Pneumatic'
class Pneumatic(DownloaderBase):
protocol ... | gpl-3.0 |
kerr-huang/SL4A | python-build/python-libs/gdata/src/atom/core.py | 137 | 20292 | #!/usr/bin/env python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
seocam/django | django/core/checks/messages.py | 104 | 2472 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.encoding import force_str, python_2_unicode_compatible
# Levels
DEBUG = 10
INFO = 20
WARNING = 30
ERROR = 40
CRITICAL = 50
@python_2_unicode_compatible
class CheckMessage(object):
def __init__(self, level, msg, hint=None, obj=Non... | bsd-3-clause |
kingvuplus/bh-s | lib/python/Plugins/SystemPlugins/VideoEnhancement/plugin.py | 42 | 16356 | from Plugins.Plugin import PluginDescriptor
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Screens.Screen import Screen
from S... | gpl-2.0 |
emc-openstack/storops | storops/vnx/resource/__init__.py | 1 | 7054 | # coding=utf-8
# Copyright (c) 2015 EMC Corporation.
# 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
#
#... | apache-2.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/numpy/core/tests/test_records.py | 19 | 6308 | from __future__ import division, absolute_import, print_function
from os import path
import numpy as np
from numpy.testing import *
from numpy.compat import asbytes, asunicode
import warnings
import collections
import pickle
class TestFromrecords(TestCase):
def test_fromrecords(self):
r = np.rec.fromrec... | gpl-3.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/py-storm/package.py | 5 | 1585 | ##############################################################################
# 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 |
betoesquivel/fil2014 | build/django/build/lib.linux-x86_64-2.7/django/contrib/gis/geoip/tests.py | 76 | 4765 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.geoip import HAS_GEOIP
from django.utils import unittest
from django.utils.unittest import skipUnless
from django.utils import six
if HAS_GEO... | mit |
namccart/gnuradio | grc/grc_gnuradio/blks2/packet.py | 26 | 10065 | # Copyright 2008,2009,2012-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later... | gpl-3.0 |
open-switch/ops-cli | ops-tests/component/test_vtysh_ct_bgp_redistribute.py | 1 | 4837 | # -*- coding: utf-8 -*-
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
#
# GNU Zebra is free software; you can rediTestribute 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... | gpl-2.0 |
xiaozhuchacha/OpenBottle | action_earley_srv/scripts/nltk/translate/bleu_score.py | 5 | 26268 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: BLEU Score
#
# Copyright (C) 2001-2017 NLTK Project
# Authors: Chin Yee Lee, Hengfeng Li, Ruxin Hou, Calvin Tanujaya Lim
# Contributors: Dmitrijs Milajevs, Liling Tan
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""BLEU score implementation.""... | mit |
patricmutwiri/pombola | pombola/core/models.py | 1 | 57338 | from __future__ import division
import datetime
from functools import partial
import re
import itertools
import random
from collections import defaultdict
from django.conf import settings
from django.core import exceptions
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.db im... | agpl-3.0 |
gully/Starfish | Starfish/single.py | 2 | 7567 | # Serial implementation for sampling a single chunk of a spectrum, namely one or two spectroscopic lines.
import multiprocessing as mp
import argparse
parser = argparse.ArgumentParser(prog="single.py", description="Run Starfish fitting model in parallel.")
parser.add_argument("-r", "--run_index", help="All data will ... | bsd-3-clause |
GaZ3ll3/numba | numba/typing/cmathdecl.py | 5 | 2272 | import cmath
from numba import types, utils
from numba.typing.templates import (AbstractTemplate, ConcreteTemplate,
signature, Registry, bound_function)
registry = Registry()
# TODO: support non-complex arguments (floats and ints)
@registry.resolves_global(cmath.acos)
@registry.r... | bsd-2-clause |
Luffin/powerline | powerline/lib/overrides.py | 33 | 1815 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import json
from powerline.lib.dict import REMOVE_THIS_KEY
def parse_value(s):
'''Convert string to Python object
Rules:
* Empty string means that corresponding key should be removed from the
... | mit |
vinegret/youtube-dl | youtube_dl/extractor/digg.py | 28 | 1882 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import js_to_json
class DiggIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?digg\.com/video/(?P<id>[^/?#&]+)'
_TESTS = [{
# JWPlatform via provider
'url': 'http://digg.com/video/sci-fi-short-jonah-dani... | unlicense |
todaychi/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/cell.py | 61 | 14259 | # file openpyxl/cell.py
# Copyright (c) 2010 openpyxl
#
# 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, m... | apache-2.0 |
mortcanty/earthengine | src/Crypto/Protocol/AllOrNothing.py | 125 | 11897 | #
# AllOrNothing.py : all-or-nothing package transformations
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew M. Kuchling and others
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... | mit |
b-long/ezbake-platform-services | security/services/ca/ezpersist/test/ezpersist/test_accu.py | 5 | 4391 | # Copyright (C) 2013-2014 Computer Sciences Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
sdague/home-assistant | tests/components/mqtt/test_switch.py | 7 | 14763 | """The tests for the MQTT switch platform."""
import copy
import json
import pytest
from homeassistant.components import switch
from homeassistant.const import ATTR_ASSUMED_STATE, STATE_OFF, STATE_ON
import homeassistant.core as ha
from homeassistant.setup import async_setup_component
from .test_common import (
... | apache-2.0 |
pshanks01/learn_python | google-python-exercises/logpuzzle/solution/logpuzzle.py | 210 | 3121 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import os
import re
import sys
import urllib
"""Logpuzzle exercise
Given an apache logfile, ... | gpl-3.0 |
CDLM-ESOF/esof-py | Chaveiro/chaveiro.py | 1 | 4440 | #! python3 (Windows)
import os, csv, pyperclip, random
def carregarCredenciais():
credenciais = {} #Dicionário
with open("credenciais.csv") as arq_csv:
leitor_csv = csv.reader(arq_csv)
for linha in leitor_csv:
if len(linha) == 2:
... | gpl-3.0 |
omaciel/robottelo | tests/robottelo/test_cli_method_calls.py | 4 | 4332 | import pytest
from robottelo.cli.org import Org
from robottelo.cli.proxy import Proxy
from robottelo.cli.repository import Repository
from robottelo.cli.subscription import Subscription
@pytest.mark.parametrize(
'command_sub',
[
'add-compute-resource',
'remove-compute-resource',
'add-c... | gpl-3.0 |
drpngx/tensorflow | tensorflow/python/saved_model/utils_impl.py | 19 | 3414 | # 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 |
chromium/chromium | tools/memory_inspector/memory_inspector/backends/android_backend_unittest.py | 54 | 7208 | # Copyright 2014 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.
"""Unittests for the android backends modules."""
import unittest
from memory_inspector.backends import adb_client
from memory_inspector.backends import an... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.