repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ridfrustum/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/webdesign/lorem_ipsum.py | 439 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo con... |
sgiavasis/nipype | refs/heads/master | nipype/interfaces/minc/tests/test_auto_Beast.py | 7 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..minc import Beast
def test_Beast_inputs():
input_map = dict(abspath=dict(argstr='-abspath',
usedefault=True,
),
args=dict(argstr='%s',
),
clobber=dict(argstr='-clobber',
usedefault=True,
)... |
juhnowski/FishingRod | refs/heads/master | production/pygsl-0.9.5/examples/integrate.py | 1 | #!/usr/bin/env python
# Author : Pierre Schnizer
"""
Integration of sin(x)/x from -infinity to + infinity.
Here the combined usage if qawf and qagp is shown. Qagp is used to integrate
the "numerical singularity" (please could someone change it to the approbriate
expression?) x = 0. qawf is used to integrate towards in... |
Oire/twython | refs/heads/master | examples/get_user_timeline.py | 9 | from twython import Twython, TwythonError
# Requires Authentication as of Twitter API v1.1
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
try:
user_timeline = twitter.get_user_timeline(screen_name='ryanmcgrath')
except TwythonError as e:
print e
print user_timeline
|
thomaspatzke/EQUEL | refs/heads/master | equel/plugins/search.py | 1 | # Search Plugins
from .generic import BasePlugin, GenericPlugin, BaseShortcutPlugin, EQUELPluginException
class BaseSearchPlugin(GenericPlugin):
"""Search specific plugin attributes"""
# Allow return value of plugin to be used as search filter, e.g. in further search subexpressions
filterable = False
clas... |
zitouni/gnuradio-3.6.1 | refs/heads/master | gnuradio-core/src/python/gnuradio/gr/qa_stream_mux.py | 18 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at ... |
sport-monkey/GYP | refs/heads/master | test/standalone/gyptest-standalone.py | 314 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that a project hierarchy created with the --generator-output=
option can be built even when it's relocated to a different path.... |
cngo-github/nupic | refs/heads/master | examples/opf/experiments/classification/category_SP_1/description.py | 32 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
bollig/pscf | refs/heads/master | tools/python/GDoc/file_util.py | 4 | #****M root/file_util ---------------------------------------------
# MODULE
# file_util
# PURPOSE
# Utility functions for manipulating files and paths
#*** --------------------------------------------------------------
import os
from os.path import *
#****f file_util/relative_path ------------------------------... |
gorczynski/dotfiles | refs/heads/master | vim/bundle/powerline/tools/purge-PRs.py | 27 | #!/usr/bin/env python
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import argparse
from getpass import getpass
from github import Github
p = argparse.ArgumentParser(description='Powerline release script')
p.add_argument('-u', '--user', type=str,... |
rjw57/rbc | refs/heads/master | test/test_switch.py | 1 | def test_basic_switch(check_output):
check_output('''
main() {
extrn putchar;;
auto i;
i = 0; while(i <= 4) {
describe(i);
putchar('*n');
++i;
}
}
describe(val) {
extrn putstr, putnumb... |
paolodedios/tensorflow | refs/heads/master | tensorflow/python/keras/layers/pooling.py | 5 | # 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... |
zorroblue/scikit-learn | refs/heads/master | examples/svm/plot_svm_scale_c.py | 60 | """
==============================================
Scaling the regularization parameter for SVCs
==============================================
The following example illustrates the effect of scaling the
regularization parameter when using :ref:`svm` for
:ref:`classification <svm_classification>`.
For SVC classificati... |
minhphung171093/GreenERP_V7 | refs/heads/master | openerp/addons/account_payment/__openerp__.py | 54 | # -*- 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... |
WSDC-NITWarangal/gunicorn | refs/heads/master | examples/frameworks/flaskapp.py | 41 | # Run with:
#
# $ gunicorn flaskapp:app
#
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
|
opengeogroep/inasafe | refs/heads/master | safe_qgis/test/test_qgis_environment.py | 2 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**ISClipper test suite.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwar... |
IvanGavran/scrapy | refs/heads/master | scrapy/http/__init__.py | 207 | """
Module containing all HTTP related classes
Use this module (instead of the more specific ones) when importing Headers,
Request and Response outside this module.
"""
from scrapy.http.headers import Headers
from scrapy.http.request import Request
from scrapy.http.request.form import FormRequest
from scrapy.http.re... |
komarudin02/Public | refs/heads/master | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | # Copyright (c) 2011 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 re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... |
orenov/phraug | refs/heads/master | csv2vw.py | 4 | """
Convert CSV file to vw format. Headers can be skipped with argv[4] == true.
Use -1 for label index if there no labels in the input file
phraug2 version has an option to ignore columns:
https://github.com/zygmuntz/phraug2/blob/master/csv2vw.py
"""
import sys
import csv
def construct_line( label, line ):
new_line... |
Livit/Livit.Learn.EdX | refs/heads/labster/develop | common/djangoapps/third_party_auth/tests/specs/test_twitter.py | 86 | """
Separate integration test for Twitter which is an OAuth1 provider.
"""
from mock import patch
from third_party_auth.tests.specs import base
class TwitterIntegrationTest(base.Oauth2IntegrationTest):
"""Integration tests for Twitter backend."""
def setUp(self):
super(TwitterIntegrationTest, self).... |
jeremykid/FunAlgorithm | refs/heads/master | faceRegonization/sample.py | 1 | # -*- coding: utf-8 -*-
import urllib2
import urllib
import time
http_url = 'https://api-us.faceplusplus.com/facepp/v3/detect'
key = "Bn7swhGpvtzxS9uMWG-0CkacJY-_gt-4"
secret = "tNCF8Wd-xjtw-qyQn47yjZh8RzLkVBkU"
filepath = r"./sample.jpg"
boundary = '----------%s' % hex(int(time.time() * 1000))
data = []
data.append('-... |
zhounanshu/flasky | refs/heads/master | app/auth/forms.py | 111 | from flask.ext.wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import Required, Length, Email, Regexp, EqualTo
from wtforms import ValidationError
from ..models import User
class LoginForm(Form):
email = StringField('Email', validators=[Required(),... |
Charimon/complex_input | refs/heads/master | node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... |
AnimeshSinha1309/Website-Edunet | refs/heads/master | WebsiteEdunet/env/Lib/site-packages/django/contrib/sites/shortcuts.py | 615 | from __future__ import unicode_literals
from django.apps import apps
def get_current_site(request):
"""
Checks if contrib.sites is installed and returns either the current
``Site`` object or a ``RequestSite`` object based on the request.
"""
# Imports are inside the function because its point is ... |
woozzu/pylearn2 | refs/heads/master | pylearn2/models/tests/test_autoencoder.py | 32 | """
Tests for the pylearn2 autoencoder module.
"""
import os.path
import numpy as np
import theano
import theano.tensor as tensor
from theano import config
from pylearn2.models.autoencoder import Autoencoder, \
HigherOrderContractiveAutoencoder, DeepComposedAutoencoder, \
UntiedAutoencoder, StackedDenoisingAut... |
Etxea/gestioneide | refs/heads/master | asistencias/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/test/test_httpservers.py | 5 | """Unittests for the various HTTPServer modules.
Written by Cody A.W. Somerville <cody-somerville@ubuntu.com>,
Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest.
"""
import os
import sys
import re
import base64
import ntpath
import shutil
import urllib
import httplib
import tempfile
import unittest
i... |
colinnewell/odoo | refs/heads/8.0 | addons/l10n_br/account.py | 340 | # -*- encoding: utf-8 -*-
#################################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/tensorflow/core/framework/op_def_pb2.py | 9 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/op_def.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf im... |
ar7z1/ansible | refs/heads/devel | test/units/modules/network/aruba/aruba_module.py | 73 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
TheNeuralBit/gottengeography | refs/heads/master | tests/test_territories.py | 1 | """Test the classes and functions defined by gg/territories.py"""
from tests import BaseTestCase
class TerritoriesTestCase(BaseTestCase):
filename = 'territories'
def setUp(self):
super().setUp()
def test_countries(self):
"""Ensure we can read country codes."""
self.assertEqual(... |
jmcarbo/openerp7 | refs/heads/master | openerp/addons/base/ir/ir_config_parameter.py | 72 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
anryko/ansible | refs/heads/devel | lib/ansible/modules/cloud/memset/memset_zone.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
# 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... |
sergray/energy-meter-mercury206 | refs/heads/master | mercury206/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Sergey Panfilov'
__email__ = 'sergray@gmail.com'
__version__ = '0.0.1'
|
therewillbecode/ichnaea | refs/heads/master | ichnaea/config.py | 1 | """
Contains helper functionality for reading and parsing configuration files.
"""
import os
from configparser import (
ConfigParser,
NoOptionError,
NoSectionError,
)
from six import PY2, string_types
class Config(ConfigParser):
"""
A :class:`configparser.ConfigParser` subclass with added
fu... |
shanemcd/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_vrfcontext.py | 27 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.2
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... |
2014c2g19/2014c2g19 | refs/heads/master | exts/w2/static/Brython2.0.0-20140209-164925/Lib/_functools.py | 727 | def partial(func, *args, **keywords):
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update(fkeywords)
return func(*(args + fargs), **newkeywords)
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords
return newfunc
def reduce(func,... |
balloob/home-assistant | refs/heads/dev | homeassistant/components/heos/const.py | 28 | """Const for the HEOS integration."""
ATTR_PASSWORD = "password"
ATTR_USERNAME = "username"
COMMAND_RETRY_ATTEMPTS = 2
COMMAND_RETRY_DELAY = 1
DATA_CONTROLLER_MANAGER = "controller"
DATA_SOURCE_MANAGER = "source_manager"
DATA_DISCOVERED_HOSTS = "heos_discovered_hosts"
DOMAIN = "heos"
SERVICE_SIGN_IN = "sign_in"
SERVIC... |
tmerrick1/spack | refs/heads/develop | var/spack/repos/builtin.mock/packages/archive-files/package.py | 4 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
sagemathinc/smc | refs/heads/master | src/smc_sagews/smc_sagews/tests/a.py | 5 | def f2(*args, **kwargs):
print("test f2 1")
|
dct2012/chromeos-3.14 | refs/heads/chromeos-3.14 | tools/perf/tests/attr.py | 3174 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... |
liu602348184/django | refs/heads/master | tests/aggregation_regress/tests.py | 66 | from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Coun... |
firebitsbr/raspberry_pwn | refs/heads/master | src/pentest/sqlmap/lib/core/bigarray.py | 5 | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
try:
import cPickle as pickle
except:
import pickle
import os
import tempfile
from lib.core.settings import BIGARRAY_CHUNK_LENGTH
class Cache(object):
"""
Aux... |
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/external_conversion_source.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... |
rcos/Observatory | refs/heads/master | observatory/lib/dulwich/repo.py | 2 | # repo.py -- For dealing with git repositories.
# Copyright (C) 2007 James Westby <jw+debian@jameswestby.net>
# Copyright (C) 2008-2009 Jelmer Vernooij <jelmer@samba.org>
#
# 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... |
robhudson/django | refs/heads/master | django/forms/boundfield.py | 135 | from __future__ import unicode_literals
import datetime
from django.forms.utils import flatatt, pretty_name
from django.forms.widgets import Textarea, TextInput
from django.utils import six
from django.utils.encoding import (
force_text, python_2_unicode_compatible, smart_text,
)
from django.utils.html import con... |
c11/earthengine-api | refs/heads/master | python/examples/FeatureCollection/buffer.py | 5 | #!/usr/bin/env python
"""Buffer Example.
Display the area within 2 kilometers of any San Francisco BART station.
"""
import ee
import ee.mapclient
ee.Initialize()
ee.mapclient.centerMap(-122.4, 37.7, 11)
bart_stations = ee.FeatureCollection(
'ft:1xCCZkVn8DIkB7i7RVkvsYWxAxsdsQZ6SbD9PCXw')
buffered = bart_station... |
dimtruck/magnum | refs/heads/master | magnum/common/pythonk8sclient/swagger_client/models/v1_container_port.py | 5 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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... |
sephalon/python-ivi | refs/heads/master | ivi/testequity/testequity140.py | 6 | """
Python Interchangeable Virtual Instrument Library
Driver for Test Equity Model 140
Copyright (c) 2014 Jeff Wurzbach
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, inclu... |
paulocastro31/android_kernel_motorola_msm8226 | refs/heads/master | scripts/gcc-wrapper.py | 182 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... |
hanicker/odoo | refs/heads/8.0 | addons/hr_payroll/wizard/__init__.py | 442 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... |
mKeRix/home-assistant | refs/heads/dev | homeassistant/helpers/signal.py | 24 | """Signal handling related helpers."""
import logging
import signal
import sys
from types import FrameType
from homeassistant.const import RESTART_EXIT_CODE
from homeassistant.core import HomeAssistant, callback
from homeassistant.loader import bind_hass
_LOGGER = logging.getLogger(__name__)
@callback
@bind_hass
de... |
nhomar/odoo-mirror | refs/heads/8.0 | addons/product/tests/test_uom.py | 127 | from openerp.tests.common import TransactionCase
class TestUom(TransactionCase):
"""Tests for unit of measure conversion"""
def setUp(self):
super(TestUom, self).setUp()
self.product = self.registry('product.product')
self.uom = self.registry('product.uom')
self.imd = self.regi... |
wfxiang08/sqlalchemy | refs/heads/feature/wftest | test/dialect/test_sybase.py | 28 | from sqlalchemy import *
from sqlalchemy import sql
from sqlalchemy.databases import sybase
from sqlalchemy.testing import *
class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
__dialect__ = sybase.dialect()
def test_extract(self):
t = sql.table('t', sql.column('col1'))
mapping = {
... |
huanpc/IoT-1 | refs/heads/master | gui/controller/.venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py | 780 | from __future__ import absolute_import
from base64 import b64encode
from ..packages.six import b
ACCEPT_ENCODING = 'gzip,deflate'
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=None, proxy_basic_auth=None, disable_cache=None):
"""
Shortcuts for generatin... |
ambitioninc/ambition-python | refs/heads/master | ambition/tests/api_client_tests.py | 1 | import os
from functools import partial
import datetime
import unittest
from mock import patch
from ..api_client import ApiClient
from ..configuration import ApiConfiguration
from .. import models
test_dict = {
'name': 'Test Name',
'display_name': 'Test Display Name',
'data_format': 'Test Format',
}
cl... |
balloob/home-assistant | refs/heads/dev | homeassistant/components/onvif/config_flow.py | 8 | """Config flow for ONVIF."""
from pprint import pformat
from typing import List
from urllib.parse import urlparse
from onvif.exceptions import ONVIFError
import voluptuous as vol
from wsdiscovery.discovery import ThreadedWSDiscovery as WSDiscovery
from wsdiscovery.scope import Scope
from wsdiscovery.service import Ser... |
ghjm/ansible | refs/heads/devel | lib/ansible/module_utils/facts/virtual/openbsd.py | 33 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... |
serge-sans-paille/pythran | refs/heads/master | pythran/tests/openmp.legacy/omp_taskyield.py | 1 | def omp_taskyield():
import omp
from time import sleep
NUM_TASKS = 25
count = 0
start_id = [0 for _ in range(NUM_TASKS)]
current_id = [0 for _ in range(NUM_TASKS)]
if 'omp parallel':
use_omp = omp.in_parallel()
if 'omp single':
for i in range(NUM_TASKS):
... |
UXE/local-edx | refs/heads/master | lms/djangoapps/branding/tests.py | 1 | """
Tests for branding page
"""
import datetime
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponseRedirect
from django.test.utils import override_settings
from django.test.client import RequestFactory
from pytz import UTC
from mock import patch, Mo... |
dmckinney5/SlackOff | refs/heads/master | slackoff/lib/python2.7/site-packages/slackclient/__init__.py | 3 | from slackclient._client import SlackClient # noqa
|
RuiNascimento/krepo | refs/heads/master | script.module.lambdascrapers/lib/lambdascrapers/sources_ lambdascrapers/en/myprojectfreetv.py | 1 | # -*- coding: UTF-8 -*-
# -Cleaned and Checked on 10-10-2018 by JewBMX in Yoda.
import re,urllib,urlparse
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import proxy
class source:
def __init__(self):
self.priority = 1
self.language... |
zigama/rapidsms-rwanda | refs/heads/master | apps/old.ubuzima/config.py | 4 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
title = "Child & Maternity Health"
tab_link = "/ubuzima"
|
Chenmxs/pyspider | refs/heads/master | tests/data_fetcher_processor_handler.py | 67 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2015-01-18 14:12:55
from pyspider.libs.base_handler import *
class Handler(BaseHandler):
@not_send_status
def not_send_status(self, response):
... |
epandurski/django | refs/heads/master | tests/user_commands/management/commands/leave_locale_alone_true.py | 428 | from django.core.management.base import BaseCommand
from django.utils import translation
class Command(BaseCommand):
can_import_settings = True
leave_locale_alone = True
def handle(self, *args, **options):
return translation.get_language()
|
tima/ansible | refs/heads/devel | lib/ansible/modules/network/bigswitch/bigmon_policy.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to manage Big Monitoring Fabric service chains
# (c) 2016, Ted Elhourani <ted@bigswitch.com>
# 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
__metacl... |
ashishbaghudana/mthesis-ashish | refs/heads/develop | resources/tees/ExampleBuilders/FeatureBuilders/EVEXFeatureBuilder.py | 2 | """
EVEX Feature Builder
"""
__version__ = "$Revision: 1.5 $"
from FeatureBuilder import FeatureBuilder
class EVEXFeatureBuilder(FeatureBuilder):
def __init__(self, featureSet):
"""
This is called, when the ExampleBuilder object is created.
@type featureSet: Core.IdSet
@pa... |
gf712/AbPyTools | refs/heads/master | abpytools/utils/abpytools_exceptions.py | 1 | class NumberingException(Exception):
pass
|
googleapis/google-cloud-dotnet | refs/heads/master | apis/Google.Cloud.Functions.V1/synth.py | 353 | # GENERATED BY Google.Cloud.Tools.ProjectGenerator - DO NOT EDIT!
import json
import sys
from synthtool import shell
from synthtool import metadata
from pathlib import Path
# generateapis.sh updates synth.metadata itself
metadata.enable_write_metadata(False)
AUTOSYNTH_MULTIPLE_COMMITS = True
# Parent of the script i... |
PeterDaveHello/eden | refs/heads/master | modules/s3db/climate.py | 13 | # -*- coding: utf-8 -*-
""" Sahana Eden Climate Model
@copyright: 2011-2015 (c) Sahana Software Foundation
@license: MIT
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 witho... |
ossdemura/django-miniblog | refs/heads/dev | Scripts/viewer.py | 1 | #!c:\users\juan.digicash\documents\workspace-django\miblog\scripts\python.exe
#
# The Python Imaging Library
# $Id$
#
from __future__ import print_function
import sys
if sys.version_info[0] > 2:
import tkinter
else:
import Tkinter as tkinter
from PIL import Image, ImageTk
#
# an image viewer
class UI(tki... |
yakky/django | refs/heads/master | django/core/wsgi.py | 161 | import django
from django.core.handlers.wsgi import WSGIHandler
def get_wsgi_application():
"""
The public interface to Django's WSGI support. Should return a WSGI
callable.
Allows us to avoid making django.core.handlers.WSGIHandler public API, in
case the internal WSGI implementation changes or ... |
arrayexpress/ae_auto | refs/heads/master | utils/maintenance/__init__.py | 34 | __author__ = 'Ahmed G. Ali'
|
breathe/ansible | refs/heads/devel | examples/scripts/uptime.py | 278 | #!/usr/bin/python
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# example of getting the uptime of all hosts, 10 at a time
import ansible.runner
import sys
# construct the ansible runner and execute on all hosts
results = ansible.runner.Runner(
pattern='*', forks=10,
module_name='command', module_args... |
mohamedattahri/python-docx | refs/heads/master | features/steps/image.py | 10 | # encoding: utf-8
"""
Step implementations for image characterization features
"""
from __future__ import absolute_import, print_function, unicode_literals
from behave import given, then, when
from docx.image.image import Image
from helpers import test_file
# given ===============================================... |
DIT-Tools/drqueue | refs/heads/master | etc/lightwave_sg.py | 4 | #
# THIS IS A PYTHON SCRIPT FILE
#
# Default configuration for Lightwave script generator
#
# Python variables
# SCENE, PROJECTDIR, CONFIGDIR, RF_OWNER, FFORMAT, RESX, RESY, CAMERA
#
# shell variables
# DRQUEUE_BLOCKSIZE, DRQUEUE_COMPID, DRQUEUE_ENDFRAME, DRQUEUE_ETC, DRQUEUE_FRAME,
# DRQUEUE_JOBID, DRQUEUE_JOBNAME,... |
akhilaananthram/nupic | refs/heads/master | tests/unit/nupic/utils_test.py | 7 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and condit... |
lichengshuang/createvhost | refs/heads/master | python/others/System/Threads/thread-alt.py | 2 | #!/usr/bin/env python3
import _thread
def action(i):
print(i ** 32)
class Power:
def __int__(self, i):
self.i = i
def action(self):
print(self.i ** 32)
_thread.start_new_thread(action, (2,))
_thread.start_new_thread((lambda: action(2)), ())
obj = Power()
_thread.start_ne... |
madduck/reclass | refs/heads/master | reclass/datatypes/entity.py | 4 | #
# -*- coding: utf-8 -*-
#
# This file is part of reclass (http://github.com/madduck/reclass)
#
# Copyright © 2007–14 martin f. krafft <madduck@madduck.net>
# Released under the terms of the Artistic Licence 2.0
#
from classes import Classes
from applications import Applications
from parameters import Parameters
clas... |
emijrp/youtube-dl | refs/heads/master | youtube_dl/extractor/dctp.py | 124 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
class DctpTvIE(InfoExtractor):
_VALID_URL = r'http://www.dctp.tv/(#/)?filme/(?P<id>.+?)/$'
_TEST = {
'url': 'http://www.dctp.tv/filme/videoinstallation-fuer-eine-kaufhausfassade... |
TAlonglong/trollduction-test | refs/heads/develop-ws2016 | trollduction/tests/test_trollduction.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Martin Raspaud
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.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, eit... |
dbcollection/dbcollection | refs/heads/master | tests/functional/load/coco_detection.py | 2 | #!/usr/bin/env python3
"""
Test loading coco.
"""
import os
from dbcollection.utils.test import TestBaseDB
# setup
name = 'coco'
task = 'detection_2015'
data_dir = os.path.join(os.path.expanduser("~"), 'tmp', 'download_data')
verbose = True
# Run tester
tester = TestBaseDB(name, task, data_dir, verbose)
tester.run... |
jelugbo/ddi | refs/heads/master | lms/djangoapps/django_comment_client/forum/views.py | 5 | import json
import logging
import xml.sax.saxutils as saxutils
from django.contrib.auth.decorators import login_required
from django.core.context_processors import csrf
from django.contrib.auth.models import User
from django.http import Http404, HttpResponseBadRequest
from django.views.decorators.http import require_G... |
bunnyitvn/webptn | refs/heads/master | build/lib.linux-i686-2.7/django/contrib/formtools/tests/wizard/wizardtests/forms.py | 313 | import os
import tempfile
from django import forms
from django.contrib.auth.models import User
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.forms.models import modelformset_factory
from django.http import HttpResponse
from django.template import ... |
aspiers/automation | refs/heads/master | scripts/jenkins/cloud/gerrit/gerrit_merge.py | 3 | #!/usr/bin/env python
import argparse
import os
import sys
sys.path.append(os.path.dirname(__file__))
from gerrit import GerritChange # noqa: E402
from gerrit_settings import gerrit_project_map # noqa: E402
def check_all_dependencies_satisfied(change):
change_deps = change.get_dependencies()
unmerged_de... |
cokelaer/spectrum | refs/heads/master | test/test_spetrogram.py | 1 |
from spectrum import Spectrogram, dolphin_filename, readwav
def test_spectrogram():
data, samplerate = readwav(dolphin_filename)
p = Spectrogram(data, ws=128, W=4096, sampling=samplerate)
p.periodogram()
p.plot()
|
d9pouces/swampdragon | refs/heads/master | tests/test_model_serializer_deserialize.py | 10 | from swampdragon.serializers.model_serializer import ModelSerializer
from swampdragon.testing.dragon_testcase import DragonTestCase
from .models import TextModel, SDModel
from datetime import datetime
from django.db import models
class DateModel(SDModel):
date = models.DateTimeField()
class DateModelSerializer(... |
nathanaevitas/odoo | refs/heads/master | openerp/addons/lunch/__openerp__.py | 267 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
jguyomard/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/pylib/gyp/generator/msvs.py | 137 | #!/usr/bin/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 os
import re
import subprocess
import sys
import gyp.MSVSNew as MSVSNew
import gyp.MSVSProject as MSVSProject
import gyp.MSVSToolFile as... |
thumt/THUMT | refs/heads/master | thumt/utils/checkpoint.py | 1 | # coding=utf-8
# Copyright 2017-2020 The THUMT Authors
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import torch
def oldest_checkpoint(path):
names = glob.glob(os.path.join(path, "*.pt"))
if not names:
return None... |
BiRG/Omics-Dashboard | refs/heads/master | omics/omics_dashboard/dashboards/nmr_metabolomics/opls/layouts.py | 1 | import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from flask_login import current_user
from data_tools.wrappers.analyses import get_analyses
from data_tools.wrappers.collections import get_collections
from .model import OPLSModel
def get_load_results_form(... |
jnns/wagtail | refs/heads/master | wagtail/wagtailcore/middleware.py | 47 | from wagtail.wagtailcore.models import Site
class SiteMiddleware(object):
def process_request(self, request):
"""
Set request.site to contain the Site object responsible for handling this request,
according to hostname matching rules
"""
try:
request.site = Site... |
jlspyaozhongkai/Uter | refs/heads/master | third_party_build/Python-2.7.9/lib/python2.7/test/test_threading_local.py | 96 | import unittest
from doctest import DocTestSuite
from test import test_support
import weakref
import gc
# Modules under test
_thread = test_support.import_module('thread')
threading = test_support.import_module('threading')
import _threading_local
class Weak(object):
pass
def target(local, weaklist):
weak =... |
sekikn/bigtop | refs/heads/master | bigtop-deploy/juju/hadoop-hbase/tests/01-bundle.py | 10 | #!/usr/bin/env python3
# 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 "Lic... |
timdiels/chicken_turtle_util | refs/heads/master | pytil/hashlib.py | 1 | # Copyright (C) 2016 VIB/BEG/UGent - Tim Diels <timdiels.m@gmail.com>
#
# This file is part of pytil.
#
# pytil 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 ... |
jn0/fb2utils | refs/heads/master | unidecode/x72.py | 252 | data = (
'He ', # 0x00
'Lan ', # 0x01
'Biao ', # 0x02
'Rong ', # 0x03
'Li ', # 0x04
'Mo ', # 0x05
'Bao ', # 0x06
'Ruo ', # 0x07
'Lu ', # 0x08
'La ', # 0x09
'Ao ', # 0x0a
'Xun ', # 0x0b
'Kuang ', # 0x0c
'Shuo ', # 0x0d
'[?] ', # 0x0e
'Li ', # 0x0f
'Lu ', # 0x10
'Jue ', ... |
Bjarne-AAU/MonteCarloLocalization | refs/heads/master | World.py | 1 |
import pygame
import numpy as np
from scipy import interpolate
from scipy.ndimage.filters import gaussian_filter
import cv2
import noise
from matplotlib import cm
from matplotlib.colors import Colormap
mapping = np.array([0.00, 0.05, 0.10, 0.15, 0.20, 0.45, 0.70, 0.90, 0.95, 0.97, 0.99, 1.00])
def world_type_from... |
sramsay64/python-iview | refs/heads/master | cherrypy/test/test_request_obj.py | 5 | """Basic tests for the cherrypy.Request object."""
import os
localDir = os.path.dirname(__file__)
import sys
import types
from cherrypy._cpcompat import IncompleteRead, ntob, ntou, unicodestr
import cherrypy
from cherrypy import _cptools, tools
from cherrypy.lib import httputil
defined_http_methods = ("OPTIONS", "GE... |
kswiat/django | refs/heads/master | django/conf/locale/eu/formats.py | 611 | # -*- 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 = r'Yeko M\re\n d\a'
TIME_FORMAT = '... |
Foxfanmedium/python_training | refs/heads/master | Book_courses/Berry_P/chapter_2/vowels7.py | 1 | # vowels = ['a', 'o', 'i', 'e', 'u']
# word = input("Provide a word to search for vowels:")
# found = []
# for letter in word:
# if letter in vowels:
# if letter not in found:
# found.append(letter)
# for vowel in found:
# print(vowel)
#=======================================================... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.