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 |
|---|---|---|---|---|---|
hehongliang/tensorflow | tensorflow/contrib/timeseries/examples/multivariate_test.py | 91 | 1330 | # 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 |
g19-hs/personfinder | app/unidecode/x04f.py | 252 | 4607 | data = (
'Zhong ', # 0x00
'Qi ', # 0x01
'Pei ', # 0x02
'Yu ', # 0x03
'Diao ', # 0x04
'Dun ', # 0x05
'Wen ', # 0x06
'Yi ', # 0x07
'Xin ', # 0x08
'Kang ', # 0x09
'Yi ', # 0x0a
'Ji ', # 0x0b
'Ai ', # 0x0c
'Wu ', # 0x0d
'Ji ', # 0x0e
'Fu ', # 0x0f
'Fa ', # 0x10
'Xiu ', ... | apache-2.0 |
mayankcu/Django-social | venv/Lib/encodings/iso8859_9.py | 593 | 13412 | """ Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | bsd-3-clause |
Brainiq7/Ananse | ananse_dl/extractor/franceinter.py | 139 | 1686 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class FranceInterIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.franceinter.fr/p... | unlicense |
cparawhore/ProyectoSubastas | site-packages/django/views/generic/list.py | 77 | 7223 | from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ImproperlyConfigured
from django.db.models.query import QuerySet
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import T... | mit |
Ali-aqrabawi/ezclinic | lib/django/contrib/gis/db/backends/spatialite/models.py | 510 | 2946 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
from django.db import connection, models
from django.db.backends.signals import connectio... | mit |
utkarsh-goswami/erpnext | erpnext/stock/doctype/delivery_note/delivery_note.py | 3 | 16249 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cint
from frappe import msgprint, _
import frappe.defaults
from frappe.model.mapper import get_mapped_doc
... | gpl-3.0 |
insop/sched-deadline2 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
massakam/pulsar | dashboard/django/stats/templatetags/stats_extras.py | 4 | 2075 | #
# 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... | apache-2.0 |
indictranstech/phr-frappe | frappe/website/doctype/web_form/web_form.py | 16 | 3187 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.website.website_generator import WebsiteGenerator
from frappe import _
from frappe.utils.file_manager import save_file, remov... | mit |
barnsnake351/nova | nova/tests/unit/scheduler/filters/test_exact_core_filter.py | 41 | 1954 | # 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 |
snnn/tensorflow | tensorflow/python/autograph/pyct/templates.py | 5 | 10477 | # 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 |
0ps/wfuzz | src/wfuzz/mixins.py | 1 | 1871 | from .plugin_api.urlutils import parse_url
from .exception import FuzzExceptBadInstall
# python 2 and 3
import sys
if sys.version_info >= (3, 0):
from urllib.parse import urljoin
else:
from urlparse import urljoin
class FuzzRequestSoupMixing(object):
def get_soup(self):
try:
from bs4 ... | gpl-2.0 |
adlnet-archive/edx-platform | common/djangoapps/lang_pref/tests/test_api.py | 42 | 1052 | # -*- coding: utf-8 -*-
""" Tests for the language API. """
from django.test import TestCase
import ddt
from lang_pref import api as language_api
@ddt.ddt
class LanguageApiTest(TestCase):
INVALID_LANGUAGE_CODES = ['', 'foo']
def test_released_languages(self):
released_languages = language_api.rele... | agpl-3.0 |
bigzz/autotest | client/shared/distro.py | 2 | 11636 | """
This module provides the client facilities to detect the Linux Distribution
it's running under.
This is a replacement for the get_os_vendor() function from the utils module.
"""
import os
import re
import platform
__all__ = ['LinuxDistro',
'UNKNOWN_DISTRO_NAME',
'UNKNOWN_DISTRO_VERSION',
... | gpl-2.0 |
Bago213/materia | qa/rpc-tests/getblocktemplate_proposals.py | 2 | 5726 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import MateriaTestFramework
from test_framework.util import *
from bi... | mit |
okwow123/djangol2 | example/env/lib/python2.7/site-packages/requests/packages/__init__.py | 838 | 1384 | '''
Debian and other distributions "unbundle" requests' vendored dependencies, and
rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
The problem with this is that not only requests itself imports those
dependencies, but third-party code outside of the distros' control too.
In reaction to t... | mit |
westinedu/similarinterest | django/core/management/commands/diffsettings.py | 411 | 1296 | from django.core.management.base import NoArgsCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"Converts a module namespace to a Python dictionary. Used by get_settings_diff."
return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)])
class Command(NoArgsComm... | bsd-3-clause |
madan96/sympy | sympy/core/exprtools.py | 9 | 49411 | """Tools for manipulating of large commutative expressions. """
from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.compatibility import iterable, is_sequence, SYMPY_INTS, range
from sympy.core.mul import Mul, _keep_coeff
from sympy.core.power import Pow
from sympy.core.basi... | bsd-3-clause |
wemanuel/smry | smry/oauth2client/crypt.py | 20 | 10913 | # -*- coding: utf-8 -*-
#
# Copyright 2014 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 requ... | apache-2.0 |
ovnicraft/edx-platform | openedx/core/lib/block_cache/tests/test_block_structure_factory.py | 33 | 4070 | """
Tests for block_structure_factory.py
"""
# pylint: disable=protected-access
from mock import patch
from unittest import TestCase
from ..block_structure_factory import BlockStructureFactory
from .test_utils import (
MockCache, MockModulestoreFactory, MockTransformer, ChildrenMapTestMixin
)
class TestBlockStru... | agpl-3.0 |
endlessm/chromium-browser | tools/swarming_client/third_party/oauth2client/_pycrypto_crypt.py | 6 | 4295 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | bsd-3-clause |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/test/test_optparse.py | 3 | 62704 | #
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
# test suite to this PyUnit-based version.
#
# $Id$
#
import sys
import os
import re
import copy
import unittest
from io import StringIO
from test import support
from optparse i... | gpl-2.0 |
nvoron23/socialite | jython/Lib/encodings/cp857.py | 593 | 34164 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.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_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
directorlive/oppia | core/domain/exp_domain_test.py | 2 | 41807 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
hakatashi/youtube-dl | youtube_dl/extractor/phoenix.py | 61 | 1506 | from __future__ import unicode_literals
from .dreisat import DreiSatIE
class PhoenixIE(DreiSatIE):
IE_NAME = 'phoenix.de'
_VALID_URL = r'''(?x)https?://(?:www\.)?phoenix\.de/content/
(?:
phoenix/die_sendungen/(?:[^/]+/)?
)?
(?P<id>[0-9]+)'''
_TESTS = [
{
... | unlicense |
google-research/google-research | summae/human_and_extractive.py | 1 | 8614 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
fivejjs/PTVS | Python/Product/PythonTools/Templates/Projects/WebRoleBottle/app.py | 36 | 1223 | """
This script runs the application using a development server.
It contains the definition of routes and views for the application.
"""
import os
import sys
from bottle import default_app, redirect, route, template
if '--debug' in sys.argv[1:] or 'SERVER_DEBUG' in os.environ:
# Debug mode will enable m... | apache-2.0 |
jpvanhal/cloudsizzle | cloudsizzle/asi/server.py | 1 | 11139 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2010 CloudSizzle Team
#
# 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,
#... | mit |
yaroslavvb/tensorflow | tensorflow/contrib/learn/python/learn/datasets/base_test.py | 136 | 3072 | # 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 |
vijeth-aradhya/coala-bears | bears/python/YapfBear.py | 5 | 7698 | from yapf.yapflib.yapf_api import FormatCode
from coalib.bearlib import deprecate_settings
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.bears.LocalBear import LocalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coala_utils.ContextManagers import pre... | agpl-3.0 |
dana-i2cat/felix | vt_manager/src/python/vt_manager/models/MacRange.py | 3 | 8197 | from django.db import models
from django.contrib import auth
from threading import Lock
import inspect
from vt_manager.utils.EthernetUtils import EthernetUtils
from vt_manager.utils.MutexStore import MutexStore
from vt_manager.models.MacSlot import MacSlot
'''
@author: msune
'''
class MacRange(models.Model):
f... | apache-2.0 |
fengyuanjs/catawampus | tr/vendor/tornado/tornado/test/httputil_test.py | 12 | 7089 | #!/usr/bin/env python
from __future__ import absolute_import, division, with_statement
from tornado.httputil import url_concat, parse_multipart_form_data, HTTPHeaders
from tornado.escape import utf8
from tornado.testing import LogTrapTestCase
from tornado.util import b
import logging
import unittest
class TestUrlCo... | apache-2.0 |
smallyear/linuxLearn | salt/salt/daemons/flo/__init__.py | 3 | 5034 | # -*- coding: utf-8 -*-
'''
Package for ioflo and raet based daemons and associated ioflo behaviors
To use set
opts['transport'] ='raet'
master minion config
transport: raet
See salt.config.py for relevant defaults
opts['raet_port']
opts['master_floscript']
opts['minion_floscript']
opts['ioflo_period']
opts['ioflo_r... | apache-2.0 |
diplomacy/research | diplomacy_research/__init__.py | 1 | 1696 | # ==============================================================================
# Copyright 2019 - Philip Paquette
#
# NOTICE: 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 rest... | mit |
georgid/SourceFilterContoursMelody | smstools/software/transformations_interface/harmonicTransformations_GUI_frame.py | 5 | 10584 | # GUI frame for the harmonicTransformations_function.py
from Tkinter import *
import tkFileDialog, tkMessageBox
import sys, os
import pygame
from scipy.io.wavfile import read
import numpy as np
import harmonicTransformations_function as hT
class HarmonicTransformations_frame:
def __init__(self, parent):
... | gpl-3.0 |
eezee-it/reporting-engine | report_custom_filename/__openerp__.py | 6 | 1566 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
rspavel/spack | var/spack/repos/builtin/packages/libjpeg-turbo/package.py | 4 | 3255 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class LibjpegTurbo(Package):
"""libjpeg-turbo is a fork of the original IJG libjpeg which uses S... | lgpl-2.1 |
leighpauls/k2cro4 | third_party/WebKit/Source/ThirdParty/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py | 151 | 1287 | #!/usr/bin/env python
# Copyright (c) 2009 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 inclusion of $HOME/.gyp/includes.gypi works properly with relocation
and with regeneration.
"""
import os
import TestGyp
# Re... | bsd-3-clause |
andrejcampa/compass | app/tests/autopilot/compass/__init__.py | 34 | 1068 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
"""Application autopilot helpers."""
import logging
import ubuntuuitoolkit
logger = logging.getLogger(__name__)
class AppException(ubuntuuitoolkit.ToolkitException):
"""Exception raised when there are problems with the Application."""
... | gpl-3.0 |
anirudhSK/chromium | tools/telemetry/telemetry/core/browser_unittest.py | 3 | 6035 | # 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 logging
import unittest
from telemetry import test
from telemetry.core import browser_finder
from telemetry.core import gpu_device
from telemetry... | bsd-3-clause |
ptoraskar/django | tests/template_tests/filter_tests/test_make_list.py | 345 | 1611 | from django.template.defaultfilters import make_list
from django.test import SimpleTestCase
from django.test.utils import str_prefix
from django.utils.safestring import mark_safe
from ..utils import setup
class MakeListTests(SimpleTestCase):
"""
The make_list filter can destroy existing escaping, so the resu... | bsd-3-clause |
entomb/CouchPotatoServer | libs/suds/xsd/sxbase.py | 193 | 19777 | # 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 ... | gpl-3.0 |
MiczFlor/Booktype | lib/booktype/constants.py | 1 | 22740 | # This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | agpl-3.0 |
saumishr/django | django/contrib/comments/forms.py | 92 | 8086 | import time
from django import forms
from django.forms.util import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.comments.models import Comment
from django.utils.crypto import salted_hmac, constant_time_compare
from django.utils.encoding import... | bsd-3-clause |
Senseg/Py4A | python-modules/twisted/twisted/test/test_lockfile.py | 60 | 15409 | # Copyright (c) 2005 Divmod, Inc.
# Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.lockfile}.
"""
import os, errno
from twisted.trial import unittest
from twisted.python import lockfile
from twisted.python.runtime import platform
skipKill = None
if platform... | apache-2.0 |
onethirtyfive/skadi | skadi/protoc/dota_usermessages_pb2.py | 2 | 178517 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dota_usermessages.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | mit |
hickford/youtube-dl | youtube_dl/extractor/rtlnl.py | 102 | 5637 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
)
class RtlNlIE(InfoExtractor):
IE_NAME = 'rtl.nl'
IE_DESC = 'rtl.nl and rtlxl.nl'
_VALID_URL = r'''(?x)
https?://(?:www\.)?
(?:
... | unlicense |
slagle/ansible-modules-extras | windows/win_dotnet_ngen.py | 138 | 1769 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Peter Mounce <public@neverrunwithscissors.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... | gpl-3.0 |
arnaud-morvan/QGIS | python/plugins/processing/algs/qgis/RandomSelection.py | 8 | 4391 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RandomSelection.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | gpl-2.0 |
tootedom/moto | moto/ec2/responses/network_acls.py | 7 | 6341 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.utils import filters_from_querystring, \
network_acl_ids_from_querystring
class NetworkACLs(BaseResponse):
def create_network_acl(self):
vpc_id = self.querystring.get('VpcId')[0]
network_acl = s... | apache-2.0 |
mengli/MachineLearning | self_driving/segnet/train.py | 2 | 4996 | """Train SegNet with camvid dataset.
nohup python -u -m self_driving.segnet.train > self_driving/segnet/output.txt 2>&1 &
"""
import os
import tensorflow as tf
from utils import camvid
import segnet_vgg
LOG_DIR = 'save'
EPOCH = 6000
BATCH_SIZE = 4
IMAGE_HEIGHT = 720
IMAGE_WIDTH = 960
IMAGE_CHANNEL = 3
NUM_CLASSES =... | apache-2.0 |
trondhindenes/ansible | test/integration/targets/inventory_plugin_config/test_inventory.py | 92 | 1318 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: test_inventory
plugin_type: inventory
authors:
- Pierre-Louis Bonicoli (@pilou-)
short_description: test inventory
description:
- test inventory (fetch parameters using c... | gpl-3.0 |
pepitogithub/PythonScripts | musica/drumExFachade.py | 1 | 2964 | # import pygame
import threading
import drumExMachina
class Fasade:
"""
Matrix
-> reproducir()
-> pausar()
-> salir()
-> volumen-general()
-> tempo()
-> figura()
-> agregar-pista()
-> quitar-pi... | gpl-2.0 |
jeffery9/mixprint_addons | ineco_jasper_report/__openerp__.py | 1 | 1946 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 INECO PARTNERSHIP LIMITED (http://openerp.tititab.com)
# All Right Reserved
#
# Author : Tititab Srisookco (thitithup@gmail.com)
#
# WARNING: This program as such is intended to be used by profe... | agpl-3.0 |
souravbadami/zulip | zilencer/management/commands/compare_messages.py | 37 | 1381 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from six.moves import zip
import ijson
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
help = """
Render messages to a file.
Usage: ./manage.py render_messa... | apache-2.0 |
yjmade/odoo | addons/l10n_ae/__init__.py | 669 | 1059 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
adelina-t/nova | nova/db/sqlalchemy/migrate_repo/versions/233_add_stats_in_compute_nodes.py | 81 | 1460 | # Copyright (c) 2014 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 |
mderomph-coolblue/dd-agent | tests/checks/mock/test_hdfs_namenode.py | 16 | 3402 | # Project
from tests.checks.common import AgentCheckTest, Fixtures
# 3rd Party
import mock
import json
# Namenode URI
NAMENODE_JMX_URI = 'http://localhost:50070/jmx'
# Namesystem state URL
NAME_SYSTEM_STATE_URL = NAMENODE_JMX_URI + '?qry=Hadoop:service=NameNode,name=FSNamesystemState'
# Namesystem url
NAME_SYSTEM_U... | bsd-3-clause |
gnowxilef/youtube-dl | youtube_dl/extractor/nobelprize.py | 68 | 2123 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
js_to_json,
mimetype2ext,
determine_ext,
update_url_query,
get_element_by_attribute,
int_or_none,
)
class NobelPrizeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?nobelpri... | unlicense |
rlr/kitsune | kitsune/users/migrations/0001_initial.py | 18 | 37466 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import kitsune.search.models
import kitsune.sumo.models
import timezones.fields
from django.conf import settings
import django.core.validators
class Migration(migrations.Migration):
dependenc... | bsd-3-clause |
stvstnfrd/edx-platform | lms/djangoapps/courseware/views/views.py | 1 | 89915 | """
Courseware views functions
"""
import json
import logging
from collections import OrderedDict, namedtuple
from datetime import datetime
import bleach
import requests
import six
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import Anonym... | agpl-3.0 |
defionscode/ansible | lib/ansible/module_utils/facts/compat.py | 147 | 4115 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
CasataliaLabs/biscuit_drishtiman | v4l_capture_example.py | 1 | 1279 | import Image
import select
import v4l2capture
import numpy
import pylab
import time
# Open the video device.
#~ video = v4l2capture.Video_device("/dev/video0")
video = v4l2capture.Video_device("http://admin:@192.168.1.105/snapshot.cgi?.mjpeg")
# Suggest an image size to the device. The device may choose and
# return ... | gpl-3.0 |
zhaobj/MyHadoop | src/contrib/hod/testing/lib.py | 182 | 3458 | #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 use thi... | apache-2.0 |
vipod/pyzimbra | pyzimbra/soap_auth.py | 2 | 6473 | # -*- coding: utf-8 -*-
"""
################################################################################
# Copyright (c) 2010, Ilgar Mashayev
#
# E-mail: pyzimbra@lab.az
# Website: http://github.com/ilgarm/pyzimbra
################################################################################
# This file is part ... | lgpl-3.0 |
sarvex/tensorflow | tensorflow/python/keras/layers/noise_test.py | 6 | 2995 | # 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 |
supamii/QttpServer | lib/gmock/gtest/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/test/test_applesingle.py | 136 | 1810 | # Copyright (C) 2003 Python Software Foundation
import unittest
import os
from test import test_support
import struct
MacOS = test_support.import_module('MacOS')
# The following should exist if MacOS does.
import applesingle
AS_MAGIC=0x00051600
AS_VERSION=0x00020000
dataforkdata = 'hello\r\0world\n'
resourceforkdata... | gpl-2.0 |
sounay/flaminggo-test | onadata/apps/logger/migrations/0020_auto__chg_field_instance_uuid.py | 13 | 8321 | # 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):
# Changing field 'Instance.uuid'
db.alter_column('odk_logger_instance', 'uuid', self.gf('django.db.models.... | bsd-2-clause |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pip-7.1.0/pip/_vendor/requests/packages/urllib3/response.py | 478 | 16459 | try:
import http.client as httplib
except ImportError:
import httplib
import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
)
from .packages.six import string_type... | mit |
cysnake4713/odoo | addons/account/__openerp__.py | 33 | 7683 | # -*- 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 |
alistairlow/tensorflow | tensorflow/python/ops/distributions/transformed_distribution.py | 8 | 26280 | # 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 |
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8 | lib/python2.7/test/test_select.py | 84 | 2163 | from test import test_support
import unittest
import select
import os
import sys
@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
... | gpl-2.0 |
kevinlondon/youtube-dl | youtube_dl/extractor/motorsport.py | 129 | 1797 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
class MotorsportIE(InfoExtractor):
IE_DESC = 'motorsport.com'
_VALID_URL = r'http://www\.motorsport\.com/[^/?#]+/video/(?:[^/?#]+/)(?P<id>[^/]+)/?(?:$|[?#])'
_TEST = {
... | unlicense |
rspavel/spack | var/spack/repos/builtin/packages/branson/package.py | 3 | 1683 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Branson(CMakePackage):
"""Branson's purpose is to study different algorithms for parallel ... | lgpl-2.1 |
MiltosD/CEF-ELRC | metashare/repository/editor/editorutils.py | 3 | 2218 | '''
A number of utility functions and classes which do not easily fit into a single
place.
To avoid circular imports, this file must not import anything from
metashare.repository.editor.
'''
from django.db import models
from django.contrib.admin.views.main import ChangeList
from django.core.urlresolvers import revers... | bsd-3-clause |
therealjumbo/python_summer | py31eg/print_unicode_ans.py | 2 | 1561 | #!/usr/bin/env python3
# Copyright (c) 2008-11 Qtrac Ltd. All rights reserved.
# This program or module 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 |
gcw/pycon2014-web2py-tutorial | applications/lemessage/routes.example.py | 105 | 1470 | # -*- coding: utf-8 -*-
# This is an app-specific example router
#
# This simple router is used for setting languages from app/languages directory
# as a part of the application path: app/<lang>/controller/function
# Language from default.py or 'en' (if the file is not found) is used as
# a default_language
#
# ... | bsd-2-clause |
astrofrog/ginga | ginga/gtkw/FileSelection.py | 5 | 1784 | #
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import gtk
# TODO: this code should be shared with integgui and maybe others
class FileSelection(object):
# Get the selected filename
def f... | bsd-3-clause |
danielrh/losslessh264 | build/mktargets.py | 75 | 6693 | #!/usr/bin/python
import sys
import argparse
import os
parser = argparse.ArgumentParser(description="Make helper parser")
parser.add_argument("--directory", dest="directory", required=True)
parser.add_argument("--library", dest="library", help="Make a library")
parser.add_argument("--binary", dest="binary", help="Make... | bsd-2-clause |
pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/flask/cli.py | 45 | 18091 | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock, Thread
from functools import update_wrapper
import click
... | mit |
beeftornado/sentry | src/sentry/api/endpoints/group_events.py | 1 | 5127 | from __future__ import absolute_import
import six
from datetime import timedelta
from django.utils import timezone
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from functools import partial
from sentry import eventstore
from sentry.api.base import EnvironmentMixin
fr... | bsd-3-clause |
baris/fullerite | src/diamond/collectors/xen_collector/test/testxen.py | 29 | 2970 | #!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import Mock
from mock import patch
from diamond.collector import Colle... | apache-2.0 |
vygr/Python-PCB | pcb.py | 1 | 3869 | #!/opt/local/bin/pypy -tt
# -*- coding: utf-8 -*-
#Copyright (C) 2014 Chris Hinsley All Rights Reserved
import sys, argparse, router
from copy import deepcopy
from ast import literal_eval
from mymath import *
def main():
parser = argparse.ArgumentParser(description = 'Pcb layout optimizer.', formatter_class = argpa... | gpl-2.0 |
abomyi/django | tests/utils_tests/test_termcolors.py | 337 | 6461 | import unittest
from django.utils.termcolors import (
DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES,
colorize, parse_color_setting,
)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE... | bsd-3-clause |
CanalTP/kirin | tests/integration/piv_worker_test.py | 1 | 6425 | # coding: utf8
#
# Copyright (c) 2020, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and op... | agpl-3.0 |
dirkrombauts/gherkin3 | python/gherkin/errors.py | 19 | 1996 | class ParserError(Exception):
pass
class ParserException(ParserError):
def __init__(self, message, location):
self.location = location
super(ParserException, self).__init__('(' + str(location['line']) + ':' +
str(location['column'] if 'column' in
... | mit |
dxwu/BinderFilter | resources/android-toolchain-16/lib/python2.7/test/test_compare.py | 194 | 1488 | import unittest
from test import test_support
class Empty:
def __repr__(self):
return '<Empty>'
class Coerce:
def __init__(self, arg):
self.arg = arg
def __repr__(self):
return '<Coerce %s>' % self.arg
def __coerce__(self, other):
if isinstance(other, Coerce):
... | mit |
salguarnieri/intellij-community | python/lib/Lib/site-packages/django/shortcuts/__init__.py | 71 | 4248 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
from django.template import loader, RequestContext
from django.http import HttpResponse, Http404
from django.http import HttpRespon... | apache-2.0 |
mountain213/neo4jworkshop | REST_clients/Python_client/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## 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 |
notnownikki/quatloo | quatloo/qanda/tests.py | 1 | 7688 | from django.test import TestCase, SimpleTestCase
from qanda.parser import parse_qa, ParserError
from qanda.models import Question, Answer
from qanda.factory import get_question, get_answer
class QAParserTestCase(SimpleTestCase):
def test_extract_question_and_url(self):
qa = 'How do I do the thing? http://... | gpl-3.0 |
googleads/google-ads-python | google/ads/googleads/v7/services/services/customer_client_link_service/transports/__init__.py | 2 | 1093 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
AntonelliLab/seqcap_processor | bin/aTRAM-master/atram.py | 1 | 8421 | #!/usr/bin/env python3
"""
Start atram.
This wrapper module parses the input arguments and passes them to the module
that does the actual processing (core_atram.py).
"""
import os
import argparse
import textwrap
import lib.db as db
import lib.log as log
import lib.bio as bio
import lib.util as util
import lib.blast a... | mit |
jctanner/ansible | hacking/backport/backport_of_line_adder.py | 40 | 9977 | #!/usr/bin/env python
# (c) 2020, Red Hat, Inc. <relrod@redhat.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 o... | gpl-3.0 |
argivaitv/argivaitv | repo/plugin.video.phstreams/resources/lib/sources/xmovies_mv_tv.py | 7 | 6858 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-2.0 |
AmericanResearchInstitute/poweru-server | pr_services/user_system/organization_email_domain_manager.py | 1 | 1902 | """
OrgEmailDomain manager class
@author Chris Church <cchurch@americanri.com>
@copyright Copyright 2011 American Research Institute, Inc.
"""
from pr_services.object_manager import ObjectManager
from pr_services.rpc.service import service_method
import facade
class OrgEmailDomainManager(ObjectManager):
"""
... | bsd-3-clause |
ldirer/scikit-learn | doc/sphinxext/sphinx_issues.py | 44 | 4076 | # -*- coding: utf-8 -*-
"""A Sphinx extension for linking to your project's issue tracker.
Copyright 2014 Steven Loria
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, includi... | bsd-3-clause |
davidt/reviewboard | reviewboard/reviews/detail.py | 2 | 27814 | """Definitions for the review request detail view."""
from __future__ import unicode_literals
from collections import Counter, defaultdict
from datetime import datetime
from django.db.models import Q
from django.template.loader import render_to_string
from django.utils import six
from django.utils.timezone import ut... | mit |
tornadozou/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/distribution_util_test.py | 9 | 13289 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.