repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
robocomp/learnbot
refs/heads/version-3
learnbot_dsl/functions/perceptual/camera/is_there_red_line.py
1
from __future__ import print_function, absolute_import import sys, os path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(path) import visual_auxiliary as va import numpy as np def is_there_red_line(lbot): frame = lbot.getImage() if frame is not None: rois = va.detect_red_line(frame) ...
willdecker/suds
refs/heads/master
suds/umx/core.py
200
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 hope that it will ...
psiinon/addons-server
refs/heads/master
src/olympia/reviewers/tests/test_utils.py
1
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from unittest import mock from unittest.mock import Mock, patch from django.conf import settings from django.core import mail from django.core.files.storage import default_storage as storage from django.test.utils import override_settings from django.uti...
SnabbCo/neutron
refs/heads/master
neutron/plugins/ml2/drivers/mech_arista/config.py
8
# Copyright (c) 2013 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 ...
pratiknarang/SMADES
refs/heads/master
PreProcess/FilterPackets.py
2
## Module to obtain packet data from a pcap/dump file ## and save it in csv format using tshark. ## Filenames of input pcap files are taken from InputFiles.txt ## Tshark options are present in TsharkOptions.txt ## TsharkOptions.txt should not contain the -r option. ## usage: python FilterPackets.py #import global con...
fyffyt/scikit-learn
refs/heads/master
sklearn/neighbors/tests/test_nearest_centroid.py
305
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
nils-wisiol/pypuf
refs/heads/master
crp_learn.py
1
""" This module is used for learning a PUF from known challenge-response pairs. """ import argparse from pypuf import tools from pypuf.learner.regression.logistic_regression import LogisticRegression from pypuf.simulation.arbiter_based.ltfarray import LTFArray def uint(val): """ Assures that the passed intege...
jolyonb/edx-platform
refs/heads/master
openedx/core/djangoapps/oauth_dispatch/management/commands/create_dot_application.py
1
""" Management command for creating a Django OAuth Toolkit Application model. Also creates an oauth_dispatch application access if scopes are provided. """ from __future__ import absolute_import, unicode_literals import logging from django.contrib.auth.models import User from django.core.management.base import Base...
ddico/odoo
refs/heads/master
addons/test_base_automation/models/test_base_automation.py
6
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from dateutil import relativedelta from odoo import fields, models, api class LeadTest(models.Model): _name = "base.automation.lead.test" _description = "Automated Rule Test" name = fields.Char(string='Sub...
theguardian/headphones
refs/heads/master
lib/argparse.py
33
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
gwq5210/litlib
refs/heads/master
thirdparty/sources/protobuf/python/google/protobuf/pyext/__init__.py
401
try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__)
pressel/mpi4py
refs/heads/master
demo/mpi-ref-v1/ex-3.09.py
12
from mpi4py import MPI try: import numpy except ImportError: raise SystemExit # transpose a matrix a into b a = numpy.empty((100, 100), dtype=float, order='fortran') b = numpy.empty((100, 100), dtype=float, order='fortran') a.flat = numpy.arange(a.size, dtype=float) lb, sizeofdouble = MPI.DOUBLE.Get_extent()...
pjdufour/geonode
refs/heads/master
geonode/messaging/management/commands/purgemessaging.py
5
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
tecwebjoao/TecWeb-TF-2T-B-SI
refs/heads/master
venv/Lib/encodings/euc_jisx0213.py
816
# # euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
gtko/CouchPotatoServer
refs/heads/develop
libs/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
2057
try: # Python 3.2+ from ssl import CertificateError, match_hostname except ImportError: try: # Backport of the function from a pypi module from backports.ssl_match_hostname import CertificateError, match_hostname except ImportError: # Our vendored copy from ._implementati...
smi96/django-blog_website
refs/heads/master
lib/python2.7/site-packages/django/db/migrations/__init__.py
826
from .migration import Migration, swappable_dependency # NOQA from .operations import * # NOQA
renyi533/tensorflow
refs/heads/master
tensorflow/python/autograph/converters/logical_expressions_test.py
20
# 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...
Garrett-R/scikit-learn
refs/heads/master
examples/tree/plot_tree_regression.py
40
""" =================================================================== Decision Tree Regression =================================================================== A 1D regression with decision tree. The :ref:`decision trees <tree>` is used to fit a sine curve with addition noisy observation. As a result, it learns ...
gofflab/neuron-seq-site
refs/heads/master
pyramidal/urls.py
1
from django.conf.urls import patterns, url from pyramidal import views urlpatterns = patterns('', #Index url(r'^$',views.index,name='index'), #Geneset Views url(r'^geneset/(?P<gene_list>[a-zA-Z0-9_\-\.\+]+)/?$',views.geneset,name='gene_set'), #Isoform Views url(r'^genes?/(?P<gene_id>[\w.-]+)/isoforms?/?$',vie...
vaniakov/twisted-intro
refs/heads/master
twisted-deferred/defer-10.py
11
from twisted.internet.defer import Deferred print """ This example illustrates how callbacks in a deferred chain can return deferreds themselves. """ # three simple callbacks def callback_1(res): print 'callback_1 got', res return 1 def callback_2(res): print 'callback_2 got', res return 2 def call...
sanger-pathogens/circlator
refs/heads/master
circlator/tasks/fixstart.py
2
import argparse import circlator def run(): parser = argparse.ArgumentParser( description = 'Change start point of each sequence in assembly', usage = 'circlator fixstart [options] <assembly.fasta> <outprefix>') parser.add_argument('--genes_fa', help='FASTA file of genes to search for to use as...
OpenAgInitiative/gro-api
refs/heads/master
gro_api/plants/migrations/0002_auto_20150819_0025.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('plants', '0001_squashed_0012_auto_20150812_0250'), ] operations = [ migrations.AlterModelOptions( name='harveste...
rahul-c1/scrapy
refs/heads/master
scrapy/contrib/spidermiddleware/referer.py
177
""" RefererMiddleware: populates Request referer field, based on the Response which originated it. """ from scrapy.http import Request from scrapy.exceptions import NotConfigured class RefererMiddleware(object): @classmethod def from_crawler(cls, crawler): if not crawler.settings.getbool('REFERER_ENA...
wpf710/app-proxy
refs/heads/master
jumpgate/config.py
4
from jumpgate.common import config config.configure() CONF = config.CONF
vinthony/jiandan-raccoon
refs/heads/master
scrapy_jiandan/items.py
1
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class ScrapyJiandanItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() title = scrapy.Field() link =...
Kapim/ar-table-itable
refs/heads/master
art_projected_gui/src/art_projected_gui/items/program_item.py
6
#!/usr/bin/env python from PyQt4 import QtGui, QtCore from item import Item from art_msgs.msg import LearningRequestGoal from geometry_msgs.msg import Point32, Pose from button_item import ButtonItem from art_projected_gui.helpers import conversions from list_item import ListItem from art_projected_gui.helpers.items i...
mdaniel/intellij-community
refs/heads/master
python/testData/debug/test_python_subprocess_with_c_parameter.py
12
from __future__ import print_function import subprocess import sys ret = subprocess.call([sys.executable, '-c', "from test_python_subprocess_helper import foo"], stderr=subprocess.PIPE) print('The subprocess return code is %d' % ret)
maikroeder/grape.pipeline.runner
refs/heads/master
grape/pipeline/runner/__init__.py
1
""" Runs Grape pipelines. """ import sys import argparse import logging from grape.pipeline.runner.runner import Runner def main(): print "start" desc = 'Runs configured Grape pipelines' parser = argparse.ArgumentParser(description=desc) parser.add_argument('--version', action='store_true', ...
gorodok11/ajenti
refs/heads/master
ajenti/plugins/core/download.py
17
import os.path from ajenti.com import * from ajenti.api import URLHandler, url from ajenti.utils import wsgi_serve_file from ajenti.plugmgr import PluginLoader class Downloader(URLHandler, Plugin): @url('^/dl/.+/.+') def process_dl(self, req, start_response): params = req['PATH_INFO'].split('/', 3) ...
UManPychron/pychron
refs/heads/develop
docs/user_guide/operation/scripts/examples/helix/measurement/felix_analysis120_60.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...
tupolev/plugin.video.mitele
refs/heads/master
lib/youtube_dl/extractor/voicerepublic.py
20
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( ExtractorError, determine_ext, int_or_none, sanitized_Request, ) class VoiceRepublicIE(InfoExtractor): _VALID_URL = r'https?://v...
paolodedios/tensorflow
refs/heads/master
tensorflow/python/compiler/tensorrt/model_tests/run_models.py
4
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
klahnakoski/MySQL-to-S3
refs/heads/master
vendor/mo_dots/nones.py
1
# encoding: utf-8 # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __fu...
Phuehvk/gyp
refs/heads/master
test/rules/src/copy-file.py
600
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys contents = open(sys.argv[1], 'r').read() open(sys.argv[2], 'wb').write(contents) sys.exit(0)
ipylypiv/grpc
refs/heads/master
src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py
23
# Copyright 2016, 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 the f...
dhtech/graphite-web
refs/heads/master
webapp/graphite/node.py
54
class Node(object): __slots__ = ('name', 'path', 'local', 'is_leaf') def __init__(self, path): self.path = path self.name = path.split('.')[-1] self.local = True self.is_leaf = False def __repr__(self): return '<%s[%x]: %s>' % (self.__class__.__name__, id(self), self.path) class BranchNo...
freelancer/freelancer-sdk-python
refs/heads/master
tests/test_user_helpers.py
1
import unittest from freelancersdk.resources.users.helpers import ( create_get_users_object, create_get_users_details_object, ) class TestUsersHelpers(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_create_get_users_object(self): query = creat...
jimkmc/micropython
refs/heads/master
tests/basics/set_update.py
118
s = {1} s.update() print(s) s.update([2]) print(sorted(s)) s.update([1,3], [2,2,4]) print(sorted(s))
uskudnik/ggrc-core
refs/heads/develop
src/ggrc_basic_permissions/roles/ProgramBasicReader.py
2
scope = "Program Implied" description = """ Allow any user assigned a role in a program the ability to read Role resources. """ permissions = { "read": [ "Category", "ControlCategory", "ControlAssertion", "Option", "Role", "Person", "Context", { ...
keithhendry/treadmill
refs/heads/master
treadmill/zkadmin.py
3
"""Zookeeper admin interface.""" import socket import logging _LOGGER = logging.getLogger(__name__) def netcat(hostname, port, command): """Send 4letter netcat to Zookeeper control port.""" sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) sock.sendall(command)...
KeyWeeUsr/plyer
refs/heads/master
plyer/facades/gyroscope.py
1
''' Gyroscope ============ The gyroscope measures the rate of rotation around a device's x, y, and z axis. The :class:`Gyroscope` provides access to public methods to use gyroscope of your device. Simple Examples --------------- To enable gyroscope:: >>> from plyer import gyroscope >>> gyroscope.enable() ...
justyns/home-assistant
refs/heads/dev
tests/components/sensor/test_rfxtrx.py
2
"""The tests for the Rfxtrx sensor platform.""" import unittest from homeassistant.components.sensor import rfxtrx from homeassistant.components import rfxtrx as rfxtrx_core from homeassistant.const import TEMP_CELCIUS from tests.common import get_test_home_assistant class TestSensorRfxtrx(unittest.TestCase): ...
arbrandes/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_video_mongo.py
4
""" Video xmodule tests in mongo. """ import json import shutil from collections import OrderedDict from tempfile import mkdtemp from uuid import uuid4 from unittest.mock import MagicMock, Mock, patch import pytest import ddt from django.conf import settings from django.core.files import File from django.core.files.b...
sgoodm/python-distance-rasters
refs/heads/master
examples/cdist_example.py
1
import os base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) from distancerasters import build_distance_array, rasterize, export_raster from distancerasters import distance from distancerasters.utils import convert_index_to_coords, calc_haversine_distance import fiona import numpy as np import mat...
kzganesan/you-get
refs/heads/develop
src/you_get/extractor/soundcloud.py
6
#!/usr/bin/env python __all__ = ['soundcloud_download', 'soundcloud_download_by_id'] from ..common import * def soundcloud_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False): assert title #if info["downloadable"]: # url = 'https://api.soundcloud.com/tracks/' + id +...
spaceone/pyjs
refs/heads/master
examples/showcase/src/demos_widgets/namedFrame.py
12
""" The ``ui.NamedFrame`` class is a variation of the ``ui.Frame`` which lets you assign a name to the frame. Naming a frame allows you to refer to that frame by name in Javascript code, and as the target for a hyperlink. """ from pyjamas.ui.SimplePanel import SimplePanel from pyjamas.ui.VerticalPanel import VerticalP...
willingc/oh-mainline
refs/heads/master
vendor/packages/sphinx/sphinx/builders/manpage.py
16
# -*- coding: utf-8 -*- """ sphinx.builders.manpage ~~~~~~~~~~~~~~~~~~~~~~~ Manual pages builder. :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from os import path from docutils.io import FileOutput from docutils.frontend import Opti...
dbarbier/ot-svn
refs/heads/master
python/test/t_Waarts_concave.py
2
#! /usr/bin/env python from openturns import * #from math import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # # Physical model # EtatLimite = NumericalMathFunction( ['X1', 'X2'], ['G'], ["-0.5*(X1-X2)*(X1-X2) - (X1+X2)/(sqrt(2)) + 3"]) dim = EtatLimite.getInputDimension() prin...
richard-willowit/odoo
refs/heads/master
addons/website_rating/controllers/__init__.py
29
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import website_mail
amw2104/fireplace
refs/heads/master
fireplace/cards/tgt/druid.py
1
from ..utils import * ## # Minions # Darnassus Aspirant class AT_038: play = GainEmptyMana(CONTROLLER, 1) deathrattle = GainMana(CONTROLLER, -1) # Savage Combatant class AT_039: inspire = Buff(FRIENDLY_HERO, "AT_039e") AT_039e = buff(atk=2) # Wildwalker class AT_040: play = Buff(TARGET, "AT_040e") AT_040e ...
Sendoushi/servo
refs/heads/master
tests/wpt/css-tests/tools/wptserve/tests/functional/test_server.py
299
import os import unittest import urllib2 import json import wptserve from base import TestUsingServer, doc_root class TestFileHandler(TestUsingServer): def test_not_handled(self): with self.assertRaises(urllib2.HTTPError) as cm: resp = self.request("/not_existing") self.assertEquals(c...
danlrobertson/servo
refs/heads/master
tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/user_prompts.py
26
# META: timeout=long import pytest from tests.support.asserts import assert_dialog_handled, assert_error, assert_success from tests.support.inline import inline def element_send_keys(session, element, text): return session.transport.send( "POST", "/session/{session_id}/element/{element_id}/value".format...
sikarash/linux-pm
refs/heads/master
tools/perf/scripts/python/export-to-postgresql.py
617
# export-to-postgresql.py: export perf data to a postgresql database # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # Thi...
moazzemi/HAMEX
refs/heads/master
cpu/gem5/src/python/m5/util/orderdict.py
88
# Copyright (c) 2005 The Regents of The University of Michigan # 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 ...
mozata/menpo
refs/heads/master
menpo/feature/__init__.py
1
from .features import (gradient, hog, lbp, es, igo, no_op, gaussian_filter, daisy, features_selection_widget) # If cyvlfeat is not installed, then access to vlfeat features should be blocked try: from .vlfeat import dsift except ImportError: pass from .predefined import sparse_hog, doubl...
gujiawen/flask_web
refs/heads/master
venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py
9
# postgresql/psycopg2.py # Copyright (C) 2005-2013 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 """ .. dialect:: postgresql+psycopg2 :name: psycopg2 :dbapi: psycopg2 ...
g19-hs/personfinder
refs/heads/master
app/unidecode/x08a.py
253
data = ( 'Yan ', # 0x00 'Yan ', # 0x01 'Ding ', # 0x02 'Fu ', # 0x03 'Qiu ', # 0x04 'Qiu ', # 0x05 'Jiao ', # 0x06 'Hong ', # 0x07 'Ji ', # 0x08 'Fan ', # 0x09 'Xun ', # 0x0a 'Diao ', # 0x0b 'Hong ', # 0x0c 'Cha ', # 0x0d 'Tao ', # 0x0e 'Xu ', # 0x0f 'Jie ', # 0x10 'Yi...
tanmaykm/thrift
refs/heads/julia1.0-thrift-0.11.0
contrib/zeromq/TZmqServer.py
43
# # 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...
Smarsh/django
refs/heads/master
django/contrib/gis/geos/error.py
641
""" This module houses the GEOS exceptions, specifically, GEOSException and GEOSGeometryIndexError. """ class GEOSException(Exception): "The base GEOS exception, indicates a GEOS-related error." pass class GEOSIndexError(GEOSException, KeyError): """ This exception is raised when an invalid index is...
idncom/odoo
refs/heads/8.0
addons/website_forum/tests/common.py
201
# -*- coding: utf-8 -*- from openerp.tests import common KARMA = { 'ask': 5, 'ans': 10, 'com_own': 5, 'com_all': 10, 'com_conv_all': 50, 'upv': 5, 'dwv': 10, 'edit_own': 10, 'edit_all': 20, 'close_own': 10, 'close_all': 20, 'unlink_own': 10, 'unlink_all': 20, 'gen_que_new': 1, 'gen_que...
dennisobrien/bokeh
refs/heads/master
examples/plotting/file/bar_colormapped.py
9
from bokeh.io import show, output_file from bokeh.models import ColumnDataSource from bokeh.palettes import Spectral6 from bokeh.plotting import figure from bokeh.transform import factor_cmap output_file("bar_colormapped.html") fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] counts = [5,...
cmvelo/ansible
refs/heads/devel
lib/ansible/executor/module_common.py
4
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either...
xpansa/hr
refs/heads/8.0
hr_job_categories/__openerp__.py
1
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program 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, eit...
xydinesh/youtube-dl
refs/heads/master
youtube_dl/extractor/zdf.py
108
# coding: utf-8 from __future__ import unicode_literals import functools import re from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, OnDemandPagedList, ) def extract_from_xml_url(ie, video_id, xml_url): doc = ie._download_xml( xml_url, video_id, no...
PhiInnovations/mdp28-linux-bsp
refs/heads/master
bitbake/lib/bb/fetch2/gitsm.py
2
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' git submodules implementation """ # Copyright (C) 2013 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as...
erickt/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/conf/locale/sl/formats.py
200
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd. F Y' TIME_FORMAT = 'H:i:s' DAT...
weinbe58/QuSpin
refs/heads/master
docs/downloads/8ebdaf354c80ef927ecd6a3597c6b0f6/example5.py
3
from __future__ import print_function, division import sys,os # line 4 and line 5 below are for development purposes and can be removed qspin_path = os.path.join(os.getcwd(),"../../") sys.path.insert(0,qspin_path) ##################################################################### # example...
multikatt/CouchPotatoServer
refs/heads/master
libs/pyutil/_version.py
92
# This is the version of this tree, as created by setup.py darcsver from the darcs patch # information: the main version number is taken from the most recent release # tag. If some patches have been added since the last release, this will have a # -NN "build number" suffix, or else a -rNN "revision number" suffix. Ple...
Tithen-Firion/youtube-dl
refs/heads/master
youtube_dl/extractor/aenetworks.py
23
from __future__ import unicode_literals import re from .theplatform import ThePlatformIE from ..utils import ( smuggle_url, update_url_query, unescapeHTML, extract_attributes, get_element_by_attribute, ) from ..compat import ( compat_urlparse, ) class AENetworksBaseIE(ThePlatformIE): _TH...
2014c2g23/2015cda-w17
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/browser/indexed_db.py
632
class EventListener: def __init__(self, events=[]): self._events=events def append(self, event): self._events.append(event) def fire(self, e): for _event in self._events: _event(e) class IndexedDB: def __init__(self): if not __BRYTHON__.has_indexedDB: raise NotImple...
lyft/incubator-airflow
refs/heads/master
tests/contrib/utils/test_weekday.py
5
# # 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...
furthz/colegio
refs/heads/master
src/utils/apps.py
15
from django.apps import AppConfig class UtilsConfig(AppConfig): name = 'utils'
sharad/calibre
refs/heads/master
src/calibre/ebooks/rtf/preprocess.py
10
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2010, Gerendi Sandor Attila' __docformat__ = 'restructuredtext en' """ RTF tokenizer and token parser. v.1.0 (1/17/2010) Author: Gerendi Sandor Attila At this point...
dysya92/monkeys
refs/heads/master
flask/lib/python2.7/site-packages/whoosh/lang/dmetaphone.py
96
# coding= utf-8 # This script implements the Double Metaphone algorythm (c) 1998, 1999 by # Lawrence Philips. It was translated to Python from the C source written by # Kevin Atkinson (http://aspell.net/metaphone/) By Andrew Collins - January 12, # 2007 who claims no rights to this work. # http://atomboy.isa-geek.com:...
cybem/graphite-web-iow
refs/heads/master
webapp/graphite/account/urls.py
8
"""Copyright 2008 Orbitz WorldWide 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...
vdrey/Project-Programs
refs/heads/master
Python/caesarCipher.py
1
# Caesar Cipher # the string to be encrypted/decrypted message = input('Message: ') # the encryption/decryption key key = int(input('Key (0 to 25): ')) # tells the program to encrypt or decrypt mode = input('Encrypt or Decrypt: ') mode = mode.lower() # every possible symbol that can be encrypted LETTERS = 'ABCDEFGH...
IsCoolEntertainment/debpkg_python-fabric
refs/heads/master
tests/test_server.py
35
""" Tests for the test server itself. Not intended to be run by the greater test suite, only by specifically targeting it on the command-line. Rationale: not really testing Fabric itself, no need to pollute Fab's own test suite. (Yes, if these tests fail, it's likely that the Fabric tests using the test server may als...
balloob/home-assistant
refs/heads/dev
homeassistant/components/freebox/switch.py
12
"""Support for Freebox Delta, Revolution and Mini 4K.""" import logging from typing import Dict from aiofreepybox.exceptions import InsufficientPermissionsError from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.typing import HomeAs...
shawnlawson/The_Force
refs/heads/gh-pages
pythonBridge/websocketUDPBridge.py
1
import time, sys, os, pkg_resources import SocketServer from twisted.python import log from twisted.internet import reactor, ssl from twisted.application import service from twisted.internet.protocol import DatagramProtocol, Protocol, Factory from twisted.web.server import Site from twisted.web.static import File f...
mrrrgn/AutobahnPython
refs/heads/master
examples/asyncio/wamp/basic/session/series/__init__.py
561
############################################################################### ## ## Copyright (C) 2014 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 ## ## http:/...
mathspace/python-social-auth
refs/heads/master
social/apps/cherrypy_app/views.py
77
import cherrypy from social.utils import setting_name, module_member from social.actions import do_auth, do_complete, do_disconnect from social.apps.cherrypy_app.utils import psa class CherryPyPSAViews(object): @cherrypy.expose @psa('/complete/%(backend)s') def login(self, backend): return do_aut...
liyu1990/tensorflow
refs/heads/master
tensorflow/python/ops/image_ops_test.py
5
"""Tests for tensorflow.ops.image_ops.""" import math import tensorflow.python.platform import numpy as np from tensorflow.python.framework import test_util from tensorflow.python.ops import constant_op from tensorflow.python.ops import image_ops from tensorflow.python.ops import io_ops from tensorflow.python.platfo...
luiseduardohdbackup/buck
refs/heads/master
third-party/py/twitter-commons/src/python/twitter/common/python/http/http.py
23
import contextlib import hashlib import os import socket import struct import time from ..common import safe_delete, safe_mkdir, safe_mkdtemp from ..compatibility import PY2, PY3 from .tracer import TRACER if PY3: from http.client import parse_headers, HTTPException from queue import Queue, Empty import urllib....
bawerd/mongrel2
refs/heads/master
examples/tornado/authdemo.py
101
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
amandolo/ansible-modules-core
refs/heads/devel
cloud/openstack/_quantum_network.py
127
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # 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 ...
Dhivyap/ansible
refs/heads/devel
lib/ansible/modules/network/netscaler/netscaler_lb_monitor.py
114
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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', ...
apanda/modeling
refs/heads/master
processing_tools/number_of_tenants.py
1
import sys from collections import defaultdict def Process (fnames): tenant_time = defaultdict(lambda: defaultdict(lambda: 0.0)) tenant_run = defaultdict(lambda: defaultdict(lambda:0)) for fname in fnames: f = open(fname) for l in f: if l.startswith("tenant"): co...
abhiatgithub/shogun-toolbox
refs/heads/master
examples/undocumented/python_static/classifier_mpdsvm.py
22
from tools.load import LoadMatrix from sg import sg lm=LoadMatrix() traindat=lm.load_numbers('../data/fm_train_real.dat') testdat=lm.load_numbers('../data/fm_test_real.dat') train_label=lm.load_labels('../data/label_train_twoclass.dat') parameter_list=[[traindat,testdat, train_label,10,2.1,1.2,1e-5,False], [trainda...
philsch/ansible
refs/heads/devel
lib/ansible/modules/network/ovs/openvswitch_port.py
42
#!/usr/bin/python #coding: utf-8 -*- # pylint: disable=C0111 # (c) 2013, David Stygstra <david.stygstra@gmail.com> # # Portions copyright @ 2015 VMware, Inc. # # This file is part of Ansible # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
ettm2012/MissionPlanner
refs/heads/master
Lib/MimeWriter.py
67
"""Generic MIME writer. This module defines the class MimeWriter. The MimeWriter class implements a basic formatter for creating MIME multi-part files. It doesn't seek around the output file nor does it use large amounts of buffer space. You must write the parts out in the order that they should occur in the fi...
iraquitan/political-advisor
refs/heads/master
web/myapp/tests.py
1
from django.test import TestCase # Create your tests here. class BaseTests(TestCase): def test_base(self): self.assertEqual(True, True)
aldryn/djangocms-cascade
refs/heads/master
cmsplugin_cascade/gs960/__init__.py
14224
# -*- coding: utf-8 -*-
jeffbryner/MozDef
refs/heads/master
tests/loginput/loginput_test_suite.py
3
import os from mozdef_util.utilities.dot_dict import DotDict import mock from configlib import OptionParser from tests.http_test_suite import HTTPTestSuite class LoginputTestSuite(HTTPTestSuite): def setup(self): sample_config = DotDict() sample_config.configfile = os.path.join(os.path.dirname...
pfmoore/pip
refs/heads/main
tests/data/src/extension/setup.py
4
from setuptools import Extension, setup module = Extension('extension', sources=['extension.c']) setup(name='extension', version='0.0.1', ext_modules = [module])
arnicas/eyeo_nlp
refs/heads/master
python/get_sentiment_chunks.py
1
# Usage: python get_sentiment_chunks.py [filepath] [optional_chunk_size] import json import sys NEGWORDS = "../data/sentiment_wordlists/negative-words.txt" POSWORDS = "../data/sentiment_wordlists/positive-words.txt" def load_words(path): with open(path) as handle: words = handle.readlines() words = [...
grschafer/BejeweledBot
refs/heads/master
gfx/environment.py
1
__author__ = 'Tom Schaul, tom@idsia.ch' import random import copy import numpy as np from scipy import zeros from pprint import pformat, pprint import pygame from pygame.locals import * from pybrain.utilities import Named from pybrain.rl.environments.environment import Environment # TODO: mazes can have any number o...
zenodo/invenio
refs/heads/zenodo-master
invenio/legacy/bibcirculation/web/admin/bibcirculationadmin.py
13
# This file is part of Invenio. # Copyright (C) 2008, 2009, 2010, 2011 CERN. # # Invenio 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...
elishowk/flaskexperiment
refs/heads/master
setup.py
1
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README')).read() version = '0.1' install_requires = [ 'flask', 'pymongo', 'silk-deployment', 'simplejson' # For more details, see: # http://packages.p...
fintech-circle/edx-platform
refs/heads/master
openedx/core/djangoapps/oauth_dispatch/adapters/__init__.py
55
""" Adapters to provide a common interface to django-oauth2-provider (DOP) and django-oauth-toolkit (DOT). """ from .dop import DOPAdapter from .dot import DOTAdapter
zaina/nova
refs/heads/master
nova/tests/functional/v3/test_attach_interfaces.py
28
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...