repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
mbohlool/client-python
refs/heads/master
kubernetes/test/test_v1beta2_deployment.py
1
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
yosshy/nova
refs/heads/master
nova/api/openstack/compute/legacy_v2/contrib/deferred_delete.py
69
# 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...
MoonshineSG/OctoPrint
refs/heads/master
src/octoprint/server/api/timelapse.py
2
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" im...
Big-B702/python-for-android
refs/heads/master
python-modules/twisted/twisted/words/xish/utility.py
54
# -*- test-case-name: twisted.words.test.test_xishutil -*- # # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Event Dispatching and Callback utilities. """ from twisted.python import log from twisted.words.xish import xpath class _MethodWrapper(object): """ Internal class...
SebDieBln/QGIS
refs/heads/master
python/plugins/db_manager/dlg_table_properties.py
12
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : Oct 13, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
anaran/olympia
refs/heads/master
apps/amo/urls.py
1
from waffle.views import wafflejs from django.conf.urls import include, patterns, url from django.views.decorators.cache import never_cache from . import views, install services_patterns = patterns('', url('^monitor(.json)?$', never_cache(views.monitor), name='amo.monitor'), url('^loaded$', never_cac...
dmartin35/pronosfoot
refs/heads/master
season/context_processor.py
1
""" This module adds specific data in the context - to be used for page generation - """
tjsavage/sfcsdatabase
refs/heads/master
sfcs/django/utils/unittest/signals.py
571
import signal import weakref from django.utils.unittest.compatibility import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.default_handler = default_handler def __call__(self, signum, frame): installed_handler ...
magvugr/AT
refs/heads/master
EntVirtual/lib/python2.7/site-packages/setuptools/lib2to3_ex.py
907
""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactorin...
h4r5h1t/django-hauthy
refs/heads/hauthy
tests/migrations/test_autodetector.py
20
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.db import connection, models from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.graph import MigrationGraph from django.db.migrations.loader import Migr...
maxalbert/bokeh
refs/heads/master
bokeh/plotting.py
3
from __future__ import absolute_import, print_function import logging logger = logging.getLogger(__name__) from .models import Axis, Grid, GridPlot, Legend, LogAxis, Plot from .models import glyphs, markers from .plotting_helpers import ( _list_attr_splat, _get_range, _get_axis_class, _get_num_minor_ticks, _p...
owalch/oliver
refs/heads/master
linux/config/scripts/timecalc.py
1
#!/usr/bin/env python """Simple work-time calculator. Enter time expressions in the form "07:30-10:54 + 13:15-18:15" (python preprocessor replacing HH:MM-HH:MM with hours as float) Examples: 09:30-12:00 + 13:10-17:06 6.43 hours (6h 25min) 930-1200 + 1310-1706 6.43 hours (6h 25min) 09.30-12.00/1310-1706 # numpad f...
zifza/blog-django1.9
refs/heads/master
src/cobadjango19/wsgi.py
1
""" WSGI config for cobadjango19 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_...
legalsylvain/OpenUpgrade
refs/heads/master
addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py
384
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
hbrunn/OpenUpgrade
refs/heads/master
addons/l10n_cr/__openerp__.py
170
# -*- encoding: utf-8 -*- ############################################################################## # # __openerp__.py # l10n_cr_account # First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.) # Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv...
avoorhis/mbl_sequencing_pipeline
refs/heads/master
pipeline/primer_utils20120211.py
1
import os, sys import constants as C def count_keys(hash): return len([x for x in hash]) def trim_distal_primer(primers_list, seq, trim_type, begin, end): """Doc string here..""" d_primer_found = "" trimmedPortion = "" loc = 0 # chage this to find the primer within C.dista...
radlws/AWS-ElasticBeanstalk-CLI
refs/heads/master
eb/linux/python2.7/lib/rds/__init__.py
72
#!/usr/bin/env python # ============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of th...
bitforks/freetype-py
refs/heads/master
freetype/ft_enums/ft_load_flags.py
3
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # # FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier # Distributed under the terms of the new BSD license. # # ----------------------------------------------------------------------------- ""...
uberamd/NGECore2
refs/heads/master
scripts/object/draft_schematic/food/drink_ithorian_mist.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/mobile/dressed_plasma_bandit.py
85615
import sys def setup(core, object): return
iguessthislldo/stablogen
refs/heads/master
stablogen/generate.py
1
# Python Standard Library import re from shutil import rmtree, copyfile # 3rd Party Libraries from jinja2 import Environment, PackageLoader, FileSystemLoader, ChoiceLoader # Local from stablogen.config import * from stablogen.Post import * from stablogen.code import CodeExtension, output_code_style def setup_jinja(i...
mtmiller/hy
refs/heads/master
tests/models/test_cons.py
15
# Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.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,...
lgarren/spack
refs/heads/develop
var/spack/repos/builtin/packages/curl/package.py
1
############################################################################## # Copyright (c) 2013-2017, 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...
ChanduERP/odoo
refs/heads/8.0
addons/stock_picking_wave/wizard/picking_to_wave.py
382
############################################################################## # # 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 Affero General Public L...
ZenHarbinger/snapcraft
refs/heads/master
snapcraft/tests/test_meta.py
2
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
baoboa/pyqt5
refs/heads/master
examples/qtdemo/scanitem.py
3
############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENSE:LGPL$ ## Commercial Us...
ryepdx/shipping_api
refs/heads/master
report/summary_report.py
1
# -*- 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...
sebadiaz/kafka
refs/heads/trunk
tests/kafkatest/benchmarks/core/__init__.py
678
# 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 ...
dsullivan7/scikit-learn
refs/heads/master
sklearn/metrics/base.py
231
""" Common code for all metrics """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Arnaud Joly <a.joly@ulg.ac.be> # Jochen Wersdorfer <jochen@wersdoerfer.de> # Lars Buitinck ...
davidbkemp/node-gyp
refs/heads/master
gyp/test/same-gyp-name/gyptest-library.py
315
#!/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. """ Verifies that a dependency on two gyp files with the same name do not create a uid collision in the resulting generated xcode file. """ ...
chdecultot/frappe
refs/heads/develop
frappe/core/__init__.py
73
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals
hakanardo/cuda-convnet2
refs/heads/master
python_util/util.py
181
# 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...
lsaffre/lino_book
refs/heads/master
tests/polls_test/1/polls/views.py
5
from django.shortcuts import render from django.http import HttpResponse def index(request): return HttpResponse("Hello, world. You're at the polls index.")
piyushroshan/xen-4.3
refs/heads/master
tools/python/xen/xend/server/pciif.py
20
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
newswangerd/ansible
refs/heads/devel
test/units/modules/test_async_wrapper.py
20
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import shutil import tempfile import pytest from units.compat.mock import pa...
bgabor666/csibe
refs/heads/master
gen/servo/build-servo.py
3
#!/usr/bin/python import sys import subprocess import os if __name__ == "__main__": pbdir = os.environ["PROJECT_BINARY_DIR"] psdir = os.environ["PROJECT_SOURCE_DIR"] pgdir = os.environ["PROJECT_GEN_DIR"] if not pbdir or not psdir or not pgdir: sys.exit(1) # For build directories if "...
Vishruit/DDP_models
refs/heads/master
tf1/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py
26
# urllib3/connection.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import socket from socket import timeout as SocketTimeout try: # Python 3 from http.cli...
mhogg/scipy
refs/heads/master
scipy/linalg/decomp.py
30
# # Author: Pearu Peterson, March 2002 # # additions by Travis Oliphant, March 2002 # additions by Eric Jones, June 2002 # additions by Johannes Loehnert, June 2006 # additions by Bart Vandereycken, June 2006 # additions by Andrew D Straw, May 2007 # additions by Tiziano Zito, November 2008 # # April 2010: Functio...
stuartbfox/Diamond
refs/heads/master
src/collectors/numa/numa.py
61
#!/usr/bin/env python # coding=utf-8 """ This class collects data on NUMA utilization #### Dependencies * numactl """ import diamond.collector from subprocess import Popen, PIPE from re import compile as re_compile import logging node_re = re_compile('(?P<node>^node \d+ (free|size)): (?P<size>\d+) \MB') class Num...
mancoast/CPythonPyc_test
refs/heads/master
fail/341_test_cmath.py
104
from test.support import run_unittest, requires_IEEE_754 from test.test_math import parse_testfile, test_file import unittest import cmath, math from cmath import phase, polar, rect, pi import sysconfig INF = float('inf') NAN = float('nan') complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]] com...
Treefunder/pycoin
refs/heads/master
pycoin/scripts/bitcoin_utils.py
21
#!/usr/bin/env python import argparse import binascii import sys from pycoin import ecdsa, encoding from pycoin.serialize import b2h, h2b from pycoin.ecdsa import secp256k1 def parse_as_number(s): try: return int(s) except ValueError: pass try: return int(s, 16) except ValueEr...
13W/phantomjs
refs/heads/master
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/descriptor.py
260
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
BondAnthony/ansible
refs/heads/devel
lib/ansible/module_utils/distro/__init__.py
23
# (c) 2018 Toshio Kuratomi <tkuratomi@ansible.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 your option) any later ...
conejoninja/pelisalacarta
refs/heads/master
python/main-classic/channels/tengourl.py
9
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para ver un vídeo conociendo su URL # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import ...
balloob/home-assistant
refs/heads/dev
homeassistant/components/melcloud/sensor.py
8
"""Support for MelCloud device sensors.""" from pymelcloud import DEVICE_TYPE_ATA, DEVICE_TYPE_ATW from pymelcloud.atw_device import Zone from homeassistant.const import ( DEVICE_CLASS_TEMPERATURE, ENERGY_KILO_WATT_HOUR, TEMP_CELSIUS, ) from homeassistant.helpers.entity import Entity from . import MelClou...
erstis-go-botting/sexy-bot
refs/heads/master
main.py
1
# coding=utf-8 __author__ = 'sudo' import os import logging from core.navi import Bot def get_logger(): """ Creates a sexy rootlogger. Saves everything in 'logs/' """ if not os.path.exists('logs/'): os.makedirs('logs/') #logging.basicConfig(level=logging.DEBUG) logger = logging.g...
laurentb/weboob
refs/heads/master
modules/cesu/module.py
1
# -*- coding: utf-8 -*- # Copyright(C) 2020 Ludovic LANGE # # 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 Lesser General Public License as published by # the Free Software Foundation, either version 3 of the L...
EmreAtes/spack
refs/heads/develop
lib/spack/external/_pytest/python.py
23
""" Python test discovery, setup and run of test functions. """ from __future__ import absolute_import, division, print_function import fnmatch import inspect import sys import os import collections from textwrap import dedent from itertools import count import py from _pytest.mark import MarkerError from _pytest.con...
luca76/QGIS
refs/heads/master
tests/src/python/test_qgsrelation.py
4
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsRelation. .. note:: 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. """ __aut...
haxoza/django
refs/heads/master
django/contrib/gis/forms/widgets.py
28
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Widget from django.template import loader from django.utils import six, translation logger = log...
zeitgespenst/WeatherDisplay
refs/heads/master
Server/parsejenah2.py
1
# -*- coding: utf-8 -*- """ Created on Sat Feb 15 22:04:43 2014 Hier werden die Fahrplandaten des IST-Fahrplans verarbeitet. Die Daten müssen vorher per Shell-Script geladen werden. @author: dario """ import xml.etree.ElementTree as ET from svgjenah import svgtram #setzt Daten in SVG-Datei ein #eine Funktion die...
jaksmid/gensim
refs/heads/develop
gensim/test/test_aggregation.py
19
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest from gensim.topic_...
Endika/server-tools
refs/heads/8.0
server_environment_files_sample/__openerp__.py
21
# -*- coding: utf-8 -*- ############################################################################## # # Adapted by Nicolas Bessi. Copyright Camptocamp SA # Based on Florent Xicluna original code. Copyright Wingo SA # # This program is free software: you can redistribute it and/or modify # it under the te...
IntelBUAP/Python3
refs/heads/master
codigo27.py
1
#! /usr/bin/python3 # -*- coding:utf-8 -*- # Funciones y parametros arbitrarios def funcion(**nombres): print (type(nombres)) for alumno in nombres: print ("%s es alumno y tiene %d años" % (alumno, nombres[alumno])) return nombres #diccionario = {"Adrian":25, "Niño":25, "Roberto":23, "Celina":23} p...
radiosilence/pip
refs/heads/develop
tests/test_completion.py
1
import os from tests.test_pip import reset_env, run_pip, get_env def test_completion_for_bash(): """ Test getting completion for bash shell """ reset_env() bash_completion = """\ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ COMP_CWORD=$COMP_CWORD \\ ...
tedye/leetcode
refs/heads/master
tools/leetcode.202.Happy Number/leetcode.202.Happy Number.submission1.py
1
class Solution: # @param {integer} n # @return {boolean} def isHappy(self, n): if n == 1: return True if n == 4: return False x = sum([int(i) * int(i) for i in list(str(n))]) return self.isHappy(x)
kim6515516/khypervisor_native_linux_3.8_for_rtsm
refs/heads/master
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gorlemik/selenium
refs/heads/master
py/selenium/webdriver/blackberry/webdriver.py
71
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
badock/nova
refs/heads/master
nova/api/openstack/compute/views/versions.py
22
# Copyright 2010-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...
heke123/chromium-crosswalk
refs/heads/master
testing/scripts/checkperms.py
76
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import sys import common def main_run(args): with common.temporary_file() as tempfile_path: rc = common...
james-sakalaukus/kicad
refs/heads/master
pcbnew/scripting/examples/hidePcbValuesShowReferences.py
2
#!/usr/bin/env python import sys from pcbnew import * filename=sys.argv[1] pcb = LoadBoard(filename) for module in pcb.GetModules(): print "* Module: %s"%module.GetReference() module.GetValueObj().SetVisible(False) # set Value as Hidden module.GetReferenceObj().SetVisible(True) # set Reference...
epssy/hue
refs/heads/master
apps/sqoop/src/sqoop/client/link.py
33
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
stuntman723/rap-analyzer
refs/heads/master
rap_analyzer/lib/python2.7/site-packages/pip/_vendor/lockfile/mkdirlockfile.py
478
from __future__ import absolute_import, division import time import os import sys import errno from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class MkdirLockFile(LockBase): """Lock file by creating a directory.""" def __init__(self, path, threaded=True, ...
powellc/beltbadgers
refs/heads/master
beltbadgers/apps/belts/migrations/0004_auto__add_field_testattempt_passed.py
2
# -*- 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 'TestAttempt.passed' db.add_column(u'dojo_testattempt', 'passed', self....
hfvaldesg/neltume
refs/heads/master
user.py
1
import json import time def user_data(): with open('json/user.json') as json_data: user_data = json.load(json_data) return user_data class User: def __init__(self): data = user_data() self.first_time = data["first-time"] self.first_time_vocabulary = data["first-time-vocab...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/painting/painting_zabrak_m.py
2
import sys def setup(core, object): return #painting of High Commander T'Inia
Technariumas/Marimba
refs/heads/master
firmware/util/loadMidStrokes.py
1
#!/usr/bin/python import pickle from marimba import Marimba m=Marimba() m.connect() try: with open('/home/pi/Marimba/firmware/util/midStroke', 'rb') as fp: midStroke = pickle.load(fp) except Exception: midStroke = [17] * 80 print ("Loading MIDDLE stroke strengths:") print ([(m.setMidStrokeLength(n, midStroke[n], t...
loulich/Couchpotato
refs/heads/master
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/toypics.py
150
# -*- coding:utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor import re class ToypicsIE(InfoExtractor): IE_DESC = 'Toypics user profile' _VALID_URL = r'https?://videos\.toypics\.net/view/(?P<id>[0-9]+)/.*' _TEST = { 'url': 'http://videos.toypics.net/view/514/cha...
ousia/python-fitz
refs/heads/master
demo/removePass.py
2
#!/usr/bin/env python2 #this demo will open an encrypted PDF document #decrypt it with the provided password #and save as a new PDF document #usage: removePass.py <input file> <password> <output file> import fitz import sys if len(sys.argv) != 4: print('Usage: %s <input file> <password> <output file>' % sys.argv[...
haltode/haltode.fr-core
refs/heads/master
content/articles/algorithme/ia/apprentissage_artificiel/regression_lin_poly/algo_gradient/algo_gradient.py
5
import numpy as np # x = exemple d'entrée # y = exemple de sortie # m = nombre d'exemples # n = nombre d'attributs # theta = coefficients de notre fonction d'hypothese class regression_lineaire: def __init__(self, entree): with open(entree) as f: self.m, self.n = map(int, f.readline().split(...
cortext/crawtextV2
refs/heads/master
~/venvs/crawler/lib/python2.7/site-packages/requests/packages/chardet/euckrprober.py
2930
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
ColOfAbRiX/ansible
refs/heads/devel
test/runner/lib/ansible_util.py
14
"""Miscellaneous utility functions and classes specific to ansible cli tools.""" from __future__ import absolute_import, print_function import os from lib.util import common_environment def ansible_environment(args): """ :type args: CommonConfig :rtype: dict[str, str] """ env = common_environme...
omasanori/gyp
refs/heads/master
test/generator-output/gyptest-top-all.py
216
#!/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. """ Verifies building a project hierarchy created when the --generator-output= option is used to put the build configuration files in a sepa...
IV-GII/SocialCookies
refs/heads/master
ENV1/lib/python2.7/site-packages/django/middleware/clickjacking.py
329
""" Clickjacking Protection Middleware. This module provides a middleware that implements protection against a malicious site loading resources from your site in a hidden frame. """ from django.conf import settings class XFrameOptionsMiddleware(object): """ Middleware that sets the X-Frame-Options HTTP heade...
modesttree/Projeny
refs/heads/master
Source/prj/main/PrjRunner.py
1
import sys import os import webbrowser from mtm.util.Assert import * import mtm.util.MiscUtil as MiscUtil import mtm.util.PlatformUtil as PlatformUtil from mtm.util.Platforms import Platforms from mtm.util.CommonSettings import ConfigFileName import mtm.ioc.Container as Container from mtm.ioc.Inject import Inject ...
emartonline/newfies-dialer
refs/heads/master
addons/samples/namegen/names.py
23
names = """\ aaron abdul abe abel abraham abram adalberto adam adan adolfo adolph adrian agustin ahmad ahmed al alan albert alberto alden aldo alec alejandro alex alexander alexis alfonso alfonzo alfred alfredo ali allan allen alonso alonzo alphonse alphonso alton alva alvaro alvin amado ambrose amos anderson andre and...
pandeesh/pep8
refs/heads/master
testsuite/utf-8-bom.py
69
#!/usr/bin/env python # -*- coding: utf-8 -*- hello = 'こんにちわ' # EOF
aragos/tichu-tournament
refs/heads/master
python/openpyxl/chart/shapes.py
2
from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Alias ) from openpyxl.descriptors.nested import ( EmptyTag ) from openpyxl.drawing.colors import ColorChoiceDescriptor from openpyxl...
AlgoHunt/nerual_style_transfer
refs/heads/master
datasets/preprocess_imagenet_validation_data.py
17
#!/usr/bin/python # Copyright 2016 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 a...
yuifan/pexus4_external_chromium-trace
refs/heads/pexus_kt
trace-viewer/third_party/pywebsocket/src/test/test_stream_hixie75.py
496
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
multiplay/django-mysql-fields
refs/heads/master
django_mysql_fields/urls.py
1
"""django_mysql_fields URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/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...
iw3hxn/LibrERP
refs/heads/master
l10n_it_sale_group/__openerp__.py
3
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # Copyright (C) 2014 Didotech SRL (<http://didotech.com>). # # This program is free software: you can redistribute it...
hu7241/nao_slam_amcl
refs/heads/master
voice_nav_script/phone_call.py
2
#!/usr/bin/env python import rospy from std_msgs.msg import String import socket rospy.init_node('phone_call', anonymous=False) def talker(fromDavid): pub = rospy.Publisher('/recognizer/output', String, queue_size=10) action = fromDavid #rospy.loginfo(action) pub.publish(action) talker("") # hos...
maniteja123/sympy
refs/heads/master
sympy/simplify/sqrtdenest.py
69
from __future__ import print_function, division from sympy.functions import sqrt, sign, root from sympy.core import S, sympify, Mul, Add, Expr from sympy.core.function import expand_mul from sympy.core.compatibility import range from sympy.core.symbol import Dummy from sympy.polys import Poly, PolynomialError from sym...
WillGuan105/django
refs/heads/master
tests/model_inheritance/same_model_name/models.py
346
""" Model inheritance across apps can result in models with the same name, requiring an %(app_label)s format string. This app tests this feature by redefining the Copy model from model_inheritance/models.py. """ from model_inheritance.models import NamedURL from django.db import models from django.utils.encoding imp...
jburger424/MediaQueueHCI
refs/heads/dev
m-q-env/lib/python3.4/site-packages/flask/logging.py
838
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from logging import getLogger, StreamHandler, Formatter, getLoggerClas...
ypwalter/fxos-certsuite
refs/heads/master
mcts/web-platform-tests/tests/webdriver/timeouts/implicit_waits_tests.py
7
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test class ImplicitWaitsTests(base_test.WebDriverBaseTest): def setUp(self): self.driver.get(self.webserver.where_is('timeouts/res/implicit_waits_tests.html')) def test_find_element_...
andrvb/django-rest-swagger
refs/heads/master
cigar_example/cigar_example/urls.py
5
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), (r'^api/', include('cigar_example.restapi.urls', namespace="cigars")), (r'^', include('rest_framework_swagger.urls', namespace='sw...
duncanwp/iris
refs/heads/master
lib/iris/tests/unit/lazy_data/test_lazy_elementwise.py
3
# (C) British Crown Copyright 2018, Met Office # # This file is part of Iris. # # Iris 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 option) any later ve...
lixun910/pysal
refs/heads/master
pysal/model/spreg/tests/test_diagnostics.py
1
import unittest import numpy as np import pysal.lib from pysal.model.spreg import diagnostics from pysal.model.spreg.ols import OLS from pysal.lib.common import RTOL # create regression object used by all the tests below db = pysal.lib.io.open(pysal.lib.examples.get_path("columbus.dbf")) y = np.array(db.by_col("CRIME"...
saurabh6790/omnit-app
refs/heads/master
patches/august_2013/p03_pos_setting_replace_customer_account.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes def execute(): webnotes.reload_doc("accounts", "doctype", "pos_setting") if "customer_account" in webnotes.conn.get_table_columns(...
openstack/storlets
refs/heads/master
tests/unit/sbus/client/test_client.py
1
# Copyright (c) 2015-2016 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
kennethgillen/ansible
refs/heads/devel
test/integration/consul_running.py
364
''' Checks that the consul agent is running locally. ''' if __name__ == '__main__': try: import consul consul = consul.Consul(host='0.0.0.0', port=8500) consul.catalog.nodes() print("True") except: pass
suttond/MODOI
refs/heads/master
ase/io/findsym.py
4
from ase.atoms import Atoms from ase.parallel import paropen def write_findsym(fileobj, images): if isinstance(fileobj, str): fileobj = paropen(fileobj, 'w') if not isinstance(images, (list, tuple)): images = [images] symbols = images[0].get_chemical_symbols() natoms = len(symbols) ...
AgenttiX/fys-1320
refs/heads/master
energy_spectrum_analysis/toolbox.py
1
# Mika "AgenttiX" Mäki & Alpi Tolvanen, 2017 # This file contains functions for project.py import numpy as np import scipy.integrate as integrate # Natural constants m_e = 9.10939e-31 e = 1.60218e-19 c = 2.99792458e8 h = 6.6260755e-34 # Other constants # Most common energy for Am241 is unknown, for now let's use ...
mhostetter/gnuradio
refs/heads/master
gr-analog/python/analog/qa_fastnoise.py
57
#!/usr/bin/env python # # Copyright 2007,2010,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
JeroenDeDauw/a4g
refs/heads/master
gridcalc/parser.py
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- import gridcalc import loss import json def main(): gridcells = {} for line in open('gentdata').read().split('\n'): lat, lon, azimuth, beamwidth, freq = line.split('|') lat = float(lat) lon = float(lon) azimuth = float(azimuth) beamwidth = float(be...
vasyarv/edx-platform
refs/heads/master
common/djangoapps/monkey_patch/django_utils_translation.py
128
""" Monkey-patch `django.utils.translation` to not dump header info Modify Django's translation module, such that the *gettext functions always return an empty string when attempting to translate an empty string. This overrides the default behavior [0]: > It is convention with GNU gettext to include meta-data as the >...
ROMFactory/android_external_chromium_org
refs/heads/kitkat
PRESUBMIT.py
23
# 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. """Top-level presubmit script for Chromium. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presu...
remirobert/DigitalOcean
refs/heads/master
rrdigitalocean/Domain.py
1
import requests class Domain: def __init__(self, param_init=None, client_id=None, api_key=None): if param_init != None: self.id = param_init["id"] self.name = param_init["name"] self.ttl = param_init["ttl"] self.live_zone_file = param_init["live_zone_fil...