text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
import logging
from ncclient import manager
from ncclient.xml_ import *
def connect(host, port, user, password):
conn = manager.connect(host=host,
port=port,
username=user,
password=password,
... | ncclient/ncclient | examples/vendor/juniper/unknown-rpc.py | Python | apache-2.0 | 861 | 0.002323 |
from django.conf.urls import patterns, url
from .views import (
picturegallery,
dashboard,
events,
approvals,
suggestions,
vidly_media,
comments,
loggedsearches,
users,
groups,
channels,
locations,
regions,
templates,
topics,
tags,
recruitmentmessages... | tannishk/airmozilla | airmozilla/manage/urls.py | Python | bsd-3-clause | 12,711 | 0 |
from email.utils import formatdate
from typing import Optional, Type, TypeVar
from twisted.internet import defer
from twisted.internet.error import (
ConnectError,
ConnectionDone,
ConnectionLost,
ConnectionRefusedError,
DNSLookupError,
TCPTimedOutError,
TimeoutError,
)
from twisted.web.clie... | starrify/scrapy | scrapy/downloadermiddlewares/httpcache.py | Python | bsd-3-clause | 5,481 | 0.001642 |
def greeting(msg):
print(msg)
def valediction(msg):
for char in reversed(msg):
print(char, end = "" )
print("\n")
| CDHgit/cs3240-labdemo | helper.py | Python | mit | 137 | 0.043796 |
# -*- coding: utf-8 -*-
# pylint: disable=C0321,E1120,E1123,W0223
"""
Inbound webhook handlers.
"""
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django_fixmystreet.fixmystreet.models import FMSUser, Report, ReportAttachment, ReportComment, ReportEvent... | IMIO/django-fixmystreet | django_fixmystreet/webhooks/inbound.py | Python | agpl-3.0 | 6,983 | 0.003007 |
#!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import argparse
import ConfigParser
from vnc_api.vnc_api import *
class EncapsulationProvision(object):
def __init__(self, args_str=None):
self._args = None
if not args_str:
args_str = '... | aranjan7/contrail-controller-aranjan | src/config/utils/provision_encap.py | Python | apache-2.0 | 5,187 | 0.006748 |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2009, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... | harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/ec2/test_connection.py | Python | gpl-3.0 | 8,892 | 0.000225 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 (... | hortonworks/hortonworks-sandbox | apps/oozie/src/oozie/management/commands/oozie_setup.py | Python | apache-2.0 | 3,188 | 0.006589 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Hardware Proxy',
'category': 'IOT',
'sequence': 6,
'summary': 'Connect the Web Client to Hardware Peripherals',
'website': 'https://www.odoo.com/page/iot',
'description': """
Hardware P... | t3dev/odoo | addons/hw_drivers/__manifest__.py | Python | gpl-3.0 | 592 | 0.001689 |
from bokeh.plotting import figure, show
# prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# create a new plot with a title and axis labels
p = figure(title="Simple line example", x_axis_label="x", y_axis_label="y")
# add a line renderer with legend and line thickness
p.line(x, y, legend_label="Temp.", line... | bokeh/bokeh | sphinx/source/docs/first_steps/examples/first_steps_1_simple_line.py | Python | bsd-3-clause | 358 | 0 |
# coding=utf-8
# Copyright 2022 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... | google-research/google-research | non_semantic_speech_benchmark/data_prep/beam_dofns_test.py | Python | apache-2.0 | 16,889 | 0.004855 |
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.utils.translation import gettext_lazy as _
from zds.api.validators import Validator
from zds.member.models import Profile
class ParticipantsUserValidator(Validator):
can_be_empty = False
def validate_participants(self,... | ChantyTaguan/zds-site | zds/mp/validators.py | Python | gpl-3.0 | 3,768 | 0.002132 |
import nose
def start_response_111(status, headers):
for header in headers:
if header[0] == 'Content-Type':
assert header[1] == 'application/vnd.ogc.wms_xml'
assert status == '200 OK'
def start_response_130(status, headers):
for header in headers:
if header[0] == 'Con... | pbabik/OGCServer | tests/testWsgi.py | Python | bsd-3-clause | 1,893 | 0.005811 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from channels.staticfiles import StaticFilesWrapper, StaticFilesHandler
from chat.consumers import ChatJSONConsumer... | hzlf/openbroadcast.ch | app/routing.py | Python | gpl-3.0 | 606 | 0 |
import pp
from pp.mask.merge_json import merge_json
from pp.mask.merge_markdown import merge_markdown
from pp.mask.merge_test_metadata import merge_test_metadata
from pp.mask.write_labels import write_labels
def merge_metadata(gdspath, labels_prefix="opt", label_layer=pp.LAYER.LABEL, **kwargs):
mdpath = gdspath.w... | psiq/gdsfactory | pp/mask/merge_metadata.py | Python | mit | 914 | 0.003282 |
################################################################################
# Name: PyZenity.py
# Author: Brian Ramos
# Created: 10/17/2005
# Revision Information:
# $Date: $
# $Revision: $
# $Author: bramos $
#
# Licence: MIT Licence
#
# Copyright (c) 2010 Brian Ramos
# Permission is hereby g... | dleicht/PSB | PyZenity.py | Python | mit | 15,175 | 0.005074 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.conf.urls import patterns, url
from . import views
urlpatterns... | janusnic/shoop | shoop/front/apps/customer_information/urls.py | Python | agpl-3.0 | 432 | 0 |
import json
import numpy as np
from bokeh.plotting import *
from bokeh.sampledata.olympics2014 import data
from bokeh.objects import ColumnDataSource
data = { d['abbr']: d['medals'] for d in data['data'] if d['medals']['total'] > 0}
# pull out just the data we care about
countries = sorted(
data.ke... | jakevdp/bokeh | sphinx/source/tutorial/solutions/olympics.py | Python | bsd-3-clause | 3,262 | 0.003679 |
from django.conf.urls import patterns, url
from rest_framework.routers import DefaultRouter
from ..boards.views import BoardHTMLView
from . import views
router = DefaultRouter()
router.register(r'cards', views.CardViewSet)
api_urlpatterns = router.urls
urlpatterns = patterns(
# Prefix
'',
url(r'^$',... | jessamynsmith/boards-backend | blimp_boards/cards/urls.py | Python | agpl-3.0 | 471 | 0 |
def f1():
while True:
x = [] | Microsoft/pxt | tests/pyconverter-test/cases/empty_array_declaration.py | Python | mit | 40 | 0.025 |
from chai import Chai
import unittest
import dfaker.common_fields as common_fields
import dfaker.tools as tools
class Test_Common_Fields(Chai):
def test_common_fields(self):
""" Test that common fields populate properly"""
name = "bolus"
datatype = {}
timestamp = tools.convert_IS... | tidepool-org/dfaker | tests/test_common_fields.py | Python | bsd-2-clause | 1,297 | 0.000771 |
import uuid
from random import randint
from django.shortcuts import render
from django.http import HttpResponseRedirect
from .models import Url
def index(request):
if request.session.has_key("has_url"):
url = request.session.get("has_url")
del request.session['has_url']
return render(req... | luisalves05/shortener-url | src/apps/miudo/views.py | Python | mit | 1,890 | 0.013757 |
from django.conf.urls import patterns, url
from views import RecaptchaRegistrationView
urlpatterns = patterns(
'', url(
r'^register/$',
RecaptchaRegistrationView.as_view(),
name='registration_register'),
)
| iksaif/euscan | euscanwww/euscan_captcha/urls.py | Python | gpl-2.0 | 236 | 0 |
# -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3... | TOC-Shard/moul-scripts | Python/tldnShroomieGate.py | Python | gpl-3.0 | 4,105 | 0.005359 |
from django.core.management import call_command
from static_precompiler.management.commands.compilestatic import get_scanned_dirs
from static_precompiler.settings import STATIC_ROOT, ROOT, OUTPUT_DIR
import pytest
import os
def test_get_scanned_dirs():
assert get_scanned_dirs() == sorted([
os.path.join(o... | paera/django-static-precompiler | static_precompiler/tests/test_management.py | Python | mit | 1,188 | 0.001684 |
import os
import subprocess
import sys
__version__ = '0.0.1'
__author__ = 'Jeroen Seegers'
__license__ = 'MIT'
HOME_DIR = os.path.expanduser('~')
HISTORY_FILE = HOME_DIR + '/.git-history.log'
def ensure_history_file():
"""Ensure the history file exists"""
if not os.path.isfile(HISTORY_FILE) and os.access(... | jeroenseegers/git-history | git_history.py | Python | mit | 1,296 | 0 |
# Generated by Django 2.2.5 on 2019-09-30 13:02
from django.db import migrations
def fix_notification_body(apps, schema_editor):
PayUNotification = apps.get_model('club', 'PayUNotification')
for n in PayUNotification.objects.filter(body__startswith='b'):
n.body = n.body[2:-1]
n.save()
class... | fnp/wolnelektury | src/club/migrations/0011_fix_notification_body.py | Python | agpl-3.0 | 585 | 0 |
"""
Plugin: Slideshow
*****************
This plugin allows you to put a slideshow on a page, automatically
displaying the selected image files with customizable transitions and
intervals.
Installation
============
To use this plugin, put ``media_tree.contrib.cms_plugins.media_tree_slideshow``
in your installed app... | bittner/django-media-tree | media_tree/contrib/cms_plugins/media_tree_slideshow/__init__.py | Python | bsd-3-clause | 903 | 0.007752 |
from distutils.core import setup
setup(
name = "nip",
version = "0.1a1",
py_modules = [
"nip",
],
scripts = [
"bin/nip",
],
author = "Brian Rosner",
author_email = "brosner@gmail.com",
description = "nip is environment isolation and installation for Node.js",
lo... | brosner/nip | setup.py | Python | mit | 461 | 0.043384 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | rwl/PyCIM | CIM15/IEC61970/Informative/InfGMLSupport/GmlFill.py | Python | mit | 6,721 | 0.002381 |
"""
Whip database storage module.
All IP ranges with associated information are stored in a LevelDB
database.
Some remarks about the construction of database records:
* The most recent version of a record is stored in full, and older dicts
are stored in a history structure of (reverse) diffs. This saves a lot
of... | wbolster/whip | whip/db.py | Python | bsd-3-clause | 12,080 | 0 |
#!/usr/bin/python2.5
#
# Copyright 2009 the Melange 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... | jamslevy/gsoc | app/soc/models/ranker_root.py | Python | apache-2.0 | 1,077 | 0.0065 |
# This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
from cherrypy.test import test
test.prefer_parent_path()
try:
from hashlib import md5
except ImportError:
# Python 2.4 and earlier
from md5 import new as md5
import... | mattsch/Sickbeard | cherrypy/test/test_auth_basic.py | Python | gpl-3.0 | 2,949 | 0.004747 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/oval_5/defs/windows/EntityStatePeSubsystemType.py | Python | gpl-3.0 | 1,004 | 0.000996 |
"""ThingCloud URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | nick6918/ThingCloud | ThingCloud/ThingCloud/urls.py | Python | mit | 2,763 | 0.001448 |
from django.conf import settings
DEFAULTS = {
'SOCIAL_CONTENT_TYPES': (
'Facebook',
'Twitter',
'Instagram',
),
'SOCIAL_CONTENT_MAX_POSTS': None,
# Facebook
'FACEBOOK_APP_ID': None,
'FACEBOOK_APP_SECRET': None,
# Twitter
'TWITTER_CONSUMER_KEY': None,
'TW... | chrisforrette/django-social-content | social_content/conf.py | Python | mit | 814 | 0 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | vlegoff/tsunami | src/secondaires/magie/editeurs/spedit/__init__.py | Python | bsd-3-clause | 9,326 | 0.002161 |
import datetime
from nose.tools import eq_, ok_
from django.conf import settings
from django.test import TestCase
from crashstats.crashstats import forms
class TestForms(TestCase):
def setUp(self):
# Mocking models needed for form validation
self.current_products = {
'Firefox': [],
... | AdrianGaudebert/socorro-crashstats | crashstats/crashstats/tests/test_forms.py | Python | mpl-2.0 | 12,838 | 0 |
from flask import Blueprint, request, render_template, jsonify
from housesGenerator import House
from holdings import Holdings
houses = Blueprint('houses', __name__, url_prefix='/houses')
@houses.route('/')
def index():
return render_template('houses.html')
@houses.route('/houseGenerator', methods=['GET', 'POS... | ondoheer/GOT-Platform | app/houses/views.py | Python | gpl-2.0 | 723 | 0 |
#!/usr/bin/env python
from __future__ import print_function
################################################################################
#
#
# drmaa_wrapper.py
#
# Copyright (C) 2013 Leo Goodstadt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associa... | magosil86/ruffus | ruffus/drmaa_wrapper.py | Python | mit | 18,668 | 0.013285 |
#
# Copyright (c) 2017-Present Pivotal Software, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | pivotal-partner-solution-architecture/pcf-gcp-python | pcfgcp/pcfgcp.py | Python | apache-2.0 | 5,039 | 0.004366 |
from django.db.backends.creation import NO_DB_ALIAS
from django.db.backends.postgresql_psycopg2.base import DatabaseWrapper as Psycopg2DatabaseWrapper
from django.contrib.gis.db.backends.postgis.creation import PostGISCreation
from django.contrib.gis.db.backends.postgis.introspection import PostGISIntrospection
from dj... | 912/M-new | virtualenvironment/experimental/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py | Python | gpl-2.0 | 1,002 | 0.001996 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import sys
import logging
from warnings import warn
import six
from scss.ast import Literal
from scss.cssdefs import _expr_glob_re, _interpolate_re
from scss.errors import SassError, SassEvaluationErr... | cpfair/pyScss | scss/calculator.py | Python | mit | 6,935 | 0.000433 |
class Card:
count = 0
url = ""
name = ""
sideboard = -1 | Riizade/Magic-the-Gathering-Analysis | card.py | Python | mit | 71 | 0.014085 |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/resultset.py | Python | gpl-3.0 | 6,557 | 0.00122 |
# Copyright 2014 NEC Corporation. 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 ... | zhimin711/nova | nova/api/openstack/compute/schemas/migrate_server.py | Python | apache-2.0 | 1,742 | 0 |
# -*- coding: utf-8 -*-
"""INI temporal mean rate simulator with Tensorflow backend.
This module defines the layer objects used to create a spiking neural network
for our built-in INI simulator
:py:mod:`~snntoolbox.simulation.target_simulators.INI_temporal_mean_rate_target_sim`.
The coding scheme underlying this conv... | NeuromorphicProcessorProject/snn_toolbox | snntoolbox/simulation/backends/inisim/temporal_mean_rate_tensorflow.py | Python | mit | 28,900 | 0 |
# -*- coding:utf-8 -*-
# Copyright (c) 2013, Theo Crevon
# Copyright (c) 2013, Greg Leclercq
#
# See the file LICENSE for copying permission.
from itertools import groupby
from swf.models.event import EventFactory, CompiledEventFactory
from swf.models.event.workflow import WorkflowExecutionEvent
from swf.utils impor... | botify-labs/python-simple-workflow | swf/models/history/base.py | Python | mit | 7,957 | 0.000628 |
from fitensemble import belt
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import ALA3
import experiment_loader
grid = itertools.product(ALA3.ff_list, ALA3.prior_list)
bayesian_bootstrap_run = 0
for k, (ff, prior) in enumerate(grid):
print(ff, prior)
regulariz... | kyleabeauchamp/EnsemblePaper | code/figures/plot_MCMC_traces.py | Python | gpl-3.0 | 1,098 | 0.004554 |
"""
platformer.py
Author: Brian S
Credit: Finn H
Assignment:
Write and submit a program that implements the sandbox platformer game:
https://github.com/HHS-IntroProgramming/Platformer
"""
from ggame import App, Color, LineStyle, Sprite, RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset, ImageAsset, Frame
SCREEN_... | brianseltzer1738/Platformer | platformer.py | Python | mit | 4,532 | 0.007061 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# au... | fflewddur/python-phash | docs/conf.py | Python | cc0-1.0 | 8,370 | 0.007407 |
from greencouriers.tests import *
class TestCourierController(TestController):
def test_index(self):
response = self.app.get(url(controller='courier', action='index'))
# Test response...
| guyromm/greencouriers | greencouriers/tests/functional/test_courier.py | Python | gpl-3.0 | 209 | 0.004785 |
"""
Copyright (c) 2012 Casey Dunham <casey.dunham@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | caseydunham/tweet-dump | tweet-dump.py | Python | mit | 5,740 | 0.005401 |
# proxy module
from __future__ import absolute_import
from envisage.resource.resource_manager import *
| enthought/etsproxy | enthought/envisage/resource/resource_manager.py | Python | bsd-3-clause | 103 | 0 |
# Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | mhrivnak/pulp | client_consumer/pulp/client/consumer/config.py | Python | gpl-2.0 | 4,554 | 0.001976 |
#-
# Copyright (c) 2014 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... | 8l/beri | cheritest/trunk/tests/cp2/test_cp2_x_cincoffset_sealed.py | Python | apache-2.0 | 2,058 | 0.003887 |
from datetime import datetime, date, time, timedelta
from decimal import Decimal
SECRET_KEY = 'cheese'
MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.Authe... | jezdez/django-constance | tests/settings.py | Python | bsd-3-clause | 3,003 | 0 |
"""
URLconf for registration and activation, using django-registration's
default backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.default.urls')),
... | unomena/django-1.8-registration | registration/backends/default/urls.py | Python | bsd-3-clause | 2,086 | 0.000959 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Scott Kirkwood. All Rights Reserved.
"""
Build everything for mm2s5.
You'll need:
sudo apt-get install alien help2man fakeroot lintian
Also python-bdist
"""
from pybdist import pybdist
import optparse
import setup
def main():
parser = optparse.OptionPars... | scottkirkwood/mm2s5 | build_all.py | Python | apache-2.0 | 556 | 0.01259 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Cost Center') | mahabuber/erpnext | erpnext/accounts/doctype/cost_center/test_cost_center.py | Python | agpl-3.0 | 236 | 0.004237 |
# -*- coding: utf-8 -*-
__author__ = 'itconsense@gmail.com'
from collections import OrderedDict
from math import pi
from Products.Five import BrowserView
from plone import api
import base64
import logging
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import six
LOG = logging.getLogger('eva... | tomgross/pp-site | src/itc.pptheme/itc/pptheme/browser/view.py | Python | apache-2.0 | 4,725 | 0.001058 |
from django.contrib import admin
from django.conf import settings
from geonode.base.models import (TopicCategory, SpatialRepresentationType,
Region, RestrictionCodeType, ContactRole, ResourceBase, Link, License, Thumbnail)
class LicenseAdmin(admin.ModelAdmin):
model = License
list_display = ('id', 'name')... | mishravikas/geonode-cas | geonode/base/admin.py | Python | gpl-3.0 | 4,283 | 0.008872 |
############################################################################
##
## Copyright (C) 2006-2008 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... | Nikea/VisTrails | contrib/cdat/scripts/init_inc.py | Python | bsd-3-clause | 1,823 | 0.012068 |
import data
from utils import assert_403, assert_404, assert_200, parse_xml, xpath
PRD = 'prd'
def test_sharing(IndivoClient):
DS = 'ds'
def get_datastore(obj):
if hasattr(obj, DS):
return getattr(obj, DS).values()
return False
def set_datastore(obj, **kwargs):
if hasattr(obj, DS):
d... | newmediamedicine/indivo_server_1_0 | indivo/tests/integration/test_modules/sharing.py | Python | gpl-3.0 | 7,841 | 0.01658 |
import re
import time
import isodate
import requests
from cloudbot import hook
from cloudbot.util import timeformat
from cloudbot.util.formatting import pluralize
from cloudbot.util.colors import parse
youtube_re = re.compile(r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)([-_a-zA-Z0-9]+)', re.I)
base_url... | paris-ci/CloudBot | plugins/youtube.py | Python | gpl-3.0 | 6,992 | 0.003581 |
# coding: utf-8
# 
# # **Click-Through Rate Prediction Lab**
# #### This lab covers the steps for creating a click-through rate (CTR) prediction pipeline. You will work with the [Criteo Labs](http://labs.criteo.com/) dataset that was us... | eusebioaguilera/scalablemachinelearning | Lab04/ML_lab4_ctr_student.py | Python | gpl-3.0 | 54,867 | 0.004903 |
# coding:utf-8
'''
Author : qbeenslee
Created : 15/4/3
'''
UID = 'uid'
TOKEN = 'token'
CLIENT = 'client'
DESCRIPTION = 'description'
EMAIL = 'email'
WHAT = 'what'
IMEI = 'imei'
USERNAME = 'nickname'
PWD = 'pwd'
IMAGE_FILES = 'imagefiles'
MSG = 'msg'
VERSION = 'version'
URL = 'url'
NICKNAME = 'nickname'
MOTTO = 'motto'... | qbeenslee/Nepenthes-Server | config/param.py | Python | gpl-3.0 | 728 | 0.002747 |
#!/usr/bin/env python3
"""
Single-threaded HTTP server that extracts article's HTML from a full page HTML.
Accepts POST requests to "/extract" endpoint with body JSON:
{
"html": "<html><title>Title</title><body><p>Paragraph.</p></html>"
}
On success, returns HTTP 200 and extracted HTML:
{
... | berkmancenter/mediacloud | apps/extract-article-from-page/bin/extract_article_from_page_http_server.py | Python | agpl-3.0 | 5,416 | 0.000554 |
VERSION = '0.3.4'
| jarpy/lambkin | lambkin/version.py | Python | apache-2.0 | 18 | 0 |
"""passlib.ext.django.models -- monkeypatch django hashing framework"""
#=============================================================================
# imports
#=============================================================================
# core
import logging; log = logging.getLogger(__name__)
from warnings import wa... | charukiewicz/beer-manager | venv/lib/python3.4/site-packages/passlib/ext/django/models.py | Python | mit | 12,558 | 0.002787 |
#!/usr/bin/env python3
import torch
from torch.distributions.kl import kl_divergence
from ..distributions import Delta, MultivariateNormal
from ..lazy import MatmulLazyTensor, SumLazyTensor
from ..utils.errors import CachingError
from ..utils.memoize import pop_from_cache_ignore_args
from .delta_variational_distribut... | jrg365/gpytorch | gpytorch/variational/batch_decoupled_variational_strategy.py | Python | mit | 11,612 | 0.004134 |
from . import *
class TestTemplateUse(TestCase):
def test_resized_img_src(self):
@self.app.route('/resized_img_src')
def use():
return render_template_string('''
<img src="{{ resized_img_src('cc.png') }}" />
'''.strip())
res = self.client.get('/re... | knadir/Flask-Images | tests/test_template_use.py | Python | bsd-3-clause | 780 | 0 |
import numpy as np
from scipy.signal import medfilt
import manager.operations.method as method
from manager.operations.methodsteps.confirmation import Confirmation
from manager.exceptions import VoltPyNotAllowed
class MedianFilter(method.ProcessingMethod):
can_be_applied = True
_steps = [
{
... | efce/voltPy | manager/operations/methods/MedianFilter.py | Python | gpl-3.0 | 1,485 | 0.00202 |
docs = """django-angular-scaffold
=======================
[](https://travis-ci.org/mc706/django-angular-scaffold)
[](http://badge.fury.io/py/django-angular-scaffold... | mc706/django-angular-scaffold | angular_scaffold/_docs.py | Python | mit | 4,321 | 0.00648 |
"""
Copyright (c) 2016 - Sean Bailey - All Rights Reserved
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... | LuckehPickle/Comet | docs/categories.py | Python | apache-2.0 | 2,173 | 0.02347 |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Terminal emulation tools"""
import os
class ANSIEscapeCodeHandler(object):
"""ANSI Escape sequences handler"""
if os.name == 'nt':
#... | jromang/retina-old | distinclude/spyderlib/widgets/sourcecode/terminal.py | Python | gpl-3.0 | 4,314 | 0.007651 |
from __future__ import absolute_import
import six
import inspect
from sentry import projectoptions
from sentry.grouping.component import GroupingComponent
from sentry.grouping.enhancer import Enhancements
STRATEGIES = {}
RISK_LEVEL_LOW = 0
RISK_LEVEL_MEDIUM = 1
RISK_LEVEL_HIGH = 2
def strategy(id=None, ids=None... | beeftornado/sentry | src/sentry/grouping/strategies/base.py | Python | bsd-3-clause | 10,151 | 0.001084 |
# -*- coding: utf8 -*-
from .interface import Reliability, Session, Handler
from .logger import LogName
from .server import Server
from .protocol import Protocol, packet_classes
from .packet import ApplicationPacket
from .portscanner import PortScanner
__all__ = [
'Reliability',
'Session',
'Handler',
... | nosix/PyCraft | src/pycraft/network/__init__.py | Python | lgpl-3.0 | 433 | 0.002309 |
'''@file standard_trainer.py
contains the StandardTrainer'''
from nabu.neuralnetworks.trainers import trainer
class StandardTrainer(trainer.Trainer):
'''a trainer with no added functionality'''
def aditional_loss(self):
'''
add an aditional loss
returns:
the aditional los... | vrenkens/nabu | nabu/neuralnetworks/trainers/standard_trainer.py | Python | mit | 844 | 0.001185 |
#!/usr/bin/env python
# normalDate.py - version 1.0 - 20000717
#hacked by Robin Becker 10/Apr/2001
#major changes include
# using Types instead of type(0) etc
# BusinessDate class
# __radd__, __rsub__ methods
# formatMS stuff
# derived from an original version created
# by Jeff Bauer of Rubicon Research and us... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/reportlab/lib/normalDate.py | Python | gpl-3.0 | 20,867 | 0.005367 |
# Since bkr is a namespace package (and thus cannot have version specific
# code in bkr.__init__), the version details are retrieved from here in
# order to correctly handle module shadowing on sys.path
__version__ = '28.2'
| beaker-project/beaker | Common/bkr/common/__init__.py | Python | gpl-2.0 | 225 | 0 |
"""Tests for `fix.with_fixture`."""
from __future__ import with_statement
import os
import shutil
import tempfile
from types import FunctionType
from fix import with_fixture
def test_exists():
"""`fix.with_fixture` function exists"""
assert isinstance(with_fixture, FunctionType)
def test_setup_only():
... | schesis/fix | tests/decorators/test_with_fixture.py | Python | gpl-3.0 | 3,536 | 0 |
from __future__ import unicode_literals
from . import responses
url_bases = [
"https://route53.amazonaws.com/201.-..-../",
]
url_paths = {
'{0}hostedzone$': responses.list_or_create_hostzone_response,
'{0}hostedzone/[^/]+$': responses.get_or_delete_hostzone_response,
'{0}hostedzone/[^/]+/rrset/?$': re... | silveregg/moto | moto/route53/urls.py | Python | apache-2.0 | 565 | 0.00177 |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticati... | ccxt/ccxt | python/ccxt/bitget.py | Python | mit | 117,797 | 0.003466 |
from django.db import models
from django.contrib.auth.models import User
class OdooUser(models.Model):
user = models.OneToOneField(User)
odoo_id = models.BigIntegerField(primary_key=True)
username = models.CharField(max_length=256)
| JulienDrecq/django-odoo-auth | odoo_auth/models.py | Python | bsd-3-clause | 246 | 0 |
TWITTER_BUTTON = """
<a href="https://twitter.com/igor_chubin" class="twitter-follow-button" data-show-count="false" data-button="grey">Follow @igor_chubin</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.... | chubin/cheat.sh | lib/buttons.py | Python | mit | 1,461 | 0.004791 |
#########
# Notes #
#########
#
# Run all tests from command line
# python test.py
# python -m test
#
# Run subset of tests from command line
# python -m unittest ArchivTest
# python -m unittest ArchivTest.test_old_arxiv_id
#
# Run all tests non-interactively from REPL
# import test; test.test()
#
# Run... | gnovak/overheard | overheard/test.py | Python | mit | 12,458 | 0.004816 |
# -*- coding: utf-8 -*-
"""Git tools."""
from shlex import split
from plumbum import ProcessExecutionError
from plumbum.cmd import git
DEVELOPMENT_BRANCH = "develop"
def run_git(*args, dry_run=False, quiet=False):
"""Run a git command, print it before executing and capture the output."""
command = git[split... | andreoliw/clitoolkit | clit/git.py | Python | bsd-3-clause | 899 | 0 |
def extractDevastatranslationsWordpressCom(item):
'''
Parser for 'devastatranslations.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'tra... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractDevastatranslationsWordpressCom.py | Python | bsd-3-clause | 578 | 0.032872 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsTextBlock.
Run with: ctest -V -R QgsTextBlock
.. 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 Software Foundation; either version 2 of the License, or
(at your... | pblottiere/QGIS | tests/src/python/test_qgstextblock.py | Python | gpl-2.0 | 2,937 | 0 |
class InvalidDeviceType(Exception):
pass
| ohaut/ohaut-core | ohaut/exceptions.py | Python | gpl-3.0 | 46 | 0 |
from django.test import TestCase
from common.templatetags.verbose_name import verbose_name
from users.models import SystersUser
class TemplateTagsTestCase(TestCase):
def test_verbose_names(self):
"""Test verbose_name template tag"""
self.assertEqual(verbose_name(SystersUser, "homepage_url"), "Hom... | willingc/portal | systers_portal/common/tests/test_templatetags.py | Python | gpl-2.0 | 328 | 0 |
" Userman: Dump the database into a JSON file."
import json
import tarfile
from cStringIO import StringIO
from userman import utils
from userman import constants
def dump(db, filename):
"""Dump contents of the database to a tar file, optionally compressed.
Return the number of items, and the number of attac... | pekrau/userman | userman/dump.py | Python | mit | 3,017 | 0.000994 |
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... | googleinterns/e2e-convrec | trainer/preprocessing.py | Python | apache-2.0 | 5,116 | 0.007428 |
# -*- coding: utf-8 -*-
"""
Amavis management frontend.
Provides:
* SQL quarantine management
* Per-domain settings
"""
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy
from modoboa.admin.models import Domain
from modoboa.core.extensions import ModoExtension, exts_pool
f... | modoboa/modoboa-amavis | modoboa_amavis/modo_extension.py | Python | mit | 1,395 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: mcxiaoke
# @Date: 2018-01-26
from __future__ import print_function, unicode_literals, absolute_import
import json
import sys
import os
import re
import time
import shutil
import random
import mimetypes
import imghdr
import traceback
import json
import redis
im... | mcxiaoke/python-labs | scripts/wechat_upload.py | Python | apache-2.0 | 8,692 | 0.00115 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
import pickle
import json
from fanpy import Fanfou, FanfouHTTPError, NoAuth
from fanpy.api import FanfouDictResponse, FanfouListResponse, POST_ACTIONS, method_for_uri
noauth = NoAuth()
fanfou_na = Fanfou(auth=noauth)
AZaz = 'abcdefghijklm... | mookrs/fanpy | tests/test_sanity.py | Python | mit | 1,473 | 0.000679 |
#!/usr/bin/env python3
# Copyright (c) 2017-2019 The Particl Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_particl import (
ParticlTestFramework,
isclose,
)
from test_framework.me... | particl/particl-core | test/functional/feature_part_smsgpaidfee_ext.py | Python | mit | 4,260 | 0.003286 |
import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
def _transpose(xs, length):
xp = cuda.get_array_module(*xs)
lengths = numpy.zeros(length, dtype='i')
for i, x in enumerate(xs):
lengths[0:len(x)] = i + 1
dtype = xs[0].dtype
unit = xs[0... | benob/chainer | chainer/functions/array/transpose_sequence.py | Python | mit | 1,673 | 0.000598 |
# -*- encoding: utf-8 -*-
'''
:maintainer: HubbleStack
:maturity: 2016.7.0
:platform: Windows
:requires: SaltStack
'''
from __future__ import absolute_import
import copy
import fnmatch
import logging
import salt.utils
import salt.utils.platform
from salt.exceptions import CommandExecutionError
from distutils.version... | hubblestack/hubble-salt | hubblestack_nova/win_pkg.py | Python | apache-2.0 | 8,165 | 0.003062 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.