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
chuckbutler/kubernetes
hack/boilerplate/boilerplate.py
58
4960
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
vdt/hyde
templates/simple/settings.py
40
3451
import os here = lambda *x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) #Directories LAYOUT_DIR = here('layout') CONTENT_DIR = here('content') MEDIA_DIR = here('media') DEPLOY_DIR = here('deploy') TMP_DIR = here('deploy_tmp') BACKUPS_DIR = here('backups') BACKUP = False SITE_ROOT = "/" SITE_WWW_URL ...
mit
bigswitch/nova
nova/tests/unit/scheduler/test_host_manager.py
1
52704
# Copyright (c) 2011 OpenStack Foundation # 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 ...
apache-2.0
alrusdi/python-social-auth
examples/django_me_example/example/app/views.py
111
2194
import json from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.shortcuts import redirect from django.contrib.auth.decorators import login_required from django.contrib.auth import logout as auth_logout, login from social.backends.oauth import BaseOAuth1, BaseOAuth...
bsd-3-clause
jakirkham/bokeh
tests/test_examples.py
3
7377
from __future__ import absolute_import, print_function import os from os.path import basename import time import pytest import subprocess import signal from os.path import dirname, exists, split import six from bokeh.server.callbacks import NextTickCallback, PeriodicCallback, TimeoutCallback from bokeh._testing.uti...
bsd-3-clause
geekaia/edx-platform
cms/djangoapps/contentstore/tests/test_permissions.py
3
6359
""" Test CRUD for authorization. """ import copy from django.test.utils import override_settings from django.contrib.auth.models import User from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from contentstore.tests.modulestore_config import TEST_MODULESTORE from contentstore.tests.utils import Aj...
agpl-3.0
robomakery/a20
src/locomotion/locomotion_svc.py
2
3076
#!/usr/bin/env python import sys, traceback import Ice import platform import smbus Ice.loadSlice('--all -I' + Ice.getSliceDir() + ' -I../interfaces/' + ' ../interfaces/motorcontrol.ice') Ice.updateModules() import MotorControl # See http://www.robot-electronics.co.uk/htm/md22tech.htm # for more details about contro...
gpl-3.0
wavicles/fossasia-pslab-apps
psl_res/GUI/D_PHYSICS/B_physics/templates/simplePendulum.py
2
12199
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'simplePendulum.ui' from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context,...
gpl-3.0
Elandril/SickRage
lib/bs4/builder/_htmlparser.py
412
8839
"""Use the HTMLParser library to parse HTML files that aren't too bad.""" __all__ = [ 'HTMLParserTreeBuilder', ] from HTMLParser import ( HTMLParser, HTMLParseError, ) import sys import warnings # Starting in Python 3.2, the HTMLParser constructor takes a 'strict' # argument, which we'd like to s...
gpl-3.0
fqxp/nete-gtk
nete/components/info_bar.py
1
2094
from fluous.gobject import connect from gi.repository import Gtk, GLib, GObject class InfoBar(Gtk.InfoBar): REVEAL_TIMEOUT = 5 info_message = GObject.Property(type=str) def __init__(self, **kwargs): super().__init__( message_type=Gtk.MessageType.WARNING, revealed=False, ...
gpl-3.0
nash-x/hws
neutron/plugins/mlnx/mlnx_plugin.py
7
25042
# Copyright 2013 Mellanox Technologies, Ltd # # 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 t...
apache-2.0
with-git/tensorflow
tensorflow/contrib/learn/python/learn/estimators/svm_test.py
112
11485
# 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
2014c2g4/w16b_test
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_functiontestcase.py
791
5478
import unittest from .support import LoggingResult class Test_FunctionTestCase(unittest.TestCase): # "Return the number of tests represented by the this test object. For # TestCase instances, this will always be 1" def test_countTestCases(self): test = unittest.FunctionTestCase(lambda: None) ...
gpl-3.0
Opshun/API
venv/lib/python2.7/site-packages/pip/_vendor/requests/api.py
206
4935
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
mit
damonkohler/sl4a
python/src/Demo/pdist/cmptree.py
42
5778
"""Compare local and remote dictionaries and transfer differing files -- like rdist.""" import sys from repr import repr import FSProxy import time import os def main(): pwd = os.getcwd() s = raw_input("chdir [%s] " % pwd) if s: os.chdir(s) pwd = os.getcwd() host = ask("host", 'voorn.c...
apache-2.0
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/unittest/signals.py
1016
2403
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.original_handler = default_handler if isinstance(default_handler, int): if default_handler == signal.SIG_D...
gpl-2.0
wpm/mycroft
test/test_model.py
1
5684
import os import shutil import tempfile from itertools import tee from random import shuffle from unittest import TestCase import numpy from keras.callbacks import History from mycroft.model import BagOfWordsClassifier, RNNClassifier, load_embedding_model, ConvolutionNetClassifier from test import to_lines class Te...
mit
hlin117/scikit-learn
examples/tree/plot_iris.py
86
1965
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/SQLAlchemy-0.9.7-py2.7-linux-x86_64.egg/sqlalchemy/sql/default_comparator.py
32
13132
# sql/default_comparator.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Default implementation of SQL comparison operations. """ from .. impor...
apache-2.0
mianos/micropython
examples/asmled.py
101
1677
# flash LED #1 using inline assembler # this version is overly verbose and uses word stores @micropython.asm_thumb def flash_led(r0): movw(r1, (stm.GPIOA + stm.GPIO_BSRRL) & 0xffff) movt(r1, ((stm.GPIOA + stm.GPIO_BSRRL) >> 16) & 0x7fff) movw(r2, 1 << 13) movt(r2, 0) movw(r3, 0) movt(r3, 1 << 13...
mit
CentralLabFacilities/m3meka
python/scripts/dev/m3dev_omnibase_tuning.py
2
9257
#! /usr/bin/python #Copyright 2008, Meka Robotics #All rights reserved. #http://mekabot.com #Redistribution and use in source and binary forms, with or without #modification, are permitted. #THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS #"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI...
mit
Workday/OpenFrame
tools/telemetry/third_party/gsutilz/third_party/boto/boto/cacerts/__init__.py
260
1097
# Copyright 2010 Google Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merg...
bsd-3-clause
fanhero/thumbor
tests/metrics/test_default_metrics.py
6
1049
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com import mock from preggy import expect import thumbor.metrics from t...
mit
jmaher/treeherder
tests/services/test_taskcluster.py
2
3041
import pytest from tests.conftest import SampleDataJSONLoader from treeherder.services.taskcluster import ( TaskclusterModelImpl, taskcluster_model_factory, notify_client_factory, NotifyNullObject, NotifyAdapter, TaskclusterModelNullObject, ) load_json_fixture = SampleDataJSONLoader('sherlock'...
mpl-2.0
martijn-maklu/django-form-designer
form_designer/models.py
1
18922
import re import hashlib, uuid from decimal import Decimal from collections import OrderedDict from django.db import models from django.conf import settings from django.utils.translation import ugettext, ugettext_lazy as _ from django.forms import widgets from django.core.mail import send_mail from django.conf import ...
bsd-3-clause
saurabhbajaj207/CarpeDiem
venv/Lib/site-packages/pip/commands/completion.py
343
2453
from __future__ import absolute_import import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ CO...
mit
toladata/TolaTables
silo/migrations/0025_auto_20170829_0159.py
2
1036
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-29 08:59 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('silo', '0024_auto_20170825_0230'), ] operations = ...
gpl-2.0
pilou-/ansible
test/units/parsing/yaml/test_dumper.py
49
2314
# 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. # # Ansible is distributed i...
gpl-3.0
petrutlucian94/cinder
cinder/tests/unit/test_backup_driver_base.py
4
16907
# Copyright 2013 Canonical Ltd. # 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
chvogl/tardis
tardis/io/config_validator.py
11
48732
# coding=utf-8 import re import logging import pprint import ast import numpy as np from astropy import units try: from astropy.units.core import UnitsException except ImportError: from astropy.units.core import UnitsError as UnitsException from astropy import constants import yaml from tardis.atomic impo...
bsd-3-clause
dalegregory/odoo
addons/website_membership/models/product.py
338
1264
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
dhalleine/tensorflow
tensorflow/python/kernel_tests/init_ops_test.py
4
12608
# 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
Pistachitos/Sick-Beard
lib/subliminal/tasks.py
170
2328
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
gpl-3.0
pgleeson/TestArea
models/LarkumEtAl2009/pythonScripts/PAP_multibranches_inhibition.py
1
22104
# # A file that opens the neuroConstruct project LarkumEtAl2009 and run multiple simulations stimulating ech terminal apical branch with varying number of synapses. # # Author: Matteo Farinella from sys import * from java.io import File from java.lang import System from java.util import ArrayList from uc...
gpl-2.0
jmartinezchaine/OpenERP
openerp/addons/project_scrum/wizard/project_scrum_backlog_merger.py
9
4787
# -*- 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
eprivalov/sendec
reports/migrations/0001_initial.py
1
1324
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
apache-2.0
pgmillon/ansible
lib/ansible/modules/cloud/amazon/efs_facts.py
47
13236
#!/usr/bin/python # Copyright: 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'], ...
gpl-3.0
getredash/redash
redash/query_runner/databricks.py
3
8312
import datetime import logging import os import sqlparse from redash.query_runner import ( NotSupported, register, BaseSQLQueryRunner, TYPE_STRING, TYPE_BOOLEAN, TYPE_DATE, TYPE_DATETIME, TYPE_INTEGER, TYPE_FLOAT, ) from redash.settings import cast_int_or_default from redash.utils im...
bsd-2-clause
thfield/sf-base-election-data
venv/lib/python3.4/site-packages/yaml/dumper.py
277
2723
__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, ...
bsd-3-clause
dayatz/taiga-back
taiga/projects/migrations/0009_auto_20141024_1037.py
29
1306
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('projects', '0008_auto_20141024_1012'), ] operations = [ migrations.AlterField( model_name='issuestatus', ...
agpl-3.0
frederica07/Dragon_Programming_Process
jp/ac/kyoto_su/aokilab/dragon/example_model/example.py
1
7196
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import urllib from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * from jp.ac.kyoto_su.aokilab.dragon.mvc.model import OpenGLModel from jp.ac.kyoto_su.aokilab.dragon.mvc.view import * from jp.ac.kyoto_su.aokil...
bsd-2-clause
Learningtribes/edx-platform
lms/djangoapps/badges/events/course_meta.py
30
2945
""" Events which have to do with a user doing something with more than one course, such as enrolling in a certain number, completing a certain number, or completing a specific set of courses. """ from badges.models import CourseEventBadgesConfiguration, BadgeClass from badges.utils import requires_badges_enabled def...
agpl-3.0
manjunaths/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/split_mask.py
112
2921
# 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
ShinyROM/android_external_chromium_org
chrome/test/functional/media/media_jerky.py
78
8162
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Jerkiness performance test for video playback. Uses jerky tool, (http://go/jerky), to record a jerkiness metric for videos sens...
bsd-3-clause
tuxos/Django-facebook
docs/docs_env/Lib/encodings/iso2022_jp_ext.py
816
1069
# # iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_ext') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incr...
bsd-3-clause
jamestwebber/scipy
scipy/linalg/tests/test_basic.py
1
60524
from __future__ import division, print_function, absolute_import import warnings import itertools import numpy as np from numpy import (arange, array, dot, zeros, identity, conjugate, transpose, float32) import numpy.linalg as linalg from numpy.random import random from numpy.testing import (assert...
bsd-3-clause
EmpireProject/Empire
lib/modules/powershell/situational_awareness/network/powerview/get_loggedon.py
4
3109
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Get-NetLoggedon', 'Author': ['@harmj0y'], 'Description': ('Execute the NetWkstaUserEnum Win32API call to query a given host for actively logged on users. Part...
bsd-3-clause
ging/horizon
openstack_dashboard/dashboards/project/routers/ports/tables.py
10
3946
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic...
apache-2.0
ainmosni/django-snooze
django_snooze/fields.py
1
11240
# -*- coding: utf-8 -*- """ These are all adaptors for Django fields, not overly documented as that would just be duplicating Django's excellent documentation. """ from collections import OrderedDict from django.db.models.fields import NOT_PROVIDED from django_snooze.exceptions import RESTError class Field(object)...
bsd-3-clause
aarron/newsite
node_modules/node-gyp/gyp/gyptest.py
1752
8019
#!/usr/bin/env python # 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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
mit
quantmind/pulsar
pulsar/async/mixins.py
1
6580
import time from asyncio import Queue, CancelledError DEFAULT_LIMIT = 2**16 class FlowControl: """A protocol mixin for flow control logic. This implements the protocol methods :meth:`pause_writing`, :meth:`resume_writing`. """ _b_limit = 2*DEFAULT_LIMIT _paused = False _buffer_size = 0...
bsd-3-clause
mgagne/nova
nova/api/openstack/compute/schemas/v3/console_output.py
110
1393
# Copyright 2014 NEC Corporation. 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 ...
apache-2.0
sharpa/OMWare
Operations/BioNano/CheckMolecules/get_mol_align_stats.py
1
1186
#!/fslhome/jtpage/bin/python from sys import argv if len(argv) < 3: print("USAGE: python get_mol_align_stats.py <minimized_align_file> <mol_stats_file> [<prefiltered_ids>]") exit(1) filter=False ids=set() if len(argv) > 3: filter=True with open(argv[3]) as id_file: for line in id_file: line=line.strip() i...
gpl-2.0
xobs/novena-linux
scripts/gdb/linux/symbols.py
588
6302
# # gdb helper commands and functions for Linux kernel debugging # # load kernel and module symbols # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb import os import re from linux import module...
gpl-2.0
rsharris/kmervature
simple_errant_kmer_brute.py
1
2033
#!/usr/bin/env python """ Compute what the errant kmer distribution can be expected to look like, by brute force (considering *all* possible error patterns of a given length). That models the process used in recoverY, though it leaves out such complications as determining which kmers are good/bad, and that some errant...
lgpl-3.0
chizarlicious/chapel
util/chplenv/chpl_wide_pointers.py
5
1453
#!/usr/bin/env python import os, re, optparse from sys import stdout, stderr from utils import memoize @memoize def get(flag='wide'): wide_val = os.environ.get('CHPL_WIDE_POINTERS', 'struct') define = '' if wide_val == 'struct': define = '-DCHPL_WIDE_POINTER_STRUCT' else: match = re.m...
apache-2.0
kblin/supybot-gsoc
plugins/Google/local/simplejson/encoder.py
9
16011
"""Implementation of JSONEncoder """ import re try: from _speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _speedups import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ESCAPE = re.compile(r'...
bsd-3-clause
CAFans/android_kernel_lge_msm8974
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
simplyguru-dot/ansible-modules-extras
packaging/language/npm.py
73
8566
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chris Hoffman <christopher.hoffman@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
gpl-3.0
mic4ael/indico
indico/modules/cephalopod/forms.py
1
1122
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from wtforms import BooleanField, StringField from wtforms.fields...
mit
joeshaw/luigi
luigi/contrib/redis_store.py
74
2980
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
youprofit/kivy
kivy/extras/highlight.py
78
1880
'''Pygments lexer for kv language ''' from pygments.lexer import RegexLexer, bygroups, using from pygments.lexers.agile import PythonLexer from pygments import highlight from pygments.token import * from pygments.formatters import get_formatter_by_name import sys class KivyLexer(RegexLexer): name = 'Kivy' ali...
mit
cloudviz/agentless-system-crawler
crawler/utils/connection_utils.py
3
1809
import psutil from utils.features import ConnectionFeature def crawl_connections(): created_since = -1 proc_list = psutil.process_iter() for p in proc_list: pid = (p.pid() if hasattr(p.pid, '__call__') else p.pid) status = (p.status() if hasattr(p.status, '__call__' ...
apache-2.0
ahvigil/picklr
test/testInput.py
1
1557
# Copyright 2015 Arthur Vigil # This file is part of picklr. # # Picklr 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. # # Picklr is d...
gpl-3.0
rogerhu/django
tests/comment_tests/tests/test_feeds.py
23
1854
from xml.etree import ElementTree as ET from django.conf import settings from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from . import CommentTestCase from ..models import Article class CommentFeedTests(Commen...
bsd-3-clause
ybellavance/python-for-android
python3-alpha/extra_modules/pyxmpp2/jid.py
46
9640
# # (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
apache-2.0
peter-jang/ansible-modules-core
cloud/amazon/ec2_metric_alarm.py
53
10776
#!/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
obeattie/pylons
pylons/i18n/translation.py
2
5820
"""Translation/Localization functions. Provides :mod:`gettext` translation functions via an app's ``pylons.translator`` and get/set_lang for changing the language translated to. """ import os from gettext import NullTranslations, translation import pylons __all__ = ['_', 'add_fallback', 'get_lang', 'gettext', 'gett...
bsd-3-clause
pcm17/tensorflow
tensorflow/python/framework/random_seed_test.py
36
2150
# 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
RealTimeWeb/wikisite
MoinMoin/script/migration/text_moin158_wiki.py
1
42466
# -*- coding: iso-8859-1 -*- """ MoinMoin - MoinMoin Wiki Markup Parser @copyright: 2000, 2001, 2002 by Jürgen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ import os, re from MoinMoin import config, wikiutil from MoinMoin import macro as wikimacro from MoinMoin.Page import Page from...
apache-2.0
TheTimmy/spack
var/spack/repos/builtin/packages/portage/package.py
2
2182
############################################################################## # Copyright (c) 2017, Los Alamos National Security, LLC # Produced at the Los Alamos National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # # For details, ...
lgpl-2.1
andyzsf/edx
common/lib/xmodule/xmodule/static_content.py
4
6580
# /usr/bin/env python """ This module has utility functions for gathering up the static content that is defined by XModules and XModuleDescriptors (javascript and css) """ import logging import hashlib import os import errno import sys from collections import defaultdict from docopt import docopt from path import path...
agpl-3.0
sjperkins/tensorflow
tensorflow/python/debug/cli/stepper_cli.py
123
21329
# 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
wxgeo/geophar
wxgeometrie/sympy/physics/quantum/anticommutator.py
5
4323
"""The anti-commutator: ``{A,B} = A*B + B*A``.""" from __future__ import print_function, division from sympy import S, Expr, Mul, Integer from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.operator import Operator from sympy.physics.quantum.dagger import Dagger __all__ = [ 'AntiC...
gpl-2.0
ygol/odoo
addons/stock/report/__init__.py
376
1088
# -*- 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
x111ong/odoo
addons/website_forum/models/forum.py
233
38491
# -*- coding: utf-8 -*- from datetime import datetime import uuid from werkzeug.exceptions import Forbidden import logging import openerp from openerp import api, tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.exceptions import Warning from openerp.osv impo...
agpl-3.0
gautam1858/tensorflow
tensorflow/tools/pip_package/check_load_py_test.py
44
3076
# 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
Geoion/AutobahnPython
examples/twisted/websocket/streaming/streaming_server.py
11
3522
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 Softw...
mit
TomBaxter/osf.io
api/preprint_providers/permissions.py
4
3624
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth.models import Group from guardian.shortcuts import assign_perm from guardian.shortcuts import get_perms from guardian.shortcuts import remove_perm from rest_framework import permissions as drf_permissions from api.base.utils impo...
apache-2.0
suranap/qiime
scripts/subsample_fasta.py
15
2099
#!/usr/bin/env python from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __email__ = "william.a.walters@gmail.com" from os.path import spli...
gpl-2.0
a0c/odoo
addons/sale_layout/models/sale_layout.py
62
5080
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
mesonbuild/meson
mesonbuild/compilers/d.py
1
37425
# Copyright 2012-2017 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
apache-2.0
awagnon/maraschino
lib/sqlalchemy/util/langhelpers.py
13
28266
# util/langhelpers.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Routines to help with the creation, loading and introspection of modules, class...
mit
CVL-dev/cvl-fabric-launcher
pyinstaller-2.1/tests/setupenv_windows.py
6
4510
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
gpl-3.0
awkspace/ansible
lib/ansible/module_utils/facts/system/apparmor.py
232
1311
# Collect facts related to apparmor # # 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. # # An...
gpl-3.0
x2nie/odoo
addons/crm_partner_assign/report/crm_lead_report.py
309
5104
# -*- 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
Dawny33/luigi
test/file_test.py
26
7360
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
wesleywh/GameDevRepo
documentation_builder.py
1
6962
import os,sys, argparse,shutil,re from functools import reduce #==================================== # Will build my documentation site based on notes and # variables inside my scripts. #==================================== def main(): parser = argparse.ArgumentParser(description='Supply path to root folder of scri...
mit
tungvx/deploy
Django-0.90/tests/testapp/models/lookup.py
1
4075
""" 7. The lookup API This demonstrates features of the database API. """ from django.core import meta class Article(meta.Model): headline = meta.CharField(maxlength=100) pub_date = meta.DateTimeField() class META: ordering = ('-pub_date', 'headline') def __repr__(self): return self....
apache-2.0
Brocade-OpenSource/OpenStack-DNRM-Nova
nova/openstack/common/rpc/impl_qpid.py
3
25365
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # Copyright 2011 - 2012, 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 # # ...
apache-2.0
moble/sympy
sympy/series/fourier.py
59
10422
"""Fourier Series""" from __future__ import print_function, division from sympy import pi, oo from sympy.core.expr import Expr from sympy.core.add import Add from sympy.core.sympify import sympify from sympy.core.singleton import S from sympy.core.symbol import Dummy, Symbol from sympy.core.compatibility import is_se...
bsd-3-clause
mikaelboman/home-assistant
homeassistant/components/sensor/mfi.py
7
3182
""" Support for Ubiquiti mFi sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.mfi/ """ import logging import requests from homeassistant.components.sensor import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, TEMP_CE...
mit
komsas/OpenUpgrade
addons/web/tests/test_menu.py
34
5729
# -*- coding: utf-8 -*- import collections import mock import unittest2 from openerp.http import request as req from . import common from ..controllers import main class Placeholder(object): def __init__(self, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) class LoadTest(co...
agpl-3.0
mkennedy04/knodj
env/Lib/site-packages/django/utils/html_parser.py
82
5221
import re import sys from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = ( (current_version < (2, 7, 3)) or (current_version >= (3, 0) and current_version < (3, 2, 3)) ) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError...
mit
baifendian/harpc
python/bfd/harpc/loadbalancing_strategy/round_robin_strategy.py
1
1116
# -*- coding: utf-8 -*- # Copyright (C) 2015 Baifendian 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 appl...
apache-2.0
kuri65536/python-for-android
python-modules/twisted/twisted/python/htmlizer.py
60
2639
# -*- test-case-name: twisted.python.test.test_htmlizer -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ HTML rendering of Python source. """ import tokenize, cgi, keyword import reflect class TokenPrinter: currentCol, currentLine = 0, 1 lastIdentifier = parameters =...
apache-2.0
djw8605/htcondor
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/tr.py
10
7343
apiAttachAvailable = u'API Kullanilabilir' apiAttachNotAvailable = u'Kullanilamiyor' apiAttachPendingAuthorization = u'Yetkilendirme Bekliyor' apiAttachRefused = u'Reddedildi' apiAttachSuccess = u'Basarili oldu' apiAttachUnknown = u'Bilinmiyor' budDeletedFriend = u'Arkadas Listesinden Silindi' budFriend = u'Arka...
apache-2.0
caphrim007/ansible-modules-extras
messaging/rabbitmq_policy.py
78
4440
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, John Dewey <john@dewey.ws> # # 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, o...
gpl-3.0
c24b/reporting
connect.py
1
4135
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys #cleaning import re #connexion import urllib import requests from urlparse import urlparse #extraction methods from extractors import * class Connexion(object): ''' basic wrapper around python requests: fetching content providing a url *fetch with multiple...
gpl-2.0
bcorbet/SickRage
lib/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...
gpl-3.0