repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
gregorschatz/pymodbus3
refs/heads/master
examples/functional/asynchronous-tcp-client.py
3
#!/usr/bin/env python import unittest from twisted.internet import reactor, protocol from pymodbus.constants import Defaults from pymodbus.client.async import ModbusClientProtocol from base_runner import Runner class AsynchronousTcpClient(Runner, unittest.TestCase): ''' These are the integration tests for the ...
lehins/django-wepay
refs/heads/master
djwepay/forms.py
1
import json from django import forms from django.utils.functional import curry from djwepay.api import get_wepay_model from djwepay.models import * from wepay.exceptions import WePayError, WePayConnectionError #class JSONArrayWidget(forms.TextInput): # def render(self, name, value, attrs=None): # #if valu...
pni-libraries/python-pni
refs/heads/develop
doc/examples/attribute_io.py
1
#!/usr/bin/env python #File: attribute_io.py from __future__ import print_function import numpy import pni.io.nx.h5 as nexus f = nexus.create_file("attribute_io.nxs",overwrite=True) samptr = f.root().create_group("scan_1","NXentry"). \ create_group("instrument","NXinstrument"). \ c...
rflbras/lmtt
refs/heads/master
lmtt/wsgi.py
1
""" WSGI config for lmtt 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.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lmtt.settings") from django.core.wsgi im...
fuzzybuddha/grapevine-news-search
refs/heads/master
python/geopy/util.py
12
""" Utils. """ import logging from geopy.compat import py3k if not py3k: # pragma: no cover NUMBER_TYPES = (int, long, float) else: # pragma: no cover NUMBER_TYPES = (int, float) # long -> int in Py3k try: from decimal import Decimal NUMBER_TYPES = NUMBER_TYPES + (Decimal, ) except ImportError: # prag...
RKrahl/photo-tools
refs/heads/master
photo/qt/__init__.py
1
"""GUI elements based on PySide. """ from photo.qt.imageViewer import ImageViewer
getweber/weber-cli
refs/heads/master
cob/locations.py
2
from .utils.url import Mountpoint class Location: def __init__(self, mountpoint, is_frontend_app=False, is_static=False, fs_paths=()): assert isinstance(mountpoint, Mountpoint) self.mountpoint = mountpoint self._is_frontend_app = is_frontend_app self._is_static = is_static ...
adedayo/intellij-community
refs/heads/master
python/testData/formatter/alignInGenerators_after.py
83
def supprice(): if True: if True: agdrn = sum(VARS[drn + price] * md.c[drn][1] * md.c[drn][3] * exp(md.c[drn][2] * VARS['SEEPAGE'] - md.c[drn][3] * pmp) for drn in md.agdrn_nodes if drn in md.c)
PLyczkowski/Sticky-Keymap
refs/heads/master
2.74/python/lib/asyncio/events.py
61
"""Event loop and event loop policy.""" __all__ = ['AbstractEventLoopPolicy', 'AbstractEventLoop', 'AbstractServer', 'Handle', 'TimerHandle', 'get_event_loop_policy', 'set_event_loop_policy', 'get_event_loop', 'set_event_loop', 'new_event_loop', 'get_child_watcher...
Krienas/allianceauth
refs/heads/master
allianceauth/services/modules/discord/migrations/0002_service_permissions.py
3
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-02 05:59 from __future__ import unicode_literals from django.db import migrations from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.management import create_permissions import logging logger ...
koson/MissionPlannerKMTI
refs/heads/master
Lib/encodings/raw_unicode_escape.py
852
""" Python 'raw-unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is ...
nnmware/nnmware
refs/heads/master
apps/market/form.py
1
# nnmware(c)2012-2020 from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ from nnmware.apps.market.models import Product, ProductParameter, Order, ProductColor, ProductMaterial, ProductCategory from nnmware.apps.market.models import DeliveryMethod ...
sinbazhou/odoo
refs/heads/8.0
addons/resource/faces/utils.py
433
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
WoLpH/EventGhost
refs/heads/master
plugins/System/Execute.py
1
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/> # # EventGhost 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 versio...
dbtsai/spark
refs/heads/master
python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py
6
# # 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 us...
chew-z/Primes
refs/heads/master
libprimes.py
1
#!/usr/bin/env python3 # coding: utf-8 # various algos generating prime numbers < N, factors and couting primes < N # import itertools import numpy as np from operator import mul from functools import reduce GAMMA = 0.57721566490153286061 li2 = 1.045163780117492784844588889194 # Li(x) = li(x) - li(2) # FACTORS AN...
haoliangx/Project-Euler
refs/heads/master
src/P-040.py
1
#!/usr/bin/env python ''' Project Euler Problem 040 - Champernowne's constant ---------------- Description: Solution: ---------------- Haoliang Wang 02/06/2015 ''' from operator import mul s = ''.join([str(n) for n in xrange(1, 500000)]) print reduce(mul, [int(s[10 ** c - 1]) for c in ran...
GiovanniConserva/TestDeploy
refs/heads/master
venv/Lib/site-packages/dateutil/zoneinfo/rebuild.py
98
import logging import os import tempfile import shutil import json from subprocess import check_call from dateutil.zoneinfo import tar_open, METADATA_FN, ZONEFILENAME def rebuild(filename, tag=None, format="gz", zonegroups=[], metadata=None): """Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*ta...
ptisserand/ansible
refs/heads/devel
lib/ansible/modules/network/ordnance/ordnance_facts.py
43
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'],...
materialsproject/pymatgen
refs/heads/master
pymatgen/io/tests/test_prismatic.py
5
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import unittest from pymatgen.core.structure import Structure from pymatgen.io.prismatic import Prismatic from pymatgen.util.testing import PymatgenTest class PrismaticTest(unittest.TestCase): ...
AlexHill/django
refs/heads/master
tests/migrations/models.py
6
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.db.models.loading import BaseAppCache from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class UnicodeModel(models.Model): title = models.CharField('ÚÑÍ¢ÓÐÉ', max_lengt...
ninjin/simsem
refs/heads/master
maths.py
1
''' Mathematical related functions. Author: Pontus Stenetorp <pontus stenetorp se> Version: 2011-08-29 ''' from math import sqrt def mean(l): return sum(l) / float(len(l)) def median(l): return sorted(l)[len(l)/2] def stddev(vals): avg = mean(vals) return sqrt(sum(((val - avg) ** 2 for va...
geminateCoder/Character-Archive-Website
refs/heads/master
Lib/site-packages/sqlalchemy/ext/declarative/clsregistry.py
55
# ext/declarative/clsregistry.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 """Routines to handle the string class registry used by declarative. ...
MER-GROUP/intellij-community
refs/heads/master
python/testData/intentions/docStub.py
83
def fo<caret>o(a, b): print a print b if True: return
ColinIanKing/autotest
refs/heads/master
scheduler/email_manager.py
3
import traceback, socket, os, time, smtplib, re, getpass, logging try: import autotest.common as common except ImportError: import common from autotest.client.shared import global_config CONFIG_SECTION = 'SCHEDULER' CONFIG_SECTION_SMTP = 'SERVER' class EmailNotificationManager(object): def __init__(self)...
Sodki/ansible
refs/heads/devel
lib/ansible/modules/cloud/misc/proxmox_kvm.py
22
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Abdoul Bah (@helldorado) <bahabdoul at gmail.com> """ Ansible module to manage Qemu(KVM) instance in Proxmox VE cluster. This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fr...
DhiaEddineSaidi/python-social-auth
refs/heads/master
examples/flask_me_example/routes/main.py
27
from flask import render_template, redirect from flask.ext.login import login_required, logout_user from flask_me_example import app @app.route('/') def main(): return render_template('home.html') @login_required @app.route('/done/') def done(): return render_template('done.html') @app.route('/logout') d...
ojengwa/talk
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/creation.py
192
from django.db.backends.mysql.creation import DatabaseCreation class MySQLCreation(DatabaseCreation): def sql_indexes_for_field(self, model, f, style): from django.contrib.gis.db.models.fields import GeometryField output = super(MySQLCreation, self).sql_indexes_for_field(model, f, style) ...
MER-GROUP/intellij-community
refs/heads/master
python/testData/completion/dictKeyPrefix2.py
166
s = { 'a': 'b', 'kkkappa': 'd', 'lambda': 'foo' } s['k]kap''<caret>']
srickardti/openthread
refs/heads/master
tools/harness-automation/cases/commissioner_8_1_2.py
18
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
codesparkle/youtube-dl
refs/heads/master
youtube_dl/extractor/biqle.py
60
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class BIQLEIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?biqle\.(?:com|org|ru)/watch/(?P<id>-?\d+_\d+)' _TESTS = [{ 'url': 'http://www.biqle.ru/watch/847655_160197695', 'md5': 'ad5f746a874ccded7b8...
wdv4758h/ZipPy
refs/heads/master
edu.uci.python.benchmark/src/benchmarks/sympy/sympy/mpmath/functions/bessel.py
18
from .functions import defun, defun_wrapped @defun def j0(ctx, x): """Computes the Bessel function `J_0(x)`. See :func:`~mpmath.besselj`.""" return ctx.besselj(0, x) @defun def j1(ctx, x): """Computes the Bessel function `J_1(x)`. See :func:`~mpmath.besselj`.""" return ctx.besselj(1, x) @defun def b...
fengbaicanhe/intellij-community
refs/heads/master
python/testData/formatter/commentedCodeFragmentIgnored.py
79
# This normal comment won't be touched as well # for a in [1, 2, 3]: # if a == 1: # print 'x' # elif a == 2: # print 'y'
SnappleCap/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/conch/unix.py
20
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.cred import portal from twisted.python import components, log from twisted.internet.error import ProcessExitedAlready from zope import interface from ssh import session, forwarding, filetransfer from ssh.filetransfer import FXF_READ, ...
cityofEmbera/shadowsocks
refs/heads/master
shadowsocks/local.py
1015
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 clowwindy # # 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 r...
pgmillon/ansible
refs/heads/devel
lib/ansible/plugins/callback/sumologic.py
54
# -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distr...
qnib/qcollect
refs/heads/master
resources/diamond/collectors/varnish/varnish.py
38
# coding=utf-8 """ VarnishCollector grabs stats from Varnish and submits them the Graphite #### Dependencies * /usr/bin/varnishstat """ import diamond.collector import re import subprocess from diamond.collector import str_to_bool class VarnishCollector(diamond.collector.Collector): _RE = re.compile("^(?P<...
weimingtom/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/__init__.py
136
#!/usr/bin/python # # Copyright (C) 2006 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
zultron/virt-manager
refs/heads/rbd-wip
virtinst/devicememballoon.py
3
# Copyright (C) 2013 Red Hat, Inc. # # Copyright 2012 # Eiichi Tsukata <devel@etsukata.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your optio...
thiagopena/djangoSIGE
refs/heads/master
djangosige/__init__.py
11
# -*- coding: utf-8 -*- __version__ = '0.0.1'
kdheepak89/sl4a
refs/heads/master
android/USBHostSerialFacade/samplescripts/testusbserial.py
6
#!/usr/bin/python # -= encoding=utf-8 =- ############################################################################## # # testusbserial.py $Rev: 1259:a3e5cb9bcb0a $ # $Id: testusbserial.py 1259:a3e5cb9bcb0a 2015/03/14 07:44:55 shimoda $ # $URL: https://android-jp-kobe.googlecode.com/svn/trunk/pyAndyUI/uibt2.py $ # # ...
ChawalitK/odoo
refs/heads/master
addons/account/wizard/account_financial_report.py
43
# -*- coding: utf-8 -*- from openerp import api, fields, models class AccountingReport(models.TransientModel): _name = "accounting.report" _inherit = "account.common.report" _description = "Accounting Report" @api.model def _get_account_report(self): reports = [] if self._context...
Smerity/keras
refs/heads/master
examples/lstm_text_generation.py
7
from __future__ import print_function from keras.models import Sequential from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM from keras.datasets.data_utils import get_file import numpy as np import random import sys ''' Example script to generate text from Nietzsche's ...
film42/pyodbc-modified
refs/heads/master
setup.py
1
#!/usr/bin/python import sys, os, re, platform from os.path import exists, abspath, dirname, join, isdir try: # Allow use of setuptools so eggs can be built. from setuptools import setup, Command except ImportError: from distutils.core import setup, Command from distutils.extension import Extension from ...
dhenrygithub/QGIS
refs/heads/master
python/plugins/db_manager/db_plugins/vlayers/data_model.py
2
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : Virtual layers plugin for DB Manager Date : December 2015 copyright : (C) 2015 by Hugo Mercier email : hugo dot mercier at oslandia dot com *******...
AntonioMtn/NZBMegaSearch
refs/heads/master
requests/exceptions.py
105
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ class RequestException(RuntimeError): """There was an ambiguous exception that occurred while handling your request.""" class HTTPError(RequestException): """An HTTP error occ...
jinstrive/mycli
refs/heads/master
mycli/clitoolbar.py
27
from pygments.token import Token def create_toolbar_tokens_func(get_key_bindings, token=None): """ Return a function that generates the toolbar tokens. """ assert callable(get_key_bindings) token = token or Token.Toolbar def get_toolbar_tokens(cli): result = [] result.append((...
imron/scalyr-agent-2
refs/heads/master
scalyr_agent/third_party/pysnmp/proto/secmod/rfc3414/priv/base.py
7
from pysnmp.proto import error class AbstractEncryptionService: serviceID = None def hashPassphrase(self, authProtocol, privKey): raise error.ProtocolError('no encryption') def localizeKey(self, authProtocol, privKey, snmpEngineID): raise error.ProtocolError('no encryption') ...
pyOpenSci/pyEnsemblRest
refs/heads/master
examples.py
2
""" This file is part of pyEnsemblRest. pyEnsemblRest 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. pyEnsemblRes...
stevekuznetsov/ansible
refs/heads/devel
lib/ansible/modules/system/group.py
11
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
tellesnobrega/sahara
refs/heads/master
sahara/db/migration/alembic_migrations/versions/002_placeholder.py
13
# Copyright 2014 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 agreed to in ...
milliman/spark
refs/heads/master
python/pyspark/heapq3.py
77
# -*- encoding: utf-8 -*- # back ported from CPython 3 # A. HISTORY OF THE SOFTWARE # ========================== # # Python was created in the early 1990s by Guido van Rossum at Stichting # Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands # as a successor of a language called ABC. Guido remains Py...
DiptoDas8/Biponi
refs/heads/master
lib/python2.7/site-packages/setuptools/command/build_ext.py
28
from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler from distutils.errors import DistutilsError from distutils import log import os import sys import itertools from s...
jyt109/gensim
refs/heads/develop
gensim/test/test_miislita.py
83
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module replicates the miislita vector spaces from "A Linear Algebra Approach to the Vector Space Model -- A Fast Track Tutorial" by Dr. E. Garcia, admin@miislita.com See http://www.miisl...
delighted/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
121
# Copyright (C) 2010 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 of conditions and th...
glaubitz/fs-uae-debian
refs/heads/master
arcade/OpenGL/raw/GLX/SGIX/__init__.py
1729
"""OpenGL Extensions"""
nickhdamico/py
refs/heads/master
lib/mako/cmd.py
60
# mako/cmd.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from argparse import ArgumentParser from os.path import isfile, dirname import sys from mako.template i...
races1986/SafeLanguage
refs/heads/master
CEM/maintenance/test_namespaces.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- """ This utility's primary use is to find all mismatches between the namespace naming in the family files and the language files on the wiki servers. You may use the following options: -all Run through all known languages in a family -langs Check comma-seperate...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/static/creature/shared_droids_dz70.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/creature/shared_droids_dz70.iff" result.attribute_template_id = -1 res...
cpaulik/scipy
refs/heads/master
scipy/sparse/csgraph/tests/test_connected_components.py
144
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_array_almost_equal from scipy.sparse import csgraph def test_weak_connections(): Xde = np.array([[0, 1, 0], [0, 0, 0], [0, 0, 0]]) Xsp = ...
GheRivero/ansible
refs/heads/devel
lib/ansible/modules/network/vyos/vyos_user.py
38
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
onyxfish/csvkit
refs/heads/master
tests/test_grep.py
3
#!/usr/bin/env python import re import unittest from csvkit.grep import FilteringCSVReader from csvkit.exceptions import ColumnIdentifierError class TestGrep(unittest.TestCase): def setUp(self): self.tab1 = [ ['id', 'name', 'i_work_here'], [u'1', u'Chicago Reader', u'first'], ...
OCA/website
refs/heads/12.0
website_snippet_marginless_gallery/tests/__init__.py
2
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import test_ui
CompMusic/essentia
refs/heads/master
src/examples/python/experimental/beatogram4.py
10
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
TipsyOs-Devices/android_kernel_htc_msm8974
refs/heads/lp5.1
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
AvengersPy/MyPairs
refs/heads/master
Simulation/onePair.py
1
import os import csv import pandas as pd import numpy as np from scipy import stats import matplotlib.pyplot as plt def readCSV(): os.chdir(r'/Users/yubing/MyPairs/Simulation/data') data1 = pd.read_csv('spy.csv')# pandas dataframe data2 = pd.read_csv('csco.csv') ETFlist = list(data1['Adj Close']) # convert to li...
mapennell/ansible
refs/heads/devel
cloud/cloudstack/cs_instance.py
6
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
simongoffin/website_version
refs/heads/Multi_fonctionnel
openerp/osv/query.py
380
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP S.A. http://www.openerp.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
jelugbo/hebs_master
refs/heads/master
lms/djangoapps/foldit/migrations/0001_initial.py
74
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Score' db.create_table('foldit_score', ( ('id', self.gf('django.db.models.fields...
aselle/tensorflow
refs/heads/master
tensorflow/contrib/lite/python/convert_test.py
14
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
hxa7241/minilight-python
refs/heads/master
raytracer.py
1
# MiniLight Python : minimal global illumination renderer # # Harrison Ainsworth / HXA7241 and Juraj Sukop : 2007-2008, 2013. # http://www.hxa.name/minilight from surfacepoint import SurfacePoint from vector3f import ZERO class RayTracer(object): def __init__(self, scene): self.scene_ref = scene ...
deandunbar/bitwave
refs/heads/master
hackathon_version/venv/lib/python2.7/site-packages/pkg_resources/tests/test_pkg_resources.py
242
import sys import tempfile import os import zipfile import datetime import time import subprocess import pkg_resources try: unicode except NameError: unicode = str def timestamp(dt): """ Return a timestamp for a local, naive datetime instance. """ try: return dt.timestamp() except...
raajitr/django_hangman
refs/heads/master
env/lib/python2.7/site-packages/django/db/backends/mysql/base.py
44
""" 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 from django.conf import settings...
jawilson/home-assistant
refs/heads/master
homeassistant/components/sensor/deutsche_bahn.py
6
""" Support for information about the German train system. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.deutsche_bahn/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.sensor import PLATF...
wemanuel/smry
refs/heads/master
Crypto/SelfTest/Hash/test_MD4.py
116
# -*- coding: utf-8 -*- # # SelfTest/Hash/MD4.py: Self-test for the MD4 hash function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication ...
insertnamehere1/maraschino
refs/heads/master
lib/jinja2/visitor.py
1401
# -*- coding: utf-8 -*- """ jinja2.visitor ~~~~~~~~~~~~~~ This module implements a visitor for the nodes. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2.nodes import Node class NodeVisitor(object): """Walks the abstract syntax tree and call visitor functions for every...
dimitri-justeau/niamoto-core
refs/heads/master
niamoto/data_providers/plantnote_provider/plantnote_occurrence_provider.py
1
# coding: utf-8 from sqlalchemy import * import pandas as pd from niamoto.data_providers.base_occurrence_provider import \ BaseOccurrenceProvider class PlantnoteOccurrenceProvider(BaseOccurrenceProvider): """ Pl@ntnote Occurrence Provider. Provide occurrences from a Pl@ntnote database. The Pl@ntnote...
Intel-tensorflow/tensorflow
refs/heads/master
tensorflow/python/estimator/canned/dnn_testing_utils.py
40
# Copyright 2018 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...
myjang0507/Polaris
refs/heads/master
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
WarrenWeckesser/scipy
refs/heads/master
scipy/interpolate/_cubic.py
7
"""Interpolation algorithms using piecewise cubic polynomials.""" import numpy as np from . import PPoly from .polyint import _isscalar from scipy.linalg import solve_banded, solve __all__ = ["CubicHermiteSpline", "PchipInterpolator", "pchip_interpolate", "Akima1DInterpolator", "CubicSpline"] def prepa...
ArtsiomCh/tensorflow
refs/heads/master
tensorflow/python/ops/metrics_impl.py
3
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
narasimhan-v/avocado-misc-tests-1
refs/heads/master
io/net/infiniband/mckey.py
4
#!/usr/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
yashodhank/erpnext
refs/heads/develop
erpnext/stock/doctype/material_request_item/material_request_item.py
86
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class MaterialRequestItem(Document): pass
tempbottle/pulsar
refs/heads/master
tests/utils/tools.py
6
'''Tests the tools and utilities in pulsar.utils.''' import unittest from datetime import datetime, date from pulsar import system, get_actor from pulsar.utils.tools import checkarity, nice_number, date2timestamp from pulsar.utils.importer import py_file, import_modules from pulsar.apps.test import sequential def f0...
zchking/odoo
refs/heads/8.0
addons/auth_ldap/users_ldap.py
133
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
pabulumm/neighbors
refs/heads/master
lib/python3.4/site-packages/django/db/backends/postgresql/schema.py
6
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s" sql_create_sequence = "CREATE SEQUENCE %(sequence)s" sql_delete_sequence =...
ckan/ckanext-deadoralive
refs/heads/master
ckanext/__init__.py
878
# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__)
pquentin/django
refs/heads/stable/1.8.x
django/contrib/humanize/__init__.py
808
default_app_config = 'django.contrib.humanize.apps.HumanizeConfig'
robobrobro/ballin-octo-shame
refs/heads/master
lib/Python-3.4.3/Lib/unittest/test/testmock/testsentinel.py
99
import unittest from unittest.mock import sentinel, DEFAULT class SentinelTest(unittest.TestCase): def testSentinels(self): self.assertEqual(sentinel.whatever, sentinel.whatever, 'sentinel not stored') self.assertNotEqual(sentinel.whatever, sentinel.whateverelse, ...
renard/ansible
refs/heads/devel
test/integration/targets/uri/files/testserver.py
70
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys if __name__ == '__main__': if sys.version_info[0] >= 3: import http.server import socketserver PORT = int(sys.argv[1]) class Handler(http.server.SimpleHTTPRequestHandler): ...
MartinEnder/erpnext-de
refs/heads/develop
erpnext/selling/doctype/customer/customer.py
3
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.naming import make_autoname from frappe import _, msgprint, throw import frappe.defaults from frappe.utils import flt, c...
williamfeng323/py-web
refs/heads/master
flask/lib/python3.6/site-packages/click/formatting.py
226
from contextlib import contextmanager from .termui import get_terminal_size from .parser import split_opt from ._compat import term_len # Can force a width. This is used by the test system FORCED_WIDTH = None def measure_table(rows): widths = {} for row in rows: for idx, col in enumerate(row): ...
roscoeZA/GeoGigSync
refs/heads/master
src/pydev/third_party/pep8/pep8.py
43
#!/usr/bin/env python # pep8.py - Check Python source code formatting, according to PEP 8 # Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net> # Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this soft...
bradwoo8621/Swift-Study
refs/heads/master
Instagram/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/compiler-override/my_ld.py
980
#!/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. import sys print sys.argv
ahmedbodi/AutobahnPython
refs/heads/master
examples/twisted/websocket/echo_site_tls/server.py
18
############################################################################### ## ## Copyright (C) 2011-2013 Tavendo GmbH ## ## 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 ## ## h...
SPriyaJain/studybuddy
refs/heads/master
env/lib/python2.7/site-packages/pip/utils/encoding.py
485
import codecs import locale import re BOMS = [ (codecs.BOM_UTF8, 'utf8'), (codecs.BOM_UTF16, 'utf16'), (codecs.BOM_UTF16_BE, 'utf16-be'), (codecs.BOM_UTF16_LE, 'utf16-le'), (codecs.BOM_UTF32, 'utf32'), (codecs.BOM_UTF32_BE, 'utf32-be'), (codecs.BOM_UTF32_LE, 'utf32-le'), ] ENCODING_RE = r...
vimagick/youtube-dl
refs/heads/master
youtube_dl/extractor/sportbox.py
115
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( unified_strdate, ) class SportBoxIE(InfoExtractor): _VALID_URL = r'https?://news\.sportbox\.ru/(?:[^/]+/)+spbvideo_NI\d+_(?P<display_id>.+)' _TES...
JTarball/generator-django-polymer
refs/heads/master
app/templates/backend/apps/blog/utils.py
5
''' blog.utils ========== ''' from markdown2 import markdown # BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ from bs4 import BeautifulSoup def markup(markdown): """ Takes content that assumed to be markdown converts to markup for beautiful html output. """
wanghongjuan/crosswalk-test-suite
refs/heads/master
usecase/usecase-wrt-android-tests/inst.apk.py
5
#!/usr/bin/env python import os import commands import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short ...
dagwieers/ansible
refs/heads/devel
lib/ansible/vars/hostvars.py
33
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...