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 |
|---|---|---|---|---|---|
ZhangXinNan/tensorflow | tensorflow/python/training/monitored_session.py | 11 | 48948 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
camilonova/django | tests/multiple_database/models.py | 70 | 2216 | from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Review(models.Model):
source = models.CharField(max_length=100)
content_type = mo... | bsd-3-clause |
aman-tugnawat/namebench | nb_third_party/graphy/backends/google_chart_api/encoders.py | 230 | 14800 | #!/usr/bin/python2.4
#
# Copyright 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 applicable law o... | apache-2.0 |
fentas/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py | 122 | 4889 | # Copyright (C) 2011 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 conditions and the f... | bsd-3-clause |
dsolimando/Hot | hot-jython-modules/src/main/resources/sgmllib.py | 94 | 17772 | """A parser for SGML, using the derived class as a static DTD."""
# XXX This only supports those SGML features used by HTML.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are ... | gpl-3.0 |
apanda/modeling | mcnet/components/aclfirewall.py | 1 | 2245 | from . import NetworkObject
import z3
class AclFirewall (NetworkObject):
def _init(self, node, network, context):
super(AclFirewall, self).init_fail(node)
self.fw = node.z3Node
self.ctx = context
self.constraints = list ()
self.acls = list ()
network.SaneSend (self)
... | bsd-3-clause |
Endika/l10n-spain | payment_redsys/controllers/main.py | 8 | 2358 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
from openerp.addons.website_sale.controllers.main import website_sale
_logger = logging.getLogger(__name__)
class RedsysController(http.Controller):
_return_url = '/paymen... | agpl-3.0 |
marcoapintoo/pypro | 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
#################################################################################... | mit |
mynew1/mangos-classic | contrib/convertConditions/ConvertConditions.py | 91 | 13340 | #
# This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) ... | gpl-2.0 |
ISIFoundation/influenzanet-website | apps/survey/migrations/0010_auto__del_extraresponse.py | 4 | 12336 | # 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):
if raw_input("""Do you want to remove the table for survey.ExtraResponse?
This was at some point added for the British sit... | agpl-3.0 |
grimmjow8/ansible | lib/ansible/modules/storage/zfs/zpool_facts.py | 22 | 6675 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam ล tevko <adam.stevko@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 L... | gpl-3.0 |
haad/ansible | lib/ansible/module_utils/facts/network/openbsd.py | 232 | 1600 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
Cl3Kener/UBER-L | scripts/build-all.py | 305 | 10150 | #! /usr/bin/env python
# Copyright (c) 2009-2013, 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 |
jordan8037310/CouchPotatoServer | libs/subliminal/services/subscenter.py | 43 | 4387 | # -*- coding: utf-8 -*-
# Copyright 2012 Ofir Brukner <ofirbrukner@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of the ... | gpl-3.0 |
ARPASMR/IRIS_lombardia | html/OpenLayers-2.13.1/tests/selenium/remotecontrol/test_ol.py | 254 | 2873 | from selenium import selenium
import time
import sys
from ConfigParser import ConfigParser
MAX_TEST_LENGTH = 300
if len(sys.argv) > 2:
filename = sys.argv[2]
else:
filename = "config.cfg"
c = ConfigParser()
c.read(filename)
targets = {}
server = c.get('config', 'server')
url= c.get('config', 'url')
if c.h... | gpl-3.0 |
remitamine/youtube-dl | youtube_dl/extractor/frontendmasters.py | 14 | 8807 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
parse_duration,
url_or_none,
urlencode_postdata,
)
class FrontendMastersBaseIE(InfoExtractor):
_... | unlicense |
rhiever/bokeh | bokeh/server/settings.py | 25 | 3038 | from __future__ import absolute_import
from os.path import dirname, join
import uuid
import imp
import zmq
from ..settings import settings as bokeh_settings
default_blaze_config = join(dirname(__file__), 'blaze', 'config.py')
_defaults = dict(
ip="0.0.0.0",
port=5006,
url_prefix="",
multi_user=Fals... | bsd-3-clause |
x303597316/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_termcolors.py | 60 | 7696 | from django.utils import unittest
from django.utils.termcolors import (parse_color_setting, PALETTES,
DEFAULT_PALETTE, LIGHT_PALETTE, DARK_PALETTE, NOCOLOR_PALETTE, colorize)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAU... | apache-2.0 |
abiggerhammer/hammer | src/bindings/python/setup.py | 7 | 1281 | #!/usr/bin/env python
"""
setup.py for Hammer bindings
"""
import os, os.path, sys
from distutils.core import setup, Extension
invoked = os.getcwd()
if (os.path.dirname(sys.argv[0]) != ''):
os.chdir(os.path.dirname(sys.argv[0]))
setup(name="hammer",
version="0.9.0",
author="Upstanding Hackers, LLC",
... | gpl-2.0 |
micropython/micropython | tests/perf_bench/bm_chaos.py | 15 | 9247 | # Source: https://github.com/python/pyperformance
# License: MIT
# create chaosgame-like fractals
# Copyright (C) 2005 Carl Friedrich Bolz
import math
import random
class GVector(object):
def __init__(self, x=0, y=0, z=0):
self.x = x
self.y = y
self.z = z
def Mag(self):
retu... | mit |
sestrella/ansible | lib/ansible/modules/windows/win_webpicmd.py | 52 | 1398 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Mounce <public@neverrunwithscissors.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA ... | gpl-3.0 |
joseluisfdezbueno/proyecto_py | spyder_osl/spyder_osl/settings.py | 2 | 3020 | # -*- coding: utf-8 -*-
# Scrapy settings for spyder_osl project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/lat... | gpl-2.0 |
cxmo/project-beta | code/dataprep_script.py | 4 | 1758 |
""" The following script will apply a 3mm Gaussian filter on all the data spatially
and will save each smoothed run into the data folder as 'smoothed_run_i', where
0 <= i <= 7 is the index of the run.
"""
#Import libraries
import numpy as np
import scipy
import scipy.ndimage
from scipy.ndimage.filters import gauss... | bsd-3-clause |
utarsuno/urbtek | code_manager/miscellaneous_scripts/formatting.py | 1 | 2795 | # coding=utf-8
"""
This module, formatting.py, is just utility functions to format source code text.
"""
# This is needed for the custom compiler.
KEYWORDS = []
def sort_by_deliminator(deliminator, code_text, lines_to_ignore=None):
"""This method will take a chunk of code and format it so that it is sorted by colu... | apache-2.0 |
egoid/baytree | lib/python2.7/site-packages/django/core/signing.py | 115 | 7060 | """
Functions for creating and restoring url-safe signed JSON objects.
The format used looks like this:
>>> signing.dumps("hello")
'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'
There are two components here, separated by a ':'. The first component is a
URLsafe base64 encoded JSON of the object passed to dumps(). T... | mit |
Buggaarde/youtube-dl | youtube_dl/extractor/srf.py | 102 | 4254 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
parse_iso8601,
xpath_text,
)
class SrfIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.srf\.ch/play(?:er)?/tv/[^/]+/video/(?P<display_id>[^?]+)\?id=|tp\.srgssr\.c... | unlicense |
morphis/home-assistant | homeassistant/util/logging.py | 14 | 3216 | """Logging utilities."""
import asyncio
import logging
import threading
from .async import run_coroutine_threadsafe
class HideSensitiveDataFilter(logging.Filter):
"""Filter API password calls."""
def __init__(self, text):
"""Initialize sensitive data filter."""
super().__init__()
sel... | apache-2.0 |
extremewaysback/django | django/core/cache/backends/memcached.py | 320 | 6970 | "Memcached cache backend"
import pickle
import time
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils import six
from django.utils.encoding import force_str
from django.utils.functional import cached_property
class BaseMemcachedCache(BaseCache):
def __init__(self, server, ... | bsd-3-clause |
mahim97/zulip | zerver/management/commands/convert_bot_to_outgoing_webhook.py | 3 | 2259 |
from argparse import ArgumentParser
from typing import Any
from zerver.lib.management import ZulipBaseCommand
from zerver.models import Service, UserProfile
class Command(ZulipBaseCommand):
help = """Given an existing bot, converts it into an outgoing webhook bot."""
def add_arguments(self, parser: Argument... | apache-2.0 |
Elbagoury/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py | 384 | 3903 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
cainmatt/django | tests/template_backends/test_utils.py | 351 | 1521 | from django.core.exceptions import ImproperlyConfigured
from django.template import engines
from django.test import SimpleTestCase, override_settings
class TemplateStringsTests(SimpleTestCase):
@override_settings(TEMPLATES=[{
'BACKEND': 'raise.import.error',
}])
def test_backend_import_error(self... | bsd-3-clause |
motion2015/edx-platform | openedx/core/djangoapps/user_api/views.py | 31 | 32766 | """HTTP end-points for the User API. """
import copy
from opaque_keys import InvalidKeyError
from django.conf import settings
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured, NON_FIELD_E... | agpl-3.0 |
jorik041/Responder | tools/DHCP.py | 10 | 13833 | #!/usr/bin/env python
# This file is part of Responder
# Original work by Laurent Gaffie - Trustwave Holdings
#
# 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, o... | gpl-3.0 |
nicklhy/mxnet | example/speech-demo/io_func/utils.py | 25 | 5707 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
nicklhy/mxnet | example/rcnn/test.py | 41 | 2878 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
liorvh/Veil-Evasion | modules/payloads/cs/shellcode_inject/virtual.py | 12 | 3235 | """
C# inline shellcode injector using the VirtualAlloc()/CreateThread() pattern.
Uses basic variable renaming obfuscation.
Adapated from code from:
http://webstersprodigy.net/2012/08/31/av-evading-meterpreter-shell-from-a-net-service/
Module built by @harmj0y
"""
from modules.common import shellcode
from modu... | gpl-3.0 |
ajaali/django | django/contrib/admin/templatetags/log.py | 499 | 2080 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | bsd-3-clause |
minhphung171093/GreenERP_V8 | openerp/addons/payment_sips/controllers/main.py | 153 | 1864 | # -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
import logging
import werkzeug
from openerp import http
from openerp.http import request
_logger = logging.getLogger(__name__)
class SipsController(http.Controller):
_notify_url = '/payment/sips/ipn/'
_return_url... | agpl-3.0 |
pombredanne/teamwork | w2/static/Brython2.0.0-20140209-164925/Lib/xml/etree/ElementPath.py | 785 | 9477 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... | gpl-2.0 |
ychen820/microblog | flask/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/__init__.py | 79 | 1171 | # mysql/__init__.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
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql... | bsd-3-clause |
sshnaidm/ru | script.module.xbmcswift2/lib/xbmcswift2/logger.py | 34 | 2979 | '''
xbmcswift2.log
--------------
This module contains the xbmcswift2 logger as well as a convenience
method for creating new loggers.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
'''
import logging
from xbmcswift2 import CLI_MODE
# TODO: Add logging... | gpl-2.0 |
dmlc/tvm | tests/python/contrib/test_ethosn/test_constant_duplication.py | 2 | 2958 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
DarioGT/Zim-QDA | zim/plugins/spell.py | 1 | 4224 | # -*- coding: utf-8 -*-
# Copyright 2008 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''Spell check plugin based on gtkspell'''
import os
import gobject
from zim.config import get_environ
from zim.plugins import PluginClass
from zim.gui.widgets import ErrorDialog
from zim.signals import SIGNAL_AFTER
try:
imp... | gpl-2.0 |
Donkyhotay/MoonPy | twisted/internet/abstract.py | 12 | 13571 | # -*- test-case-name: twisted.test.test_abstract -*-
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for generic select()able objects.
Maintainer: Itamar Shtull-Trauring
"""
from zope.interface import implements
# Twisted Imports
from twisted.python import log, reflect... | gpl-3.0 |
dablak/boto | tests/integration/ec2/cloudwatch/test_connection.py | 22 | 11787 | # Copyright (c) 2010 Hunter Blanks http://artifex.org/~hblanks/
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation th... | mit |
luiseduardohdbackup/odoo | openerp/addons/base/module/wizard/base_import_language.py | 337 | 2644 | # -*- 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 |
ow2-compatibleone/accords-platform | pyaccords/amazonEc2Interface.py | 1 | 2282 | ##############################################################################
#copyright 2012, Hamid MEDJAHED & Elyes ZEKRI (hmedjahed@prologue.fr) #
# Prologue #
#Licensed under the Apache License, Version 2.0 (the "License"); #
#yo... | apache-2.0 |
Piasy/proxy-searcher | site-packages/django/templatetags/i18n.py | 80 | 16514 | from __future__ import with_statement
import re
from django.template import (Node, Variable, TemplateSyntaxError,
TokenParser, Library, TOKEN_TEXT, TOKEN_VAR)
from django.template.base import _render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import translation
regist... | mit |
abspoel/YouCompleteMe | third_party/pythonfutures/concurrent/futures/_base.py | 89 | 19642 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
from __future__ import with_statement
import logging
import threading
import time
try:
from collections import namedtuple
except ImportError:
from concurrent.futures._compat import namedtuple
__author__ = 'B... | gpl-3.0 |
jarvys/django-1.7-jdb | django/contrib/sessions/backends/file.py | 113 | 7663 | import datetime
import errno
import logging
import os
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError, VALID_KEY_CHARS
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.utils import timezone... | bsd-3-clause |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/rest_framework/urlpatterns.py | 18 | 2407 | from __future__ import unicode_literals
from django.conf.urls import url
from rest_framework.compat import RegexURLResolver, include
from rest_framework.settings import api_settings
def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
ret = []
for urlpattern in urlpatterns:
if is... | mit |
exploreodoo/datStruct | odoo/addons/stock/wizard/__init__.py | 323 | 1149 | # -*- 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... | gpl-2.0 |
loongson-community/EFI-MIPS | ToolKit/cmds/python/Lib/test/skipped/test_popen.py | 24 | 1397 | #! /usr/bin/env python
"""Basic tests for os.popen()
Particularly useful for platforms that fake popen.
"""
import os
import sys
from test.test_support import TestSkipped
from os import popen
# Test that command-lines get down as we expect.
# To do this we execute:
# python -c "import sys;print sys.argv" {rest_... | bsd-3-clause |
bubichain/blockchain | src/3rd/src/jsoncpp/scons-2.1.0/engine/SCons/Scanner/Dir.py | 21 | 3810 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# 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
# with... | apache-2.0 |
zimmermegan/smarda | nltk-3.0.3/nltk/parse/transitionparser.py | 5 | 31354 | # Natural Language Toolkit: Arc-Standard and Arc-eager Transition Based Parsers
#
# Author: Long Duong <longdt219@gmail.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import absolute_import
from __future__ import division
from __future... | mit |
zsjohny/jumpserver | apps/terminal/backends/command/models.py | 1 | 1763 | # -*- coding: utf-8 -*-
#
import uuid
from django.db import models
from django.utils.translation import ugettext_lazy as _
from orgs.mixins.models import OrgModelMixin
class AbstractSessionCommand(OrgModelMixin):
RISK_LEVEL_ORDINARY = 0
RISK_LEVEL_DANGEROUS = 5
RISK_LEVEL_CHOICES = (
(RISK_LEVEL_... | gpl-2.0 |
FFroehlich/AMICI | python/amici/setuptools.py | 1 | 9201 | """
setuptools
----------
Helper functions for AMICI core and module package preparation
"""
import os
import sys
import shlex
import subprocess
import shutil
from distutils import log
from .swig import find_swig, get_swig_version
try:
import pkgconfig # optional
# pkgconfig python module might be installe... | bsd-2-clause |
civisanalytics/ansible | lib/ansible/modules/cloud/google/gcdns_zone.py | 25 | 12939 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 CallFire Inc.
#
# This file is part of Ansible.
#
# 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... | gpl-3.0 |
ua-snap/downscale | snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_iem/old_code/cru_ts_downscaling_class_d.py | 3 | 20625 | # # #
# Downscale CRU Historical TS3.x data to a pre-processed climatology
# extent, resolution, reference system
#
# Author: Michael Lindgren (malindgren@alaska.edu)
# # #
# import some modules
import rasterio, xray, os
import numpy as np
import pandas as pd
import numpy as np
class DownscalingUtils( object ):
def... | mit |
Logic-gate/TadawulStocks | launcher.py | 1 | 5299 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# TadawulStocks v 0.1 - launcher.py
# Copyright (C) <2014> mad_dev(A'mmer Almadani)
#
# 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.... | mpl-2.0 |
MaPePeR/numpy | numpy/lib/arraypad.py | 41 | 52069 | """
The arraypad module contains a group of functions to pad values onto the edges
of an n-dimensional array.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
__all__ = ['pad']
###############################################################################
# Private utility ... | bsd-3-clause |
alsotoes/vsphere-examples | python/.venv/lib/python2.6/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | gpl-3.0 |
prasen-ftech/pywinauto | pywinauto/findbestmatch.py | 13 | 17529 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at you... | lgpl-2.1 |
MinerKasch/dd-agent | setup.py | 7 | 5157 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from datetime import date
import os
import sys
# 3p
from setuptools import find_packages, setup
from requests.certs import where
# project
from config import get_version
from utils.jmx import JMX_FETCH_... | bsd-3-clause |
hbhzwj/imalse | tools/ns-allinone-3.14.1/ns-3.14.1/src/spectrum/bindings/callbacks_list.py | 63 | 1224 | callback_classes = [
['void', 'ns3::Ptr<ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['vo... | gpl-3.0 |
frainfreeze/studying | home/python/venv/lib/python3.5/site-packages/pip/_vendor/chardet/charsetgroupprober.py | 270 | 3787 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
Evervolv/android_external_chromium_org | tools/diagnose-me.py | 50 | 3016 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import os
import subprocess
import sys
all_chec... | bsd-3-clause |
groovecoder/kuma | kuma/users/providers/persona/views.py | 21 | 3499 | import requests
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse, QueryDict
from django.shortcuts import redirect
from django.template import RequestContext
from django.views.decorators.http import require_POST, require_GET
from allauth.socia... | mpl-2.0 |
ewheeler/rapidsms-core | lib/rapidsms/webui/utils.py | 2 | 9801 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import sys
import copy
import os, re, traceback
from rapidsms.webui import settings
from django.template import RequestContext
from django.shortcuts import render_to_response as django_r_to_r
from django.core.paginator import Paginator, EmptyPage, InvalidPage
def re... | lgpl-3.0 |
sudosurootdev/kernel_staging | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
irwinsnet/DesPy | despy/fel/event.py | 1 | 9768 | # Despy: A discrete event simulation framework for Python
# Version 0.1
# Released under the MIT License (MIT)
# Copyright (c) 2015, Stacy Irwin
"""
****************
despy.model.event
****************
.. autosummary::
Event
.. todo
Refactor event so it no longer inherits from Component.
... | mit |
ollitapa/VTT-Raytracer | python_source/pyraytracer/spectrumTools.py | 1 | 1572 | #
# Copyright 2015 VTT Technical Research Center of Finland
#
# 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 applicabl... | apache-2.0 |
logan169/pyGeno | pyGeno/importation/SNPs.py | 1 | 7001 | import urllib, shutil
from ConfigParser import SafeConfigParser
import pyGeno.configuration as conf
from pyGeno.SNP import *
from pyGeno.tools.ProgressBar import ProgressBar
from pyGeno.tools.io import printf
from Genomes import _decompressPackage, _getFile
from pyGeno.tools.parsers.CasavaTools import SNPsTxtFile
fro... | apache-2.0 |
dreamsxin/kbengine | kbe/res/scripts/common/Lib/distutils/tests/test_cmd.py | 118 | 3835 | """Tests for distutils.cmd."""
import unittest
import os
from test.support import captured_stdout, run_unittest
from distutils.cmd import Command
from distutils.dist import Distribution
from distutils.errors import DistutilsOptionError
from distutils import debug
class MyCmd(Command):
def initialize_options(self)... | lgpl-3.0 |
tersmitten/ansible-modules-core | cloud/rackspace/rax_keypair.py | 157 | 4957 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
ltilve/chromium | tools/perf/benchmarks/smoothness.py | 1 | 9502 | # 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 telemetry import benchmark
from benchmarks import silk_flags
from benchmarks import webgl_expectations
from measurements import smoothness
import page_... | bsd-3-clause |
omakk/servo | tests/wpt/web-platform-tests/tools/gitignore/gitignore.py | 90 | 3939 | import itertools
import re
import os
end_space = re.compile(r"([^\\]\s)*$")
def fnmatch_translate(pat, path_name=False):
parts = []
seq = False
i = 0
if pat[0] == "/" or path_name:
parts.append("^")
any_char = "[^/]"
if pat[0] == "/":
pat = pat[1:]
else:
... | mpl-2.0 |
ByteMail/ByteMail | rsa/_version133.py | 177 | 11274 | """RSA module
pri = k[1] //Private part of keys d,p,q
Module for calculating large primes, and RSA encryption, decryption,
signing and verification. Includes generating public and private keys.
WARNING: this code implements the mathematics of RSA. It is not suitable for
real-world secur... | mit |
cjaffar/jaffarchiosa | jaffarchiosa/lib/python2.7/site-packages/pip/log.py | 47 | 9438 | """Logging
"""
import sys
import os
import logging
from pip import backwardcompat
import colorama, pkg_resources
def _color_wrap(*colors):
def wrapped(inp):
return "".join(list(colors) + [inp, colorama.Style.RESET_ALL])
return wrapped
def should_color(consumer, environ, std=(sys.stdout, sys.stderr... | mit |
hyperkitty/hyperkitty | hyperkitty/south_migrations/0004_auto__add_index_email_in_reply_to.py | 2 | 12212 | # -*- coding: utf-8 -*-
# pylint: skip-file
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'Email', fields ['in_reply_to']
db.... | gpl-3.0 |
glwu/python-for-android | python3-alpha/python3-src/Tools/scripts/finddiv.py | 49 | 2498 | #! /usr/bin/env python3
"""finddiv - a grep-like tool that looks for division operators.
Usage: finddiv [-l] file_or_directory ...
For directory arguments, all files in the directory whose name ends in
.py are processed, and subdirectories are processed recursively.
This actually tokenizes the files to avoid false ... | apache-2.0 |
crossbario/autobahn-testsuite | autobahntestsuite/autobahntestsuite/case/case5_2.py | 2 | 1372 | ###############################################################################
##
## Copyright (c) Crossbar.io Technologies GmbH
##
## 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... | apache-2.0 |
Eric89GXL/numpy | numpy/distutils/conv_template.py | 18 | 9732 | #!/usr/bin/env python
"""
takes templated file .xxx.src and produces .xxx file where .xxx is
.i or .c or .h, using the following template rules
/**begin repeat -- on a line by itself marks the start of a repeated code
segment
/**end repeat**/ -- on a line by itself marks it's end
After the /**be... | bsd-3-clause |
abhijit86k/tapiriik | tapiriik/services/auto_pause.py | 15 | 4729 | import itertools
from collections import defaultdict
from tapiriik.services.interchange import WaypointType
def pairwise(gen):
x, y = itertools.tee(gen)
next(y, None)
return zip(x, y)
class AutoPauseCalculator:
@classmethod
def calculate(cls, waypoints, target_duration):
if not waypoints:... | apache-2.0 |
Ssawa/Diamond | src/diamond/handler/statsite.py | 57 | 5987 | # coding=utf-8
"""
Send metrics to a [Statsite](https://github.com/armon/statsite/)
using the default interface.
Statsite
========
This is a stats aggregation server. Statsite is based heavily
on Etsy's [StatsD](https://github.com/etsy/statsd). This is
a re-implementation of the Python version of
[statsite](https://... | mit |
bravominski/PennApps2015-HeartMates | venv/lib/python2.7/site-packages/werkzeug/testsuite/multipart/collect.py | 248 | 1584 | #!/usr/bin/env python
"""
Hacky helper application to collect form data.
"""
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
def copy_stream(request):
from os import mkdir
from time import time
folder = 'request-%d' % time()
mkdir(folder)
environ = request.e... | apache-2.0 |
toslunar/chainerrl | tests/experiments_tests/test_train_agent_batch.py | 1 | 5850 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import math
import tempfile
import unittest
from chainer imp... | mit |
motion2015/edx-platform | lms/djangoapps/notes/tests.py | 129 | 16454 | """
Unit tests for the notes app.
"""
from mock import patch, Mock
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from django.test import TestCase, RequestFactory
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.c... | agpl-3.0 |
varunarya10/oslo.middleware | doc/source/conf.py | 4 | 2462 | # -*- coding: utf-8 -*-
# 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... | apache-2.0 |
olegpshenichniy/truechat | server/api/thread/views.py | 1 | 2146 | from rest_framework import generics
from rest_framework.exceptions import PermissionDenied
from .models import PrivateThread, GroupThread
from .serializers import PrivateThreadListCreateSerializer, PrivateThreadRetrieveDestroySerializer
from .serializers import GroupThreadListCreateSerializer, GroupThreadRetrieveUpdat... | mit |
dgarros/ansible | lib/ansible/compat/selectors/_selectors2.py | 124 | 24265 | # This file is from the selectors2.py package. It backports the PSF Licensed
# selectors module from the Python-3.5 stdlib to older versions of Python.
# The author, Seth Michael Larson, dual licenses his modifications under the
# PSF License and MIT License:
# https://github.com/SethMichaelLarson/selectors2#license
#... | gpl-3.0 |
rgaino/three.js | utils/exporters/blender/addons/io_three/exporter/api/light.py | 195 | 1099 | from bpy import data, types
from .. import utilities, logger
def _lamp(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(name, types.Lamp):
lamp = name
... | mit |
pexip/meson | mesonbuild/modules/rpm.py | 2 | 8284 | # Copyright 2015 The Meson development 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
# Unless required by applicable law or agreed to ... | apache-2.0 |
RobertWWong/WebDev | djangoApp/ENV/lib/python3.5/site-packages/django/db/backends/sqlite3/introspection.py | 44 | 12308 | import re
import warnings
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models.indexes import Index
from django.utils.deprecation import RemovedInDjango21Warning
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
def get_... | mit |
dataxu/ansible | lib/ansible/modules/network/nxos/nxos_install_os.py | 3 | 20862 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
m-rakowski/html-to-csv | app/extract.py | 1 | 2373 | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import csv
import re
class Extraction():
def has_class(self,tag):
return tag.has_attr('class')
def get_info_dict(self,url):
r = requests.get(url)
r.encoding = 'utf-8'
data = r.text
soup =... | bsd-3-clause |
qedsoftware/commcare-hq | corehq/util/doc_processor/interface.py | 1 | 11487 | import weakref
from abc import ABCMeta, abstractmethod
from datetime import datetime
import six
from corehq.util.pagination import PaginationEventHandler, TooManyRetries
class BulkProcessingFailed(Exception):
pass
DOCS_SKIPPED_WARNING = """
WARNING {} documents were not processed due to concurrent mod... | bsd-3-clause |
rooshilp/CMPUT410Lab6 | virt_env/virt1/lib/python2.7/site-packages/django/views/csrf.py | 107 | 4958 | from django.conf import settings
from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.utils.translation import ugettext as _
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and ... | apache-2.0 |
googleglass/mirror-catfacts-python | libs/oauth2client/appengine.py | 154 | 32524 | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
hanul93/kicomav | Engine/plugins/dde.py | 1 | 8396 | # -*- coding:utf-8 -*-
# Author: Kei Choi(hanul93@gmail.com)
import os
import re
import zipfile
import kernel
# -------------------------------------------------------------------------
# zip ํ์ผ์ ํน๋ณํ ํ์ผ๋ช
์ ์์ถ ํด์ ํ์ฌ ๋ฐ์ดํฐ๋ฅผ ๋ฆฌํดํ๋ค.
# -------------------------------------------------------------------------
def get_zip_data... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.