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
talhajaved/nyuadmarket
flask/lib/python2.7/site-packages/sqlalchemy/orm/identity.py
21
7091
# orm/identity.py # Copyright (C) 2005-2015 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 import weakref from . import attributes from .. import util class IdentityMap(dict...
mit
steveb/heat
heat/api/openstack/v1/actions.py
8
2608
# # 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, software # ...
apache-2.0
IronLanguages/ironpython3
Src/StdLib/Lib/idlelib/SearchDialog.py
12
2630
from tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase def _setup(text): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_searchdialog"): engine._searchdialog = SearchDialog(root, engine) return engine._searchdia...
apache-2.0
standak3/ElementalX_4.4.2
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
wangyum/beam
sdks/python/apache_beam/runners/dataflow/internal/dependency.py
1
26995
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
shashankbassi92/tornado
tornado/tcpclient.py
208
6802
#!/usr/bin/env python # # Copyright 2014 Facebook # # 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 a...
apache-2.0
busyStone/ardupilot
mk/PX4/Tools/genmsg/src/genmsg/__init__.py
215
2116
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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 ...
gpl-3.0
cloudfoundry/php-buildpack
fixtures/symfony_5_local_deps/vendor/doctrine/orm/docs/en/conf.py
24
6535
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
apache-2.0
snoopspy/gtest
test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
jrutila/django-shop
docs/conf.py
19
7127
# -*- coding: utf-8 -*- # # django SHOP documentation build configuration file, created by # sphinx-quickstart on Mon Dec 6 14:42:25 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
bsd-3-clause
katjoyce/certificate-transparency
python/ct/client/async_log_client.py
7
18328
"""RFC 6962 client API.""" from ct.client import log_client from ct.client.db import database import gflags import logging import random from twisted.internet import defer from twisted.internet import error from twisted.internet import protocol from twisted.internet import reactor as ireactor from twisted.internet im...
apache-2.0
networks-lab/isilib
metaknowledge/medline/recordMedline.py
2
5557
#Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2016 import collections import itertools import io from ..mkExceptions import BadPubmedRecord, RCTypeError from ..mkRecord import ExtendedRecord from .tagProcessing.tagNames import tagNameConverterDict, authorBasedTags from .tagProcessing.tag...
gpl-2.0
akx/lepo
lepo/apidef/operation/base.py
1
2258
from collections.__init__ import OrderedDict from django.utils.functional import cached_property from lepo.utils import maybe_resolve class Operation: parameter_class = None # This should never be used def __init__(self, api, path, method, data): """ :type api: lepo.apidef.doc.APIDefinitio...
mit
trishnaguha/ansible
lib/ansible/utils/module_docs_fragments/cloudstack.py
53
2922
# -*- coding: utf-8 -*- # Copyright (c) 2015, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard cloudstack documentation fragment DOCUMENTATION = ''' options: api_key: description: ...
gpl-3.0
JustinWingChungHui/okKindred
family_tree/models/relation.py
2
5182
from django.db import models from family_tree.models.person import Person from django.utils.translation import ugettext_lazy as _ import reversion #Relation types. Note that 'raised by' will resolve to 'raised' but inverse PARTNERED = 1 RAISED = 2 RAISED_BY = 3 RELATION_TYPES = ( (PARTNERED, _('Partnered')), ...
gpl-2.0
edx/xqueue-watcher
tests/test_grader.py
1
4632
import unittest from unittest import mock import json import sys from path import Path from queue import Queue from xqueue_watcher import grader MYDIR = Path(__file__).dirname() / 'fixtures' class MockGrader(grader.Grader): def grade(self, grader_path, grader_config, student_response): tests = [] ...
agpl-3.0
jonathan-beard/edx-platform
common/djangoapps/edxmako/shortcuts.py
67
5272
# Copyright (c) 2008 Mikeal Rogers # # 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...
agpl-3.0
tpummer/fm-pw6-forbiddenisle-tombot
game.py
1
3338
#fm-pw6-forbiddenisle aka TomBot - Bot for the Freies Magazin 6th programming challenge # Copyright (C) 2013 Thomas Pummer # # 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 v...
gpl-3.0
ollie314/cassandra
pylib/cqlshlib/test/test_cqlsh_commands.py
32
1219
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
loseblue/vim-ycm-windows-64
third_party/ycmd/third_party/jedi/test/test_evaluate/test_absolute_import.py
11
1207
""" Tests ``from __future__ import absolute_import`` (only important for Python 2.X) """ import jedi from jedi._compatibility import u from jedi.parser import Parser from .. import helpers def test_explicit_absolute_imports(): """ Detect modules with ``from __future__ import absolute_import``. """ par...
gpl-3.0
Taapat/enigma2-openpli-vuplus
keyids.py
53
5285
KEYIDS = { "KEY_RESERVED": 0, "KEY_ESC": 1, "KEY_1": 2, "KEY_2": 3, "KEY_3": 4, "KEY_4": 5, "KEY_5": 6, "KEY_6": 7, "KEY_7": 8, "KEY_8": 9, "KEY_9": 10, "KEY_0": 11, "KEY_MINUS": 12, "KEY_EQUAL": 13, "KEY_BACKSPACE": 14, "KEY_TAB": 15, "KEY_Q": 16, "KEY_W": 17, "KEY_E": 18, "KEY_R": 19, "KEY_T": 20, "KEY_Y": 21, "KEY_U...
gpl-2.0
google/it-cert-automation
Course1/snippets/C1M2.py
1
5737
#!/usr/bin/env python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
monash-merc/karaage
karaage/legacy/admin/south_migrations/00001_initial_create.py
3
8990
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration from django.db import connection class Migration(SchemaMigration): def forwards(self, orm): cursor = connection.cursor() if 'django_admin_log' not in connection.introspection.get_table_list(cursor): d...
gpl-3.0
ArtsiomCh/tensorflow
tensorflow/contrib/boosted_trees/python/kernel_tests/split_handler_ops_test.py
30
19467
# 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
rschroll/prsannots
prsannots/pdfcontent.py
1
4222
# Copyright 2012 Robert Schroll # # This file is part of prsannots and is distributed under the terms of # the LGPL license. See the file COPYING for full details. from pyPdf.pdf import ContentStream from pyPdf.generic import ArrayObject, NameObject class StupidSVGInterpreterError(Exception): pass # Help on add...
lgpl-3.0
emencia/emencia-django-socialaggregator
socialaggregator/migrations/0005_auto__add_field_ressource_language.py
1
5298
# -*- 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 'Ressource.language' db.add_column(u'socialaggregator_ressource', 'language', ...
agpl-3.0
rosmo/boto
tests/integration/cloudsearch/test_cert_verification.py
126
1577
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 withou...
mit
Arcanemagus/SickRage
lib/guessit/rules/properties/container.py
11
2338
#!/usr/bin/env python # -*- coding: utf-8 -*- """ container property """ from rebulk.remodule import re from rebulk import Rebulk from ..common import seps from ..common.validators import seps_surround from ...reutils import build_or_pattern def container(): """ Builder for rebulk object. :return: Creat...
gpl-3.0
livioc/selenium
py/test/selenium/webdriver/common/example2.py
51
1326
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requ...
apache-2.0
theheros/kbengine
kbe/res/scripts/common/Lib/ctypes/test/test_simplesubclasses.py
6
1344
import unittest from ctypes import * class MyInt(c_int): def __eq__(self, other): if type(other) != MyInt: return NotImplementedError return self.value == other.value class Test(unittest.TestCase): def test_compare(self): self.assertEqual(MyInt(3), MyInt(3)) ...
lgpl-3.0
jwbaker/pytvdb
tests/test_api.py
1
4769
import pytest from pytvdb import TVDB class TestTVDB: @pytest.mark.unit def test_build_list_of_models(self): class TestObject: def __init__(self, **kwargs): self.value = kwargs.get('value') data = [1, 2, 3, 4, 5] f = TestObject res = TVDB()._build...
unlicense
ForNeVeR/styx-miranda
styx-client/protobuf-2.5.0/python/mox.py
603
38237
#!/usr/bin/python2.4 # # Copyright 2008 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 o...
mit
tmerrick1/spack
var/spack/repos/builtin/packages/r-dicekriging/package.py
4
1672
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
zcqHub/django-booking
booking/migrations/0008_move_data_from_old_model_to_hvad.py
4
11224
# flake8: noqa # -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # for every status for status in orm['booking.BookingS...
mit
iamutkarshtiwari/kivy
kivy/lang.py
12
80219
'''Kivy Language ============= The Kivy language is a language dedicated to describing user interface and interactions. You could compare this language to Qt's QML (http://qt.nokia.com), but we included new concepts such as rule definitions (which are somewhat akin to what you may know from CSS), templating and so on....
mit
ostinelli/pyopenspime
lib/pyopenspime/xmpp/roster.py
203
9163
## roster.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version. ...
gpl-3.0
thobrla/apitools
apitools/base/py/credentials_lib_test.py
11
4797
# # Copyright 2015 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
oudalab/fajita
pythonAPI/flask/lib/python3.5/site-packages/flask/debughelpers.py
318
6024
# -*- coding: utf-8 -*- """ flask.debughelpers ~~~~~~~~~~~~~~~~~~ Various helpers to make the development experience better. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from ._compat import implements_to_string, text_type from .app import Flask from .bl...
mit
LLCoolDave/MafiaBot
MafiaBotTest.py
1
5747
__author__ = 'LLCoolDave' # ToDo: Replace by proper unit tests, currently broken as it stands import logging from MafiaBot.MafiaBot import * from sopel.tools import Identifier log = logging.getLogger('MafiaBot') log.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) formatter = logging.F...
mit
noam09/deluge-telegramer
telegramer/include/telegram/inline/inlinequeryresultcachedsticker.py
2
2684
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
thaumos/ansible
lib/ansible/modules/network/fortios/fortios_firewall_ssh_host_key.py
24
9501
#!/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
lucastheis/c2s
scripts/c2s-evaluate.py
1
7723
#!/usr/bin/env python """ Evaluates firing rate predictions in terms of correlations or Poisson likelihoods. Examples: c2s evaluate data.preprocessed.pck predictions.pck """ import os import sys from argparse import ArgumentParser from scipy.io import savemat from pickle import load from numpy import mean, min, h...
mit
tonisbones/thisiship
utils.py
1
1827
import json import sys import os import facebook import datetime import logging template_dir = "templates" log_dir = "logs" log_level = logging.INFO default_event_priority = "9" jsondump_dir = "jsondump" pages_filename = "pages.json" """ the next 3 methods are duplicates. need to abstract it out enum? constants? """...
gpl-3.0
talha131/pelican-plugins
tag_cloud/tag_cloud.py
15
2646
''' tag_cloud =================================== This plugin generates a tag cloud from available tags ''' from __future__ import unicode_literals from collections import defaultdict from operator import itemgetter import logging import math import random from pelican import signals logger = logging.getLogger(__n...
agpl-3.0
mttr/django
django/core/management/utils.py
405
2590
from __future__ import unicode_literals import os import sys from subprocess import PIPE, Popen from django.utils import six from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text from .base import CommandError def popen_wrapper(args, os_err_exc_type=CommandError, universal_newlines=True): """ ...
bsd-3-clause
alex/kombu
kombu/transport/sqlalchemy/models.py
38
1961
from __future__ import absolute_import import datetime from sqlalchemy import (Column, Integer, String, Text, DateTime, Sequence, Boolean, ForeignKey, SmallInteger) from sqlalchemy.orm import relation from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.schema...
bsd-3-clause
koparasy/faultinjection-gem5
src/arch/x86/isa/insts/simd64/integer/data_transfer/move_mask.py
91
2227
# 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...
bsd-3-clause
Sweetgrassbuffalo/ReactionSweeGrass-v2
.meteor/local/dev_bundle/python/Lib/lib2to3/fixes/fix_idioms.py
327
4889
"""Adjust some old Python 2 idioms to their modern counterparts. * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while True:"....
gpl-3.0
StackStorm/pecan
pecan/templating.py
5
8272
from .compat import escape from .jsonify import encode _builtin_renderers = {} error_formatters = [] # # JSON rendering engine # class JsonRenderer(object): ''' Defines the builtin ``JSON`` renderer. ''' def __init__(self, path, extra_vars): pass def render(self, template_path, namespac...
bsd-3-clause
Parrot-Developers/ardupilot
Tools/autotest/param_metadata/htmlemit.py
148
2754
#!/usr/bin/env python import re from param import * from emit import Emit import cgi # Emit docs in a form acceptable to the APM wordpress docs site class HtmlEmit(Emit): def __init__(self): html_fname = 'Parameters.html' self.f = open(html_fname, mode='w') self.preamble = '''<!-- Dyn...
gpl-3.0
rolapp/ZattooBox
pytz/tests/test_lazy.py
88
9772
from operator import * import os.path import sys import unittest import warnings if __name__ == '__main__': # Only munge path if invoked as a script. Testrunners should have setup # the paths already sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, os.pardir))) from pytz.lazy import LazyList, ...
bsd-2-clause
jhjguxin/blogserver
lib/python2.7/site-packages/PIL/GbrImagePlugin.py
40
1628
# # The Python Imaging Library # $Id$ # # load a GIMP brush file # # History: # 96-03-14 fl Created # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1996. # # See the README file for information on usage and redistribution. # import Image, ImageFile def i32(c): return ord(c[3]) + (or...
mit
kyro38/TagData
osmAPI.py
1
11061
#!/usr/bin/python """ Basicly what this script does : * First it retrieve from the Overpass API every line of the TAG network (id 3300434) * Each line has 2 to 6 directions (also known as mutliple banches). * Each direction has a sorted list of station. Some of them are shared (main trunk) * By comparing each direc...
apache-2.0
amit0701/rally
rally/verification/tempest/compare2html.py
8
1213
# 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, software # distributed under the Li...
apache-2.0
schleichdi2/OpenNfr_E2_Gui-6.0
lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py
42
13887
from boxbranding import getMachineBrand, getMachineName, getBoxType from os import system from enigma import eTimer from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Components.Pixmap import Pixmap from Componen...
gpl-2.0
sanjayankur31/hamster
wafadmin/TaskGen.py
7
10634
#!/usr/bin/env python2 # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,traceback,copy import Build,Task,Utils,Logs,Options from Logs import debug,error,warn from Constants import* typos={'sources':'source','targets':'target','include':'includes','define':'defines','imp...
gpl-3.0
yrobla/nova
nova/api/openstack/compute/versions.py
14
7798
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 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.apach...
apache-2.0
x2nie/odoo
addons/lunch/report/order.py
377
2637
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
tlakshman26/cinder-bug-fix-volume-conversion-full
cinder/tests/unit/scheduler/test_capacity_weigher.py
17
14495
# Copyright 2011-2012 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
oinopion/django
django/core/mail/backends/smtp.py
477
5239
"""SMTP email backend class.""" import smtplib import ssl import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address from django.core.mail.utils import DNS_NAME class EmailBackend(BaseEmailBackend): """ A...
bsd-3-clause
EdDev/vdsm
lib/vdsm/network/netinfo/bridges.py
1
2859
# # Copyright 2015 Hat, 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 2 of the License, or # (at your option) any later version. # # This program is distributed in the ho...
gpl-2.0
elsonrodriguez/madhatter
cobbler/action_replicate.py
3
13381
""" Replicate from a cobbler master. Copyright 2007-2009, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> Scott Henson <shenson@redhat.com> 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 ve...
gpl-2.0
Bjay1435/capstone
rootfs/usr/lib/python3.4/curses/has_key.py
195
5634
# # Emulation of has_key() function for platforms that don't use ncurses # import _curses # Table mapping curses keys to the terminfo capability name _capability_names = { _curses.KEY_A1: 'ka1', _curses.KEY_A3: 'ka3', _curses.KEY_B2: 'kb2', _curses.KEY_BACKSPACE: 'kbs', _curses.KEY_BEG: 'kbeg', ...
mit
donald-pinckney/EM-Simulator
EM Sim/EM Sim/py_lib/ctypes/macholib/framework.py
268
2414
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ Generic framework path manipulation """ import re __all__ = ['framework_info'] STRICT_FRAMEWORK_RE =...
apache-2.0
Jannis/ardour3
libs/pbd/pbd/signals.py
1
10246
#!/usr/bin/python # # Copyright (C) 2009-2012 Paul Davis # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # ...
gpl-2.0
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Utilities/TokenStorage/__init__.py
4
1173
from temboo.Library.Utilities.TokenStorage.DeleteToken import DeleteToken, DeleteTokenInputSet, DeleteTokenResultSet, DeleteTokenChoreographyExecution from temboo.Library.Utilities.TokenStorage.GetTokenDetails import GetTokenDetails, GetTokenDetailsInputSet, GetTokenDetailsResultSet, GetTokenDetailsChoreographyExecutio...
apache-2.0
shenyy/lily2-gem5
src/cpu/testers/directedtest/RubyDirectedTester.py
17
2482
# Copyright (c) 2010 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions...
bsd-3-clause
mpetyx/palmdrop
venv/lib/python2.7/site-packages/cms/tests/menu_utils.py
7
3062
from cms.test_utils.testcases import CMSTestCase from cms.test_utils.util.mock import AttributeObject from django.http import HttpResponse from menus.templatetags.menu_tags import PageLanguageUrl from menus.utils import (simple_language_changer, find_selected, language_changer_decorator) class DumbPageLanguageUr...
apache-2.0
wolftankk/livestreamer
src/livestreamer/plugins/wattv.py
32
2341
import hashlib import re from livestreamer.plugin import Plugin from livestreamer.plugin.api import http from livestreamer.stream import HDSStream # Got the secret from the swf with rev number location # (tv/wat/player/media/Media.as) TOKEN_SECRET = '9b673b13fa4682ed14c3cfa5af5310274b514c4133e9b3a81e6e3aba009l2564' ...
bsd-2-clause
DragonMastur/FakeRealNewsDetection
Serverless Functions/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## 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 ...
agpl-3.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/requests/requests/packages/urllib3/contrib/pyopenssl.py
215
10101
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
lgpl-3.0
eshioji/omibot
ampel.py
1
1487
import subprocess import threading import time import traceback import common import config class Ampel: def __init__(self, base_command): self.base_command = base_command def signal(self, order, switchto): switch = '1' if switchto else '0' cmd = self.base_command + ['-as', str(order...
apache-2.0
bt3gl/Python-and-Algorithms-and-Data-Structures
First_edition_2014/ebook_src/builtin_structures/permutations.py
2
1171
#!/usr/bin/env python __author__ = "bt3" def perm(str1): ''' >>> perm('123') ['123', '132', '231', '213', '312', '321'] ''' if len(str1) < 2: return str1 res = [] for i, c in enumerate(str1): for cc in perm(str1[i+1:] + str1[:i]): res.append(c + cc) retu...
mit
SAM-IT-SA/odoo
openerp/addons/base/tests/test_qweb.py
289
4814
# -*- coding: utf-8 -*- import cgi import json import os.path import glob import re import collections from lxml import etree import openerp.addons.base.ir.ir_qweb import openerp.modules from openerp.tests import common from openerp.addons.base.ir import ir_qweb class TestQWebTField(common.TransactionCase): def ...
agpl-3.0
ohagendorf/project_generator
project_generator/settings.py
4
2317
# Copyright 2014-2015 0xc0170 # # 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
XiaodunServerGroup/xiaodun-platform
lms/djangoapps/wechat/tests/test_tabs.py
13
14836
from django.test import TestCase from mock import MagicMock from mock import patch import courseware.tabs as tabs from django.test.utils import override_settings from django.core.urlresolvers import reverse from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factorie...
agpl-3.0
Lynx187/script.module.urlresolver
lib/urlresolver/plugins/facebook.py
4
3010
''' facebook urlresolver plugin Copyright (C) 2013 icharania This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is d...
gpl-2.0
javachengwc/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/maps/google/zoom.py
224
6622
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import xrange from math import pi, sin, log, exp, atan # Constants used for degree to radian conversion, and vice-versa. DTOR = pi / 180. RTOD = 18...
apache-2.0
JonathanStein/odoo
addons/membership/report/report_membership.py
313
5267
# -*- 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
calebjordan/klayout-macros
pymacros/Write Images.py
1
4299
# $description: Write Image Distribution from Wafer # $autorun # $show-in-menu import pya import sys from math import copysign from numpy import arange sys.stderr = sys.stdout class MenuAction(pya.Action): def __init__(self, title, shortcut, action): self.title = title self.shortcut = shortcut ...
mit
sbryan12144/BeastMode-Elite
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
mkowoods/deep-learning
transfer-learning/tensorflow_vgg/vgg19.py
153
4616
import os import tensorflow as tf import numpy as np import time import inspect VGG_MEAN = [103.939, 116.779, 123.68] class Vgg19: def __init__(self, vgg19_npy_path=None): if vgg19_npy_path is None: path = inspect.getfile(Vgg19) path = os.path.abspath(os.path.join(path, os.pardir...
mit
xiangel/hue
desktop/core/ext-py/Django-1.6.10/tests/admin_ordering/tests.py
49
6672
from __future__ import absolute_import, unicode_literals from django.test import TestCase, RequestFactory from django.contrib import admin from django.contrib.admin.options import ModelAdmin from django.contrib.auth.models import User from .models import (Band, Song, SongInlineDefaultOrdering, SongInlineNewOrderi...
apache-2.0
Alpheus/simc
casc_extract/casc_extract.py
4
6915
#!/usr/bin/env python3 # vim: tabstop=4 shiftwidth=4 softtabstop=4 import optparse, sys, os import build_cfg, casc import binascii parser = optparse.OptionParser( usage = 'Usage: %prog -d wow_install_dir [options] file_path ...') parser.add_option( '--cdn', dest = 'online', action = 'store_true', help = 'Fetch data f...
gpl-3.0
turbidsoul/tsutil
tsutil/http_server.py
1
5471
# -*- coding: utf-8 -*- import asyncio import logging import os from typing import Union import mimetypes req_log = logging.getLogger('request') req_log.setLevel(logging.INFO) dir_template = '''<html> <head> <title>目录 {dir_name}</title> </head> <body> <h2>{nav}</h2> <hr> {content} </body> </html>''' file_template = ...
mit
vmarkovtsev/django
tests/custom_columns/tests.py
89
4105
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import Article, Author class CustomColumnsTests(TestCase): def setUp(self): self.a1 = Author.objects.create(first_name="John", last_name="Smit...
bsd-3-clause
archen/django
tests/utils_tests/test_datetime_safe.py
54
2080
import unittest from datetime import date as original_date, datetime as original_datetime from django.utils.datetime_safe import date, datetime class DatetimeTests(unittest.TestCase): def setUp(self): self.just_safe = (1900, 1, 1) self.just_unsafe = (1899, 12, 31, 23, 59, 59) self.really...
bsd-3-clause
ojengwa/oh-mainline
vendor/packages/Django/django/contrib/flatpages/tests/forms.py
113
4014
from __future__ import unicode_literals from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage from django.test import TestCase from django.test.utils import override_settings from django.utils import translation @override_settings...
agpl-3.0
moloch--/TornadoAppTemplate
handlers/AuthenticationHandlers.py
1
3911
# -*- coding: utf-8 -*- """ @author: moloch Copyright 2015 """ import json import logging from datetime import datetime import bcrypt from tornado.options import options from libs.JsonAPI import json_api_method from libs.ValidationError import ValidationError from models.User import User from .BaseHandlers import ...
apache-2.0
pmclanahan/basket
news/migrations/0001_initial.py
2
3070
# -*- 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 'Subscriber' db.create_table('news_subscriber', ( ('email', self.gf('django.db.mo...
mpl-2.0
windskyer/k_cinder
paxes_cinder/k2aclient/k2asample/tool_ssp_audit_plot.py
1
18735
# # # ================================================================= # ================================================================= import eventlet from itertools import repeat from collections import deque import time import pickle from paxes_cinder.k2aclient.k2asample.tool_ssp_simulation import MockLu, \ ...
apache-2.0
ScholzVolkmer/django-cms
cms/management/commands/subcommands/base.py
36
1617
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError import sys class SubcommandsCommand(BaseCommand): subcommands = {} command_name = '' def __init__(self): super(SubcommandsCommand, self).__init__() for name, subcommand in self.subcommands.items(): ...
bsd-3-clause
morrisonlevi/FrameworkBenchmarks
php-fuel/setup.py
5
1857
import subprocess import sys import os import setup_util from os.path import expanduser home = expanduser("~") def start(args, logfile, errfile): setup_util.replace_text("php-fuel/fuel/app/config/production/db.php", "localhost", ""+ args.database_host +"") setup_util.replace_text("php-fuel/deploy/nginx.conf", "ro...
bsd-3-clause
jbedorf/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/conditional_distribution_test.py
135
3028
# 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
vineodd/PIMSim
GEM5Simulation/gem5/src/gpu-compute/X86GPUTLB.py
2
3390
# Copyright (c) 2011-2015 Advanced Micro Devices, Inc. # All rights reserved. # # For use for simulation and test purposes only # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must ...
gpl-3.0
prds21/barrial-movie
servers/jumbofiles.py
44
2439
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para jumbofiles # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core i...
gpl-3.0
brain-tec/e-commerce
website_sale_product_brand/controllers/main.py
3
3061
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd. # (<http://www.serpentcs.com>) # # This program is free softwa...
agpl-3.0
victormanakkat/Taco-Chronicles
main.py
1
3071
# main.py # By Tyler Spadgenske VERSION = '1.0.19' def main(): #Really important values showFPS = True TOTAL_OBJECTS = 1 #Import modules import pygame, sys, os from pygame.locals import * #import custom classes import background, button, toolbar, selectGun, selectTool, person, powerup...
gpl-3.0
kongo/vim-presentation-ru
node_modules/grunt/node_modules/gzip-js/node_modules/deflate-js/test/runner.py
177
1688
#!/usr/bin/env python import argparse import deflate import inflate from colorama import Fore testDir = 'test-files' outDir = 'test-outs' allPassed = True parser = argparse.ArgumentParser(description='Process command-line arguments') parser.add_argument('--test', metavar='path/to/file', type=str, default='both', na...
mit
jbzdak/edx-platform
common/djangoapps/util/memcache.py
251
1344
""" This module provides a KEY_FUNCTION suitable for use with a memcache backend so that we can cache any keys, not just ones that memcache would ordinarily accept """ from django.utils.encoding import smart_str import hashlib import urllib def fasthash(string): """ Hashes `string` into a string representatio...
agpl-3.0