repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
cpennington/edx-platform
refs/heads/master
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
1
# -*- coding: utf-8 -*- """ Unit tests for LMS instructor-initiated background tasks helper functions. - Tests that CSV grade report generation works with unicode emails. - Tests all of the existing reports. """ import os import shutil import tempfile from contextlib import contextmanager from datetime import date...
robbinscp/learnpython3hard
refs/heads/master
exercise_14/ex14.py
1
# Python import statements from sys import argv # Store variables from argv, set prompt display script, user_name, date = argv prompt = '-> ' # Print initial text print(f"Hi, {user_name}, I am the {script} script.") print("I'd like to ask you a few questions.") print(f"Do you like me {user_name}?") # Store input in...
maciekcc/tensorflow
refs/heads/master
tensorflow/contrib/testing/__init__.py
178
# 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...
Limags/MissionPlanner
refs/heads/master
Lib/string.py
55
"""A collection of string operations (most are no longer used). Warning: most of the code you see here isn't normally used nowadays. Beginning with Python 1.6, many of these functions are implemented as methods on the standard string object. They used to be implemented by a built-in module called strop, but strop...
vmanoria/bluemix-hue-filebrowser
refs/heads/master
hue-3.8.1-bluemix/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/PublicKey/test_ElGamal.py
112
# -*- coding: utf-8 -*- # # SelfTest/PublicKey/test_ElGamal.py: Self-test for the ElGamal primitive # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone ...
marc-sensenich/ansible
refs/heads/devel
lib/ansible/plugins/connection/docker.py
13
# Based on the chroot connection plugin by Maykel Moya # # (c) 2014, Lorin Hochstein # (c) 2015, Leendert Brouwer (https://github.com/objectified) # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-...
wenhuizhang/neutron
refs/heads/master
neutron/tests/unit/agent/linux/test_bridge_lib.py
3
# Copyright 2015 Intel Corporation. # Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com> # <isaku.yamahata at gmail com> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Licen...
maxim-komar/mail.ru
refs/heads/master
tarantool/comparison/zabbix/tnt.py
1
#!/usr/bin/python import sys import time from tarantool import Connection c = Connection("127.0.0.1", 3301) def conv(line): return [ int(x) for x in line.split() ] filename = sys.argv[1] with open(filename) as f: content = f.readlines() data = [ conv(line) for line in content ] if len(data) == 0: sys.exi...
jpts/picam-led-direction
refs/heads/master
scripts/rgb.py
1
#!/usr/bin/env python #import the required module. import RPi.GPIO as GPIO import time as t # Set the mode of numbering the pins. GPIO.setmode(GPIO.BOARD) # GPIO pin 10 is the output. GPIO.setup(31, GPIO.OUT) GPIO.setup(33, GPIO.OUT) GPIO.setup(35, GPIO.OUT) x = 2 y = 2 GPIO.output(31, 1) t.sleep(x) GPIO.output(31...
agry/NGECore2
refs/heads/master
scripts/object/tangible/storyteller/prop/pr_emperor_statue.py
85615
import sys def setup(core, object): return
wasit7/labeller
refs/heads/master
lib/werkzeug/testsuite/contrib/fixers.py
146
# -*- coding: utf-8 -*- """ werkzeug.testsuite.fixers ~~~~~~~~~~~~~~~~~~~~~~~~~ Server / Browser fixers. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.datastructures import Res...
cg31/glmark2
refs/heads/master
waflib/Tools/c_aliases.py
14
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys,re from waflib import Utils,Build from waflib.Configure import conf def get_extensions(lst): ret=[] for x in Utils.to_list(lst): try: if not isinstance(x,...
PetrDlouhy/django
refs/heads/master
django/contrib/admin/apps.py
459
from django.apps import AppConfig from django.contrib.admin.checks import check_admin_app from django.core import checks from django.utils.translation import ugettext_lazy as _ class SimpleAdminConfig(AppConfig): """Simple AppConfig which does not do automatic discovery.""" name = 'django.contrib.admin' ...
cchurch/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/redshift_subnet_group.py
27
#!/usr/bin/python # Copyright 2014 Jens Carl, Hothead Games Inc. # 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', 'stat...
airanmehr/bio
refs/heads/master
Scripts/TimeSeriesPaper/Plot/DemographicScenarios.py
1
import numpy as np; np.set_printoptions(linewidth=200, precision=5, suppress=True) import pandas as pd; pd.options.display.max_rows=50;pd.options.display.expand_frame_repr=False import os; home=os.path.expanduser('~') +'/' import sys sys.path.insert(1,'/home/arya/workspace/bio/') from Utils import Simula...
john-wang-metro/metro-openerp
refs/heads/master
metro/wizard/confirm_message.py
2
# -*- 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...
MaxxUAV/ardupilot
refs/heads/master
Tools/autotest/dump_logs.py
229
#!/usr/bin/env python # dump flash logs from SITL # Andrew Tridgell, April 2013 import pexpect, os, sys, shutil, atexit import optparse, fnmatch, time, glob, traceback, signal sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pysim')) import util ############## main program ############# ...
gdm/easyengine
refs/heads/master
tests/cli/plugins/test_example.py
9
"""Tests for Example Plugin.""" from ee.utils import test class ExamplePluginTestCase(test.EETestCase): def test_load_example_plugin(self): self.app.setup() self.app.plugin.load_plugin('example')
rruebner/odoo
refs/heads/master
addons/account_payment/report/__init__.py
436
# -*- 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...
johnno1962d/swift
refs/heads/master
validation-test/stdlib/Slice/Inputs/GenerateSliceTests.py
3
#!/usr/bin/env python import itertools traversal_options = ['Forward', 'Bidirectional', 'RandomAccess'] base_kind_options = ['Defaulted', 'Minimal'] mutable_options = [False, True] for traversal, base_kind, mutable in itertools.product(traversal_options, base_kin...
sparkslabs/kamaelia_
refs/heads/master
Sketches/MPS/Experiments/Logger.py
3
#!/usr/bin/python import Axon from Axon.CoordinatingAssistantTracker import coordinatingassistanttracker as CAT from Kamaelia.File.Writing import SimpleFileWriter from Kamaelia.Util.Console import ConsoleEchoer from Kamaelia.Chassis.Pipeline import pipeline from Services import MSComponent, SingleService, SingleServi...
temasek/android_external_chromium_org
refs/heads/cm-11.0
tools/swig/swig.py
133
#!/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. """Wrapper around swig. Sets the SWIG_LIB environment var to point to Lib dir and defers control to the platform-specific swig bin...
streety/kaggle-seizure-prediction
refs/heads/master
combine_predictions.py
2
import os import pickle output = ['clip,seizure,early'] files = [i for i in os.listdir('.') if i.endswith('.pkl')] files.sort() for filename in files: with open(filename) as f: p = pickle.load(f) for l, s in zip(p[0], p[1]): output.append('%s,%f,%f' % (l,s,s)) print('\n'.join(output))
Phonemetra/TurboCoin
refs/heads/master
test/functional/rpc_help.py
1
#!/usr/bin/env python3 # Copyright (c) 2018 TurboCoin # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPC help output.""" from test_framework.test_framework import TurbocoinTestFramework from test_framework.util import ass...
wrigri/libcloud
refs/heads/trunk
libcloud/test/common/test_digitalocean_v1.py
35
# 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 ...
nvoron23/scipy
refs/heads/master
tools/cythonize.py
1
#!/usr/bin/env python """ cythonize Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'scipy'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs cython on these files to recreate the C files. The script th...
roderickvd/nzbToMedia
refs/heads/master
libs/unidecode/x0fd.py
252
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
Fl0rianFischer/sme_odoo
refs/heads/9.0
addons/website_sale_options/controllers/__init__.py
2262
import main
Paul-Ezell/cinder-1
refs/heads/master
cinder/api/v1/limits.py
13
# 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
leilihh/novaha
refs/heads/kvm_ha_tmp
nova/api/openstack/compute/schemas/v3/extended_volumes.py
31
# Copyright 2013 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 ...
binarydud/django-oscar
refs/heads/master
sites/demo/urls.py
31
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from django.conf.urls.static import static from stores.app import application as stores_app from stores.dashboard.app import application as dashboard_app from apps.app import application from datacash.dashboard....
FedoraScientific/salome-smesh
refs/heads/master
src/SMESH_SWIG/ex14_cyl1holed.py
1
# -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
petewarden/tensorflow
refs/heads/master
tensorflow/python/keras/preprocessing/dataset_utils.py
3
# Copyright 2020 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...
ressu/SickGear
refs/heads/master
lib/bs4/tests/test_builder_registry.py
485
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
arborh/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/denormal_test.py
22
# 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...
monaparty/counterparty-lib
refs/heads/monaparty-develop
counterpartylib/lib/database.py
1
import apsw import logging logger = logging.getLogger(__name__) import time import collections import copy from counterpartylib.lib import config from counterpartylib.lib import util from counterpartylib.lib import exceptions from counterpartylib.lib import log BLOCK_MESSAGES = [] def rowtracer(cursor, sql): """...
aslamplr/shorts
refs/heads/master
lib/markupsafe/_native.py
1243
# -*- coding: utf-8 -*- """ markupsafe._native ~~~~~~~~~~~~~~~~~~ Native Python implementation the C module is not compiled. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from markupsafe import Markup from markupsafe._compat import text_type def escape(...
jzt5132/scikit-learn
refs/heads/master
examples/svm/plot_svm_kernels.py
329
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM-Kernels ========================================================= Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially useful when the data-points are not linearly sep...
kapouille/mongoquery
refs/heads/master
mongoquery/__init__.py
1
""" mongoquery provides a straightforward API to match Python objects against MongoDB Query Language queries. """ import re from collections.abc import Sequence, Mapping from six import string_types # pylint: disable=invalid-name try: string_type = basestring except NameError: string_type = str class QueryE...
wechasing/tornado
refs/heads/master
tornado/httputil.py
51
#!/usr/bin/env python # # Copyright 2009 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...
dhruvsrivastava/OJ
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.py
2161
from __future__ import absolute_import from . import ssl_match_hostname
ksanchezcld/volatility
refs/heads/master
volatility/plugins/linux/check_syscall.py
44
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
2013Commons/hue
refs/heads/master
desktop/core/ext-py/python-openid-2.2.5/openid/test/test_urinorm.py
77
import os import unittest import openid.urinorm class UrinormTest(unittest.TestCase): def __init__(self, desc, case, expected): unittest.TestCase.__init__(self) self.desc = desc self.case = case self.expected = expected def shortDescription(self): return self.desc ...
jpetto/olympia
refs/heads/master
src/olympia/landfill/management/commands/generate_themes.py
3
from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from olympia.landfill.generators import generate_themes class Command(BaseCommand): """ Generate example themes for development/testing purpose. Themes will have 1 preview...
jjmleiro/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_module/good_module.py
255
content = 'Good Module'
adobe/chromium
refs/heads/master
chrome/test/functional/media/media_constrained_network_perf.py
5
#!/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. """Records metrics on playing media under constrained network conditions. Spins up a Constrained Network Server (CNS) and runs thr...
sbalde/edxplatform
refs/heads/master
common/djangoapps/third_party_auth/admin.py
9
# -*- coding: utf-8 -*- """ Admin site configuration for third party authentication """ from django import forms from django.contrib import admin from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin from .models import ( OAuth2ProviderConfig, SAMLProviderConfig, SAMLConfig...
ztuowen/chill-dev
refs/heads/master
Manual/tests/test4.py
2
from chill import * source('test4.c') procedure('mm') loop(0) known('n > 0') print_code() print_space() print_dep()
Jonekee/chromium.src
refs/heads/nw12
net/PRESUBMIT.py
57
# Copyright 2014 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. """Top-level presubmit script for src/net. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit ...
MozillaSecurity/dharma
refs/heads/master
dharma/__version__.py
1
__title__ = 'dharma' __version__ = '1.3.2' __license__ = 'MPL 2.0' __description__ = 'Generation-based, context-free grammar fuzzer.' __keywords__ = 'fuzzer fuzzing security testing generator' __author__ = 'Christoph Diehl' __author_email__ = 'cdiehl@mozilla.com' __maintainer__ = 'Mozilla Fuzzing Team' __maintainer_ema...
mlavin/django
refs/heads/master
django/template/backends/dummy.py
61
import string from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import Origin, TemplateDoesNotExist from django.utils.html import conditional_escape from .base import BaseEngine from .utils import csrf_input_lazy, csrf_token_lazy class TemplateStrings(Base...
fuselock/odoo
refs/heads/8.0
addons/hw_posbox_homepage/__init__.py
1894
# -*- 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...
nucoin/nucoin
refs/heads/master
contrib/pyminer/pyminer.py
1257
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
jiminliang/cuda-convnet2
refs/heads/master
python_util/__init__.py
364
# 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 required by applicable law or...
pfctdayelise/pytest
refs/heads/master
src/_pytest/recwarn.py
2
""" recording warnings during test function execution. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import inspect import re import sys import warnings import six import _pytest._code from _pytest.fixtures import yield_fixture from _pytest.outcomes ...
gdgphilippines/main
refs/heads/gh-pages
node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
philanthropy-u/edx-platform
refs/heads/master
openedx/core/djangoapps/header_control/tests/test_middleware.py
34
"""Tests for header_control middleware.""" from django.http import HttpResponse, HttpRequest from django.test import TestCase from openedx.core.djangoapps.header_control import remove_headers_from_response, force_header_for_response from openedx.core.djangoapps.header_control.middleware import HeaderControlMiddleware ...
Gazer022/bitcoin
refs/heads/master
test/functional/test_framework/siphash.py
77
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Specialized SipHash-2-4 implementations. This implements SipHash-2-4 for 256-bit integers. """ def rotl64(...
matrixorz/matrixorz.github.io
refs/heads/master
epoll1.py
1
import socket,select EOL1=b'\n\n' EOL2=b'\n\r\n' response = b'HTTP\1.0 200 OK\r\nDate:Mon,1 Jan 1996 01:01:01 GMT\r\n' response += b'Content-Type:text/plain\r\nContent-Length:13\r\n\r\n' response += b'Hello,world!' serversocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) serversocket.setsockopt(socket.SOL_SOCKE...
eric100lin/Qt-4.8.6
refs/heads/master
src/3rdparty/webkit/Source/ThirdParty/gyp/tools/pretty_sln.py
15
#!/usr/bin/python2.5 # Copyright (c) 2009 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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependencie...
MartinRiese/python_koans
refs/heads/master
python2/_runner_tests.py
211
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import unittest from runner.runner_tests.test_mountain import TestMountain from runner.runner_tests.test_sensei import TestSensei from runner.runner_tests.test_helper import TestHelper def suite(): suite = unittest.TestSuite() suite.addTests(unittest.T...
ArthurChiao/flame
refs/heads/master
celeryapp/views.py
1
from django.shortcuts import render # encoding:utf-8
henryleach/lampi
refs/heads/master
globetest.py
1
#!/usr/bin/python3 """ globetest.py Version 1.0 To test if the LEDs light up correctly using the LED board and lampi_lib. """ import lampi_lib as ll import RPi.GPIO as GPIO ##pin numbers to match LED legs ##These match LED board pins. red_pin = 19 green_pin = 21 blue_pin = 23 ##create a light object with correct b...
chrismeyersfsu/ansible
refs/heads/devel
lib/ansible/modules/system/selinux_permissive.py
48
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Michael Scherer <misc@zarb.org> # inspired by code of github.com/dandiker/ # # 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 Softwar...
renzifeng/renzifeng
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py
2687
#!/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. """ Unit tests for the msvs.py file. """ import gyp.generator.msvs as msvs import unittest import StringIO class TestSequenceFunctions(uni...
dssinger/allstats
refs/heads/master
allstats.py
1
#!/usr/bin/env python """ This program combines info about a Toastmasters District's clubs into one easy-to-read report. """ import csv, urllib, datetime, pickle, os, sys, webbrowser, math, time from operator import attrgetter dists = { 'P': 'President\'s Distinguished = %d', 'S': 'Select Distinguished = %d'...
Squarific/SmartHome
refs/heads/master
server/backend/views.py
1
from django.db import connection from backend.models import * from backend.serializers import * from django.utils import timezone, dateparse from django.contrib.auth.models import User from django.db.models import F, Q from django.http import Http404 from rest_framework.views import APIView from rest_framework.respo...
Tatsh-ansible/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/htpasswd.py
9
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Nimbis Services, Inc. # 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.0', ...
consulo/consulo-mercurial
refs/heads/master
src/test/resources/bin/mercurial/mpatch.py
96
# mpatch.py - Python implementation of mpatch.c # # Copyright 2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import struct try: from cStringIO import StringIO except ImportError:...
googleapis/googleapis-gen
refs/heads/master
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/language_constant_service/transports/base.py
1
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
GunnerJnr/_CodeInstitute
refs/heads/master
Stream-3/Full-Stack-Development/2.Hello-Django-Templates/1.Hello-And-Templates/hello_django/HelloWorld_prj/HelloWorld_prj/urls.py
1
"""HelloWorld_prj URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') C...
CredoReference/edx-platform
refs/heads/integration-hawthorn-qa
openedx/core/djangoapps/zendesk_proxy/v0/views.py
13
""" Define request handlers used by the zendesk_proxy djangoapp """ from rest_framework import status from rest_framework.parsers import JSONParser from rest_framework.response import Response from rest_framework.throttling import SimpleRateThrottle from rest_framework.views import APIView from openedx.core.djangoapps...
pmazurek/ansible-modules-extras
refs/heads/devel
system/solaris_zone.py
73
#!/usr/bin/python # (c) 2015, Paul Markham <pmarkham@netrefinery.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 3 of the License, or # (at you...
LarsMichelsen/pmatic
refs/heads/master
pmatic/manager.py
2
#!/usr/bin/env python # encoding: utf-8 # # pmatic - Python API for Homematic. Easy to use. # Copyright (C) 2016 Lars Michelsen <lm@larsmichelsen.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 Found...
aikaterna/aikaterna-cogs
refs/heads/v3
rndstatus/__init__.py
1
from .rndstatus import RndStatus __red_end_user_data_statement__ = "This cog does not persistently store data or metadata about users." def setup(bot): bot.add_cog(RndStatus(bot))
emelkrml/dictionary2
refs/heads/master
dictionary2/topics/migrations/0004_user_name.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-08-28 10:50 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0003_auto_20160828_1307'), ] operations = [ migrations.AddField( ...
SPARLab/BikeMaps
refs/heads/master
mapApp/models/alert_area.py
1
from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.contrib.gis.db import models from django.db.models import Manager as GeoManager import datetime from django.utils import timezone class AbstractPolygon(models.Model): """ Abstract class to define a polygon area ...
knuu/competitive-programming
refs/heads/master
aoj/5/aoj0589.py
1
o={} for _ in range(int(input())):p,m=input().split();o[p]=o.get(p,0)+int(m) k=sorted([(len(x),x)for x in o.keys()]) for _,i in k:print(i,o[i])
msparapa/das
refs/heads/master
das/legacy/Numerics/__init__.py
17
import os import glob modules = glob.glob(os.path.dirname(__file__)+"/*.py") __all__ = [ os.path.basename(f)[:-3] for f in modules]
renjithsraj/photogallery
refs/heads/master
feedback/admin.py
13848
from django.contrib import admin # Register your models here.
valdergallo/pyconst
refs/heads/master
pyconst/__init__.py
1
# encoding: utf-8 from __future__ import unicode_literals, absolute_import __version__ = (2, 0, 0) __author__ = 'valdergallo@gmail.com' from .const import Const from .slug import slugify def get_version(): return '.'.join(map(str, __version__)) __all__ = [ 'Const', 'slugify', ]
Zarokka/exaile
refs/heads/master
xl/player/gst/sink_windows.py
4
# Copyright (C) 2013-2015 Dustin Spicuzza # # 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. # # This program is distributed in the hope...
nlharris/narrative
refs/heads/master
src/biokbase/Tree/Client.py
7
############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # # Passes on URLError, timeout, and BadStatusLine exceptions. # See: # http://docs.python.org/2/library/urllib2.html # http://docs.python.org/2/library/ht...
demarle/VTK
refs/heads/master
Rendering/Core/Testing/Python/TestOpacity2.py
6
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() cone = vtk.vtkConeSource() cone.SetHeight(3.0) cone.SetRadius(1.0) cone.SetResolution(10) coneMapper = vtk.vtkPolyDataMapper() coneMapper.SetInputConnection(cone.GetOutputPort()) # ...
wkrzemien/DIRAC
refs/heads/integration
DataManagementSystem/Client/FileCatalogClientCLI.py
2
#!/usr/bin/env python """ File Catalog Client Command Line Interface. """ from __future__ import print_function __RCSID__ = "$Id$" import commands import os.path import time import sys import getopt from DIRAC.Core.Utilities.ReturnValues import returnSingleResult from DIRAC.Core.Base.CLI import CLI from DIRAC.Core.S...
Captnoord/openpli-enigma2
refs/heads/master
lib/python/Screens/Standby.py
7
from Screen import Screen from Components.ActionMap import ActionMap from Components.config import config from Components.AVSwitch import AVSwitch from Components.Harddisk import internalHDDNotSleeping from Components.SystemInfo import SystemInfo from Tools import Notifications from GlobalActions import globalActionMap...
kyle1986/robortframe
refs/heads/master
src/robot/utils/charwidth.py
18
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
rhizolab/rhizo-server
refs/heads/master
main/api/resources.py
1
import json import base64 import hashlib # fix(clean): remove? import zipfile import datetime from io import BytesIO # external imports from flask import request, abort, make_response from sqlalchemy import not_ from sqlalchemy.orm.exc import NoResultFound from flask_restful import Resource as ApiResource from flask...
nimon/GPSense
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
mabotech/maboss.py
refs/heads/master
maboss/functions/concept/__init__.py
1
import time from time import strftime, localtime def get_time(t1, t2): v = strftime("%Y-%m-%d %H:%M:%S", localtime()) return "%s [%s,%s]" % (v, t1, t2) if __name__ == '__main__': print get_time('a','b')
cathywu/Sentiment-Analysis
refs/heads/master
PyML-0.7.9/PyML/preproc/preproc.py
2
from PyML.base.pymlObject import PyMLobject from PyML.utils import misc from PyML.feature_selection import featsel import numpy import math import random def pca(X, numcomp = None) : '''returns the matrix X as represented in the numcomp leading principal components if numcomp is None, all principal compo...
immerrr/numpy
refs/heads/master
numpy/distutils/fcompiler/gnu.py
14
from __future__ import division, absolute_import, print_function import re import os import sys import warnings import platform import tempfile from subprocess import Popen, PIPE, STDOUT from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import ex...
murphy-wang/aws-ec2
refs/heads/master
lib/boto-2.34.0/boto/pyami/installers/__init__.py
153
# Copyright (c) 2006,2007,2008 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,...
zhenbinwu/LHETools
refs/heads/master
Reader/readT2qqLHE.py
1
import sys import ROOT as rt import math from LHEevent import * from LHEfile import * import plotTools if __name__ == '__main__': #T2qq histograms MSquark = rt.TH1D("MSquark", "MSquark", 100, 0., 2.) MLSP = rt.TH1D("MLSP", "MLSP", 100, 0., 2.) # find events in file myLHEfile = LHEfile(sys.arg...
mementum/backtrader
refs/heads/master
samples/talib/tablibsartest.py
1
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
OXPHOS/shogun
refs/heads/develop
examples/undocumented/python/features_dense_io.py
6
#!/usr/bin/env python parameter_list=[[]] def features_dense_io(): from shogun import RealFeatures, CSVFile feats=RealFeatures() f=CSVFile("../data/fm_train_real.dat","r") f.set_delimiter(" ") feats.load(f) return feats if __name__=='__main__': print('Dense Real Features IO') features_dense_io(*parameter_list...
gerddie/nipype
refs/heads/master
nipype/pipeline/tests/test_utils.py
14
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Tests for the engine utils module """ import os from copy import deepcopy from tempfile import mkdtemp from shutil import rmtree from ...testing import (assert_equal, assert_true, assert_false) import n...
laurentb/weboob
refs/heads/master
modules/lameteoagricole/module.py
1
# -*- coding: utf-8 -*- # Copyright(C) 2017 Vincent A # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
spidgorny/energy-monitor
refs/heads/master
python/Image/Straighten.py
1
import math import cv2 from .ImageProcessor import ImageProcessor from math import pi import configparser class Straighten(ImageProcessor): def __init__(self, img, debug: bool = False): super().__init__(img) """ @type debug: bool """ self.debug = debug print('deb...
mathemage/h2o-3
refs/heads/master
h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2oremove_all.py
1
from __future__ import print_function import sys sys.path.insert(1,"../../../") from tests import pyunit_utils import h2o import inspect def h2oremove_all(): """ Python API test: h2o.remove_all() Cannot test this one on Jenkins. It will crash other tests. So, Pasha found a way around this by just ch...