repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
pyblish/pyblish-endpoint
refs/heads/master
pyblish_endpoint/vendor/nose/plugins/prof.py
106
"""This plugin will run tests using the hotshot profiler, which is part of the standard library. To turn it on, use the ``--with-profile`` option or set the NOSE_WITH_PROFILE environment variable. Profiler output can be controlled with the ``--profile-sort`` and ``--profile-restrict`` options, and the profiler output f...
erikriver/eduIntelligent-cynin
refs/heads/master
src/ubify.coretypes/ubify/coretypes/setuphandlers.py
5
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distributed ...
crisgc/mab719
refs/heads/master
Downey2012a_exes/cap02/cookie2.py
1
"""This file contains code for use with "Think Bayes", by Allen B. Downey, available from greenteapress.com Copyright 2012 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from thinkbayes import Pmf from bowl import Bowl class Cookie(Pmf): """A map from string bowl ID to probablity."""...
Unow/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/video_module/video_xfields.py
21
""" XFields for video module. """ import datetime from xblock.fields import Scope, String, Float, Boolean, List, Dict from xmodule.fields import RelativeTime # Make '_' a no-op so we can scrape strings _ = lambda text: text class VideoFields(object): """Fields for `VideoModule` and `VideoDescriptor`.""" di...
ganeshkoilada/libforensics
refs/heads/master
code/lf/win/consts/fs.py
13
# Copyright 2010 Michael Murr # # This file is part of LibForensics. # # LibForensics 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 ver...
fredokun/tango
refs/heads/master
test/test_subdoc.py
1
''' Test sub documents ''' import unittest if __name__ == "__main__": import sys sys.path.append("../src") from tangolib.parser import Parser from tangolib.processor import DocumentProcessor, CommandProcessor, EnvironmentProcessor class TestSubDoc(unittest.TestCase): class CountItem(CommandProcessor): ...
tbpmig/mig-website
refs/heads/master
member_resources/quorum.py
1
from time import sleep from django.core.mail import send_mail from datetime import date from django.db.models import Q from django.http import HttpResponse from django.utils import timezone from history.models import Distinction, Officer from requirements.models import ( ProgressItem, ...
bradsk88/WinkHouse
refs/heads/master
lib/pyasn1/codec/ber/__init__.py
3653
# This file is necessary to make this directory a package.
neurotechuoft/MindType
refs/heads/master
Code/V1/src/deprecated/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyqt.py
49
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './pyqtgraph/flowchart/FlowchartCtrlTemplate.ui' # # Created: Mon Dec 23 10:10:50 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtC...
makeittotop/inventory-project
refs/heads/master
hr_data/models.py
1
from django.db import models from django.utils.html import mark_safe # Create your models here. class Employee(models.Model): first_name = models.CharField('First Name', max_length=200, blank=False) last_name = models.CharField('Last Name', max_length=200, blank=False) gender_choices = ( (1, 'Male...
randynobx/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/dnf.py
35
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2015 Cristian van Ee <cristian at cvee.org> # Copyright 2015 Igor Gnatenko <i.gnatenko.brain@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 pu...
carolFrohlich/nipype
refs/heads/master
nipype/interfaces/fsl/maths.py
2
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ The maths module provides higher-level interfaces to some of the operations that can be performed with the fslmaths command-line program. Change directory to provide...
anuruddhal/jinja2
refs/heads/master
examples/basic/cycle.py
83
from jinja2 import Environment env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}") print env.from_string("""\ <ul> # for item in range(10) <li class="${loop.cycle('odd', 'even')}">${item}</li> # endfor </ul>\ """).render()
edx/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/db/models/manager.py
306
from django.utils import copycompat as copy from django.conf import settings from django.db import router from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet from django.db.models import signals from django.db.models.fields import FieldDoesNotExist def ensure_default_manager(sender, ...
aetilley/scikit-learn
refs/heads/master
examples/missing_values.py
233
""" ====================================================== Imputing missing values before building an estimator ====================================================== This example shows that imputing the missing values can give better results than discarding the samples containing any missing value. Imputing does not ...
piotrek-golda/CivilHubCopy
refs/heads/master
gallery/models.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.db import models from django.conf import settings from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.contrib.contenttypes import generic from django.contrib.contenttypes.models impor...
nox/servo
refs/heads/master
tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py
154
def main(request, response): headers = [("Content-Type", "text/javascript")] body = "test2_token = \"script executed\";" return 200, headers, body
rajalokan/nova
refs/heads/master
nova/tests/unit/virt/test_fake.py
86
# # Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
studio666/gratipay.com
refs/heads/master
gratipay/models/account_elsewhere.py
3
from __future__ import absolute_import, division, print_function, unicode_literals from datetime import timedelta import json from urlparse import urlsplit, urlunsplit import uuid import xml.etree.ElementTree as ET from aspen import Response from aspen.utils import utcnow from postgres.orm import Model from psycopg2 ...
azoft-dev-team/imagrium
refs/heads/win
env/Lib/test/test_socket.py
2
import java import unittest from test import test_support import errno import jarray import Queue import platform import select import socket import struct import sys import time import thread, threading from weakref import proxy from StringIO import StringIO PORT = 50100 HOST = 'localhost' MSG = 'Michael Gilfix was...
icoxfog417/music_hack_day_onpasha
refs/heads/master
tests/test_spotify.py
1
import unittest from api.spotify import Spotify class TestSpotify(unittest.TestCase): def test_get_track(self): s = Spotify() track = s.get_track("0eGsygTp906u18L0Oimnem") self.assertTrue("preview_url" in track) print(track)
GiovanniConserva/TestDeploy
refs/heads/master
venv/Lib/site-packages/django/contrib/gis/utils/layermapping.py
335
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
xq262144/hue
refs/heads/master
desktop/libs/aws/src/aws/s3/__init__.py
3
# 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...
josephmfaulkner/stoqs
refs/heads/master
stoqs/contrib/analysis/__init__.py
1
#!/usr/bin/env python __author__ = "Mike McCann" __copyright__ = "Copyright 2013, MBARI" __license__ = "GPL" __maintainer__ = "Mike McCann" __email__ = "mccann at mbari.org" __status__ = "Development" __doc__ = ''' Base class for querying the database for measured parameters from the same instantpoint and to make sca...
gmist/ctm-5studio
refs/heads/master
main/control/user.py
10
# coding: utf-8 import copy from google.appengine.ext import ndb from webargs import fields as wf from webargs.flaskparser import parser import flask import flask_login import flask_wtf import wtforms import auth import cache import config import model import task import util from main import app ################...
lucventurini/mikado
refs/heads/master
Mikado/transcripts/transcript.py
1
from .._transcripts.transcript_base import TranscriptBase, Metric from ..configuration.configuration import MikadoConfiguration from ..configuration.daijin_configuration import DaijinConfiguration from .transcript_methods import splitting, retrieval from typing import List from ..serializers.blast_serializer import Hit...
jkarnows/scikit-learn
refs/heads/master
sklearn/feature_selection/base.py
149
# -*- coding: utf-8 -*- """Generic feature selection mixin""" # Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman # License: BSD 3 clause from abc import ABCMeta, abstractmethod from warnings import warn import numpy as np from scipy.sparse import issparse, csc_matrix from ..base import TransformerMixin f...
CSF-JH/crossbarexamples
refs/heads/master
launchpad/launchpad.py
12
#!/usr/bin/env python2.7 # vim: set fileencoding=UTF-8 : """Python interface for Novation Launchpads Requires pyPortMidi from http://alumni.media.mit.edu/~harrison/code.html But that version doesn't compile on a modern python without patching. You can instead use pyGame's MIDI support which is more up to date. TODO: ...
111t8e/h2o-2
refs/heads/master
py/testdir_single_jvm/test_rf_many_rooz_enums_fvec.py
9
import unittest, random, sys, time, re sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_rf targetList = ['red', 'mail', 'black flag', 5, 1981, 'central park', 'good', 'liquor store rooftoop', 'facebook'] lol = [ ['red','orange','yellow','green','blue','indigo...
JackDandy/SickGear
refs/heads/master
lib/apprise/plugins/NotifyDiscord.py
2
# -*- coding: utf-8 -*- # # Copyright (C) 2019 Chris Caron <lead2gold@gmail.com> # All rights reserved. # # This code is licensed under the MIT License. # # 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 th...
mjakop/pywinauto
refs/heads/master
examples/examples_watsup/watsup_ex1.py
17
#encoding=latin1 "Reimplement some of the watsup tests using pywinauto" import sys from time import sleep import os import os.path from application import Application, WindowNotFoundError def do_test_1(): "1st Watsup Test" app = Application().start_(r"c:\windows\Notepad") notepadWindow = a...
googleapis/googleapis-gen
refs/heads/master
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/custom_interest_service/transports/base.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
mathLab/RBniCS
refs/heads/master
rbnics/backends/dolfin/wrapping/get_default_linear_solver.py
1
# Copyright (C) 2015-2021 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later from dolfin import compile_cpp_code cpp_code = """ #include <petscksp.h> #include <dolfin/common/MPI.h> #include <pybind11/pybind11.h> std::string get_default_linear_solver(...
tashaxe/Red-DiscordBot
refs/heads/develop
lib/pip/_vendor/colorama/initialise.py
485
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import contextlib import sys from .ansitowin32 import AnsiToWin32 orig_stdout = None orig_stderr = None wrapped_stdout = None wrapped_stderr = None atexit_done = False def reset_all(): if AnsiToWin32 is not None: # Is...
disqus/django-old
refs/heads/master
tests/modeltests/model_formsets/models.py
89
import datetime from django.db import models class Author(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ('name',) def __unicode__(self): return self.name class BetterAuthor(Author): write_speed = models.IntegerField() class Book(models.Model): aut...
acsone/reporting-engine
refs/heads/8.0
report_xml_sample/models.py
9
# -*- encoding: utf-8 -*- # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> from os import path from openerp import api, models class XSDSampleReport(models.AbstractModel): """This report is checked against an XSD before downloading. The XML itself is declared in ``./views/res_partner_templates.xml``...
timlinux/watchkeeper
refs/heads/develop
django_project/sms/migrations/0005_auto__add_field_gateway_check_number_url__add_field_gateway_check_numb.py
5
# encoding: 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 'Gateway.check_number_url' db.add_column('sms_gateway', 'check_number_url', self.gf('django...
mou4e/zirconium
refs/heads/master
tools/profile_chrome/main.py
4
#!/usr/bin/env python # # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import optparse import os import sys import webbrowser from profile_chrome import chrome_controller from profile_chro...
google-research/google-research
refs/heads/master
dvrl/main_dvrl_image_transfer_learning.py
1
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
tumbl3w33d/ansible
refs/heads/devel
lib/ansible/module_utils/network/junos/facts/l3_interfaces/l3_interfaces.py
20
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The junos l3_interfaces fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based o...
jshiv/turntable
refs/heads/master
test/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py
3132
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
step21/inkscape-osx-packaging-native
refs/heads/master
packaging/macosx-native/Inkscape.app/Contents/Resources/extensions/spirograph.py
3
#! /usr/bin/env python ''' Copyright (C) 2007 Joel Holdsworth joel@airwebreathe.org.uk 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 v...
canaltinova/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/update/tree.py
11
import os import re import subprocess from .. import vcs from ..vcs import bind_to_repo, git, hg def get_unique_name(existing, initial): """Get a name either equal to initial or of the form initial_N, for some integer N, that is not in the set existing. :param existing: Set of names that must not be ch...
hbrunn/OpenUpgrade
refs/heads/master
addons/web_tests/__init__.py
385
# -*- coding: utf-8 -*- import tests
utopiaprince/micropython
refs/heads/master
tests/basics/dict_popitem.py
116
els = [] d = {1:2,3:4} a = d.popitem() print(len(d)) els.append(a) a = d.popitem() print(len(d)) els.append(a) try: print(d.popitem(), "!!!",) except KeyError: print("Raised KeyError") else: print("Did not raise KeyError") print(sorted(els))
pkappesser/youtube-dl
refs/heads/master
youtube_dl/extractor/rtvnh.py
84
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ExtractorError class RTVNHIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rtvnh\.nl/video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.rtvnh.nl/video/131946', 'md5': '6e1d0ab079e...
kanagasabapathi/python-for-android
refs/heads/master
python-modules/twisted/twisted/mail/test/test_smtp.py
52
# Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.mail.smtp module. """ from zope.interface import implements from twisted.python.util import LineLog from twisted.trial import unittest, util from twisted.protocols import basic, loopback from twisted.mail imp...
istevens/personfinder-search-api
refs/heads/master
tools/import.py
2
#!/usr/bin/python2.5 # Copyright 2010 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 or agree...
lowinger42/ergotime
refs/heads/master
server/app/controller/table_crud.py
1
#!/usr/bin/env python3 """ SQL Table CRUD controller Copyright (C) 2020 Anders Lowinger, anders@abundo.se 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 you...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/quest/talus_brood_egg_single_05.py
85615
import sys def setup(core, object): return
sophron/wifiphisher
refs/heads/master
tests/test_victims.py
2
"""This module tests the victims class.""" import os import sys import unittest import wifiphisher.common.victim as victim dir_of_executable = os.path.dirname(__file__) path_to_project_root = os.path.abspath(os.path.join(dir_of_executable, '..')) sys.path.insert(0, path_to_project_root) os.chdir(path_to_project_root...
Alberto-Beralix/Beralix
refs/heads/master
i386-squashfs-root/usr/share/pyshared/twisted/protocols/gps/rockwell.py
37
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Rockwell Semiconductor Zodiac Serial Protocol Coded from official protocol specs (Order No. GPS-25, 09/24/1996, Revision 11) Maintainer: Bob Ippolito The following Rockwell Zodiac messages are currently understood:: EARTHA\\r\\n (a hack...
openstack/keystone
refs/heads/master
keystone/cmd/doctor/tokens.py
2
# 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 t...
EmerJuny/djcasemg
refs/heads/master
interfmg/interfapp/migrations/0032_auto_20170331_1802.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('interfapp', '0031_auto_20170331_1729'), ] operations = [ migrations.RenameField( mo...
amenonsen/ansible
refs/heads/devel
test/units/modules/remote_management/oneview/test_oneview_san_manager.py
68
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from units.compat import unittest, mock from oneview_module_loader import SanManagerModule from hpe_test_utils import OneViewBaseTestCase from copy import dee...
abomyi/django
refs/heads/master
django/utils/datetime_safe.py
535
# Python's datetime strftime doesn't handle dates before 1900. # These classes override date and datetime to support the formatting of a date # through its full "proleptic Gregorian" date range. # # Based on code submitted to comp.lang.python by Andrew Dalke # # >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was...
dholbach/snapcraft
refs/heads/master
snapcraft/sources.py
1
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015, 2016 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...
dpassante/ansible
refs/heads/devel
test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/uses_collection_redirected_mu.py
35
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import sys from ansible_collections.testns.testcoll.plugins.module_utils.moved_out_root import importme from ..module_utils.formerly_testcoll_pkg import thing as movedthing # pylint: disable=relative...
melersh/Yasta
refs/heads/master
werkzeug/testsuite/security.py
66
# -*- coding: utf-8 -*- """ werkzeug.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the security helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.securit...
fui/fui-kk
refs/heads/master
fui_kk/plot_courses.py
1
#!/usr/bin/env python3 """This is a module that is used for generating plots that show how a course has evolved.""" __authors__ = ["Ole Herman Schumacher Elgesem", "Lars Tveito"] __copyright__ = "Lars Tveito" __credits__ = ["Lars Tveito"] __license__ = "MIT" # The MIT License (MIT) # Copyright (c) 2016 Lar...
warmlab/bakerycms
refs/heads/master
app/admin/filters.py
1
class BakeryFilter(BaseFilter): def __init__(self, column, name, options=None, data_type=None): super(MyBaseFilter, self).__init__(name, options, data_type) self.column = column class ProductFilter(BakeryFilter): def apply(self, query, value): return query.filter(self.column == value)...
childresslab/MicrocavityExp1
refs/heads/master
hardware/laser/simple_laser_dummy.py
2
# -*- coding: utf-8 -*- """ This module acts like a laser. Qudi 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. Qudi is distributed in the ...
jansegre/calcnum
refs/heads/master
python/trab3/newtonraphson.py
1
from base import * @algoritmo def newtonraphson(self, f, x0): df = lambda x: (f(x + self.tol) - f(x - self.tol)) / (2 * self.tol) self.tabela('k', 'x0', 'f(x0)', 'f\'(x0)', 'x') for k in xrange(self.nmi): fx0, dfx0 = f(x0), df(x0) x = x0 - fx0 / dfx0 self.tabela(k, x0, fx0, dfx0, x...
bverburg/CouchPotatoServer
refs/heads/master
libs/subliminal/services/thesubdb.py
107
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
thaumos/ansible
refs/heads/devel
test/units/module_utils/facts/network/test_fc_wwn.py
9
# -*- coding: utf-8 -*- # Copyright (c) 2019 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 from ansible.module_utils.facts.network import fc_wwn from units.compat.mock i...
keith-rollin/mal
refs/heads/master
python/env.py
60
# Environment class Env(): def __init__(self, outer=None, binds=None, exprs=None): self.data = {} self.outer = outer or None if binds: for i in range(len(binds)): if binds[i] == "&": self.data[binds[i+1]] = exprs[i:] break...
ruibarreira/linuxtrail
refs/heads/master
usr/lib/python2.7/lib2to3/fixes/fix_isinstance.py
326
# Copyright 2008 Armin Ronacher. # Licensed to PSF under a Contributor Agreement. """Fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. eg. isinstance(x, (int,...
fernandog/osmc
refs/heads/master
package/mediacenter-addon-osmc/src/script.module.osmcsetting.apfstore/resources/lib/apf_gui.py
9
# KODI modules import xbmc import xbmcaddon import xbmcgui # Standard modules import sys import os import socket import json addonid = "script.module.osmcsetting.apfstore" __addon__ = xbmcaddon.Addon(addonid) __path__ = xbmc.translatePath(xbmcaddon.Addon(addonid).getAddonInfo('path')) # Custom module path sys....
nlholdem/icodoom
refs/heads/master
ICO1/run_agentDFL.py
1
from __future__ import print_function import numpy as np import cv2 import tensorflow as tf import sys import os sys.path.append('./agent') sys.path.append('./deep_feedback_learning') from agent.doom_simulator import DoomSimulator from agent.agent import Agent import deep_feedback_learning from deep_feedback_learning i...
Epirex/android_external_chromium_org
refs/heads/cm-11.0
tools/bisect-builds.py
23
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Snapshot Build Bisect Tool This script bisects a snapshot archive using binary search. It starts at a bad revision (it will try...
laayis/yowsup
refs/heads/master
yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_demote.py
61
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .iq_groups_participants import ParticipantsGroupsIqProtocolEntity class DemoteParticipantsIqProtocolEntity(ParticipantsGroupsIqProtocolEntity): ''' <iq type="set" id="{{id}}" xmlns="w:g2", to="{{group_jid}}"> <demote> <partic...
erickt/hue
refs/heads/master
desktop/core/ext-py/sasl-0.1.1/sasl/__init__.py
76
from sasl.saslwrapper import *
Alex-Ian-Hamilton/sunpy
refs/heads/master
sunpy/util/create.py
1
# -*- coding: utf-8 -*- # Author: Florian Mayer <florian.mayer@bitsrc.org> from __future__ import absolute_import, division, print_function import os import glob from sunpy import config from sunpy.util.net import download_file from sunpy.util.cond_dispatch import ConditionalDispatch, run_cls from sunpy.extern impo...
mwilliams3/disco
refs/heads/develop
tests/test_external.py
9
from disco.test import TestCase, TestJob from disco.util import external from disco.compat import str_to_bytes from subprocess import check_call, STDOUT from os import uname, path class ExternalJob(TestJob): ext_params = {"test1": "1,2,3", "one two three": "dim\ndam\n", "dummy": "value"} sort = False class E...
kangkot/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/build/gyp/pylib/gyp/generator/android.py
446
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
roth1002/thefuck
refs/heads/master
tests/rules/test_open.py
9
import pytest from thefuck.rules.open import match, get_new_command from tests.utils import Command @pytest.mark.parametrize('command', [ Command(script='open foo.com'), Command(script='open foo.ly'), Command(script='open foo.org'), Command(script='open foo.net'), Command(script='open foo.se'), ...
admire93/youtube-dl
refs/heads/master
youtube_dl/extractor/dreisat.py
107
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, ) class DreiSatIE(InfoExtractor): IE_NAME = '3sat' _VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:(?:mode|display)=[^...
fairbird/OpenPLI-BlackHole
refs/heads/master
lib/python/Blackhole/BhUtils.py
1
from re import sub from Tools.Directories import fileExists, resolveFilename, SCOPE_CURRENT_SKIN import xml.etree.cElementTree entities = [('&#228;', u'\xe4'), ('&auml;', u'\xe4'), ('&#252;', u'\xfc'), ('&uuml;', u'\xfc'), ('&#246;', u'\xf6'), ('&ouml;', u'\xf6'), ('&#196;', u'\xc4'), ('&Auml;', u'\xc4'), ('&#2...
andrewzwicky/PUBGIS
refs/heads/master
pubgis/output/pubgis_json.py
1
import json from jsonschema import validate, ValidationError SCHEMA = { "$schema": "http://json-schema.org/draft-06/schema#", "additionalProperties": False, "definitions": {}, "properties": { "game": { "type": ["integer", "null"] }, "name": { "type": ["st...
163gal/Time-Line
refs/heads/master
libs/wx/lib/delayedresult.py
6
""" This module supports the thread-safe, asynchronous transmission of data ('delayed results') from a worker (non-GUI) thread to the main thread. Ie you don't need to mutex lock any data, the worker thread doesn't wait (or even check) for the result to be received, and the main thread doesn't wait for the worker t...
t794104/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/supervisorctl.py
73
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # 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', ...
jmarsik/mopidy
refs/heads/develop
tests/mpd/protocol/test_reflection.py
14
from __future__ import absolute_import, unicode_literals from tests.mpd import protocol class ReflectionHandlerTest(protocol.BaseTestCase): def test_config_is_not_allowed_across_the_network(self): self.send_request('config') self.assertEqualResponse( 'ACK [4@0] {config} you don\'t ha...
xiandiancloud/edxplaltfom-xusong
refs/heads/master
common/djangoapps/user_api/views.py
29
from django.conf import settings from django.contrib.auth.models import User from rest_framework import authentication from rest_framework import filters from rest_framework import generics from rest_framework import permissions from rest_framework import status from rest_framework import viewsets from rest_framework.e...
zorg/zorg-network-camera
refs/heads/master
zorg_network_camera/light_sensor.py
2
from zorg.driver import Driver from PIL import Image, ImageStat class LightSensor(Driver): """ This driver makes it possible to use a camera as a light sensor by analyzing the lighting levels of the image. """ def __init__(self, options, connection): super(LightSensor, self).__init__(...
ArianeFire/HaniCam
refs/heads/master
Hanicam/OpenCV/opencv-3.1.0/modules/python/test/leak1.py
13
#!/usr/bin/env python import cv2.cv as cv import numpy as np cv.NamedWindow('Leak') while 1: leak = np.random.random((480, 640)) * 255 cv.ShowImage('Leak', leak.astype(np.uint8)) cv.WaitKey(10)
project-magpie/enigma2-openpli
refs/heads/master
lib/python/Plugins/SystemPlugins/Videomode/plugin.py
7
from Screens.Screen import Screen from Plugins.Plugin import PluginDescriptor from Components.SystemInfo import SystemInfo from Components.ConfigList import ConfigListScreen from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing, ConfigSlider from Components.Label import Label from Compo...
akarambir/shadow
refs/heads/master
blog/admin.py
1
from django.contrib import admin from blog.models import Category from blog.models import Entry def num_live_entries(obj): return obj.live_entries.count() num_live_entries.short_description = 'Live entries' class CategoryAdmin(admin.ModelAdmin): fieldsets = ( ('Metadata', { 'fields': ('...
MarkTseng/django-farmersale
refs/heads/master
farmersale-env/lib/python2.7/site-packages/django/contrib/messages/tests/test_session.py
226
from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTests from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.session import SessionStorage from django.utils.safestring import SafeData, mark_safe from django.test import TestCase de...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/ctypes/test/test_structures.py
6
import unittest from ctypes import * from ctypes.test import need_symbol from struct import calcsize import _testcapi class SubclassesTest(unittest.TestCase): def test_subclass(self): class X(Structure): _fields_ = [("a", c_int)] class Y(X): _fields_ = [("b", c_int)] ...
BT-ojossen/odoo
refs/heads/8.0
addons/website/models/ir_qweb.py
44
# -*- coding: utf-8 -*- """ Website-context rendering needs to add some metadata to rendered fields, as well as render a few fields differently. Also, adds methods to convert values back to openerp models. """ import cStringIO import datetime import itertools import logging import os import urllib2 import urlparse im...
AutorestCI/azure-sdk-for-python
refs/heads/master
azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
40223136/2015cdag1man
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/platform.py
620
#!/usr/bin/env python3 """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as pa...
penberg/linux-kvm
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
1891
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
medspx/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/VoronoiPolygons.py
7
# -*- coding: utf-8 -*- """ *************************************************************************** VoronoiPolygons.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***********************...
orekyuu/intellij-community
refs/heads/master
python/lib/Lib/sha.py
85
# $Id: sha.py 39316 2005-08-21 18:45:59Z greg $ # # Copyright (C) 2005 Gregory P. Smith (greg@electricrain.com) # Licensed to PSF under a Contributor Agreement. from hashlib import sha1 as sha new = sha blocksize = 1 # legacy value (wrong in any useful sense) digest_size = 20 digestsize = 20
yawnosnorous/python-for-android
refs/heads/master
python-modules/twisted/twisted/protocols/basic.py
49
# -*- test-case-name: twisted.test.test_protocols -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Basic protocols, such as line-oriented, netstring, and int prefixed strings. Maintainer: Itamar Shtull-Trauring """ # System imports import re import struct import warnings imp...
mdrumond/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/padding_fifo_queue_test.py
49
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
baroquebobcat/pants
refs/heads/master
contrib/mypy/src/python/pants/contrib/mypy/tasks/mypy_task.py
2
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
dlazz/ansible
refs/heads/devel
lib/ansible/module_utils/netapp.py
14
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
runekaagaard/django-contrib-locking
refs/heads/master
tests/test_client_regress/context_processors.py
530
def special(request): return {'path': request.special_path}