repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
libscie/liberator
liberator/lib/python3.6/site-packages/gunicorn/reloader.py
98
1533
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import re import sys import time import threading class Reloader(threading.Thread): def __init__(self, extra_files=None, interval=1, callback=None): super(Reloader, sel...
cc0-1.0
supriyasingh01/github_basics
Internetworking Distributed Project/finalProject/ovs/pox-master/pox/lib/revent/revent.py
6
19832
# Copyright 2011 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
cc0-1.0
Ooblioob/collab
core/custom_comments/migrations/0002_auto__add_field_mpttcomment_is_anonymous.py
4
6757
# -*- coding: 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): # Adding field 'MPTTComment.is_anonymous' db.add_column(u'custom_comments_mpttcomment', 'is_anonymous', ...
cc0-1.0
cxxgtxy/tensorflow
tensorflow/python/ops/distributions/beta.py
73
13214
# 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
the-adrian/demoFlask
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
1093
8936
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
gpl-3.0
sortable/amphtml
validator/validator_gen.py
112
11182
# # Copyright 2015 The AMP HTML 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 applic...
apache-2.0
andrewnc/scikit-learn
sklearn/utils/sparsefuncs.py
220
11424
# Authors: Manoj Kumar # Thomas Unterthiner # License: BSD 3 clause import scipy.sparse as sp import numpy as np from .fixes import sparse_min_max, bincount from .sparsefuncs_fast import csr_mean_variance_axis0 as _csr_mean_var_axis0 from .sparsefuncs_fast import csc_mean_variance_axis0 as _csc_mean_var_axis...
bsd-3-clause
benoitsteiner/tensorflow-xsmm
tensorflow/python/ops/control_flow_ops_test.py
5
38293
# 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
hdinsight/hue
desktop/core/ext-py/Pygments-1.3.1/pygments/unistring.py
75
404249
# -*- coding: utf-8 -*- """ pygments.unistring ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project. :copyright: Copyright 2006-2010 by the Pygment...
apache-2.0
vitchyr/rlkit
rlkit/torch/vae/vae_base.py
1
3881
import torch import numpy as np import abc from torch.distributions import Normal from torch.nn import functional as F from rlkit.torch import pytorch_util as ptu class VAEBase(torch.nn.Module, metaclass=abc.ABCMeta): def __init__( self, representation_size, ): super().__init__...
mit
Appsamblea/Appsamblea
main_appsamblea/models/asamblea.py
1
2771
# -*- encoding: utf-8 -*- from __future__ import division import json from django.core.validators import URLValidator from django.db import models from main_appsamblea.models.usuario import Usuario from main_appsamblea.models.organizacion import Organizacion class Asamblea(models.Model): nombre = models.CharField(max...
gpl-2.0
EduPepperPD/pepper2013
common/lib/xmodule/xmodule/tests/test_graders.py
102
12238
"""Grading tests""" import unittest from xmodule import graders from xmodule.graders import Score, aggregate_scores class GradesheetTest(unittest.TestCase): '''Tests the aggregate_scores method''' def test_weighted_grading(self): scores = [] Score.__sub__ = lambda me, other: (me.earned - oth...
agpl-3.0
Beomi/irkshop
core/bank.py
1
3354
# coding: utf-8 import requests import json from bs4 import BeautifulSoup as bs from datetime import date, timedelta from os import environ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) with open(os.path.join(BA...
apache-2.0
ya7lelkom/googleads-python-lib
examples/adwords/v201502/campaign_management/get_all_disapproved_ads_with_awql.py
3
2172
#!/usr/bin/python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
fvant/ansible-modules-core
cloud/amazon/rds_param_group.py
104
10673
#!/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
PerArneng/dockerusr
dockerusr.py
1
7771
#!/usr/bin/env python3 # Author: Per Arneng # License: Apache License Version 2.0 import argparse import hashlib import os import pwd import subprocess import sys from abc import abstractmethod, ABCMeta import re def md5_sum(plain_text: str): md5 = hashlib.md5() md5.update(plain_text.encode('utf-8')) ret...
apache-2.0
jjd27/xen-api
ocaml/idl/binding_sanity_checks/nagios_plugins/check_pool.py
25
3723
#!/usr/bin/python #This is an example plugin for the popular network monitoring program nagios. #Check if all the hosts in a pool are live. #If we log in to a slave by mistake (the master can sometimes change) #then redirect the request to the real master #example command line: ./check_pool.py -H ivory -p password -...
lgpl-2.1
fw1121/zulip
zerver/lib/cache_helpers.py
120
4368
from __future__ import absolute_import # This file needs to be different from cache.py because cache.py # cannot import anything from zerver.models or we'd have an import # loop from django.conf import settings from zerver.models import Message, UserProfile, Stream, get_stream_cache_key, \ Recipient, get_recipient...
apache-2.0
timesking/MITMf
core/poisoners/MDNS.py
24
3205
#!/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
ehashman/oh-mainline
vendor/packages/django-assets/django_assets/filter/jspacker/jspacker.py
19
22540
## ParseMaster, version 1.0 (pre-release) (2005/05/12) x6 ## Copyright 2005, Dean Edwards ## Web: http://dean.edwards.name/ ## ## This software is licensed under the CC-GNU LGPL ## Web: http://creativecommons.org/licenses/LGPL/2.1/ ## ## Ported to Python by Florian Schulze import os, re # a multi-pattern parser...
agpl-3.0
murphy-wang/aws-ec2
lib/boto-2.34.0/boto/ec2/cloudwatch/__init__.py
76
24442
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
QianBIG/odoo
addons/document/test_cindex.py
444
1553
#!/usr/bin/python import sys import os import glob import time import logging from optparse import OptionParser logging.basicConfig(level=logging.DEBUG) parser = OptionParser() parser.add_option("-q", "--quiet", action="store_false", dest="verbose", default=True, help="don't prin...
agpl-3.0
JackWoot/E2E-Messenger
Server/requests/packages/urllib3/contrib/ntlmpool.py
714
4741
# urllib3/contrib/ntlmpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
gpl-2.0
bob-the-hamster/commandergenius
project/jni/python/src/Lib/test/test_dis.py
58
4785
# Minimal tests for dis module from test.test_support import run_unittest import unittest import sys import dis import StringIO def _f(a): print a return 1 dis_f = """\ %-4d 0 LOAD_FAST 0 (a) 3 PRINT_ITEM 4 PRINT_NEWLINE %-4d 5 LOAD_CONST ...
lgpl-2.1
srluge/SickRage
lib/unidecode/x092.py
252
4648
data = ( 'Ba ', # 0x00 'Fang ', # 0x01 'Chen ', # 0x02 'Xing ', # 0x03 'Tou ', # 0x04 'Yue ', # 0x05 'Yan ', # 0x06 'Fu ', # 0x07 'Pi ', # 0x08 'Na ', # 0x09 'Xin ', # 0x0a 'E ', # 0x0b 'Jue ', # 0x0c 'Dun ', # 0x0d 'Gou ', # 0x0e 'Yin ', # 0x0f 'Qian ', # 0x10 'Ban ',...
gpl-3.0
xbmc/atv2
xbmc/lib/libPython/Python/Lib/xdrlib.py
5
7353
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct try: from cStringIO import StringIO as _StringIO except ImportError: from StringIO import StringIO as _StringIO __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exceptions class Error(Exceptio...
gpl-2.0
GreenJoey/My-Simple-Programs
python/Twisted/krondo Twisted Introduction/twisted-client-5/get-poetry-1.py
1
3786
# This is the Twisted Get Poetry Now! client, version 5.1 import optparse import random import sys from twisted.internet import defer from twisted.internet.protocol import Protocol, ClientFactory def parse_args(): usage = """usage: %prog [options] [hostname]:port ... This is the Get Poetry Now! client, Twiste...
gpl-2.0
anedos/sqlalchemy-migrate-egg
migrate/tests/versioning/test_keyedinstance.py
41
1287
#!/usr/bin/python # -*- coding: utf-8 -*- from migrate.tests import fixture from migrate.versioning.util.keyedinstance import * class TestKeydInstance(fixture.Base): def test_unique(self): """UniqueInstance should produce unique object instances""" class Uniq1(KeyedInstance): @classmet...
mit
rue89-tech/edx-platform
lms/djangoapps/instructor/tests/test_tools.py
6
11698
""" Tests for views/tools.py. """ import datetime import mock import json import unittest from django.utils.timezone import utc from django.test.utils import override_settings from courseware.field_overrides import OverrideFieldData # pylint: disable=import-error from student.tests.factories import UserFactory # p...
agpl-3.0
paulsmith/geodjango
django/contrib/auth/handlers/modpython.py
436
1899
from mod_python import apache import os def authenhandler(req, **kwargs): """ Authentication handler that checks against Django's auth database. """ # mod_python fakes the environ, and thus doesn't process SetEnv. This fixes # that so that the following import works os.environ.update(req.subp...
bsd-3-clause
noahwilliamsson/micropython
tests/basics/int_mpz.py
14
2093
# to test arbitrariy precision integers x = 1000000000000000000000000000000 y = 2000000000000000000000000000000 # printing print(x) print(y) # addition print(x + 1) print(x + y) # subtraction print(x - 1) print(x - y) print(y - x) # multiplication print(x * 2) print(x * y) # integer division print(x // 2) print(y...
mit
IanMezza/GPIO-101
weblamp/weblamp.py
1
1088
import RPi.GPIO as GPIO from flask import Flask, render_template, request app = Flask(__name__) GPIO.setmode(GPIO.BOARD) pins = { 23 : {'name' : 'Lampara', 'state' : GPIO.LOW} } for pin in pins: GPIO.setup(pin, GPIO.OUT) GPIO.output(pin, GPIO.LOW) @app.route("/") def main(): for pin in pins: pi...
mit
Titan-C/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
4
2433
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
Shuailong/CCGSupertagging
code/preprocessing.py
1
6542
#!/usr/bin/env python # encoding: utf-8 ''' Text preprocessing module modified by Shuailong. https://github.com/fchollet/keras/blob/master/keras/preprocessing/text.py ''' from __future__ import absolute_import from __future__ import division import numpy as np from six.moves import range from six.moves import zip imp...
mit
d3banjan/polyamide
webdev/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## 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...
bsd-2-clause
naver/hubblemon
jstat_mon/jstat_view.py
1
2278
# # Hubblemon - Yet another general purpose system monitor # # Copyright 2015 NAVER Corp. # # 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 # # U...
apache-2.0
vineodd/PIMSim
GEM5Simulation/gem5/src/arch/x86/isa/insts/simd64/floating_point/arithmetic/subtraction.py
91
2766
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
gpl-3.0
charris/numpy
numpy/core/tests/test_errstate.py
17
2066
import pytest import sysconfig import numpy as np from numpy.testing import assert_, assert_raises # The floating point emulation on ARM EABI systems lacking a hardware FPU is # known to be buggy. This is an attempt to identify these hosts. It may not # catch all possible cases, but it catches the known cases of gh-4...
bsd-3-clause
mmbtba/odoo
addons/point_of_sale/report/pos_lines.py
230
2464
# -*- 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
sander76/home-assistant
homeassistant/components/hive/water_heater.py
1
4352
"""Support for hive water heaters.""" from datetime import timedelta import voluptuous as vol from homeassistant.components.water_heater import ( STATE_ECO, STATE_OFF, STATE_ON, SUPPORT_OPERATION_MODE, WaterHeaterEntity, ) from homeassistant.const import TEMP_CELSIUS from homeassistant.helpers im...
apache-2.0
sid-kap/pants
tests/python/pants_test/tasks/test_minimal_cover.py
8
3257
# coding=utf-8 # Copyright 2014 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) from textwrap import...
apache-2.0
srikantbmandal/ansible
lib/ansible/modules/cloud/amazon/_ec2_vpc.py
71
30146
#!/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
srittau/rouver
rouver_test/html.py
1
4989
from http import HTTPStatus from asserts import assert_equal, assert_in, assert_raises from dectest import TestCase, test from rouver.html import ( bad_arguments_list, created_at_page, http_status_page, see_other_page, temporary_redirect_page, ) class HTTPStatusPageTest(TestCase): @test ...
mit
chemelnucfin/tensorflow
tensorflow/python/tpu/topology.py
8
9292
# 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
maheshp/novatest
nova/virt/baremetal/vif_driver.py
14
3049
# Copyright (c) 2012 NTT DOCOMO, INC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
tempbottle/ironpython3
Src/StdLib/Lib/asyncio/futures.py
16
13088
"""A Future class similar to the one in PEP 3148.""" __all__ = ['CancelledError', 'TimeoutError', 'InvalidStateError', 'Future', 'wrap_future', ] import concurrent.futures._base import logging import sys import traceback from . import events # States for Future. _PENDING = 'PENDING'...
apache-2.0
teamotrinidad/plugin.video.chicovara
servers/filefactory.py
43
3595
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para filefactory # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core i...
gpl-2.0
aaltinisik/OCBAltinkaya
openerp/osv/orm.py
1
6293
try: import simplejson except ImportError: import json as simplejson from lxml import etree from ..exceptions import except_orm from ..models import ( MetaModel, BaseModel, Model, TransientModel, AbstractModel, MAGIC_COLUMNS, LOG_ACCESS_COLUMNS, ) from openerp.tools.safe_eval import safe_...
agpl-3.0
Work4Labs/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/many_to_one_regress/tests.py
92
4466
from django.db import models from django.test import TestCase from models import First, Second, Third, Parent, Child, Category, Record, Relation class ManyToOneRegressionTests(TestCase): def test_object_creation(self): Third.objects.create(id='3', name='An example') parent = Parent(name='fred') ...
gpl-3.0
nwswanson/checkin
server/vendor/marshmallow/schema.py
1
26626
# -*- coding: utf-8 -*- """The :class:`Schema` class, including its metaclass and options (class Meta).""" from __future__ import absolute_import, unicode_literals import copy import datetime as dt import decimal import json import types import uuid import warnings from collections import namedtuple from functools imp...
mit
cpcloud/ibis
ibis/tests/all/test_param.py
1
2434
import collections import pytest import ibis import ibis.expr.datatypes as dt @pytest.mark.parametrize( ('column', 'raw_value'), [ ('double_col', 0.0), ('double_col', 10.1), ('float_col', 1.1), ('float_col', 2.2), ], ) @pytest.mark.xfail_unsupported def test_floating_scal...
apache-2.0
srsman/odoo
openerp/addons/base/ir/ir_logging.py
326
1882
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
agpl-3.0
skylines-project/skylines
tests/model/test_timezone.py
1
1024
# -*- coding: utf-8 -*- import pytest from geoalchemy2.shape import from_shape from shapely.geometry import Polygon, MultiPolygon from skylines.model import TimeZone, Location @pytest.fixture def berlin(db_session): # | # | * * # | # | * # | * # +------------ shape = MultiPolygon...
agpl-3.0
Mutnick/nicotine-plus
pynicotine/gtkgui/userlist.py
2
20551
# -*- coding: utf-8 -*- # # COPYRIGHT (C) 2016-2017 Michael Labouebe <gfarmerfr@free.fr> # COPYRIGHT (C) 2009 Quinox <quinox@users.sf.net> # COPYRIGHT (C) 2006-2009 Daelstorm <daelstorm@gmail.com> # COPYRIGHT (C) 2003-2004 Hyriand <hyriand@thegraveyard.org> # # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # ...
gpl-3.0
dtuchsch/rpi-linux-preempt_rt
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
umitproject/openmonitor-aggregator
django/contrib/localflavor/is_/is_postalcodes.py
438
4913
# -*- coding: utf-8 -*- IS_POSTALCODES = ( ('101', u'101 Reykjavík'), ('103', u'103 Reykjavík'), ('104', u'104 Reykjavík'), ('105', u'105 Reykjavík'), ('107', u'107 Reykjavík'), ('108', u'108 Reykjavík'), ('109', u'109 Reykjavík'), ('110', u'110 Reykjavík'), ('111', u'111 Reykjavík'...
agpl-3.0
jef-n/QGIS
python/plugins/processing/tools/system.py
33
3596
# -*- coding: utf-8 -*- """ *************************************************************************** py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***************************************...
gpl-2.0
Apiaceae/biopython
tidy_title_BOLD.py
1
1063
# filter sequence by title name as we need to filter sequence by its gens regions, # such as ITS, rbcL, matK ## ITSAO3147-14|Ligusticum sinense|ITS2|KC295049 import sys import re from Bio import SeqIO def filter_seq_title(records): sequences = set() for record in records: seq_description = record.description ...
gpl-2.0
anorfleet/turntable
test/lib/python2.7/site-packages/scipy/interpolate/interpolate_wrapper.py
17
5310
""" helper_funcs.py. scavenged from enthought,interpolate """ from __future__ import division, print_function, absolute_import import numpy as np from . import _interpolate # C extension. Does all the real work. def atleast_1d_and_contiguous(ary, dtype=np.float64): return np.atleast_1d(np.ascontiguousarray...
mit
kisoku/ansible
hacking/update_bundled.py
66
1304
#!/usr/bin/python2 -tt import glob import json import os.path from distutils.version import LooseVersion from ansible.module_utils.urls import open_url basedir = os.path.dirname(__file__) for filename in glob.glob(os.path.join(basedir, '../lib/ansible/compat/*/__init__.py')): if 'compat/tests' in filename: ...
gpl-3.0
fernandog/Medusa
ext/gntp/cli.py
6
4141
# Copyright: 2013 Paul Traylor # These sources are released under the terms of the MIT license: see LICENSE import logging import os import sys from optparse import OptionParser, OptionGroup from gntp.notifier import GrowlNotifier from gntp.shim import RawConfigParser from gntp.version import __version__ DEFAULT_CON...
gpl-3.0
akhilman/cement
cement/ext/ext_jinja2.py
2
3767
""" The Jinja2 Extension module provides output templating based on the `Jinja2 Templating Language \ <http://jinja.pocoo.org/>`_. Requirements ------------ * Jinja2 (``pip install Jinja2``) Configuration ------------- To **prepend** a directory to the ``template_dirs`` list defined by the application/developer,...
bsd-3-clause
5GExchange/mapping
alg1/utils/StressTest.py
2
19348
# Copyright 2017 Balazs Nemeth # # 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, s...
apache-2.0
Mirantis/mos-horizon
openstack_dashboard/dashboards/admin/networks/tests.py
1
29082
# Copyright 2012 NEC 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 applicable law or ag...
apache-2.0
DirtyUnicorns/android_kernel_samsung_manta
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
LokiCoder/Sick-Beard
sickbeard/databases/mainDB.py
3
32364
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
dessHub/bc-14-online-store-application
flask/lib/python2.7/site-packages/setuptools/command/test.py
22
8857
import os import operator import sys import contextlib import itertools from distutils.errors import DistutilsError, DistutilsOptionError from distutils import log from unittest import TestLoader from setuptools.extern import six from setuptools.extern.six.moves import map, filter from pkg_resources import (resource_...
gpl-3.0
crazy-canux/django
tests/shortcuts/tests.py
199
5776
from django.test import SimpleTestCase, ignore_warnings, override_settings from django.test.utils import require_jinja2 from django.utils.deprecation import RemovedInDjango110Warning @override_settings( ROOT_URLCONF='shortcuts.urls', ) class ShortcutTests(SimpleTestCase): def test_render_to_response(self): ...
bsd-3-clause
tartavull/google-cloud-python
setup.py
2
2846
# Copyright 2016 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 writing, ...
apache-2.0
duke2906/traccar
tools/swagger2html.py
4
13091
#!/usr/bin/python import sys, argparse, json, re def handleException(etype, e=None): if etype == 'KeyError': print "Error: Required property {} not found".format(e) elif etype == 'IOError': print "Error ({}): {}".format(e.errno, e.strerror) elif etype == 'ValueError': print "Error:...
apache-2.0
Instagram/django
tests/regressiontests/utils/feedgenerator.py
51
2526
import datetime from django.utils import feedgenerator, tzinfo, unittest class FeedgeneratorTest(unittest.TestCase): """ Tests for the low-level syndication feed framework. """ def test_get_tag_uri(self): """ Test get_tag_uri() correctly generates TagURIs. """ self.ass...
bsd-3-clause
Colabra/SMU
node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
1366
120842
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
gpl-3.0
bkirui/odoo
addons/l10n_at/account_wizard.py
379
1234
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
agpl-3.0
gdkar/pyglet
tools/genmpkg/bdist_mpkg_pyglet/cmd_bdist_mpkg.py
26
17325
"""bdist_mpkg.cmd_bdist_mpkg Implements the Distutils 'bdist_mpkg' command (create an OS X "mpkg" binary distribution).""" import os import sys import zipfile from setuptools import Command from distutils.util import get_platform, byte_compile from distutils.dir_util import remove_tree, mkpath from distutils.errors...
bsd-3-clause
Javiercerna/MissionPlanner
Lib/site-packages/scipy/signal/info.py
55
5542
""" Signal Processing Tools ======================= Convolution: convolve: N-dimensional convolution. correlate: N-dimensional correlation. fftconvolve: N-dimensional convolution using the FFT. convolve2d: 2-dimensional convolution (more options). correlate2d: ...
gpl-3.0
nicko96/Chrome-Infra
infra/services/master_manager_launcher/__main__.py
1
4487
#!/usr/bin/python # Copyright 2015 Google Inc. All Rights Reserved. # pylint: disable=F0401 """Launch a master_manager script for every master on a host.""" # pragma: no cover import argparse import logging import os import socket import subprocess import sys from infra.libs.gitiles import gitiles from infra.libs.p...
bsd-3-clause
EnTeQuAk/doit
src/doit/utils/dates.py
2
2129
from datetime import datetime from django.utils.timezone import utc from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext import pytz JUST_NOW = _("just now") SECONDS_AGO = (_("%(seconds)d second ago"), _("%(seconds)d seconds ago")) MINUTES_AGO = (_("%(minutes)d minu...
bsd-3-clause
kotobukki/MobSF-Translate
StaticAnalyzer/views/ios.py
1
35336
# -*- coding: utf_8 -*- from django.shortcuts import render from django.http import HttpResponseRedirect from django.http import HttpResponse from django.template.loader import get_template from django.conf import settings from django.utils.html import escape from django.template.defaulttags import register from share...
gpl-3.0
py-geek/City-Air
venv/lib/python2.7/site-packages/pip/baseparser.py
149
9643
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import os import re import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip._vendor.six.moves import configparser from pip.locations import ( legacy_config_file, config_b...
mit
hrjn/scikit-learn
benchmarks/bench_sample_without_replacement.py
397
8008
""" Benchmarks for sampling without replacement of integer. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import operator import matplotlib.pyplot as plt import numpy as np import random from sklearn.externals.six.moves i...
bsd-3-clause
mezz64/home-assistant
homeassistant/components/elkm1/const.py
7
1262
"""Support the ElkM1 Gold and ElkM1 EZ8 alarm/integration panels.""" from elkm1_lib.const import Max import voluptuous as vol from homeassistant.const import ATTR_CODE DOMAIN = "elkm1" CONF_AUTO_CONFIGURE = "auto_configure" CONF_AREA = "area" CONF_COUNTER = "counter" CONF_ENABLED = "enabled" CONF_KEYPAD = "keypad" ...
apache-2.0
brettchien/LeetCode
88_MergeSortedArray.py
1
1526
class Solution: # @param {integer[]} nums1 # @param {integer} m # @param {integer[]} nums2 # @param {integer} n # @return {void} Do not return anything, modify nums1 in-place instead. def merge(self, nums1, m, nums2, n): print nums1, nums2 if m == 0: for idx in range...
mit
lucasw/popcanbot
popcanbot_control/scripts/command_to_joint_state.py
2
1078
#!/usr/bin/env python # Lucas Walter # make a joint exactly what the command wants it to be- this only works # for position control. import rospy from sensor_msgs.msg import JointState from std_msgs.msg import Float64 class CommandToJointState: def __init__(self): self.joint_name = rospy.get_param("~joi...
gpl-3.0
spblightadv/rethinkdb
test/rql_test/connections/http_support/werkzeug/contrib/cache.py
146
23519
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
agpl-3.0
tchellomello/home-assistant
homeassistant/components/ambient_station/sensor.py
7
2791
"""Support for Ambient Weather Station sensors.""" import logging from homeassistant.const import ATTR_NAME from homeassistant.core import callback from . import ( SENSOR_TYPES, TYPE_SOLARRADIATION, TYPE_SOLARRADIATION_LX, AmbientWeatherEntity, ) from .const import ( ATTR_LAST_DATA, ATTR_MONIT...
apache-2.0
carlmw/oscar-wager
django/utils/decorators.py
16
4040
"Functions that help with dynamically creating decorators for views." import types try: from functools import wraps, update_wrapper, WRAPPER_ASSIGNMENTS except ImportError: from django.utils.functional import wraps, update_wrapper, WRAPPER_ASSIGNMENTS # Python 2.4 fallback. def method_decorator(decorator): ...
bsd-3-clause
devssay/newbook
library/flask/logging.py
194
2683
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys from werkzeug.local import LocalProxy from logging import ...
mit
axinging/chromium-crosswalk
build/android/buildbot/bb_host_steps.py
5
4973
#!/usr/bin/env python # 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. import os import json import sys import bb_utils import bb_annotations sys.path.append(os.path.join(os.path.dirname(__file__), '..'))...
bsd-3-clause
asvetlov/motor
test/high_availability/ha_tools.py
1
14260
# Copyright 2009-2014 MongoDB, 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 writin...
apache-2.0
mrquim/repository.mrquim
script.module.youtube.dl/lib/youtube_dl/extractor/cliprs.py
81
1030
# coding: utf-8 from __future__ import unicode_literals from .onet import OnetBaseIE class ClipRsIE(OnetBaseIE): _VALID_URL = r'https?://(?:www\.)?clip\.rs/(?P<id>[^/]+)/\d+' _TEST = { 'url': 'http://www.clip.rs/premijera-frajle-predstavljaju-novi-spot-za-pesmu-moli-me-moli/3732', 'md5': 'c41...
gpl-2.0
diegocortassa/TACTIC
src/pyasm/prod/biz/biz_test.py
1
1900
#!/usr/bin/python ########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way wi...
epl-1.0
jantman/cobbler
bin/demo_connect.py
19
1527
#!/usr/bin/python """ Copyright 2007-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> 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 yo...
gpl-2.0
detiber/ansible
lib/ansible/modules/cloud/openstack/_keystone_user.py
12
14285
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. # ...
gpl-3.0
RunningLight/machinekit
configs/ARM/BeagleBone/BeBoPr-Bridge/ReadTemp.py
76
11233
#!/usr/bin/python ######################################################################## # Description: temp.py # # This code reads an ADC input on the BeagleBone and converts the # # resulting value into a temperature according to the thermistor # # type, a...
lgpl-2.1
nowster/linux-ubnt-e200
tools/perf/scripts/python/failed-syscalls-by-pid.py
1996
2233
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
eammx/proyectosWeb
cursoPython/lib/python3.6/site-packages/pip/baseparser.py
339
10465
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import os import re import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip._vendor.six.moves import configparser from pip.locations import ( legacy_config_file, config_b...
mit
Team74/FRC_2016_Python_Stronghold
components/armControl.py
1
2336
""" File Author: Will Hescott, Will Lowry File Creation Date: 1/28/2015 File Purpose: To control an arm """ import wpilib from wpilib import CANTalon, Timer, DigitalInput, AnalogPotentiometer, PIDController, Compressor from . import Component class arm(Component): #set up variables def __init__(self, robot): ...
gpl-3.0
kernevil/samba
python/samba/tests/dns_packet.py
2
7302
# Tests of malformed DNS packets # Copyright (C) Catalyst.NET ltd # # written by Douglas Bagnall <douglas.bagnall@catalyst.net.nz> # # 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 versio...
gpl-3.0
edx/edx-notes-api
notesapi/v1/permissions.py
1
2268
import logging import jwt from django.conf import settings from rest_framework.permissions import BasePermission logger = logging.getLogger(__name__) class TokenWrongIssuer(Exception): pass class HasAccessToken(BasePermission): """ Allow requests having valid ID Token. https://tools.ietf.org/html...
agpl-3.0
TwolDE2/enigma2
lib/python/Plugins/Extensions/DVDBurn/Process.py
47
36668
from Components.Task import Task, Job, DiskspacePrecondition, Condition, ToolExistsPrecondition from Components.Harddisk import harddiskmanager from Screens.MessageBox import MessageBox from Project import iso639language from Tools import Notifications class png2yuvTask(Task): def __init__(self, job, inputfile, outpu...
gpl-2.0