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
Lokke/eden
controllers/assess.py
23
6452
# -*- coding: utf-8 -*- """ Assessments """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------------------- def index(): """ RESTful CRUD c...
mit
Brahimbaz/venom-xbmc-addons-beta
plugin.video.vstream/resources/hosters/videoweed.py
4
2917
from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.util import cUtil from resources.lib.parser import cParser from resources.lib.gui.gui import cGui from resources.hosters.hoster import iHoster import urllib class cHoster(iHoster): def __init__(self): self.__sDisplayName =...
gpl-2.0
fsulib/ojsh
ojsh.py
2
4662
#!/usr/bin/env python3 import os import sys import random import shutil import time import urllib.request import argparse from bs4 import BeautifulSoup as bs from lxml import etree parser = argparse.ArgumentParser() parser.add_argument("-o", "--output", required=True, help="Name of output file") parser.add_argument("...
cc0-1.0
Noltari/lede
scripts/dl_github_archive.py
2
14570
#!/usr/bin/env python3 # # Copyright (c) 2018 Yousong Zhou <yszhou4tech@gmail.com> # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. import argparse import calendar import datetime import errno import fcntl import hashlib import json import os import os.p...
gpl-2.0
petewarden/tensorflow_makefile
tensorflow/python/kernel_tests/io_ops_test.py
15
2814
# -*- coding: utf-8 -*- # 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 require...
apache-2.0
ticosax/django
django/contrib/gis/utils/ogrinfo.py
564
1984
""" This module includes some utility functions for inspecting the layout of a GDAL data source -- the functionality is analogous to the output produced by the `ogrinfo` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.geometries import GEO_CLASSES def ogrinfo(data_source, num...
bsd-3-clause
jiachenning/odoo
addons/edi/__init__.py
437
1157
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
dagwieers/ansible
lib/ansible/modules/cloud/google/gcp_forwarding_rule.py
15
12914
#!/usr/bin/python # Copyright 2017 Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
spoonysonny/SAKS-tutorials
saks-v1.x/digital-clock/sakshat.py
6
3444
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 NXEZ.COM. # http://www.nxez.com # # Licensed under the GNU General Public 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.gnu.org/licen...
gpl-2.0
binhqnguyen/lena
nsc/scons-local-1.2.0.d20090223/SCons/Platform/sunos.py
19
1927
"""engine.SCons.Platform.sunos Platform-specific initialization for Sun systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009...
gpl-2.0
openthread/silk
silk/tests/openthread/ot_test_child_table.py
1
6689
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
heiths/allura
Allura/allura/tests/unit/phone/test_nexmo.py
2
6452
# 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 (t...
apache-2.0
evanma92/routeh
flask/lib/python2.7/site-packages/migrate/tests/fixture/pathed.py
79
2146
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import shutil import tempfile from migrate.tests.fixture import base class Pathed(base.Base): # Temporary files _tmpdir = tempfile.mkdtemp() def setUp(self): super(Pathed, self).setUp() self.temp_usable_dir = tempfile.m...
bsd-3-clause
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/pair/test/test_ip.py
22
14432
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.python import components from twisted.pair import ip, raw from zope import interface class MyProtocol: interface.implements(raw.IRawDatagramProtocol) def __init__(self, expecting): ...
gpl-3.0
testalt/electrum-dgc-server
src/processor.py
25
7472
import json import Queue as queue import socket import threading import time import sys from utils import random_string, timestr, print_log from utils import logger class Shared: def __init__(self, config): self.lock = threading.Lock() self._stopped = False self.config = config se...
agpl-3.0
Bulochkin/tensorflow_pack
tensorflow/python/kernel_tests/init_ops_test.py
67
21210
# 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
frink182/stevostat
pir.py
1
1322
#!/usr/bin/env python from time import sleep from time import strftime import RPi.GPIO as GPIO import os import paho.mqtt.publish as publish import paho.mqtt.client as mqtt from datetime import datetime PIR=26 SCREEN_TIMEOUT=300 SCREEN='/sys/class/backlight/rpi_backlight/bl_power' ON=0 OFF=1 TOPIC="presence/PIR" GPI...
gpl-2.0
rane-hs/fabric-py3
tests/Python26SocketServer.py
1
22074
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
bsd-2-clause
40223219/w16_test
static/Brython3.1.1-20150328-091302/Lib/textwrap.py
745
16488
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> import re __all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent'] # Hardcode the recognized whitespace characters to the US-ASCII # whit...
agpl-3.0
sunlianqiang/kbengine
kbe/src/lib/python/Tools/scripts/nm2def.py
97
2451
#! /usr/bin/env python3 """nm2def.py Helpers to extract symbols from Unix libs and auto-generate Windows definition files from them. Depends on nm(1). Tested on Linux and Solaris only (-p option to nm is for Solaris only). By Marc-Andre Lemburg, Aug 1998. Additional notes: the output of nm is supposed to look like t...
lgpl-3.0
NL66278/odoo
openerp/http.py
2
57543
# -*- coding: utf-8 -*- #---------------------------------------------------------- # OpenERP HTTP layer #---------------------------------------------------------- import ast import collections import contextlib import datetime import errno import functools import getpass import inspect import logging import mimetypes...
agpl-3.0
serbyy/MozDef
cron/google2mozdef.py
7
8867
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation # # Contributors: # Jeff Bryner jbryner@mozilla.com impo...
mpl-2.0
StefGou/Kijiji-Repost-Headless
kijiji_repost_headless/kijiji_cmd.py
1
4487
import argparse import os import sys from time import sleep import kijiji_api if sys.version_info < (3, 0): raise Exception("This program requires Python 3.0 or greater") def main(): ##Start here #Takes: config(user/pass) #One of: #post adPostingFile #show #delete adId #show #repost adPo...
mit
Ophiuchus1312/enigma2-master
Navigation.py
1
7217
from enigma import eServiceCenter, eServiceReference, eTimer, pNavigation, getBestPlayableServiceReference, iPlayableService from Components.ParentalControl import parentalControl from Components.config import config from Tools.BoundFunction import boundFunction from Tools.StbHardware import setFPWakeuptime, getFPWakeu...
gpl-2.0
dsandeephegde/servo
tests/wpt/web-platform-tests/tools/py/py/_path/common.py
171
13048
""" """ import os, sys, posixpath import py # Moved from local.py. iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt') class Checkers: _depend_on_existence = 'exists', 'link', 'dir', 'file' def __init__(self, path): self.path = path def dir(self): raise NotImplemen...
mpl-2.0
ColdSauce/IsSittingOnButt
server/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
apache-2.0
x303597316/hue
desktop/core/ext-py/Django-1.6.10/tests/check/tests.py
51
5087
from django.core.checks.compatibility import base from django.core.checks.compatibility import django_1_6_0 from django.core.management.commands import check from django.core.management import call_command from django.db.models.fields import NOT_PROVIDED from django.test import TestCase from .models import Book class...
apache-2.0
john5223/bottle-auth
auth/controllers/user_controller.py
1
2915
import logging logger = logging.getLogger(__name__) from bottle import route, get, post, delete from bottle import request, response def error(code, message): response.status = code message['status'] = code return message get_user_table = lambda db: db.get_table('users', primary_id='userid', primary_t...
gpl-2.0
daviddao/luminosity
sklearn-server/flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
bsd-3-clause
chromium/chromium
components/feed/core/v2/tools/stream_dump.py
7
3890
#!/usr/bin/python3 # Copyright 2019 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. # Usage: # Dump the feedv2 stream database from a connected device to a directory on this # computer. # > stream_dump.py --device=FA77D030...
bsd-3-clause
alanquillin/ryu
ryu/services/protocols/ovsdb/event.py
15
5649
# Copyright (c) 2014 Rackspace Hosting # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
damngamerz/coala-bears
tests/general/QuotesBearTest.py
20
4052
import unittest from queue import Queue from textwrap import dedent from coalib.results.HiddenResult import HiddenResult, Result from bears.general.QuotesBear import QuotesBear from coalib.results.SourceRange import SourceRange from coalib.settings.Section import Section from coalib.testing.LocalBearTestHelper import ...
agpl-3.0
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/persisted/crefutil.py
45
4496
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utility classes for dealing with circular references. """ import types from twisted.python import log, reflect class NotKnown: def __init__(self): self.dependants = [] ...
gpl-3.0
beacloudgenius/edx-platform
common/djangoapps/student/management/commands/add_to_group.py
182
1968
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User, Group class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--list', action='store_true', de...
agpl-3.0
orion1024/Sick-Beard
lib/simplejson/scanner.py
89
2231
"""JSON token scanner """ import re try: from lib.simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_...
gpl-3.0
yl565/statsmodels
statsmodels/tsa/statespace/tests/results/results_kalman_filter.py
37
41500
""" Results for Kalman Filter Author: Chad Fulton License: Simplified-BSD Notes ----- There was an error in the loglikelihood computation in the GAUSS code from Kim and Nelson for the Clark 1989 model, omitting the exponent term on ``2 pi''. Therefore the loglikelihood in the test results for uc_bi is instead from t...
bsd-3-clause
nolanliou/tensorflow
tensorflow/python/ops/manip_grad.py
67
1168
# 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
karban/field
resources/python/pylint/reporters/text.py
10
5349
# Copyright (c) 2003-2007 Sylvain Thenault (thenault@gmail.com). # Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE). # 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 L...
gpl-2.0
jalonsob/Informes
testing/tests/test_scr.py
3
7099
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 Bitergia # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This ...
gpl-3.0
nagyistoce/eutester
testcases/cloud_user/tagging/tagging.py
5
21715
#!/usr/bin/python import time from eucaops import Eucaops from eucaops import EC2ops from eutester.eutestcase import EutesterTestCase import os import random class TaggingBasics(EutesterTestCase): def __init__(self, extra_args= None): self.setuptestcase() self.setup_parser() if extra_args:...
bsd-2-clause
av8ramit/tensorflow
tensorflow/compiler/tests/adam_test.py
79
7193
# 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
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KPixmapCache.py
1
2878
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg cl...
gpl-2.0
juharris/tensorflow
tensorflow/python/kernel_tests/decode_png_op_test.py
27
1822
# 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
jiachenning/odoo
odoo.py
257
5618
#!/usr/bin/env python #---------------------------------------------------------- # odoo cli # # To install your odoo development environement type: # # wget -O- https://raw.githubusercontent.com/odoo/odoo/8.0/odoo.py | python # # The setup_* subcommands used to boostrap odoo are defined here inline and may # only depe...
agpl-3.0
yencarnacion/jaikuengine
.google_appengine/lib/django-1.5/tests/regressiontests/custom_managers_regress/models.py
51
1194
""" Regression tests for custom manager classes. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible class RestrictedManager(models.Manager): """ A manager that filters out non-public instances. """ def get_query_set(self): return super(RestrictedMan...
apache-2.0
tumbl3w33d/ansible
lib/ansible/modules/network/cloudengine/ce_evpn_bgp_rr.py
13
18414
#!/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
EclipseXuLu/DataHouse
DataHouse/crawler/university_spider.py
1
3941
import requests from bs4 import BeautifulSoup from lxml import etree import pandas as pd from io import StringIO, BytesIO university_list = [] class University(): def __init__(self, name='', is_985=False, is_211=False, has_institute=False, location='', orgnization='', education_level='', educat...
mit
reinaldomaslim/Singaboat_RobotX2016
robotx_nav/nodes/task2_toplevel_try.py
3
4644
#!/usr/bin/env python import multiprocessing as mp import rospy from visualization_msgs.msg import MarkerArray, Marker from geometry_msgs.msg import Point, Quaternion import numpy as np from sklearn.cluster import KMeans, DBSCAN from sklearn import svm from move_base_loiter import Loiter from move_base_waypoint import ...
gpl-3.0
vinhqdang/algorithms_for_interviews
chapter1/problem1_3.py
1
1291
# given a sorted array and a key # find the first occurrence that larger than k # return -1 if there is no such element from problem0 import binary_search def test_find_first_larger_1 (): assert (find_first_larger([1,2,3,4,5,5,6],7) == -1) def test_find_first_larger_2 (): assert (find_first_larger([1,2,3,4,...
gpl-3.0
servo/servo
components/script/dom/bindings/codegen/parser/tests/test_special_methods.py
35
2906
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface SpecialMethods { getter long long (unsigned long index); setter long long (unsigned long index, long long value); getter boolean (DOMString name); setter boolean (DOMString name, boolean value)...
mpl-2.0
govindraj-raja/linux-omap
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
xodus7/tensorflow
tensorflow/python/tools/print_selective_registration_header_test.py
24
7356
# 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
iynaix/manga-downloader-flask
manga/spiders/animea.py
1
1663
import datetime from scrapy.selector import Selector from .base import BaseSpider as Spider from manga.items import MangaItem, MangaChapterItem from utils import extract_link class AnimeA(Spider): name = "animea" allowed_domains = ["animea.net"] start_urls = [ "http://manga.animea.net/series_old...
mit
elkingtonmcb/rethinkdb
test/rql_test/connections/http_support/werkzeug/testsuite/exceptions.py
145
3325
# -*- coding: utf-8 -*- """ werkzeug.testsuite.exceptions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The tests for the exception classes. TODO: - This is undertested. HTML is never checked :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest fro...
agpl-3.0
amenonsen/ansible
lib/ansible/plugins/filter/k8s.py
59
1064
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by':...
gpl-3.0
rossburton/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/python/test/test_htmlizer.py
68
1231
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.htmlizer}. """ from StringIO import StringIO from twisted.trial.unittest import TestCase from twisted.python.htmlizer import filter class FilterTests(TestCase): """ Tests for L{twisted.python.htmlizer.fil...
gpl-2.0
hgl888/crosswalk-android-extensions
build/idl-generator/third_party/jinja2/loaders.py
255
17027
# -*- coding: utf-8 -*- """ jinja2.loaders ~~~~~~~~~~~~~~ Jinja loader classes. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import weakref from types import ModuleType from os import path from hashlib import sha1 from jinja2.excepti...
bsd-3-clause
jessrenteria/flowbot
src/data/preprocessor.py
1
4786
"""Module for preprocessing Cornell dialog data. """ import os import pickle import nltk from tqdm import tqdm class Preprocessor: """Class for parsing and preprocessing dialogs. """ def __init__(self, config): self._config = config self._lines, self._token2id, self._id2token = self._prep...
apache-2.0
ncoghlan/pip
pip/_vendor/requests/status_codes.py
926
3200
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
mit
janusnic/shoop
setup.py
2
4284
# This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import os import sys import setuptools import shoop_setup_utils as utils TOPDIR = os.path.abspath...
agpl-3.0
jgcaaprom/android_external_chromium_org
tools/idl_parser/idl_ppapi_lexer.py
44
2001
#!/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. """ Lexer for PPAPI IDL The lexer uses the PLY library to build a tokenizer which understands both WebIDL and Pepper tokens. WebI...
bsd-3-clause
ridfrustum/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/mail/tests.py
38
25337
# coding: utf-8 import asyncore import email import os import shutil import smtpd import sys from StringIO import StringIO import tempfile import threading from django.conf import settings from django.core import mail from django.core.mail import EmailMessage, mail_admins, mail_managers, EmailMultiAlternatives from dj...
gpl-3.0
libravatar/libravatar
libravatar/account/urls.py
1
5296
# Copyright (C) 2011, 2013, 2015, 2016 Francois Marier <francois@libravatar.org> # Copyright (C) 2010 Francois Marier <francois@libravatar.org> # Jonathan Harker <jon@jon.geek.nz> # Brett Wilkins <bushido.katana@gmail.com> # # This file is part of Libravatar # # Libravatar is f...
agpl-3.0
junhuac/MQUIC
src/tools/usb_gadget/mouse_gadget.py
101
5065
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Implementation of a USB HID mouse. Two classes are provided by this module. The MouseFeature class implements the core functionality of a HID mouse and c...
mit
karthik339/Agni
MainDemo/flask/bin/activate_this.py
669
1129
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
apache-2.0
mindw/python-qwt
qwt/py3compat.py
2
6196
# -*- coding: utf-8 -*- # # Copyright © 2012-2013 Pierre Raybaut # Licensed under the terms of the MIT License # (see LICENSE file for details) """ guidata.py3compat (exact copy of spyderlib.py3compat) ----------------------------------------------------- Transitional module providing compatibility function...
lgpl-2.1
hezlog/rt-thread
bsp/stm32f429-apollo/rtconfig.py
7
3781
import os # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK...
apache-2.0
mxOBS/deb-pkg_xbmc-imx6
tools/EventClients/lib/python/zeroconf.py
181
4874
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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 opti...
gpl-2.0
jbolinge/keras
keras/constraints.py
78
1081
from __future__ import absolute_import import theano import theano.tensor as T import numpy as np class Constraint(object): def __call__(self, p): return p def get_config(self): return {"name": self.__class__.__name__} class MaxNorm(Constraint): def __init__(self, m=2): self.m =...
mit
initOS/server-tools
base_suspend_security/models/res_users.py
35
1444
# -*- coding: utf-8 -*- ############################################################################## # # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
agpl-3.0
natsheh/semantic_query
api.py
1
4747
# -*- coding: utf-8 -*- # # This file is part of semantic_query. # Copyright (C) 2016 CIAPPLE. # # This is a free software; you can redistribute it and/or modify it # under the terms of the Revised BSD License; see LICENSE file for # more details. # Semantic Query API # Author: Hussein AL-NATSHEH <h.natsheh@ciapple.c...
bsd-3-clause
QUANTAXIS/QUANTAXIS
QUANTAXIS/QAEngine/QAAsyncThread.py
2
2408
import asyncio import threading from functools import wraps from janus import Queue as QA_AsyncQueue from QUANTAXIS.QAEngine.QAEvent import QA_Event from QUANTAXIS.QAUtil import QA_util_log_info, QA_util_random_with_topic, RUNNING_STATUS class QA_AsyncThread(threading.Thread): _loop = asyncio.new_event_loop() ...
mit
SitiBanc/1061_NCTU_IOMDS
1108/HW7/HW7.py
1
3177
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 8 20:25:18 2017 @author: sitibanc """ import numpy as np from scipy import signal from PIL import Image def gen2DGaussian(stdv, mean, h, w): x, y = np.meshgrid(np.linspace(-1, 1, w), np.linspace(-1, 1, h)) d = np.sqrt(x ** 2 + y ** 2) ...
apache-2.0
mlaitinen/odoo
addons/marketing_campaign_crm_demo/__openerp__.py
260
1623
# -*- 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
wufangjie/leetcode
015. 3Sum.py
1
1747
''' Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. For example, given array S = [-1, 0, 1, 2, -1, -4], A solution set is: [ [-1, 0, 1], [-1, -1,...
gpl-3.0
DLlearn/PCV
PCV/localdescriptors/harris.py
9
4941
from pylab import * from numpy import * from scipy.ndimage import filters def compute_harris_response(im,sigma=3): """ Compute the Harris corner detector response function for each pixel in a graylevel image. """ # derivatives imx = zeros(im.shape) filters.gaussian_filter(im, (sigma,sigm...
bsd-2-clause
bebby520/essay_devel
venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_structures.py
906
1809
# Copyright 2014 Donald Stufft # # 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, so...
apache-2.0
solashirai/edx-platform
lms/djangoapps/course_blocks/transformers/tests/test_library_content.py
12
6778
""" Tests for ContentLibraryTransformer. """ import mock from student.tests.factories import CourseEnrollmentFactory from openedx.core.lib.block_structure.transformers import BlockStructureTransformers from ...api import get_course_blocks, clear_course_from_cache from ..library_content import ContentLibraryTransforme...
agpl-3.0
satterly/alerta5
alerta/app/database/backends/mongodb/base.py
1
40457
import json import pytz import re from datetime import datetime, timedelta from flask import current_app, g from pymongo import MongoClient, ASCENDING, TEXT, ReturnDocument from pymongo.errors import ConnectionFailure from alerta.app.models import status_code from alerta.app.utils.format import DateTime from alerta....
apache-2.0
SproutOrc/libdispatch
thirdparty/click/tests/test_arguments.py
11
5108
# -*- coding: utf-8 -*- import click def test_nargs_star(runner): @click.command() @click.argument('src', nargs=-1) @click.argument('dst') def copy(src, dst): click.echo('src=%s' % '|'.join(src)) click.echo('dst=%s' % dst) result = runner.invoke(copy, ['foo.txt', 'bar.txt', 'dir']...
apache-2.0
craigcitro/pydatalab
tests/stackdriver/monitoring/query_tests.py
3
3522
# Copyright 2016 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 agreed ...
apache-2.0
Plain-Andy-legacy/android_external_chromium_org
third_party/markdown/treeprocessors.py
104
14665
# markdown is released under the BSD license # Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) # Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) # Copyright 2004 Manfred Stienstra (the original version) # # All rights reserved. # # Redistribution and use in source and binary forms, with or...
bsd-3-clause
ckan/ckanext-archiver
ckanext/archiver/lib.py
1
1725
import os import logging import ckan.plugins as p from ckanext.archiver.tasks import update_package, update_resource log = logging.getLogger(__name__) def compat_enqueue(name, fn, queue, args=None): u''' Enqueue a background job using Celery or RQ. ''' try: # Try to use RQ from ckan....
mit
jhermann/rituals
src/rituals/util/shell.py
1
2127
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Shell command calls. """ # Copyright ⓒ 2015 Jürgen Hermann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This pr...
gpl-2.0
saurabh6790/trufil_app
selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py
30
2034
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import getdate, cint import calendar def execute(filters=None): # key yyyy-mm new_customers_in = {} repeat_cu...
agpl-3.0
ujenmr/ansible
lib/ansible/plugins/action/net_get.py
19
5123
# (c) 2018, Ansible Inc, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
gpl-3.0
google-research/google-research
task_set/tasks/conv_fc_test.py
1
1058
# 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
uclouvain/OSIS-Louvain
base/migrations/0411_auto_20181210_1029.py
2
1126
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2018-12-10 10:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0410_auto_20181207_1523'), ] operations = [ migrations.RemoveField(...
agpl-3.0
mixtile/buildroot
support/scripts/gen-manual-lists.py
24
20512
## gen-manual-lists.py ## ## This script generates the following Buildroot manual appendices: ## - the package tables (one for the target, the other for host tools); ## - the deprecated items. ## ## Author(s): ## - Samuel Martin <s.martin49@gmail.com> ## ## Copyright (C) 2013 Samuel Martin ## ## This program is free...
gpl-2.0
brandond/ansible
lib/ansible/modules/network/f5/bigip_monitor_ldap.py
14
25309
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
ThomasFeher/audacity
lib-src/lv2/lv2/plugins/eg-amp.lv2/waflib/Tools/kde4.py
275
2007
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys,re from waflib import Options,TaskGen,Task,Utils from waflib.TaskGen import feature,after_method @feature('msgfmt') def apply_msgfmt(self): for lang in self.to_...
gpl-2.0
gautamMalu/rootfs_xen_arndale
usr/lib/python2.7/traceback.py
64
11285
"""Extract, format and print information about Python stack traces.""" import linecache import sys import types __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc', 'format_exc', 'print_exception', ...
gpl-2.0
davidmueller13/android_kernel_lge_msm8974-old
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
TeamHackLG/lge-kernel-lproj
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
Nth-iteration-labs/streamingbandit
app/handlers/evalhandlers.py
1
3985
# -* coding: utf-8 -*- import json import numpy as np from handlers.basehandler import BaseHandler, ExceptionHandler from core.experiment import Experiment global numpy global random class Simulate(BaseHandler): def get(self, exp_id): """ Simulate your experiment based on four scripts, which create a cl...
mit
grupoprog3/proyecto_final
Entrega Final/flask/Lib/site-packages/pip/wheel.py
338
32010
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
apache-2.0
Nitaco/ansible
lib/ansible/modules/cloud/amazon/aws_region_facts.py
52
3496
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'supported_by': 'community', 'status': ['preview'] } DOCUMENTATION = ''' module: aws_region_facts short_descri...
gpl-3.0
RobertKolner/hastebin-client
tests/test_haste_utils.py
1
1819
import pytest import requests from hastebin_client.utils import create_url, read_data, upload from unittest import mock def test_create_url(): assert create_url('key') == 'https://hastebin.com/key' with pytest.raises(ValueError): create_url(None) def test_read_data_stdin(): with mock.patch('sys....
mit
brettcs/diffoscope
diffoscope/comparators/utils/archive.py
1
3833
# -*- coding: utf-8 -*- # # diffoscope: in-depth comparison of files, archives, and directories # # Copyright © 2016 Chris Lamb <lamby@debian.org> # # diffoscope 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,...
gpl-3.0
hendynew/fatncurious
vendors/jqvmap/create/jqvmap.py
305
20344
import sys import json import csv import shapely.wkb import shapely.geometry import shapely.ops import os import copy from osgeo import ogr from osgeo import osr from booleano.parser import Grammar, EvaluableParseManager, SymbolTable, Bind from booleano.operations import Variable class JQVMap: def __init__(self, na...
mit