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
liangwang/m5
configs/example/fs.py
1
5997
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
ghickman/django
django/template/defaultfilters.py
13
27084
"""Default variable filters.""" from __future__ import unicode_literals import random as random_module import re from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation from functools import wraps from pprint import pformat from django.conf import settings from django.utils import formats, six from djan...
bsd-3-clause
geminateCoder/Character-Archive-Website
Lib/site-packages/pip/_vendor/distlib/markers.py
1261
6282
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform from .compa...
cc0-1.0
kkusch/HoneyPy
loggers/twitter/honeypy_twitter.py
1
1837
# HoneyPy Copyright (C) 2013-2017 foospidy # https://github.com/foospidy/HoneyPy # See LICENSE for details # HoneyPy twitter module from twitter import Twitter from twitter.oauth import OAuth from twisted.python import log def process(config, section, parts, time_parts): # TCP # parts[0]: date ...
gpl-2.0
wartman4404/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake_hybi.py
413
22552
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mpl-2.0
schuylermartin45/mood_switch
musicservice.py
1
1849
#/usr/bin/python from __future__ import print_function ''' musicservice.py Parent class for all music services. "Enforces" a strict interface. These classes are used by the Playback class. @author: Schuyler Martin <schuylermartin45@gmail.com> ''' __author__ = "Schuyler Martin" class MusicService: ''' Music Se...
mit
khertan/KhtBMA
khtbma/bna.py
1
5890
""" python-bna Battle.net Authenticator routines in Python. Specification can be found here: <http://bnetauth.freeportal.us/specification.html> Python implementation by Jerome Leclanche <jerome.leclanche@gmail.com> """ __version__ = "3.1" import hmac from binascii import hexlify from hashlib import sha1 try: from...
gpl-3.0
Bloodyaugust/pongsugarlabcpp
lib/boost/tools/build/src/util/order.py
9
4322
# Copyright (C) 2003 Vladimir Prus # Use, modification, and distribution is subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy # at http://www.boost.org/LICENSE_1_0.txt) class Order: """Allows ordering arbitrary objects with regard to arbitrary binary rel...
gpl-2.0
msegado/edx-platform
lms/djangoapps/course_api/blocks/views.py
25
9338
""" CourseBlocks API views """ from django.core.exceptions import ValidationError from django.http import Http404 from rest_framework.generics import ListAPIView from rest_framework.response import Response from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from openedx.core.lib.api.vie...
agpl-3.0
jgcaaprom/android_external_chromium_org
third_party/closure_linter/closure_linter/scopeutil.py
84
5414
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
bsd-3-clause
myfluxi/xxICSKernel
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
moreati/numpy
numpy/lib/npyio.py
35
71412
from __future__ import division, absolute_import, print_function import sys import os import re import itertools import warnings import weakref from operator import itemgetter import numpy as np from . import format from ._datasource import DataSource from numpy.core.multiarray import packbits, unpackbits from ._ioto...
bsd-3-clause
qusp/orange3
Orange/widgets/utils/scaling.py
1
25636
from datetime import time import sys import random import numpy as np import Orange from Orange.data import Table, ContinuousVariable, DiscreteVariable from Orange.statistics.basic_stats import DomainBasicStats from Orange.widgets.settings import Setting from Orange.widgets.utils.datacaching import getCached, setCache...
bsd-2-clause
Jasoning/namebench
nb_third_party/dns/rdtypes/ANY/RP.py
248
3275
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
openstack/networking-bagpipe-l2
networking_bagpipe/db/sfc_db.py
3
5828
# Copyright (c) 2017 Orange. # 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 a...
apache-2.0
Widiot/simpleblog
venv/lib/python3.5/site-packages/flask_admin/babel.py
12
1945
try: from flask_babelex import Domain except ImportError: def gettext(string, **variables): return string % variables def ngettext(singular, plural, num, **variables): variables.setdefault('num', num) return (singular if num == 1 else plural) % variables def lazy_gettext(strin...
mit
xxshutong/openerp-7.0
openerp/addons/base/module/wizard/base_module_configuration.py
447
2274
# -*- 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
mythsmith/veusz
veusz/dialogs/preferences.py
4
9670
# Copyright (C) 2006 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 # ...
gpl-2.0
dcroc16/skunk_works
google_appengine/lib/django-1.3/django/template/loader.py
149
8326
# Wrapper for loading templates from storage of some sort (e.g. filesystem, database). # # This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use. # Each loader is expected to have this interface: # # callable(name, dirs=[]) # # name is the template name. # dirs is an optional list of directories ...
mit
yuanyelele/solfege
tools/mk-classhier-graph.py
2
4488
#!/usr/bin/python import re import sys import os import textwrap if len(sys.argv) == 1 or sys.argv[1] == '-h': print "\nUsage:" print "\t./tools/classhier.py file1.py file2.py ...\n" print "\n\t".join(textwrap.wrap("\tGenerate a nice graph of the class hierarchy in the files supplied as arguments.")) ...
gpl-3.0
rfdrake/netbox
netbox/extras/management/commands/run_inventory.py
1
5738
from getpass import getpass from ncclient.transport.errors import AuthenticationError from paramiko import AuthenticationException from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import transaction from dcim.models import Device, Module, Site class C...
apache-2.0
shupelneker/gae_new_structure
boilerplate/_lib/utils.py
25
7368
# *-* coding: UTF-8 *-* # standard library imports import os import re import random import hashlib import logging import string import unicodedata from datetime import datetime, timedelta import Cookie import webapp2 def random_string(size=6, chars=string.ascii_letters + string.digits): """ Generate random stri...
lgpl-3.0
etzhou/edx-platform
common/lib/capa/capa/tests/test_input_templates.py
13
38980
""" Tests for the logic in input type mako templates. """ import unittest import capa import os.path import json from lxml import etree from mako.template import Template as MakoTemplate from mako import exceptions from capa.inputtypes import Status class TemplateError(Exception): """ Error occurred while re...
agpl-3.0
ran5515/DeepDecision
tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py
8
56990
# 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
jelugbo/hebs_repo
lms/djangoapps/bulk_email/migrations/0001_initial.py
182
6854
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseEmail' db.create_table('bulk_email_courseemail', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True...
agpl-3.0
linhdh/SnakeRepellerOnMbed50
mbed-os/tools/export/qtcreator/__init__.py
21
2260
""" mbed SDK Copyright (c) 2014-2017 ARM Limited 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 wr...
gpl-2.0
laborautonomo/poedit
deps/boost/tools/build/v2/tools/gcc.py
15
38213
# Status: being ported by Steven Watanabe # Base revision: 47077 # TODO: common.jam needs to be ported # TODO: generators.jam needs to have register_c_compiler. # # Copyright 2001 David Abrahams. # Copyright 2002-2006 Rene Rivera. # Copyright 2002-2003 Vladimir Prus. # Copyright (c) 2005 Reece H. Dunn. # Copyright 200...
mit
Juniper/neutron
neutron/db/migration/alembic_migrations/versions/3d2585038b95_vmware_nsx.py
16
2181
# Copyright 2014 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 # # Unless required by applicable law ...
apache-2.0
gsehub/edx-platform
lms/djangoapps/verify_student/tests/test_fake_software_secure.py
13
2781
""" Tests for the fake software secure response. """ from django.test import TestCase from mock import patch from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from student.tests.factories import UserFactory from util.testing import UrlResetMixin class SoftwareSecureFakeViewTest(UrlRes...
agpl-3.0
sh4t/Sick-Beard
lib/imdb/_logging.py
143
2171
""" _logging module (imdb package). This module provides the logging facilities used by the imdb package. Copyright 2009-2010 Davide Alberani <da@erlug.linux.it> 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...
gpl-3.0
nishigori/boto
tests/unit/manage/test_ssh.py
114
2004
#!/usr/bin/env python # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without ...
mit
austinzheng/swift
utils/swift-api-dump.py
25
11781
#!/usr/bin/env python # This tool dumps imported Swift APIs to help validate changes in the # projection of (Objective-)C APIs into Swift, which is a function of the # (Objective-)C APIs, any API notes added on top of those APIs, and the # Clang importer itself. One can execute it to dump the API of a given # module w...
apache-2.0
geodynamics/burnman
tests/test_planet.py
2
1989
from __future__ import absolute_import import unittest import os import sys sys.path.insert(1, os.path.abspath('..')) import warnings import burnman from burnman import minerals from burnman import seismic from burnman.planet import Planet from burnman.layer import Layer from burnman import mineral_helpers as helpers...
gpl-2.0
mdaif/olympia
apps/versions/feeds.py
13
3897
from django.contrib.syndication.views import Feed from django.shortcuts import get_object_or_404 from django.utils.feedgenerator import DefaultFeed from jingo.helpers import datetime from tower import ugettext as _ import amo from amo.urlresolvers import reverse from amo.helpers import absolutify, url from amo.utils ...
bsd-3-clause
randynobx/ansible
lib/ansible/modules/windows/win_find.py
22
10385
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, 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 o...
gpl-3.0
kswiat/django
tests/model_options/test_tablespaces.py
34
5513
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.db import connection from django.core.management.color import no_style from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models.tablespaces import (Article, ArticleRef, Authors,...
bsd-3-clause
yencarnacion/jaikuengine
.google_appengine/lib/django-1.5/django/contrib/databrowse/datastructures.py
100
9090
""" These classes are light wrappers around Django's database API that provide convenience functionality and permalink functions for the databrowse app. """ from __future__ import unicode_literals from django.db import models from django.utils import formats from django.utils.text import capfirst from django.utils.enc...
apache-2.0
specialkevin/ansible-modules-core
system/authorized_key.py
55
15877
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add authorized_keys for ssh logins. (c) 2012, Brad Olson <brado@movedbylight.com> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ...
gpl-3.0
TeamExodus/external_chromium_org
content/test/gpu/gpu_tests/memory_test.py
26
4403
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import memory_test_expectations import page_sets from telemetry import benchmark from telemetry.page import page_test from telemetry.core.platform import...
bsd-3-clause
bikong2/django
tests/nested_foreign_keys/tests.py
174
9494
from __future__ import unicode_literals from django.test import TestCase from .models import ( Event, Movie, Package, PackageNullFK, Person, Screening, ScreeningNullFK, ) # These are tests for #16715. The basic scheme is always the same: 3 models with # 2 relations. The first relation may be null, while the sec...
bsd-3-clause
j0nathan33/CouchPotatoServer
couchpotato/core/media/movie/charts/main.py
9
2409
import time from couchpotato.core.logger import CPLog from couchpotato.api import addApiView from couchpotato.core.event import addEvent,fireEvent from couchpotato.core.plugins.base import Plugin import tmdb3 log = CPLog(__name__) class Charts(Plugin): update_in_progress = False update_interval = 72 # hour...
gpl-3.0
walteryang47/ovirt-engine
packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/async_tasks_map.py
8
3443
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013 Red Hat, 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 r...
apache-2.0
lauria/Samba4
source4/scripting/python/samba/tests/core.py
2
2175
#!/usr/bin/env python # Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008 # # 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 Lice...
gpl-3.0
crazyyoung01/vv
vn.qdp/pyscript/generate_md_functions.py
15
10378
# encoding: UTF-8 __author__ = 'CHENXY' from string import join from qdp_struct import structDict def processCallBack(line): orignalLine = line line = line.replace('\tvirtual void ', '') # 删除行首的无效内容 line = line.replace('{};\n', '') # 删除行尾的无效内容 content = line.split('(') cbNa...
mit
HiroIshikawa/21playground
flask-rethink/env/lib/python3.5/site-packages/pip/_vendor/colorama/win32.py
446
5121
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetCon...
mit
ilya-epifanov/ansible
lib/ansible/plugins/callback/hipchat.py
101
5867
# (C) 2014, Matt Martz <matt@sivel.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 option) any later version. # #...
gpl-3.0
meabsence/python-for-android
python3-alpha/python3-src/Lib/distutils/tests/test_bdist_dumb.py
46
2555
"""Tests for distutils.command.bdist_dumb.""" import unittest import sys import os from test.support import run_unittest from distutils.core import Distribution from distutils.command.bdist_dumb import bdist_dumb from distutils.tests import support SETUP_PY = """\ from distutils.core import setup import foo setup(n...
apache-2.0
bettermirror/wget
testenv/Test-auth-digest.py
12
1568
#!/usr/bin/env python3 from sys import exit from test.http_test import HTTPTest from misc.wget_file import WgetFile """ This test ensures Wget's Digest Authorization Negotiation. """ ############# File Definitions ############################################### File1 = "Need a cookie?" File2 = "Want cookies with m...
gpl-3.0
ARM-software/mbed-beetle
tools/size.py
52
4111
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
orione7/plugin.video.streamondemand-pureita
lib/elementtree/__init__.py
127
1491
# $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2004 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
gpl-3.0
rtucker-mozilla/mozilla_inventory
mozdns/txt/migrations/0001_initial.py
3
5233
# -*- 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 model 'TXT' db.create_table('txt', ( ('domain', self.gf('django.db.models.fields.relate...
bsd-3-clause
SEL-Columbia/commcare-hq
custom/openlmis/api.py
2
19029
from datetime import datetime import json import feedparser import time import requests from corehq.apps.commtrack.const import REQUISITION_CASE_TYPE from corehq.apps.commtrack.models import RequisitionCase from custom.api.utils import EndpointMixin from custom.openlmis.exceptions import OpenLMISAPIException REQUISITI...
bsd-3-clause
dyoung418/tensorflow
tensorflow/contrib/session_bundle/exporter.py
35
12771
# 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
leesavide/pythonista-docs
Documentation/matplotlib/examples/old_animation/histogram_tkagg.py
3
1847
""" This example shows how to use a path patch to draw a bunch of rectangles for an animated histogram """ import numpy as np import matplotlib matplotlib.use('TkAgg') # do this before importing pylab import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.path as path fig, ax = plt.sub...
apache-2.0
RodrigoDev/Django-todo
todo/settings.py
1
2707
""" Django settings for todo project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
mit
dkarakats/edx-platform
lms/envs/sauce.py
116
2389
""" This config file extends the test environment configuration so that we can run the lettuce acceptance tests on SauceLabs. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from sel...
agpl-3.0
ntiufalara/openerp7
openerp/addons/l10n_pt/__openerp__.py
51
1844
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Thinkopen Solutions, Lda. All Rights Reserved # http://www.thinkopensolutions.com. # $Id$ # # This program is free software: you can red...
mit
Hazelsuko07/17WarmingUp
py3.6/lib/python3.6/site-packages/flask_wtf/recaptcha/widgets.py
91
1267
# -*- coding: utf-8 -*- from flask import current_app, Markup from flask import json from werkzeug import url_encode JSONEncoder = json.JSONEncoder RECAPTCHA_SCRIPT = u'https://www.google.com/recaptcha/api.js' RECAPTCHA_TEMPLATE = u''' <script src='%s' async defer></script> <div class="g-recaptcha" %s></div> ''' __...
mit
perryjrandall/arsenalsuite
cpp/lib/PyQt4/examples/widgets/screenshot.py
22
5860
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2005-2005 Trolltech AS. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## This file may be used under the terms of the GNU General Public ## License version...
gpl-2.0
thresholdsoftware/asylum-v2.0
openerp/addons/crm_profiling/crm_profiling.py
52
10442
# -*- 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
jianglu/mojo
third_party/android_platform/development/scripts/stack_core.py
49
10687
#!/usr/bin/env python # # Copyright (C) 2013 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
bsd-3-clause
rbarlow/pulp_docker
plugins/pulp_docker/plugins/importers/sync.py
1
16753
""" This module contains the primary sync entry point for Docker v2 registries. """ from gettext import gettext as _ import errno import httplib import itertools import logging import os from pulp.common.plugins import importer_constants from pulp.plugins.util import nectar_config, publish_step from pulp.server.contro...
gpl-2.0
ganeti/ganeti-doc
roles/ganeti-doc/files/srv/ganeti-vcs/hooks/ciabot.py
1
7112
#!/usr/bin/env python # Copyright (c) 2010 Eric S. Raymond <esr@thyrsus.com> # Distributed under BSD terms. # # Google changes (iustin): # - taken from upstream git repo, contrib/ciabot/ciabot.py # - disabled cgit.cgi and use gitweb as we use it on git.ganeti.org # (url tweaked) # - to not use tinyurl # - remove the ...
gpl-2.0
ATIX-AG/ansible
contrib/inventory/openvz.py
196
2818
#!/usr/bin/env python # -*- coding: utf-8 -*- # # openvz.py # # Copyright 2014 jordonr <jordon@beamsyn.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 ...
gpl-3.0
Pragith/p8ste
src/app/user.py
2
1733
# Copyright 2008 Thomas Quemard # # Paste-It 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.0, or (at your option) # any later version. # # Paste-It is distributed in the hope that it will be...
gpl-3.0
gylian/sickrage
lib/github/Commit.py
25
9927
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
lin-credible/scikit-learn
examples/cluster/plot_kmeans_stability_low_dim_dense.py
338
4324
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
bsd-3-clause
tyler6389/count_kernel_grand
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
Mj258/weiboapi
srapyDemo/envs/Lib/site-packages/twisted/spread/ui/tktree.py
11
5515
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ What I want it to look like: +- One | \- Two | |- Three | |- Four | +- Five | | \- Six | |- Seven +- Eight | \- Nine """ import os from Tkinter import END, Listbox, Tk, Scrollbar, LEFT, BOTH, RIGHT, Y class Node: def __init__(self): ...
mit
resmo/cloudstack
scripts/vm/hypervisor/kvm/test_patchviasocket.py
4
4640
#!/usr/bin/env python # 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 # "Li...
apache-2.0
HackerEcology/SuggestU
suggestu/scrapers/views.py
1
1827
from django.template import RequestContext from django.core.context_processors import csrf from django.shortcuts import render_to_response from django.http import Http404, HttpResponse, HttpResponseRedirect import json from urllib import urlopen from subprocess import call def test(request): c = {} return rend...
gpl-3.0
subailong/ns3-wireless-planning.ns-3
bindings/python/apidefs/gcc-LP64/ns3_module_radvd.py
8
21115
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## simple-ref-count.h: ns3::SimpleRefCount<ns3::RadvdInterface, ns3::empty, ns3::DefaultDeleter<ns3::RadvdInterface> > [class] module.add_class('SimpleRefCount'...
gpl-2.0
summerlight/anlp
src/dataset.py
1
1423
import glob import json from data_gen import segmentation def iter_segment(doc): text = doc['text'] for segment in doc['metadata']: yield segment['lang'], text[segment['begin']:segment['end']] def iter_sentences(doc): for lang, segment in iter_segment(doc): for st in segmentation.by_sent...
apache-2.0
WarrenWeckesser/scipy
scipy/linalg/decomp_schur.py
17
10216
"""Schur decomposition functions.""" import numpy from numpy import asarray_chkfinite, single, asarray, array from numpy.linalg import norm # Local imports. from .misc import LinAlgError, _datacopied from .lapack import get_lapack_funcs from .decomp import eigvals __all__ = ['schur', 'rsf2csf'] _double_precision = ...
bsd-3-clause
delmic/odemis
src/odemis/gui/dev/powermate.py
2
9666
# -*- coding: utf-8 -*- """ @author: Rinze de Laat Copyright © 2015 Rinze de Laat, Éric Piel, Delmic This file is part of Odemis. Odemis 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. Odemis is dist...
gpl-2.0
dvliman/jaikuengine
.google_appengine/lib/yaml/lib/yaml/dumper.py
131
2718
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from emitter import * from serializer import * from representer import * from resolver import * class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__(self, stream, default_style=None, default_flow_style=None, c...
apache-2.0
Khan/khan-linter
vendor/py2/yaml/tokens.py
985
2573
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
apache-2.0
tumbl3w33d/ansible
lib/ansible/modules/network/fortios/fortios_system_management_tunnel.py
13
11162
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
rhyolight/nupic.son
tests/app/soc/modules/gci/views/helper/test_redirect_helper.py
1
2784
# Copyright 2012 the Melange 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 applicable law or agreed to in wr...
apache-2.0
schinke/solid-fortnight-ba
flask/venv/lib/python2.7/site-packages/pip/_vendor/packaging/_structures.py
1152
1416
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class Infinity(object): def __repr__(self): return "Infinity...
mit
guaix-ucm/numina
numina/user/clirundal.py
3
1572
# # Copyright 2008-2019 Universidad Complutense de Madrid # # This file is part of Numina # # SPDX-License-Identifier: GPL-3.0+ # License-Filename: LICENSE.txt # """User command line interface of Numina.""" import logging from .baserun import run_reduce from .helpers import create_datamanager, load_observations _l...
gpl-3.0
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/lib2to3/fixes/fix_sys_exc.py
327
1039
"""Fixer for sys.exc_{type, value, traceback} sys.exc_type -> sys.exc_info()[0] sys.exc_value -> sys.exc_info()[1] sys.exc_traceback -> sys.exc_info()[2] """ # By Jeff Balogh and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms clas...
gpl-3.0
groutr/numpy
numpy/matrixlib/tests/test_defmatrix.py
130
14801
from __future__ import division, absolute_import, print_function import collections import numpy as np from numpy import matrix, asmatrix, bmat from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises ) fro...
bsd-3-clause
emijrp/WikiApiary
apiary/tasks/website/extensions.py
2
7314
"""Record extension data.""" # pylint: disable=C0301,W1201 from apiary.tasks import BaseApiaryTask import requests import logging import HTMLParser import re import semantic_version LOGGER = logging.getLogger() class RecordExtensionsTask(BaseApiaryTask): def run(self, site_id, sitename, api_url): """Ge...
gpl-2.0
spininertia/graph-mining-rdbms
src/phase-3/src/radius/radius.py
1
5219
import sys import random import math def time_it(fn): def wrapped(*args): import time start = time.time() fn(*args) used = time.time() - start print "%s used %s" % (str(fn), used) return wrapped @time_it def assign_fm(conn, tbl_name, edge_table, k): cur = conn.cursor() # cur.execute("delete from %s" % t...
mit
CatherineWong/zxing-glass
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/bcc32.py
34
2986
"""SCons.Tool.bcc32 XXX """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without rest...
apache-2.0
eabatalov/au-linux-kernel-autumn-2017
linux/tools/perf/python/tracepoint.py
270
1465
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- import perf class tracepoint(perf.evsel): def __init__(self, sys, name): config = perf.tracepoint(sys, name) perf.evsel.__init__(self, type = perf.TYPE_TRACEPOINT, config = config,...
gpl-3.0
vponomaryov/manila
manila/tests/network/linux/test_ovs_lib.py
4
2879
# Copyright 2014 Mirantis 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 agre...
apache-2.0
thomasvs/morituri
examples/readhtoa.py
2
1662
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 import os import sys import optparse import tempfile import shutil from morituri.common import task, checksum, log from morituri.program import cdrdao, cdparanoia import gobject gobject.threads_init() def main(): log.init() parser = optparse.OptionParser() ...
gpl-3.0
trondhindenes/ansible
lib/ansible/plugins/action/enos.py
21
3504
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
gpl-3.0
hwroitzsch/BikersLifeSaver
local/share/OpenCV/samples/python/video_threaded.py
5
2365
#!/usr/bin/env python ''' Multithreaded video processing sample. Usage: video_threaded.py {<video device number>|<video file name>} Shows how python threading capabilities can be used to organize parallel captured frame processing pipeline for smoother playback. Keyboard shortcuts: ESC - exit spac...
mit
py-geek/City-Air
venv/lib/python2.7/site-packages/pymysql/err.py
29
4025
import struct from .constants import ER class MySQLError(Exception): """Exception related to operation with MySQL.""" class Warning(Warning, MySQLError): """Exception raised for important warnings like data truncations while inserting, etc.""" class Error(MySQLError): """Exception that is the bas...
mit
aroche/django
django/core/cache/backends/locmem.py
586
4287
"Thread-safe in-memory cache backend." import time from contextlib import contextmanager from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils.synch import RWLock try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle # Global in-memor...
bsd-3-clause
shayanb/pycoin
pycoin/encoding.py
14
10776
# -*- coding: utf-8 -*- """ Various utilities useful for converting one Bitcoin format to another, including some the human-transcribable format hashed_base58. The MIT License (MIT) Copyright (c) 2013 by Richard Kiss Permission is hereby granted, free of charge, to any person obtaining a copy of this software and a...
mit
rcarrillocruz/ansible
lib/ansible/modules/files/tempfile.py
17
3614
#!/usr/bin/python #coding: utf-8 -*- # (c) 2016 Krzysztof Magosa <krzysztof@magosa.pl> # # 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 Lice...
gpl-3.0
ronasimi/aosp-kernel_lge_geeb
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
miguelfervi/SSBW-Restaurantes
restaurantes/lib/python2.7/site-packages/django/core/servers/basehttp.py
274
7319
""" HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21). Based on wsgiref.simple_server which is part of the standard library since 2.5. This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE! """ from __f...
gpl-3.0
python-xlib/python-xlib
Xlib/ext/xtest.py
4
4564
# Xlib.ext.xtest -- XTEST extension module # # Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the L...
lgpl-2.1
subhrm/google-code-jam-solutions
solutions/helpers/CodeJam-0.3.0/codejam/datastructures/summing_list.py
1
1482
class summing_list: layers = [[0]] size = 0 def __init__(self, iter=None): if iter != None: for i in iter: self.append(i) def _sum(self, i): t = 0 for r in self.layers: if i % 2: t += r[i - 1] i >>= 1 r...
mit
mschuurman/FMSpy
nomad/core/atom_lib.py
1
1315
""" A library containing atom widths, atomic numbers, etc. """ import nomad.math.constants as constants atom_name = ['X', 'H', 'D', 'T', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar'] atom_width = [0.0, 4.5, 4.5, 4.5, 0.0, 0.0, 0.0, 0.0, 22.5, 19.5, 13.0,...
lgpl-3.0