repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/git/refs/tag.py
4
from .reference import Reference __all__ = ["TagReference", "Tag"] class TagReference(Reference): """Class representing a lightweight tag reference which either points to a commit ,a tag object or any other object. In the latter case additional information, like the signature or the tag-creator, is avai...
Kakadu/embox
refs/heads/clang-compilation
mk/gensums.py
4
#!/usr/bin/env python import sys import re try: # Python2 import md5 md5factory = md5.new md5dig = lambda m: [ ord(x) for x in m.digest() ] except ImportError: # Python3 import hashlib md5factory = hashlib.md5 md5dig = lambda m: list(m.digest()) def parse(file, sectname): vmas = d...
theandygross/Figures
refs/heads/master
setup.py
1
#!/usr/bin/env python from setuptools import setup setup(name='PandasFigureWrappers', version='0.1', description='Wrappers for Scipy and R stats using Pandas objects.', author='Andrew Gross', author_email='[email protected]', url='http://andy-gross.flavors.me', package_dir...
GNOME/orca
refs/heads/master
src/orca/scripts/web/speech_generator.py
1
# Orca # # Copyright 2005-2009 Sun Microsystems Inc. # Copyright 2010-2011 Orca Team # Copyright 2011-2015 Igalia, S.L. # # This library 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 ...
yasoob/PythonRSSReader
refs/heads/master
venv/lib/python2.7/dist-packages/PIL/ContainerIO.py
18
# # The Python Imaging Library. # $Id$ # # a class to read from a container file # # History: # 1995-06-18 fl Created # 1995-09-07 fl Added readline(), readlines() # # Copyright (c) 1997-2001 by Secret Labs AB # Copyright (c) 1995 by Fredrik Lundh # # See the README file for information on usage and redistribut...
ryanraaum/oldowan.mtconvert
refs/heads/master
oldowan/mtconvert/biopython/listfns.py
1
# Copyright 2000 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """This provides useful general functions for working with lists. Functions: asdict ...
sridevikoushik31/openstack
refs/heads/T11906
nova/tests/baremetal/test_pxe.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, 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....
ericbaze/continuum_code_2012
refs/heads/master
pydata/moin/pythonenv/local/lib/python2.7/encodings/cp850.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
kustodian/ansible
refs/heads/devel
test/units/modules/network/fortios/test_fortios_vpn_ipsec_phase1.py
21
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
bneg/Empire
refs/heads/master
lib/modules/powershell/situational_awareness/host/monitortcpconnections.py
10
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Start-MonitorTCPConnections', # li...
pupil-labs/pyv4l2
refs/heads/master
example.py
1
import v4l2 import logging # import cv2 from time import time logging.basicConfig(level=logging.DEBUG) from time import time,sleep import numpy as np if v4l2.list_devices() ==[]: exit() print v4l2.list_devices() cap = v4l2.Capture("/dev/video0") print cap.get_info() cap.transport_formats print cap.frame_rate ...
spaceof7/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/v_lrs_segment.py
5
# -*- coding: utf-8 -*- """ *************************************************************************** v_lrs_segment.py ---------------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr *****************************...
bioconda/bioconda-utils
refs/heads/master
setup.py
1
# -*- coding: UTF-8 -*- from setuptools import setup, find_packages import versioneer setup( name='bioconda-utils', author="Johannes Köster, Ryan Dale, The Bioconda Team", description="Utilities for building and managing conda packages", license="MIT", packages=find_packages(exclude=['test']), ...
shenyushun/cookiecutter-simple-django-cn
refs/heads/master
{{cookiecutter.project_slug}}/manage.py
78
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
pdellaert/ansible
refs/heads/devel
test/units/modules/network/fortios/test_fortios_wireless_controller_hotspot20_icon.py
21
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
madjar/cython
refs/heads/master
docs/sphinxext/ipython_console_highlighting.py
31
from pygments.lexer import Lexer, do_insertions from pygments.lexers.agile import PythonConsoleLexer, PythonLexer, \ PythonTracebackLexer from pygments.token import Comment, Generic from sphinx import highlighting import re line_re = re.compile('.*?\n') class IPythonConsoleLexer(Lexer): """ For IPython co...
abhattad4/Digi-Menu
refs/heads/master
tests/utils_tests/test_itercompat.py
569
from django.test import TestCase from .models import Category, Thing class TestIsIterator(TestCase): def test_regression(self): """This failed on Django 1.5/Py2.6 because category has a next method.""" category = Category.objects.create(name='category') Thing.objects.create(category=categ...
karyon/django
refs/heads/master
django/contrib/admin/templatetags/admin_list.py
30
from __future__ import unicode_literals import datetime import warnings from django.contrib.admin.templatetags.admin_urls import add_preserved_filters from django.contrib.admin.utils import ( display_for_field, display_for_value, label_for_field, lookup_field, ) from django.contrib.admin.views.main import ( A...
dracos/django
refs/heads/master
django/contrib/gis/db/backends/oracle/adapter.py
91
from cx_Oracle import CLOB from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.geos import GeometryCollection, Polygon class OracleSpatialAdapter(WKTAdapter): input_size = CLOB def __init__(self, geom): """ Oracle requires that polygon rings are in prop...
ghandiosm/Test
refs/heads/master
addons/hr_timesheet_sheet/report/__init__.py
46
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import hr_timesheet_report
pwong-mapr/private-hue
refs/heads/HUE-1096-abe
desktop/core/ext-py/Django-1.4.5/tests/regressiontests/urlpatterns_reverse/middleware.py
92
from __future__ import absolute_import from . import urlconf_inner class ChangeURLconfMiddleware(object): def process_request(self, request): request.urlconf = urlconf_inner.__name__ class NullChangeURLconfMiddleware(object): def process_request(self, request): request.urlconf = None
danielmellado/tempest
refs/heads/master
tempest/stress/actions/ssh_floating.py
6
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # di...
VariationalResearch/Polaron
refs/heads/master
polrabi/wf2.py
1
from . basic import * # NOTE: FORGOT TO MULTIPLY BY dk IN INTEGRALS FOR SECONDWF CALCULATIONS # ALSO, WK**-1 IS WRONG APPARENTLY -> NEED TO DO 1/WK def pchi(betaVec, kVec, gBB, mB, n0): # takes finite vector of Beta_{k} values and returns (1/2)*Sum_{k}[W_{k}*(Beta_{k}+Beta_{k}^{*})] betaSum = betaVec + np.co...
gpmidi/MCEdit-Unified
refs/heads/master
albow/file_dialogs.py
3
# -*- coding: utf-8 -*- # # Albow - File Dialogs # #-# Modified by D.C.-G. for translation purpose """ TODO: * Implement Windows support. """ import os, sys from pygame import event, image from pygame.transform import scale from pygame.locals import * from albow.widget import Widget from albow.dialogs import Dialog,...
Johnzero/erp
refs/heads/fga
openerp/pychart/line_style.py
15
# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito ([email protected]) # # Jockey 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 vers...
maxalbert/ansible
refs/heads/devel
contrib/inventory/digital_ocean.py
33
#!/usr/bin/env python ''' DigitalOcean external inventory script ====================================== Generates Ansible inventory of DigitalOcean Droplets. In addition to the --list and --host options used by Ansible, there are options for generating JSON of other DigitalOcean data. This is useful when creating d...
UQ-UQx/edx-platform_lti
refs/heads/master
lms/djangoapps/shoppingcart/reports.py
66
""" Objects and functions related to generating CSV reports """ from decimal import Decimal import unicodecsv from django.utils.translation import ugettext as _ from courseware.courses import get_course_by_id from course_modes.models import CourseMode from shoppingcart.models import CertificateItem, OrderItem from s...
guerrerocarlos/odoo
refs/heads/8.0
openerp/addons/base/module/wizard/base_update_translations.py
447
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
phys-tools/pi-qmc
refs/heads/master
test/system/sho/test_sho.py
1
import unittest import subprocess import os import pitools import math class SHOTestCase(unittest.TestCase): @classmethod def setUpClass(cls): os.chdir("sho") out = file("pi.log", "w") process = subprocess.Popen("../../../bin/pi-qmc", stdout=subprocess.PIPE, stdin=subproce...
eg-zhang/scikit-learn
refs/heads/master
sklearn/ensemble/weight_boosting.py
71
"""Weight Boosting This module contains weight boosting estimators for both classification and regression. The module structure is the following: - The ``BaseWeightBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regression and classification only differ from each ot...
mattvick/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/__init__.py
6014
# Required for Python to search this directory for module files
mengli/MachineLearning
refs/heads/master
self_driving/segnet/evaluate_kitti.py
2
"""Evaluate SegNet. nohup python -u -m self_driving.segnet.evaluate_kitti > self_driving/segnet/output.txt 2>&1 & """ import os import tensorflow as tf from utils import kitti_segnet from scipy import misc LOG_DIR = 'backup/segnet_kitti' EPOCH = 237 BATCH_SIZE = 1 IMAGE_HEIGHT = 375 IMAGE_WIDTH = 1242 NUM_CLASSES =...
anandsimmy/ecommerce
refs/heads/master
tests/functional/test_offer.py
70
from oscar.test.testcases import WebTestCase class TestTheOfferListPage(WebTestCase): def test_exists(self): response = self.app.get('/offers/') self.assertEqual(200, response.status_code)
matt-hammond-bbc/gst-plugins-bad-mpegtsdemux-mods
refs/heads/1.4.3-mods
gst/gaudieffects/blur-example.py
73
#!/usr/bin/python import gobject; gobject.threads_init() import pygst; pygst.require("0.10") import gst p = gst.parse_launch (""" v4l2src ! videoconvert ! queue ! video/x-raw,width=320,height=240,framerate=30/1 ! gaussianblur qos=true name=vf ! videoconvert ! timeoverlay ! xvimagesink """) m = p.get_by_nam...
adrienbrault/home-assistant
refs/heads/dev
homeassistant/components/elkm1/config_flow.py
3
"""Config flow for Elk-M1 Control integration.""" import asyncio import logging from urllib.parse import urlparse import elkm1_lib as elkm1 import voluptuous as vol from homeassistant import config_entries, exceptions from homeassistant.const import ( CONF_ADDRESS, CONF_HOST, CONF_PASSWORD, CONF_PREFI...
jdinsh/MyClientMap
refs/heads/master
plugins/com.soasta.touchtest.android/plugin.py
23
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, subprocess, hashlib, time, shutil, zipfile from time import sleep from os import listdir from os.path import isfile, join def compile(c): global project_dir global sdk_dir global deploy_type global builder global android global conf...
ACJTeam/enigma2
refs/heads/master
lib/python/Components/EpgList.py
1
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from enigma import eEPGCache, eListbox, eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER from Tools.Alternatives import CompareWithAlternatives from Tools.LoadPixmap import LoadPixmap f...
devmax59/cloudtunes
refs/heads/master
cloudtunes-server/cloudtunes/worker.py
14
""" Main script for Celery worker. """ from __future__ import absolute_import from celery.app import Celery from cloudtunes import settings celery = Celery( 'tasks', broker='redis://{host}:6379/1'.format(**settings.REDIS) ) celery.conf.CELERY_DISABLE_RATE_LIMITS = True celery.conf.CELERY_IMPORTS = [ '...
shuishoudage/CloudappCLI
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py
2762
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
barberscore/barberscore-api
refs/heads/master
project/apps/registration/migrations/0009_auto_20190909_0637.py
3
# Generated by Django 2.2.5 on 2019-09-09 13:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registration', '0008_auto_20190909_0626'), ] operations = [ migrations.AlterField( model_name='assignment', name='ar...
lcdb/lcdblib
refs/heads/master
docs/conf.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # lcdblib documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # aut...
z1gm4/desarrollo_web_udp
refs/heads/dev
env/lib/python2.7/site-packages/bs4/__init__.py
38
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a pluggable XML or HTML parser to parse a (possibly invalid) document into a tree representation. Beautiful Soup provides provides methods and Pythonic idioms that make it easy to navigate...
laenderoliveira/exerclivropy
refs/heads/master
cap09/listagem-09-08.py
1
f = { "drama": ["Cidadão Kane", "O Poderoso Chefão"], "comedia": ["Tempos Modernos", "American Pie", "Dr. Dolittle"], "policial": ["Chuva Negra", "Desejo de Matar", "Difícil de Matar"], "guerra": ["Rambo", "Platoon", "Tora!Tora!Tora"] } pagina = open("index.html", "w", encoding="utf-8") pagina.write("<...
collinmsn/thrift
refs/heads/master
lib/py/src/server/TProcessPoolServer.py
47
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
ludwiktrammer/bestja
refs/heads/master
addons/bestja_stores/models.py
1
# -*- coding: utf-8 -*- import re import datetime from openerp import models, fields, api, exceptions class RetailChain(models.Model): _name = 'bestja_stores.chain' name = fields.Char(required=True) class Store(models.Model): _name = 'bestja_stores.store' _inherit = [ 'protected_fields.mixi...
codeman38/toggldesktop
refs/heads/master
third_party/googletest-read-only/test/gtest_xml_outfiles_test.py
2526
#!/usr/bin/env python # # Copyright 2008, 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...
badloop/SickRage
refs/heads/master
lib/jsonrpclib/jsonrpc.py
68
""" Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Lice...
christianbaun/octopuscloud
refs/heads/master
boto/sdb/db/property.py
1
# 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,...
andymckay/django
refs/heads/master
django/template/loader.py
83
# Wrapper for loading templates from storage of some sort (e.g. filesystem, database). # # This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use. # Each loader is expected to have this interface: # # callable(name, dirs=[]) # # name is the template name. # dirs is an optional list of directories ...
cloudera/hue
refs/heads/master
desktop/core/ext-py/nose-1.3.7/unit_tests/test_result_proxy.py
10
import sys import unittest from inspect import ismethod from nose.config import Config from nose.proxy import ResultProxyFactory, ResultProxy from mock import RecordingPluginManager class TestResultProxy(unittest.TestCase): def test_proxy_has_basic_methods(self): res = unittest.TestResult() proxy ...
octavioturra/aritial
refs/heads/master
google_appengine/lib/django/django/templatetags/i18n.py
33
from django.template import Node, resolve_variable from django.template import TemplateSyntaxError, TokenParser, Library from django.template import TOKEN_TEXT, TOKEN_VAR from django.utils import translation register = Library() class GetAvailableLanguagesNode(Node): def __init__(self, variable): self.var...
JackDanger/sentry
refs/heads/master
src/sentry/search/django/constants.py
7
""" sentry.search.django.constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import SORT_CLAUSES = { 'priority': 'sentry_groupedmessage.score', 'date': 'EXTRACT(E...
arru/pypegs
refs/heads/master
pypegs/__init__.py
1
# pyPEGS # # Copyright (c) 2015, Arvid Rudling # All rights reserved. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
brownharryb/erpnext
refs/heads/develop
erpnext/patches/v4_2/delete_old_print_formats.py
120
# 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 def execute(): old_formats = ("Sales Invoice", "Sales Invoice Spartan", "Sales Invoice Modern", "Sales Invoice Classic", "Sales Orde...
mudbungie/carrieocoyle
refs/heads/master
gallery/migrations/0008_remove_piece_medium.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('gallery', '0007_auto_20151027_1103'), ] operations = [ migrations.RemoveField( model_name='piece', n...
blakfeld/ansible
refs/heads/devel
lib/ansible/plugins/cache/redis.py
34
# (c) 2014, Brian Coca, Josh Drake, et al # # 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. ...
naototty/pyflag
refs/heads/master
src/plugins_old/DiskForensics/TimeLine.py
5
# ****************************************************** # Copyright 2004: Commonwealth of Australia. # # Developed by the Computer Network Vulnerability Team, # Information Security Group. # Department of Defence. # # Michael Cohen <[email protected]> # David Collett <[email protected]> # # ***...
mmccoo/kicad_mmccoo
refs/heads/master
svg2border/test_parser.py
1
import inspect import sys, os.path oldpath = sys.path # inspect.stack()[0][1] is the full path to the current file. sys.path.insert(0, os.path.dirname(inspect.stack()[0][1])) import parse_svg_path sys.path = oldpath paths = parse_svg_path.parse_svg_path('/home/mmccoo/kicad/kicad_mmccoo/svg2border/drawing.svg') for ...
sreichholf/python-coherence
refs/heads/develop
coherence/extern/db_row.py
2
# Wraps DB-API 2.0 query results to provide a nice list and dictionary interface. # Copyright (C) 2002 Dr. Conan C. Albrecht <[email protected]> # # This library 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 Softwar...
rob-hills/Booktype
refs/heads/2.0
lib/booktype/apps/reader/forms.py
2
from django import forms from booki.editor.models import Book from django.utils.translation import ugettext_lazy as _ from booktype.apps.core.forms import BaseBooktypeForm class EditBookInfoForm(BaseBooktypeForm, forms.ModelForm): description = forms.CharField( label=_("Book description"), ...
mredar/django-dublincore
refs/heads/master
test_project/test_project/wsgi.py
73
""" WSGI config for test_project project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATI...
qpython-android/QPypi-numpy
refs/heads/master
numpy/distutils/command/bdist_rpm.py
101
import os import sys if 'setuptools' in sys.modules: from setuptools.command.bdist_rpm import bdist_rpm as old_bdist_rpm else: from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm class bdist_rpm(old_bdist_rpm): def _make_spec_file(self): spec_file = old_bdist_rpm._make_spec_file(sel...
cactusbin/nyt
refs/heads/master
matplotlib/doc/pyplots/whats_new_98_4_fancy.py
6
import matplotlib.patches as mpatch import matplotlib.pyplot as plt figheight = 8 fig = plt.figure(1, figsize=(9, figheight), dpi=80) fontsize = 0.4 * fig.dpi def make_boxstyles(ax): styles = mpatch.BoxStyle.get_styles() for i, (stylename, styleclass) in enumerate(styles.items()): ax.text(0.5, (float...
yetercatikkas/ulakbus
refs/heads/master
ulakbus/lib/s3_file_manager.py
1
# -*- coding: utf-8 -*- """ """ # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. import base64 import os from uuid import uuid4 from boto.s3.connection import S3Connection as s3 from boto.s3.key import Key from pyoko.conf im...
UManPychron/pychron
refs/heads/develop
docs/user_guide/operation/scripts/examples/helix/measurement/felix_analysis120_60_no_center.py
2
#!Measurement ''' baseline: after: true before: false counts: 60 detector: H2 mass: 40.062 settling_time: 15.0 default_fits: nominal equilibration: eqtime: 1.0 inlet: H inlet_delay: 3 outlet: V use_extraction_eqtime: true multicollect: counts: 120 detector: H2 isotope: Ar40 peakcenter: aft...
XDATA-Year-3/clique-anb
refs/heads/master
src/assets/tangelo/anb/get_nodes.py
1
from pymongo import MongoClient def run(host=None, db=None, coll=None, filename=None): client = MongoClient(host) db = client[db] graph = db[coll] return graph.distinct("data.label", {"type": "node", "data.filename": filename})
adieu/django-nonrel
refs/heads/master
django/contrib/gis/gdal/error.py
466
""" This module houses the OGR & SRS Exception objects, and the check_err() routine which checks the status code returned by OGR methods. """ #### OGR & SRS Exceptions #### class GDALException(Exception): pass class OGRException(Exception): pass class SRSException(Exception): pass class OGRIndexError(OGRException, K...
FluffyMortain/heekscnc
refs/heads/master
pycnc/Operation.py
24
from Object import Object from consts import * import HeeksCNC from CNCConfig import CNCConfig class Operation(Object): def __init__(self): Object.__init__(self) self.active = True self.comment = '' self.title = self.TypeName() self.tool_number = 0 ...
Vagab0nd/SiCKRAGE
refs/heads/master
lib3/feedparser/parsers/loose.py
3
# The loose feed parser that interfaces with an SGML parsing library # Copyright 2010-2020 Kurt McKee <[email protected]> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are perm...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.7.2/Lib/xml/dom/minicompat.py
209
"""Python version compatibility support for minidom.""" # This module should only be imported using "import *". # # The following names are defined: # # NodeList -- lightest possible NodeList implementation # # EmptyNodeList -- lightest possible NodeList that is guaranteed to # remain empty...
Kapeli/PopClip-Extensions
refs/heads/master
source/OneNote/requests/packages/urllib3/packages/ordered_dict.py
2039
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
maestro-hybrid-cloud/horizon
refs/heads/master
openstack_dashboard/enabled/_2010_admin_system_panel_group.py
42
from django.utils.translation import ugettext_lazy as _ # The slug of the panel group to be added to HORIZON_CONFIG. Required. PANEL_GROUP = 'admin' # The display name of the PANEL_GROUP. Required. PANEL_GROUP_NAME = _('System') # The slug of the dashboard the PANEL_GROUP associated with. Required. PANEL_GROUP_DASHBOA...
henrytao-me/openerp.positionq
refs/heads/master
openerp/addons/document/odt2txt.py
435
#!/usr/bin/python # -*- 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 unde...
zidootech/xbmc4zidoo
refs/heads/master
kodi_14.1_release/tools/EventClients/lib/python/bt/bt.py
181
# -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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. ...
jhaux/tensorflow
refs/heads/master
tensorflow/tools/graph_transforms/python/transform_graph_test.py
169
# 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 applicable ...
quietcoolwu/leetcode-python
refs/heads/master
add_binary/solution2.py
6
class Solution: # @param a, a string # @param b, a string # @return a string def addBinary(self, a, b): list_a = [int(i) for i in a[::-1]] list_b = [int(i) for i in b[::-1]] la = len(list_a) lb = len(list_b) # Pad zeroes if la < lb: list_a += [...
vlachoudis/sl4a
refs/heads/master
python/src/Lib/encodings/cp1250.py
593
""" Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
emoronayuso/beeton
refs/heads/master
asterisk-bee/asteriskbee/api_colas_llamadas/views.py
6027
# Create your views here.
toshywoshy/ansible
refs/heads/devel
lib/ansible/modules/cloud/dimensiondata/dimensiondata_vlan.py
21
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Dimension Data # # 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 Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
twlizer/plugin.video.Pseudonymous
refs/heads/master
chardet/codingstatemachine.py
206
######################## 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. ...
luoxufeiyan/python
refs/heads/master
NKUCodingCat/0007/0007.py
40
#coding=utf-8 import os,sys,re def each(path): All = [] for root, dirs, files in os.walk(path): for name in files: All.append(root+"/"+name) return All def deal(input): if os.path.splitext(input)[1] in [".py",".pyw"]: total,comment,empty = 0,0,0 f = open(input,"r") in_comment = False for line in f: ...
ClearCorp-dev/odoo
refs/heads/8.0
addons/event/report/__init__.py
435
# -*- 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...
misterhat/youtube-dl
refs/heads/master
youtube_dl/extractor/pornhd.py
19
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, js_to_json, ) class PornHdIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<id>\d+)(?:/(?P<display_id>.+))?' _TESTS = [...
robben1234/CNN-CIFAR10-Classifier
refs/heads/master
image-classifier.py
1
import os from flask import Flask, flash, request, redirect, url_for, jsonify from flask import render_template from werkzeug.contrib.fixers import ProxyFix from cnncifar10use import predict as nn_predict app = Flask(__name__) app.wsgi_app = ProxyFix(app.wsgi_app) CLASSES = ['airplane', 'automobile', 'bird', 'cat', ...
darko-bede/HardWay
refs/heads/master
ex32.py
1
the_count = [1, 2, 3, 4, 5] fruits = ["apples", "oranges", "pears", "apricots"] change = [1, "pennies", 2, "dimes", 3, "quarters"] # This first kind of for loop goes through a list for number in the_count: print "This is count %d" % number # same as above for fruit in fruits: print "A fruit of type: %s" % f...
wrouesnel/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_ucs.py
12
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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 import os import json import pytest import sys from nose.plugins.skip imp...
andreww/elastic-constants
refs/heads/master
generate_strain.py
1
#!/usr/bin/env python """ generate_strain.py Generate strained castep input files and .cijdat files for elastic constants calculation for analysis with elastics.py Copyright (c) 2010-2020 Andrew Walker <[email protected]> All rights reserved. """ from __future__ import print_function import sys import os import ...
kuri65536/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/apps/groups/service.py
137
#!/usr/bin/python # # Copyright (C) 2008 Google, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
lavallc/ion
refs/heads/master
bootloader/flashing_utils/ble_dfu_send_hex/dfu/ble_dfu.py
1
import time from intelhex import IntelHex from dfu.master_emulator import MasterEmulator import System import Nordicsemi # DFU OpCodes class OpCodes: START_DFU = 1 INITIALIZE_DFU = 2 RECEIVE_FIRMWARE_IMAGE = 3 VALIDATE_FIRMWARE_IMAGE = 4 ACTIVATE_FIRMWARE_AND_RESET = 5 SYSTEM_RESET = 6 REQ...
mckinseyacademy/django-upload-validator
refs/heads/master
tests/tests.py
1
import os from ddt import ddt, data from django.test import TestCase from upload_validator import FileTypeValidator TEST_FILES_DIR = os.path.join(os.path.dirname(__file__), 'test_files') TEST_FILES = [ # word 'word-mac.doc', 'word-mac.docx', 'word-windows.docx', 'word-ubuntu.doc', 'word-ubuntu.docx', ...
repotvsupertuga/tvsupertuga.repository
refs/heads/master
plugin.video.TVsupertuga/resources/lib/plugins/TVsupertuga.py
1
import base64, codecs magic = 'IyAtKi0gY29kaW5nOiB1dGYtOCAtKi0KCmltcG9ydCBfX2J1aWx0aW5fXwppbXBvcnQgZGF0ZXRpbWUKaW1wb3J0IHN5cwppbXBvcnQgdGltZQppbXBvcnQgcGlja2xlCgppbXBvcnQgcmVxdWVzdHMKCmltcG9ydCBrb2RpbmcKaW1wb3J0IHhibWNhZGRvbgppbXBvcnQgeGJtY2d1aQppbXBvcnQgeGJtY3BsdWdpbgpmcm9tIC4ucGx1Z2luIGltcG9ydCBQbHVnaW4KZnJvbSBsYW5n...
sf-wind/caffe2
refs/heads/master
caffe2/python/mkl/mkl_fill_op_test.py
4
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
zzxuanyuan/root-compressor-dummy
refs/heads/compressionbench
interpreter/llvm/src/bindings/python/llvm/tests/base.py
107
import os.path import unittest POSSIBLE_TEST_BINARIES = [ 'libreadline.so.5', 'libreadline.so.6', ] POSSIBLE_TEST_BINARY_PATHS = [ '/usr/lib/debug', '/lib', '/usr/lib', '/usr/local/lib', '/lib/i386-linux-gnu', ] class TestBase(unittest.TestCase): def get_test_binary(self): """...
Trii/NoseGAE
refs/heads/master
examples/tests_in_package/helloworld/tests/__init__.py
1307
pass
jhoos/django
refs/heads/master
django/template/loaders/base.py
12
import warnings from inspect import getargspec from django.template import Origin, Template, TemplateDoesNotExist from django.utils.deprecation import RemovedInDjango21Warning class Loader(object): # Only used to raise a deprecation warning. Remove in Django 2.0. _accepts_engine_in_init = True def __ini...
laslabs/geospatial
refs/heads/8.0
geoengine_project/models/project_project.py
5
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of geoengine_project, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # geoengine_project is free software: # you can redistribute it and/or modif...
yinchunlong/abelkhan-1
refs/heads/master
ext/c++/thirdpart/c++/boost/libs/python/test/newtest.py
46
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) """ >>> from m1 import * >>> from m2 import * Prove that we get an appropriate error from trying to return a type for which we h...
shafaypro/PYSHA
refs/heads/master
Chatstuff/__chatcheck.py
2
import random import textblob from nltk.tokenize import * # tokenizing the sentences on the basis of natural langauge processing from textblob import * from nltk.stem import PorterStemmer # importing the port stemmer for later purpose from nltk.corpus import stopwords from nltk.corpus import state_union # for ...
alphafoobar/intellij-community
refs/heads/master
python/testData/inspections/PyNumpyType/Vectorize.py
79
class vectorize(object): """ vectorize(pyfunc, otypes='', doc=None, excluded=None, cache=False) Generalized function class. Define a vectorized function which takes a nested sequence of objects or numpy arrays as inputs and returns a numpy array as output. The vectorized function evaluates `p...
tsabi/Odoo-tsabi-fixes
refs/heads/master
addons/marketing_campaign/__openerp__.py
67
# -*- 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...