repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
peiyuwang/pants | src/python/pants/help/build_dictionary_info_extracter.py | 12 | 10702 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import inspect
impor... | apache-2.0 |
manisandro/QGIS | python/plugins/processing/core/ProcessingResults.py | 17 | 1679 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingResults.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... | gpl-2.0 |
HaebinShin/tensorflow | tensorflow/contrib/linear_optimizer/python/kernel_tests/sdca_ops_test.py | 1 | 34924 | # 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 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Tools/scripts/linktree.py | 67 | 2440 | #! /usr/bin/env python3
# linktree
#
# Make a copy of a directory tree with symbolic links to all files in the
# original tree.
# All symbolic links go to a special symbolic link at the top, so you
# can easily fix things if the original source tree moves.
# See also "mkreal".
#
# usage: mklinks oldtree newtree
impor... | gpl-3.0 |
labordoc/labordoc-next | modules/websearch/web/admin/websearchadmin.py | 25 | 45852 | ## This file is part of Invenio.
## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Lic... | gpl-2.0 |
mrquim/repository.mrquim | script.module.youtube.dl/lib/youtube_dl/extractor/addanime.py | 48 | 3315 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urllib_parse_urlencode,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
qualities,
)
class AddAnimeIE(InfoExtractor):
_VAL... | gpl-2.0 |
crowdhackathon-transport/optimizers | crowdstance-api/venv/lib/python2.7/site-packages/werkzeug/script.py | 116 | 11365 | # -*- coding: utf-8 -*-
r'''
werkzeug.script
~~~~~~~~~~~~~~~
.. admonition:: Deprecated Functionality
``werkzeug.script`` is deprecated without replacement functionality.
Python's command line support improved greatly with :mod:`argparse`
and a bunch of alternative modules.
Most ... | mit |
patrickhartling/maestro | playpen/win_pageant.py | 2 | 4475 | # Copyright (C) 2005 John Arbash-Meinel <john@arbash-meinel.com>
# Modified up by: Todd Whiteman <ToddW@ActiveState.com>
#
# This file is part of paramiko.
#
# Paramiko 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
# Softwa... | gpl-2.0 |
santidediego/LearningDjango | lib/python3.5/site-packages/django/apps/config.py | 121 | 8077 | import os
from importlib import import_module
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils._os import upath
from django.utils.module_loading import module_has_submodule
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django ap... | mit |
jeffreyliu3230/osf.io | website/conferences/utils.py | 20 | 3066 | # -*- coding: utf-8 -*-
import uuid
import requests
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth import Auth
from framework.auth.core import get_user
from website import util
from website import security
from website import settings
from website.project import n... | apache-2.0 |
omprakasha/odoo | addons/l10n_de/__openerp__.py | 260 | 7736 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
acsone/sale-workflow | sale_service_project/models/hr_timesheet_invoice.py | 9 | 5715 | # -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Sergio Teruel
# © 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, api, _
from openerp.exceptions import except_orm
class HrAnalyticTimesheet(models.Model):
_inherit =... | agpl-3.0 |
polyaxon/polyaxon | platform/coredb/tests/test_runs/test_run_model.py | 1 | 3332 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | apache-2.0 |
jorsea/odoo-addons | account_bank_voucher/wizard/bank_statement_populate.py | 4 | 3057 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | agpl-3.0 |
Storyyeller/Krakatau | Krakatau/classfileformat/reader.py | 1 | 1221 | import struct
class TruncatedStreamError(EOFError):
pass
class Reader(object):
__slots__ = ['d', 'off']
def __init__(self, data, off=0):
self.d = data
self.off = off
def done(self): return self.off >= len(self.d)
def copy(self): return Reader(self.d, self.off)
def u8(self):... | gpl-3.0 |
GreenRecycleBin/servo | tests/wpt/web-platform-tests/webdriver/cookie/cookie_test.py | 58 | 1987 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from webdriver import exceptions
class CookieTest(base_test.WebDriverBaseTest):
def setUp(self):
self.driver.get(self.webserver.where_is("cookie/res/cookie_container.html"))
def... | mpl-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/lib-tk/test/widget_tests.py | 24 | 19643 | # Common tests for test_tkinter/test_widgets.py and test_ttk/test_widgets.py
import unittest
import sys
import Tkinter as tkinter
from ttk import Scale
from test_ttk.support import (AbstractTkTest, tcl_version, requires_tcl,
get_tk_patchlevel, pixels_conv, tcl_obj_eq)
import test.test_sup... | mit |
yarikoptic/pystatsmodels | statsmodels/sandbox/examples/example_gam.py | 4 | 2337 | '''original example for checking how far GAM works
Note: uncomment plt.show() to display graphs
'''
example = 2 # 1,2 or 3
import numpy as np
import numpy.random as R
import matplotlib.pyplot as plt
from statsmodels.sandbox.gam import AdditiveModel
from statsmodels.sandbox.gam import Model as GAM #?
from statsmode... | bsd-3-clause |
zerkh/theano_lstm | theano_lstm/__init__.py | 9 | 21559 | """
Small Theano LSTM recurrent network module.
@author: Jonathan Raiman
@date: December 10th 2014
Implements most of the great things that came out
in 2014 concerning recurrent neural networks, and
some good optimizers for these types of networks.
Note (from 5 January 2015): Dropout api is a bit sophisticated due t... | bsd-3-clause |
sanyaade-teachings/gyp | test/subdirectory/gyptest-top-all.py | 261 | 1373 | #!/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 building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... | bsd-3-clause |
ezequielpereira/Time-Line | autopilot/autopilotlib/manuscript/instructionpopup.py | 3 | 1635 | # Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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... | gpl-3.0 |
shujaatak/UAV_MissionPlanner | Lib/site-packages/numpy/distutils/npy_pkg_config.py | 53 | 13468 | import sys
if sys.version_info[0] < 3:
from ConfigParser import SafeConfigParser, NoOptionError
else:
from configparser import SafeConfigParser, NoOptionError
import re
import os
import shlex
__all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet',
'read_config', 'parse_flags']
_VAR = re... | gpl-2.0 |
slightlymadphoenix/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/db/backends/utils.py | 39 | 7380 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
import re
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrap... | mit |
edudobay/mingus | scripts/generate_wiki_docs.py | 1 | 7140 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
================================================================================
Music theory Python package
Copyright (C) 2008, 2009, Bart Spaans
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General P... | gpl-3.0 |
HaroldMills/Vesper | scripts/compare_recording_file_csv_files.py | 1 | 3968 | from collections import namedtuple
from pathlib import Path
import csv
DATA_DIR_PATH = Path(
'/Users/harold/Desktop/NFC/Data/MPG Ranch/'
'2016 MPG Ranch Recording Files Comparison')
DEBBIE_FILE_PATH = DATA_DIR_PATH / 'Recording Files Debbie.csv'
HAROLD_FILE_PATH = DATA_DIR_PATH / 'Recording Files Harold.csv'... | mit |
mrocklin/unification | unification/tests/test_more.py | 1 | 2685 | from collections import namedtuple
from unification.more import (unify_object, reify_object,
unifiable)
from unification import var, variables
from unification.core import unify, reify, _unify, _reify
class Foo(object):
def __init__(self, a, b):
self.a = a
self.b = b
de... | bsd-3-clause |
stiandre/sdhash-integration | external/tools/build/v2/test/inherit_toolset.py | 20 | 1175 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
import string
t = BoostBuild.Tester(pass_toolset=0)
t.write("a.cpp", """
""")
t.write("yfc1.jam", """
imp... | apache-2.0 |
Bredgren/GenericGameEngine | python/gge/Button.py | 1 | 2790 |
from gge.GameObject import GameObject
from gge.InputAttribute import InputAttribute
from gge.Attribute import SingletonAttribute
import gge.Types as T
import gge.DisplayTypes as DT
class MouseWithin(SingletonAttribute): pass
class MouseDown(SingletonAttribute): pass
class ShapeButton(GameObject):
def ... | gpl-3.0 |
mjtamlyn/django | tests/model_fields/test_genericipaddressfield.py | 171 | 1475 | from django.core.exceptions import ValidationError
from django.db import models
from django.test import TestCase
from .models import GenericIPAddress
class GenericIPAddressFieldTests(TestCase):
def test_genericipaddressfield_formfield_protocol(self):
"""
GenericIPAddressField with a specified pr... | bsd-3-clause |
salguarnieri/intellij-community | python/lib/Lib/xmllib.py | 160 | 34848 | """A parser for XML, using the derived class as static DTD."""
# Author: Sjoerd Mullender.
import re
import string
import warnings
warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", DeprecationWarning)
del warnings
version = '0.3'
class Error(RuntimeError):
pass
# Regular expressions used f... | apache-2.0 |
orhanf/fuel | tests/test_schemes.py | 21 | 7676 | import numpy
from numpy.testing import assert_raises
from fuel.schemes import (ConstantScheme, SequentialExampleScheme,
SequentialScheme, ShuffledExampleScheme,
ShuffledScheme, ConcatenatedScheme,
cross_validation)
def iterator_requester(s... | mit |
keen99/SickRage | lib/pyasn1/type/tagmap.py | 200 | 1772 | from pyasn1 import error
class TagMap:
def __init__(self, posMap={}, negMap={}, defType=None):
self.__posMap = posMap.copy()
self.__negMap = negMap.copy()
self.__defType = defType
def __contains__(self, tagSet):
return tagSet in self.__posMap or \
self.__... | gpl-3.0 |
dydek/django | django/views/decorators/vary.py | 586 | 1200 | from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-langu... | bsd-3-clause |
albertomurillo/ansible | test/units/modules/network/nso/test_nso_action.py | 40 | 7714 | #
# Copyright (c) 2017 Cisco and/or its affiliates.
#
# 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... | gpl-3.0 |
markgrovs/alfred-airmail-to-todoist | src/lib/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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 |
ramanajee/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/efl.py | 117 | 5906 | # Copyright (C) 2011 ProFUSION Embedded Systems. All rights reserved.
# Copyright (C) 2011 Samsung Electronics. All rights reserved.
# Copyright (C) 2012 Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# me... | bsd-3-clause |
mm1ke/portage | pym/portage/data.py | 6 | 9785 | # data.py -- Calculated/Discovered Data Values
# Copyright 1998-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import os, pwd, grp, platform, sys
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.output:colorize',
'portage.util:writemsg',
'portage.uti... | gpl-2.0 |
zhouzhenghui/python-for-android | python3-alpha/python3-src/Lib/idlelib/FileList.py | 55 | 3814 | import os
from tkinter import *
import tkinter.messagebox as tkMessageBox
class FileList:
# N.B. this import overridden in PyShellFileList.
from idlelib.EditorWindow import EditorWindow
def __init__(self, root):
self.root = root
self.dict = {}
self.inversedict = {}
self.v... | apache-2.0 |
ddico/server-tools | base_module_doc_rst/wizard/tech_rst_guide.py | 23 | 17280 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
steventimberman/masterDebater | venv/lib/python2.7/site-packages/pbr/hooks/files.py | 98 | 3681 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | mit |
imaculate/scikit-learn | benchmarks/bench_mnist.py | 38 | 6799 | """
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... | bsd-3-clause |
kennethlyn/parallella-lcd-linux | tools/perf/scripts/python/netdev-times.py | 1544 | 15191 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
nightflyer73/plugin.video.3bmeteo | default.py | 1 | 1616 | # -*- coding: utf-8 -*-
import os
import sys
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import urllib
import urllib2
import urlparse
from xml.dom import minidom
# plugin constants
__plugin__ = "plugin.video.3bmeteo"
__author__ = "Nightflyer"
Addon = xbmcaddon.Addon(id=__plugin__)
# plugin handle
... | gpl-3.0 |
dharmabumstead/ansible | lib/ansible/modules/web_infrastructure/apache2_module.py | 16 | 8135 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2013-2014, Christian Berendt <berendt@b1-systems.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': ... | gpl-3.0 |
tiefpunkt/thingstore | thingstore/views.py | 1 | 7148 | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404, render_to_response
from django.utils.timezone import now
from datetime import timedelta
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.c... | mit |
staudt/everest-legacy | lib/deps/httplib2/multipart.py | 1 | 4134 | # #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <bolacha - http library for python, with cookies and upload support>
# Copyright (C) <2010> Gabriel Falcão <gabriel@nacaolivre.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files ... | mit |
igurrutxaga/tvalacarta | python/main-classic/channels/fpt.py | 3 | 4035 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta - XBMC Plugin
# Fútbol Para Todos
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#
# Autor: Juan Pablo Candioti (@JPCandioti)
# Desarrollo basado sobre otros canales de tvalacarta
#---------------------------------... | gpl-3.0 |
kubernetes-client/python | kubernetes/client/models/v1_limit_range.py | 1 | 6534 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | apache-2.0 |
ovilab/atomify | libs/lammps/tools/python/neb_combine.py | 51 | 2170 | #!/usr/bin/env python
# make new dump file by combining snapshots from multiple NEB replica dumps
# Syntax: neb_combine.py -switch arg(s) -switch arg(s) ...
# -o outfile = new dump file
# each snapshot has NEB atoms from all replicas
# -r dump1 dump2 ... = replica dump files of NEB atoms
# ... | gpl-3.0 |
johan--/asteroids | game/load.py | 2 | 2097 | # -*- coding: utf-8 *-*
import pyglet
from . import util
from . import resources
from . import physicalobject
from . import ship as ship_
import random
def asteroid(player_pos=(-1000,-1000), screensize=(800,600), score=0, *args, **kwargs):
"""spawns an asteroid at random position"""
pos = util.random_pos(sc... | bsd-3-clause |
alishakiba/kaggle-ndsb | configurations/bagging_17_cr4_ds.py | 6 | 7849 | import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import dihedral_fast
import tmp_dnn
import tta
validation_split_path = "splits/bagging_split_17.pkl"
patch_sizes = [(95, 95), (47, 47)]
augmentation_params = {
'zoom_ran... | mit |
h42i/trafficlight | main.py | 1 | 2880 | import network
import time
from umqtt.simple import MQTTClient
from lights import *
from traffic import *
# Config
wifi_ssid = "HaSi-Kein-Internet-Legacy"
wifi_psk = "bugsbunny"
mqtt_server = "mqtt.hasi"
mqtt_client_name = "traffic_light"
mqtt_topic = "hasi/lights/traffic_light"
# State
lights_on = True
mqtt_client =... | mit |
pombreda/tipfy | tests/ext_mako_test.py | 4 | 2712 | # -*- coding: utf-8 -*-
"""
Tests for tipfyext.mako
"""
import os
import sys
import unittest
from tipfy import RequestHandler, Request, Response, Tipfy
from tipfy.app import local
from tipfyext.mako import Mako, MakoMixin
import test_utils
current_dir = os.path.abspath(os.path.dirname(__file__))
templates_dir = ... | bsd-3-clause |
cnsoft/kbengine-cocos2dx | kbe/res/scripts/common/Lib/unittest/util.py | 794 | 4157 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
... | lgpl-3.0 |
arcticshores/kivy | examples/canvas/tesselate.py | 30 | 4477 | '''
Tesselate Demonstration
=======================
This demonstrates the experimental library for tesselating polygons. You
should see a hollow square with some buttons below it. You can click and
drag to create additional shapes, watching the number of vertexes and elements
at the top of the screen. The 'debug' butt... | mit |
fangdingjun/shadowsocks | shadowsocks/crypto/rc4_md5.py | 1042 | 1339 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
badloop/SickRage | lib/tmdb_api/tmdb_api.py | 57 | 29696 | """
tmdbsimple.py is a wrapper for The Movie Database API.
Refer to the official API documentation for more information.
http://docs.themoviedb.apiary.io/
Created by Celia Oakley on 2013-10-31.
"""
import json
import requests
class TMDB:
def __init__(self, api_key, version=3):
TMDB.api_key = str(api_key)... | gpl-3.0 |
gregsymons/jenkins-job-builder | jenkins_jobs/modules/properties.py | 8 | 22619 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
Gitlab11/theHarvester | discovery/baidusearch.py | 21 | 1298 | import httplib
import myparser
import time
import sys
class search_baidu:
def __init__(self, word, limit):
self.word = word
self.total_results = ""
self.server = "www.baidu.com"
self.hostname = "www.baidu.com"
self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-U... | gpl-2.0 |
makinacorpus/Geotrek | geotrek/feedback/tests/test_commands.py | 2 | 1330 | from io import StringIO
from django.core.management import call_command
from django.test import TestCase
from django.utils import timezone
from geotrek.feedback.models import Report
from geotrek.feedback.factories import ReportFactory
class TestRemoveEmailsOlders(TestCase):
"""Test command erase_emails, if olde... | bsd-2-clause |
nurmd2/nurmd | addons/sale/wizard/sale_make_invoice_advance.py | 11 | 7094 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp import api, fields, models, _
import openerp.addons.decimal_precision as dp
from openerp.exceptions import UserError
class SaleAdvancePaymentInv(models.TransientModel):
_name = "sale.advance.payment.inv"
_desc... | gpl-3.0 |
armab/st2 | st2common/tests/unit/test_hash.py | 9 | 1458 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
SaranyaKarthikeyan/boto | tests/unit/ec2/elb/test_attribute.py | 114 | 8314 | from tests.unit import unittest
from tests.compat import mock
from boto.ec2.elb import ELBConnection
from boto.ec2.elb import LoadBalancer
from boto.ec2.elb.attributes import LbAttributes
ATTRIBUTE_GET_TRUE_CZL_RESPONSE = b"""<?xml version="1.0" encoding="UTF-8"?>
<DescribeLoadBalancerAttributesResponse xmlns="http:... | mit |
JoaoVasques/aws-devtool | eb/linux/python3/lib/aws/requests/packages/chardet2/sjisprober.py | 25 | 3654 | ######################## 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.
... | apache-2.0 |
umitproject/site-status | django/contrib/auth/decorators.py | 230 | 2388 | import urlparse
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.utils.decorators import available_attrs
def user_passes_test(test_func, login... | agpl-3.0 |
sivaramakrishnansr/ryu | ryu/services/protocols/vrrp/rpc_manager.py | 8 | 7329 | # Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... | apache-2.0 |
chandranaik/Aligning-of-PIE-with-rfc8033-in-ns3 | src/wifi/test/examples-to-run.py | 8 | 72014 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... | gpl-2.0 |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/contrib/slim/python/slim/nets/vgg.py | 164 | 11241 | # 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 |
randomblame/android_kernel_hisense_3.4 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
vijayendrabvs/ssl-neutron | neutron/tests/unit/brocade/test_brocade_vlan.py | 24 | 2176 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013 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
#
# ... | apache-2.0 |
VasilyNemkov/percona-xtrabackup | storage/innobase/xtrabackup/test/python/testtools/runtest.py | 42 | 7648 | # Copyright (c) 2009-2010 testtools developers. See LICENSE for details.
"""Individual test case execution."""
__all__ = [
'MultipleExceptions',
'RunTest',
]
import sys
from testtools.testresult import ExtendedToOriginalDecorator
class MultipleExceptions(Exception):
"""Represents many exceptions r... | gpl-2.0 |
cortesi/mitmproxy | mitmproxy/tools/console/commands.py | 3 | 4544 | import urwid
import blinker
import textwrap
from mitmproxy.tools.console import layoutwidget
from mitmproxy.tools.console import signals
HELP_HEIGHT = 5
command_focus_change = blinker.Signal()
class CommandItem(urwid.WidgetWrap):
def __init__(self, walker, cmd, focused):
self.walker, self.cmd, self.focu... | mit |
Senseg/Py4A | python3-alpha/python3-src/Lib/encodings/uu_codec.py | 55 | 2763 | """Python 'uu_codec' Codec - UU content transfer encoding.
This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().
Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ellinghouse and
modified by Jack... | apache-2.0 |
clearlinux/clearstack | clearstack/common/swupd.py | 1 | 1587 | #
# Copyright (c) 2015 Intel Corporation
#
# Author: Alberto Murillo <alberto.murillo.silva@intel.com>
# Author: Victor Morales <victor.morales@intel.com>
#
# 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... | apache-2.0 |
KAsante95/osf.io | website/addons/dropbox/views.py | 8 | 2917 | """Views fo the node settings page."""
# -*- coding: utf-8 -*-
import logging
import httplib as http
from dropbox.rest import ErrorResponse
from dropbox.client import DropboxClient
from urllib3.exceptions import MaxRetryError
from framework.exceptions import HTTPError
from website.addons.dropbox.serializer import Dro... | apache-2.0 |
pchaigno/grr | lib/hunts/standard.py | 6 | 31511 | #!/usr/bin/env python
"""Some multiclient flows aka hunts."""
import threading
import logging
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import stats
from grr.lib import utils... | apache-2.0 |
lunafeng/django | tests/user_commands/management/commands/hal.py | 372 | 1024 | from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Useless command."
def add_arguments(self, parser):
parser.add_argument('args', metavar='app_label', nargs='*',
help='Specify the app label(s) to works on.')
parser.add_argument('-... | bsd-3-clause |
luogangyi/Ceilometer-oVirt | ceilometer/collector.py | 2 | 5792 | #
# Copyright 2012-2013 eNovance <licensing@enovance.com>
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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/license... | apache-2.0 |
duyet-website/api.duyet.net | lib/faker/providers/address/ko_KR/__init__.py | 3 | 12654 | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
"""
Korean Address Provider
=======================
Korea has two address and postal code system.
Address
-------
- Address based on land parcel numbers
... | mit |
thresholdsoftware/asylum | openerp/addons/account/wizard/account_move_line_reconcile_select.py | 56 | 2399 | # -*- 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 |
umass-bib/bibcpp | scripts/cppProjectScripts/createTestDir.py | 8 | 4212 | #!/usr/bin/env python3
import shutil, os, argparse, sys, stat,errno
import CppHeaderParser
from string import replace
from argparse import Action
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)), "pyUtils"))
from color_text import ColorText as CT
from headInGraph import *
testerBodyTemplate = "... | gpl-3.0 |
Andrey-Pavlov/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/showresults.py | 146 | 1943 | # Copyright (C) 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 conditions and the... | bsd-3-clause |
sauloal/pycluster | pypy-1.9_64/lib-python/2.7/tempfile.py | 89 | 17875 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | mit |
dud225/incubator-airflow | tests/executor/test_executor.py | 24 | 1058 | # -*- 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, softw... | apache-2.0 |
ClusterHQ/benchmark-server | setup.py | 1 | 1061 | from setuptools import setup
def read(path):
"""
Read the contents of a file.
"""
with open(path) as f:
return f.read()
setup(
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independen... | apache-2.0 |
CenturylinkTechnology/ansible-modules-extras | cloud/misc/proxmox.py | 13 | 18979 | #!/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 |
vegitron/ansible | test/units/module_utils/basic/test__log_invocation.py | 2 | 3323 | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
#
# 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 |
MiLk/ansible | lib/ansible/module_utils/connection.py | 17 | 5354 | #
# 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 ... | gpl-3.0 |
clumsy/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/models/sql/compiler.py | 222 | 12579 | from itertools import izip
from django.db.backends.util import truncate_name
from django.db.models.sql import compiler
from django.db.models.sql.constants import TABLE_NAME
from django.db.models.sql.query import get_proxied_model
SQLCompiler = compiler.SQLCompiler
class GeoSQLCompiler(compiler.SQLCompiler):
def ... | apache-2.0 |
danielvdende/incubator-airflow | airflow/contrib/executors/kubernetes_executor.py | 1 | 27629 | # 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 |
inares/edx-platform | common/djangoapps/external_auth/tests/test_helper.py | 165 | 1259 | """
Tests for utility functions in external_auth module
"""
from django.test import TestCase
from external_auth.views import _safe_postlogin_redirect
class ExternalAuthHelperFnTest(TestCase):
"""
Unit tests for the external_auth.views helper function
"""
def test__safe_postlogin_redirect(self):
... | agpl-3.0 |
wiltonlazary/arangodb | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/requests/auth.py | 46 | 5665 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import logging
from base64 import b64encode
from .compat import urlparse, str
from .utils import parse_dict_header
log = logging.getLogger(__nam... | apache-2.0 |
embeddedarm/android_external_chromium_org | tools/update_reference_build.py | 24 | 11532 | #!/usr/bin/env python
#
# Copyright (c) 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.
"""Updates the Chrome reference builds.
Use -r option to update a Chromium reference build, or -b option for Chrome
official bui... | bsd-3-clause |
mbrukman/libcloud | libcloud/test/storage/test_atmos.py | 46 | 32319 | # 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 ... | apache-2.0 |
edxzw/edx-platform | openedx/core/djangoapps/user_api/tests/test_middleware.py | 152 | 4415 | """Tests for user API middleware"""
from mock import Mock, patch
from unittest import TestCase
from django.http import HttpResponse
from django.test.client import RequestFactory
from student.tests.factories import UserFactory, AnonymousUserFactory
from ..tests.factories import UserCourseTagFactory
from ..middleware ... | agpl-3.0 |
crmccreary/openerp_server | openerp/addons/project_scrum/report/sprint_burndown.py | 9 | 3896 | # -*- 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 |
rvalyi/geraldo | site/newsite/site-geraldo/django/contrib/sitemaps/views.py | 55 | 1891 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.utils.encoding import smart_str
from django.core.paginator import EmptyPage, PageNotAnInteger
def index(request, sitemaps):
current_site = S... | lgpl-3.0 |
techhat/libcloud | libcloud/compute/drivers/ktucloud.py | 56 | 3606 | # 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 ... | apache-2.0 |
rabipanda/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/mixture_test.py | 21 | 38286 | # Copyright 2015 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 |
jmw7912/wat-0016-kernel-2.6.37 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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)
# any later version.
#
# This program i... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.