repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
tempbottle/rethinkdb
refs/heads/next
external/v8_3.30.33.16/tools/unittests/run_perf_test.py
36
#!/usr/bin/env python # Copyright 2014 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from collections import namedtuple import coverage import json from mock import DEFAULT from mock import MagicMock import os from os ...
mrjoes/flask-admin
refs/heads/master
flask_admin/contrib/sqla/tools.py
6
from sqlalchemy import tuple_, or_, and_ from sqlalchemy.sql.operators import eq from sqlalchemy.exc import DBAPIError from ast import literal_eval from flask.ext.admin._compat import filter_list from flask.ext.admin.tools import iterencode, iterdecode, escape def parse_like_term(term): if term.startswith('^'): ...
cfg2015/EPT-2015-2
refs/heads/master
addons/account_followup/wizard/__init__.py
437
# -*- 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...
eneldoserrata/marcos_openerp
refs/heads/master
addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/utils/users.py
9
#messages_pool = [] def post_message(request, msg): #global messages_pool #messages_pool.append(msg) try: if not 'messages_pool' in request.session: request.session['messages_pool'] = [] request.session['messages_pool'] = request.session['messages_pool'] + [msg] except: ...
dshyshov/MAVProxy
refs/heads/master
MAVProxy/tools/mavflightview.py
3
#!/usr/bin/env python ''' view a mission log on a map ''' import sys, time, os from pymavlink import mavutil, mavwp, mavextra from MAVProxy.modules.mavproxy_map import mp_slipmap, mp_tile from MAVProxy.modules.lib import mp_util import functools try: import cv2.cv as cv except ImportError: import cv from o...
wtanaka/google-app-engine-django-openid
refs/heads/master
src/openid/yadis/accept.py
184
"""Functions for generating and parsing HTTP Accept: headers for supporting server-directed content negotiation. """ def generateAcceptHeader(*elements): """Generate an accept header value [str or (str, float)] -> str """ parts = [] for element in elements: if type(element) is str: ...
jgmize/kuma
refs/heads/master
kuma/wiki/tests/test_tasks.py
4
from __future__ import with_statement from datetime import datetime import os from django.conf import settings from kuma.core.cache import memcache from kuma.core.tests import ok_ from kuma.users.models import User from kuma.users.tests import UserTestCase, user from . import document, revision from ..models import...
PongPi/isl-odoo
refs/heads/8.0
addons/website_crm_partner_assign/models/__init__.py
1273
import res_partner
2013Commons/HUE-SHARK
refs/heads/master
desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/core/management/commands/runserver.py
72
from django.core.management.base import BaseCommand, CommandError from optparse import make_option import os import sys class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--noreload', action='store_false', dest='use_reloader', default=True, help='Tells Django to ...
Mlieou/leetcode_python
refs/heads/master
leetcode/python/ex_415.py
3
class Solution(object): def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ i = len(num1) -1 j = len(num2) -1 carry = 0 res = '' while i >= 0 or j >= 0 or carry > 0: s = 0 ...
vineodd/PIMSim
refs/heads/master
GEM5Simulation/gem5/src/mem/slicc/ast/TypeFieldStateAST.py
26
# Copyright (c) 2011 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...
janusnic/shoop
refs/heads/master
shoop_tests/core/test_order_reference.py
7
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.test import override_settings import hashlib import pytest from...
ksmaheshkumar/clusterd
refs/heads/master
src/platform/weblogic/fingerprints/WL10s.py
8
from src.platform.weblogic.interfaces import WINTERFACES, WLConsole class FPrint(WLConsole): """ WebLogic 10 is bugged when using Oracle's custom implementation of SSL. Only if the default Java implementation is set will this work; otherwise, Oracle sends an SSL23_GET_SERVER_HELLO and breaks OpenSSL. ...
odoousers2014/odoo
refs/heads/master
addons/stock_account/res_config.py
8
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
amaozhao/basecms
refs/heads/master
cms/tests/templates.py
14
# -*- coding: utf-8 -*- from imp import load_module, PY_SOURCE import os.path from django.conf import settings from django.template import loader, TemplateDoesNotExist from django.test.utils import override_settings from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ f...
Art-SoftWare/discordBot
refs/heads/master
modules/admin/log.py
1
# -*- coding: UTF-8 -*- """Logs every user interaction.""" bot = None import os import time def init(botInstance): global bot bot = botInstance bot.modules.check("modules.main.hooks") bot.modules["modules.main.hooks"].addHook("MESSAGE", hook_msg) if not os.path.exists("log"): os.m...
Abjad/abjad
refs/heads/master
tests/test_mutate_replace.py
1
import abjad def test_mutate_replace_01(): """ Moves parentage from two old notes to five new notes. Equivalent to staff[1:3] = new_notes. """ staff = abjad.Staff("c'8 d'8 e'8 f'8") abjad.beam(staff[:2]) abjad.beam(staff[2:]) abjad.hairpin("< !", staff[:]) assert abjad.lilypond(...
CyanogenMod/android_external_chromium_org
refs/heads/cm-12.0
third_party/tlslite/tlslite/checker.py
118
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """Class for post-handshake certificate checking.""" from .x509 import X509 from .x509certchain import X509CertChain from .errors import * class Checker(object): """This class is passed to a handshake function to ch...
frmwrk123/rpo-website
refs/heads/master
src/rpocore/apps.py
1
from django.apps import AppConfig class RpoCoreConfig(AppConfig): name = 'rpocore'
alfredodeza/boto
refs/heads/develop
boto/services/__init__.py
782
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
akashsinghal/Speech-Memorization-App
refs/heads/master
Python_Backend/env/lib/python3.6/site-packages/pip/vcs/mercurial.py
514
from __future__ import absolute_import import logging import os import tempfile from pip.utils import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip._vendor.six.moves import configparser logger = logging.getLogger(__name__) class Mercurial(VersionControl...
michaelgallacher/intellij-community
refs/heads/master
python/testData/psi/DictLiteral.py
83
{'a': 1, 'b': 2}
dkarakats/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/validation.py
206
""" Extension of XBlock Validation class to include information for presentation in Studio. """ from xblock.validation import Validation, ValidationMessage class StudioValidationMessage(ValidationMessage): """ A message containing validation information about an xblock, extended to provide Studio-specific fie...
javilonas/SGS3-Sourcedrops
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
kargakis/test-infra
refs/heads/master
scenarios/kubernetes_execute_bazel.py
6
#!/usr/bin/env python # Copyright 2018 The Kubernetes 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 appli...
ridhoillyasa/jaikuengine
refs/heads/master
vendor/markdown/markdown2.py
35
#!/usr/bin/env python # Copyright (c) 2007-2008 ActiveState Corp. # License: MIT (http://www.opensource.org/licenses/mit-license.php) r"""A fast and complete Python implementation of Markdown. [from http://daringfireball.net/projects/markdown/] > Markdown is a text-to-HTML filter; it translates an easy-to-read / > ea...
Hellowlol/PyTunes
refs/heads/master
libs/engines/other/mininova.py
3
#VERSION: 1.50 #AUTHORS: Christophe Dumez (chris@qbittorrent.org) # 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 condit...
jorgefg/test
refs/heads/master
ViPR/test3.py
2
#!/usr/bin/env python from vipr import * client = ViPR( username='root', password='ChangeMe1!', token_endpoint='https://192.168.10.182:4443/login', vipr_endpoint='https://192.168.10.182:4443', request_timeout=30, verify_ssl=False )
ip42/kossel
refs/heads/master
clean_gcode.py
4
#!/usr/bin/env python """ Gcode cleaner to work around some bugs in KISSlicer. This eliminates stuttering caused by too many extra G1 commands on straight lines or very short segments. It also reduces Gcode file size by up to 20%, without reducing print quality or resolution. To use this script automatically in KISS...
alexston/calibre-webserver
refs/heads/master
src/calibre/gui2/catalog/catalog_csv_xml.py
3
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre.gui2 import gprefs from calibre.gui2.catalog.catalog_csv_xml_ui import U...
40223108/w18
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/xml/dom/NodeFilter.py
926
# This is the Python mapping for interface NodeFilter from # DOM2-Traversal-Range. It contains only constants. class NodeFilter: """ This is the DOM2 NodeFilter interface. It contains only constants. """ FILTER_ACCEPT = 1 FILTER_REJECT = 2 FILTER_SKIP = 3 SHOW_ALL = 0x...
jkthompson/nupic
refs/heads/master
py/regions/ImageSensorExplorers/ImageSweep.py
17
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
spradeepv/dive-into-python
refs/heads/master
mocking/mock_class.py
1
import mock import unittest class Class1(object): def __init__(self, name): self.name = name def get_name(self): print "Pradeep" return "Pradeep" class TestClass1(unittest.TestCase, Class1): def setUp(self): print "Start" def test_get_name(self): name = self...
lenw/ansible-modules-core
refs/heads/devel
windows/win_ping.py
208
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
martexcoin/martexcoin
refs/heads/master
test/functional/wallet_hd.py
1
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test Hierarchical Deterministic wallet function.""" import os import shutil from test_framework.test_...
demisto/content
refs/heads/master
Packs/Base/Scripts/CreateIndicatorRelationship/CreateIndicatorRelationship_test.py
1
def test_validate_arguments(): """ Test that all the error occur in each scenario. Given: - a collection of arguments to the validate args function When: - each arg collection should result in a different error Then: - check that the corresponding error occurs """ from CreateI...
lekshmideepu/nest-simulator
refs/heads/master
pynest/nest/tests/test_sp/test_synaptic_elements.py
20
# -*- coding: utf-8 -*- # # test_synaptic_elements.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
bratsche/Neutron-Drive
refs/heads/master
neutron-drive/django/conf/locale/sq/formats.py
433
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'g.i.s.A' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = '...
PaulKinlan/cli-caniuse
refs/heads/master
site/app/scripts/bower_components/jsrepl-build/extern/python/unclosured/lib/python2.7/email/generator.py
106
# Copyright (C) 2001-2010 Python Software Foundation # Contact: email-sig@python.org """Classes to generate plain text from a message object tree.""" __all__ = ['Generator', 'DecodedGenerator'] import re import sys import time import random import warnings from cStringIO import StringIO from email.header import Hea...
ocefpaf/cf_units
refs/heads/master
cf_units/tests/unit/unit/test_Unit.py
2
# (C) British Crown Copyright 2015 - 2019, Met Office # # This file is part of cf-units. # # cf-units 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 the License, or # (at your optio...
probablytom/tomwallis.net
refs/heads/master
venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py
33
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings try: import MySQLdb as Datab...
agry/NGECore2
refs/heads/master
scripts/object/tangible/wearables/armor/rebel_spec_force/armor_rebel_spec_force_chest_plate.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/tangible/component/bio/bio_component_food_medium_nutrition.py
85615
import sys def setup(core, object): return
vollov/ocbl.ca
refs/heads/master
django/team/service.py
1
from django.utils.translation import ugettext as _ import logging logger = logging.getLogger(__name__) from team.models import Player, Team class TeamHelper: def __init__(self): pass def get_players_for_view(self, players): players_dict = {} i = 1 for ...
klahnakoski/Bugzilla-ETL
refs/heads/v2
vendor/mo_times/durations.py
2
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
schaubl/libcloud
refs/heads/trunk
docs/examples/compute/gce/gce_service_account_scopes.py
59
# See previous examples for connecting and creating the driver # ... driver = None # Define common example attributes s = 'n1-standard-1' i = 'debian-7' z = 'us-central1-a' # Service Account Scopes require a list of dictionaries. Each dictionary # can have an optional 'email' address specifying the Service Account # ...
onceuponatimeforever/oh-mainline
refs/heads/master
vendor/packages/python-social-auth/social/tests/backends/test_email.py
92
from social.tests.backends.legacy import BaseLegacyTest class EmailTest(BaseLegacyTest): backend_path = 'social.backends.email.EmailAuth' expected_username = 'foo' response_body = 'email=foo@bar.com' form = """ <form method="post" action="{0}"> <input name="email" type="text"> <but...
gomiero/PTVS
refs/heads/master
Python/Tests/TestData/DebuggerProject/SimpleException.py
18
try: print('raising') raise Exception() except: print('caught')
mikacashman/mcashmanFS
refs/heads/master
lib/mcashman_FS/mcashman_FSServer.py
1
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestE...
Hoekz/hackness-monster
refs/heads/master
venv/lib/python2.7/site-packages/jinja2/nodes.py
342
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
streamlio/heron
refs/heads/master
heron/tools/common/src/python/access/fetch.py
10
# Copyright 2016 Twitter. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
dougfelt/noto-emoji
refs/heads/master
add_emoji_gsub.py
8
#!/usr/bin/env python # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
blacklin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/distlib/compat.py
357
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO stri...
Alexpux/MSYS2-pacman
refs/heads/master
test/pacman/tests/sync120.py
27
self.description = "Sysupgrade of packages in 'IgnorePkg'" sp1 = pmpkg("pkg1", "1.0-2") sp2 = pmpkg("pkg2", "1.0-2") for p in sp1, sp2: self.addpkg2db("sync", p) lp1 = pmpkg("pkg1") lp2 = pmpkg("pkg2") for p in lp1, lp2: self.addpkg2db("local", p) self.option["IgnorePkg"] = ["pkg2"] self.args = "-Su" self.addr...
holmes/intellij-community
refs/heads/master
python/helpers/docutils/writers/pep_html/__init__.py
58
# $Id: __init__.py 6328 2010-05-23 21:20:29Z gbrandl $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ PEP HTML Writer. """ __docformat__ = 'reStructuredText' import sys import os import os.path import codecs import docutils from docutils import fronte...
bcornwellmott/frappe
refs/heads/develop
frappe/core/doctype/tag_category/tag_category.py
22
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class TagCategory(Document): pass
dmillington/ansible-modules-core
refs/heads/devel
cloud/amazon/ec2_lc.py
41
#!/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...
codesmythe/gnucash
refs/heads/maint
gnucash/python/pycons/setup.py
8
#! /usr/bin/env python # # Copyright (c) 2008, Nicolas Rougier # 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 # noti...
google/tf-quant-finance
refs/heads/master
tf_quant_finance/models/hjm/__init__.py
1
# Lint as: python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
tbabej/freeipa
refs/heads/master
ipaplatform/fedora/paths.py
10
# Authors: # Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2014 Red Hat # see file 'COPYING' for use and warranty information # # 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 vers...
monpanel/hub
refs/heads/master
bin/act2disp.py
1
# NeoPixel library strandtest example # Author: Tony DiCola (tony@tonydicola.com) # # Direct port of the Arduino NeoPixel library strandtest example. Showcases # various animations on a strip of NeoPixels. import time import math import thread import threading #from colour import Color as Colour from threading import ...
bluhm/sosplice-regress
refs/heads/master
scapy/scapy-delay-oobinline.py
1
#!/usr/local/bin/python2.7 # send urgent data from client before handshake has completed import os import sys import threading from addr import * from scapy.all import * client=os.getpid() & 0xffff relay=int(sys.argv[2]) server=int(sys.argv[1]) class Sniff1(threading.Thread): filter = None captured = None packet ...
jpush/jbox
refs/heads/master
Server/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2928
######################## 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 ...
j-o/libzeug
refs/heads/master
source/tests/googletest/googlemock/scripts/generator/cpp/gmock_class.py
520
#!/usr/bin/env python # # Copyright 2008 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
cjaymes/pyscap
refs/heads/master
src/scap/model/ai_1_1/WebsiteURLType.py
1
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
mikalstill/ostrich
refs/heads/master
ostrich/stages-disabled/stage_95_ephyra_setup.py
1
# 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 th...
swcarpentry/amy
refs/heads/develop
amy/dashboard/tests/test_landing_page.py
1
from django.contrib.auth.models import Group from django.urls import reverse from workshops.tests.base import TestBase from workshops.models import ( Event, Organization, Tag, Person, ) class TestAdminDashboard(TestBase): """Tests for the admin dashboard.""" def setUp(self): self._se...
daureg/illalla
refs/heads/master
calc_tsne.py
1
#! /usr/bin/env python # vim: set fileencoding=utf-8 """ simple Python wrapper for the bh_tsne binary. adapted from https://github.com/ninjin/barnes-hut-sne to deal directly with numpy array as input and output """ # Copyright (c) 2014, Géraud Le Falher <daureg@gmail.com> # Copyright (c) 2013, Pontus Stenetorp <pontus...
leafclick/intellij-community
refs/heads/master
python/helpers/pydev/pydev_tests_python/resources/_debugger_case_get_thread_stack.py
15
import threading event_set = False inner_started = False def method(): global inner_started inner_started = True while not event_set: import time time.sleep(.1) t = threading.Thread(target=method) t.start() while not inner_started: import time time.sleep(.1) print('break h...
Aminakh/or-tools
refs/heads/master
src/ortools/constraint_solver/__init__.py
36
import os as _os __path__.append(_os.path.join(__path__[0], '..', '..', 'gen', 'ortools', 'constraint_solver')) __path__.append(_os.path.join(__path__[0], '..', '..', '..', 'lib'))
lflrocha/ebc.pauta
refs/heads/master
ebc/pauta/skins/ebc_pauta_custom_templates/getPautasPanoramaIpea.py
1
## Script (Python) "getPautasPanoramaIpea" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title=Retorna a lista de pautas do Panorama IPEA pautas = context.portal_catalog.searchResults(portal_type='Pauta', \ ...
kfox1111/horizon
refs/heads/master
openstack_dashboard/test/test_plugins/panel_group_config/_10_admin_add_panel_group.py
124
# The name of the panel group to be added to HORIZON_CONFIG. Required. PANEL_GROUP = 'plugin_panel_group' # The display name of the PANEL_GROUP. Required. PANEL_GROUP_NAME = 'Plugin Panel Group' # The name of the dashboard the PANEL_GROUP associated with. Required. PANEL_GROUP_DASHBOARD = 'admin'
hamzehd/edx-platform
refs/heads/master
common/djangoapps/edxmako/makoloader.py
28
import logging from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loaders.filesystem import Loader as FilesystemLoader from django.template.loaders.app_directories import Loader as AppDirectoriesLoader from...
Endika/django
refs/heads/master
django/conf/locale/vi/formats.py
619
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'\N\gà\y d \t\há\n\g n \nă\m Y' T...
procangroup/edx-platform
refs/heads/master
lms/djangoapps/course_api/blocks/views.py
16
""" CourseBlocks API views """ from django.core.exceptions import ValidationError from django.http import Http404 from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from rest_framework.generics import ListAPIView from rest_framework.response import Response from six import text_type fro...
richardliaw/ray
refs/heads/master
streaming/python/runtime/remote_call.py
3
import logging import os import ray import time from enum import Enum from ray.actor import ActorHandle from ray.streaming.generated import remote_call_pb2 from ray.streaming.runtime.command\ import WorkerCommitReport, WorkerRollbackRequest logger = logging.getLogger(__name__) class CallResult: """ Call...
SnabbCo/neutron
refs/heads/master
neutron/openstack/common/excutils.py
21
# Copyright 2011 OpenStack Foundation. # Copyright 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
duducosmos/pgs4a
refs/heads/master
python-install/lib/python2.7/sets.py
262
"""Classes to represent arbitrary sets (including sets of sets). This module implements sets using dictionaries whose values are ignored. The usual operations (union, intersection, deletion, etc.) are provided as both methods and operators. Important: sets are not sequences! While they support 'x in s', 'len(s)', a...
b-carter/numpy
refs/heads/master
numpy/core/code_generators/genapi.py
19
""" Get API information encoded in C files. See ``find_function`` for how functions should be formatted, and ``read_order`` for how the order of the functions should be specified. """ from __future__ import division, absolute_import, print_function import sys, os, re import hashlib import textwrap from os.path imp...
liorvh/golismero
refs/heads/master
thirdparty_libs/nltk/examples/pt.py
12
# -*- coding: iso-8859-1 -*- # Natural Language Toolkit: Some Portuguese texts for exploration in chapter 1 of the book # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from nltk.corpus import machado, mac_...
mccheung/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/setuptools/tests/test_svn.py
73
# -*- coding: utf-8 -*- """svn tests""" import os import sys import unittest import codecs import subprocess from setuptools.tests import environment from setuptools.compat import unicode, unichr from setuptools import svn_utils from setuptools.tests.py26compat import skipIf def _do_svn_check(): try: s...
40423146/2016fallcadp_hw
refs/heads/gh-pages
plugin/liquid_tags/youtube.py
284
""" Youtube Tag --------- This implements a Liquid-style youtube tag for Pelican, based on the jekyll / octopress youtube tag [1]_ Syntax ------ {% youtube id [width height] %} Example ------- {% youtube dQw4w9WgXcQ 640 480 %} Output ------ <iframe width="640" height="480" src="https://www.youtube.com/embed/dQw4...
Health123/ansible
refs/heads/devel
hacking/module_formatter.py
103
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others # # 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 So...
andriykohut/blab
refs/heads/master
blab/routes.py
1
from blab import app from blab import controllers app.router.add_route('GET', '/', controllers.hello)
michaelrice/pyvmomi
refs/heads/master
sample/getallvms.py
9
#!/usr/bin/env python # VMware vSphere Python SDK # Copyright (c) 2008-2015 VMware, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
remind101/stacker_blueprints
refs/heads/master
stacker_blueprints/empire/policies.py
1
import logging from awacs import ( awslambda, ecs, ec2, events, iam, route53, kinesis, sns, logs, sqs, s3, cloudformation, elasticloadbalancing as elb, ecr, ) from awacs.aws import ( Statement, Allow, Policy, Action, Principal, Condition, ...
google/closure-linter
refs/heads/master
closure_linter/error_fixer_test.py
6
#!/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 # #...
Godiyos/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/tlslite/messages.py
273
"""Classes representing TLS messages.""" from utils.compat import * from utils.cryptomath import * from errors import * from utils.codec import * from constants import * from X509 import X509 from X509CertChain import X509CertChain import sha import md5 class RecordHeader3: def __init__(self): self.type ...
mehdidc/scikit-learn
refs/heads/master
examples/manifold/plot_manifold_sphere.py
258
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
vmendez/DIRAC
refs/heads/integration
ResourceStatusSystem/scripts/dirac-rss-query-dtcache.py
2
#!/usr/bin/env python """ dirac-rss-query-dtcache Select/Add/Delete a new DownTime entry for a given Site or Service. Usage: dirac-rss-query-dtcache [option] <query> Queries: [select|add|delete] Options: --downtimeID= The ID of the downtime --element= ...
gandalfcode/gandalf
refs/heads/master
tests/dust_tests/dustyshocktest.py
1
#============================================================================== # adsodtest.py # Run the adiabatic Sod shocktube test using initial conditions specified in # the file 'adsod.dat' and then plotting important quantities together # with the analytical solutions. #==========================================...
kietdlam/Dator
refs/heads/master
data_api/api.py
1
import json from tastypie.authentication import Authentication from tastypie.fields import IntegerField, DateTimeField, CharField, BooleanField from tastypie.resources import ModelResource from tastypie.authorization import Authorization from tastypie.resources import ALL_WITH_RELATIONS from tastypie import fields from...
jermainewang/mxnet
refs/heads/master
example/rcnn/rcnn/utils/combine_model.py
41
# 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...
boscotsang/EncryptHashPassword
refs/heads/master
genpassword/genpassword.py
1
#!/usr/bin/env python __author__ = "BoscoTsang" import hashlib import getpass def genhash(): while(True): domain = raw_input("Input your website domain:\n") print "Your website domain is: ", domain print "Enter your password" pwd = getpass.getpass() print "Confirm your pas...
morreene/tradenews
refs/heads/master
venv/Lib/site-packages/sqlalchemy/dialects/firebird/fdb.py
55
# firebird/fdb.py # Copyright (C) 2005-2016 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 """ .. dialect:: firebird+fdb :name: fdb :dbapi: pyodbc :connectstring: ...
xHeliotrope/injustice_dropper
refs/heads/master
env/lib/python3.4/site-packages/gunicorn/workers/_gaiohttp.py
39
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import asyncio import functools import logging import os import gunicorn.workers.base as base from aiohttp.wsgi import WSGIServerHttpProtocol class AiohttpWorker(base.Worker): def __in...
slisson/intellij-community
refs/heads/master
python/testData/resolve/KWArg.py
83
from datetime import timedelta def foo(**kwargs): pass def bar(): foo(timedelta=timedelta) # <ref>
mfcabrera/luigi
refs/heads/master
luigi/tools/deps_tree.py
19
# -*- coding: utf-8 -*- """ This module parses commands exactly the same as the luigi task runner. You must specify the module, the task and task paramters. Instead of executing a task, this module prints the significant paramters and state of the task and its dependencies in a tree format. Use this to visualize the ex...
munkiat/mist.io
refs/heads/master
src/mist/io/tests/gui/features/steps/general.py
4
from behave import * from time import time, sleep try: from mist.io.tests.settings import LOCAL except ImportError: LOCAL = True pass @when(u'I visit mist.io') def visit(context): if not LOCAL: end_time = time() + 160 while time() < end_time: try: context.b...
mrquim/mrquimrepo
refs/heads/master
repo/plugin.video.live.streamspro/wattv.py
304
import hashlib,binascii, time,base64 def getWatToken(mediaId): curr_time=int(time.time()) appName='sdk/Iphone/1.0' method='getLiveUrl' version='1.3' #time=1417304914#fbc3d36ff262e98acedfcb5dda7ea346/1417304914 #46091b344ccc00e4db189c1097804bbc/1417193313000 secret=base64.b64decode('VzNtMCMxbUZJ') s="%s-%s-%s-%s...