code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | gangadhar-kadam/sms-erpnext | accounts/search_criteria/sales_register/sales_register.py | Python | agpl-3.0 | 2,756 |
import os
import tempfile
import numpy as np
from numpy.testing import assert_equal, raises, assert_allclose
from skimage import novice
from skimage.novice._novice import (array_to_xy_origin, xy_to_array_origin,
rgb_transpose)
from skimage import data_dir
from skimage._shared.utils ... | youprofit/scikit-image | skimage/novice/tests/test_novice.py | Python | bsd-3-clause | 8,082 |
import activity
from boto.s3.key import Key
from boto.s3.connection import S3Connection
import requests
from provider import eif as eif_provider
"""
RewriteEIF.py activity
"""
class activity_RewriteEIF(activity.activity):
def __init__(self, settings, logger, conn=None, token=None, activity_task=None):
ac... | jhroot/elife-bot | activity/activity_RewriteEIF.py | Python | mit | 2,429 |
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | mcloudv/fuel-ostf | fuel_plugin/ostf_adapter/nose_plugin/nose_utils.py | Python | apache-2.0 | 7,327 |
# -*- coding: utf-8 -*-
"""
Package of failing integer functions.
"""
from metaopt.objective.integer.failing.f import f as f
from metaopt.objective.integer.failing.g import f as g
FUNCTIONS_FAILING = [f, g]
| cigroup-ol/metaopt | metaopt/objective/integer/failing/__init__.py | Python | bsd-3-clause | 209 |
# -*- coding: utf-8 -*-
#
# 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
#... | owlabs/incubator-airflow | tests/contrib/operators/test_redis_publish_operator.py | Python | apache-2.0 | 2,312 |
from websocket_lib.websocket import WebSocket
from websocket_lib.state import State
from websocket_lib.status_code import StatusCode
"""
Example of usage with the web socket library
"""
class WebSocketExample(WebSocket):
# Variables for use of server
ip_address = "127.0.0.1"
port_number = 3001
backlo... | ingunnsund/Python-WebSocket | example/server/websocket_example.py | Python | mit | 1,552 |
'''extra statistical function and helper functions
contains:
* goodness-of-fit tests
- powerdiscrepancy
- gof_chisquare_discrete
- gof_binning_discrete
Author: Josef Perktold
License : BSD-3
changes
-------
2013-02-25 : add chisquare_power, effectsize and "value"
'''
from statsmodels.compat.python import r... | phobson/statsmodels | statsmodels/stats/gof.py | Python | bsd-3-clause | 16,799 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.forms import models
from ..models import Credential
from util import make_db_random_password
LOG = logging.getLogger(__name__)
class CredentialForm(models.ModelForm):
def __init__(self, *args, **kwargs):
... | globocom/database-as-a-service | dbaas/logical/forms/credential.py | Python | bsd-3-clause | 608 |
#!/usr/bin/env python3
"""
Created on 20 Jun 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_dfe.interface.interface_conf import InterfaceConf
from scs_host.sys.host import Host
# ---------------------------------------------------------------------------------------------------------... | south-coast-science/scs_dfe_eng | tests/interface/interface_conf_test.py | Python | mit | 463 |
# coding: utf-8
import gevent.monkey
gevent.monkey.patch_all()
import os
import sys
from flask.ext.script import Manager
from Qingblog.app import create_app
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
LOG_FILE = os.path.join(ROOT_DIR, 'data', 'profile.log')
app = create_app()
manager = Manag... | harveyqing/Qingblog | manage.py | Python | mit | 1,520 |
from django.core.files.uploadedfile import SimpleUploadedFile
# Produce a small red dot
IMG_FILE = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
def get_dummy_img():
return IMG_FILE.decode('base64')
def get_dummy_uploaded_image(name='dummy_... | camillemonchicourt/Geotrek | geotrek/common/utils/testdata.py | Python | bsd-2-clause | 709 |
from django.contrib.sites.models import Site
from django.conf import settings
from django.db.models import get_model
from django.utils.translation import ugettext_lazy as _
from oscar.apps.shipping.methods import Free
from oscar.apps.order.exceptions import UnableToPlaceOrder
from oscar.core.loading import get_class
... | michaelBenin/django-oscar | oscar/apps/order/utils.py | Python | bsd-3-clause | 10,663 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, tim... | yeyanchao/calibre | src/calibre/gui2/threaded_jobs.py | Python | gpl-3.0 | 8,038 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from distutils.core import setup
from glob import glob
import os
import sys
from stgit import commands, version
from stgit.completion.bash import write_bash_completion
from stgit.completion... | ctmarinas/stgit | setup.py | Python | gpl-2.0 | 5,157 |
import agents as ag
def HW2Agent() -> object:
"An agent that keeps track of what locations are clean or dirty."
oldPercepts = [('None', 'Clean', 0, 0, 0,0, 'notFoundLeft', 'notFoundTop', 'notFoundRight', 'notFoundBottom', 'firstMove', 'middle')]
oldActions = ['NoOp']
def program(percept):
"Sa... | austinban/aima-python | submissions/Ottenlips/vacuum2.py | Python | mit | 3,489 |
# -*- coding: utf-8 -*-
"""Setup file for easy installation"""
from os.path import join, dirname
from setuptools import setup
version = __import__('social_auth').__version__
LONG_DESCRIPTION = """
Django Social Auth is an easy to setup social authentication/registration
mechanism for Django projects.
Crafted using ... | thesealion/django-social-auth | setup.py | Python | bsd-3-clause | 1,851 |
'''
A collection of twisted utility code
'''
from twisted.cred import portal, checkers
from twisted.conch import manhole, manhole_ssh
from twisted.conch.insults import insults
def InstallManagementConsole(namespace, users={'admin':'admin'}, port=503):
''' Helper method to start an ssh management console
fo... | museumvictoria/nodel-recipes | Advantech ADAM 6050 6060 relay module/legacy/pymodbus/internal/ptwisted.py | Python | mit | 1,478 |
from __future__ import unicode_literals
import logging
import sys
import types
import warnings
from django import http
from django.conf import settings
from django.core import signals
from django.core.exceptions import (
MiddlewareNotUsed, PermissionDenied, SuspiciousOperation,
)
from django.db import connections... | yephper/django | django/core/handlers/base.py | Python | bsd-3-clause | 13,338 |
# -*- coding: utf-8 -*-
from cwr.record import TransactionRecord
"""
Acknowledgement entity model classes.
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class AcknowledgementRecord(TransactionRecord):
"""
Represents a CWR Acknowledgement of Transaction (ACK).
... | weso/CWR-DataApi | cwr/acknowledgement.py | Python | mit | 11,084 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orb', '0030_auto_20160907_1547'),
]
operations = [
migrations.AlterField(
model_name='tag',
name='na... | mPowering/django-orb | orb/migrations/0031_auto_20160909_1450.py | Python | gpl-3.0 | 1,078 |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import A... | kinow-io/kinow-python-sdk | test/test_registration_field.py | Python | apache-2.0 | 787 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import http.client
import httplib2
import os, random, sys, time
from threading import Lock
from . import fileutil
from apiclient.discovery import build
from apiclient.errors import HttpError
from apiclient.http import MediaFileUpload
from oauth2client.client import flow_f... | setminami/TokageUtil | util/y2butil.py | Python | apache-2.0 | 15,689 |
# -*- coding: utf-8 -*-
"""
Inventory Management
A module to record inventories of items at a locations (sites),
including Warehouses, Offices, Shelters & Hospitals
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabl... | anubhav929/eden | controllers/inv.py | Python | mit | 71,961 |
import os
import time
import re
from slackbot.slackbot import SlackBot
from eventbrite import Eventbrite
# Create bot as subclass of SlackBot
class EventbriteBot(SlackBot):
"""
A class for connecting to Eventbrite via Slack.
"""
# constants
WHAT_COMMAND = "what"
ARE_COMMAND = "are"
WHERE_COMMAND = "whe... | andrewsage/slackbot | examples/eventbritebot.py | Python | mit | 3,587 |
#!/usr/bin/env python
#
# Copyright 2016 Google 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 require... | dougfelt/nototools | nototools/mti_cmap_data.py | Python | apache-2.0 | 8,449 |
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility class to build the omaha master BuildFactory's.
Based on gclient_factory.py and adds omaha-specific steps."""
from master.factory import oma... | eunchong/build | scripts/master/factory/omaha_factory.py | Python | bsd-3-clause | 1,936 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import re
from dat... | Rafiot/logbook | scripts/make-release.py | Python | bsd-3-clause | 4,069 |
import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_list()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.allphones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
def clear(s):
return ... | kKhilko/python_training | test/test_phones.py | Python | apache-2.0 | 795 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import random
from threading import Thread
import zmq
def worker_a(context):
worker = context.socket(zmq.DEALER)
worker.setsockopt(zmq.IDENTITY, 'A')
worker.connect("ipc://routing.ipc")
total = 0
while True:
# We receive one part,... | bjorskog/majordomo | majordomo/tests/rd_test.py | Python | bsd-3-clause | 1,561 |
#!/usr/bin/env python
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
import os
import sys
from typing import List
from kitty.cli import parse_args
from kitty.cli_stub import ShowKeyCLIOptions
from kittens.tui.operations import raw_mode, styled
ctrl_keys = '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'... | kovidgoyal/kitty | kittens/show_key/main.py | Python | gpl-3.0 | 2,252 |
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | johnwallace123/dx-toolkit | src/python/dxpy/cli/workflow.py | Python | apache-2.0 | 11,696 |
from compliance_checker.ioos import IOOS0_1Check, IOOS1_1Check
from compliance_checker.tests.resources import STATIC_FILES
from compliance_checker.tests import BaseTestCase
from netCDF4 import Dataset
import os
class TestIOOS0_1(BaseTestCase):
'''
Tests for the IOOS Inventory Metadata v0.1
'''
def se... | DanielJMaher/compliance-checker | compliance_checker/tests/test_ioos_profile.py | Python | apache-2.0 | 10,600 |
from PyQt5 import QtGui
import pyqtgraph as pg
from ocelot.cpbd.elements import *
from app.parser import *
from app.ui_forms.widgets.tune_panel import *
class LatticeElementsPics():
def __init__(self, lattice):
self.scale = 1.0
self.h_drift = 0.01
self.lattice = lattice
... | ocelot-collab/ocelot | ocelot_gui/app/functions/calc_lattice_element_pics.py | Python | gpl-3.0 | 7,625 |
class Solution(object):
def numTrees(self, n):
"""
:type n: int
:rtype: int
"""
if n <= 1: return 1
nt = [0] * (n+1)
nt[0] = 1
nt[1] = 1
for i in xrange(2, n+1):
# i numbers
total = 0
for k in xrange(i):
# let kth number be the root, left has k numbers, right has i-k-1 numbers
total... | xiaonanln/myleetcode-python | src/96. Unique Binary Search Trees.py | Python | apache-2.0 | 560 |
import argparse
import logging
import os
from pprint import pprint
from resello import ReselloClient
import sys
def init_parser(description):
"""
Initialize arg parser.
"""
parser = argparse.ArgumentParser(
description=description
)
parser.add_argument('--debug', dest='debug', action='... | duct-tape/resello | examples/examples_shared.py | Python | bsd-3-clause | 2,114 |
# QTLAB class for remote access of an TIP temperature control server,
# Author: HR @ KIT 2011
import qkit
from qkit.core.instrument_base import Instrument
import socket
import time
import types
from numpy import arange, size, linspace, sqrt, ones, delete, append, argmin, array, abs
import logging
import six
try:
i... | qkitgroup/qkit | qkit/drivers/tip_client.py | Python | gpl-2.0 | 10,524 |
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
def conf_matrix(p,labels,names=['1','0'],threshold=.5,show=True):
"""
Returns error rate and true/false positives in a binary classification problem
- Actual classes are displ... | TianpeiLuke/GPy | GPy/util/classification.py | Python | bsd-3-clause | 1,484 |
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from poster.migrations import metadata
from poster.users.enums import UserGender
__all__ = ['users', 'gender_enum', ]
gender_enum = postgresql.ENUM(UserGender)
users = sa.Table(
'users', metadata,
sa.Column('id', sa.Integer, primary_key=T... | jsandovalc/poster | poster/users/tables.py | Python | agpl-3.0 | 684 |
#!/usr/bin/env python
'''
pySLSQP - A Python pyOpt interface to SLSQP.
Copyright (c) 2008-2013 by pyOpt Developers
All rights reserved.
Revision: 1.2 $Date: 21/06/2010 21:00$
Tested on:
---------
Linux with g77
Linux with gfortran
Linux with pathf95
Win32 with g77
Mac with g95
Developers:
-----------
- Dr. Ruben ... | hschilling/pyOpt | pyOpt/pySLSQP/pySLSQP.py | Python | gpl-3.0 | 14,674 |
# Copyright (C) 2016 Red Hat, Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in ... | cooktheryan/commissaire | test/test_script.py | Python | gpl-3.0 | 6,433 |
# 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... | frreiss/tensorflow-fred | tensorflow/python/framework/test_util.py | Python | apache-2.0 | 128,647 |
#!/usr/bin/env python
# Copyright (c) 2005 Gavin E. Crooks <gec@threeplusone.com>
#
# This software is distributed under the MIT Open Source License.
# <http://www.opensource.org/licenses/mit-license.html>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and as... | JohnReid/bioinf-utilities | python/corebio/seq_io/fasta_io.py | Python | mit | 7,820 |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | jmcnamara/XlsxWriter | xlsxwriter/test/comparison/test_rich_string12.py | Python | bsd-2-clause | 1,187 |
from model.flyweight import Flyweight
from model.static.database import database
class MetaGroup(Flyweight):
def __init__(self,meta_group_id):
#prevents reinitializing
if "_inited" in self.__dict__:
return
self._inited = None
#prevents reinitializing
self.meta_g... | Iconik/eve-suite | src/model/static/inv/meta_group.py | Python | gpl-3.0 | 684 |
from .LeagueEndpoint import LeagueEndpoint
class SpecatorV4Endpoint(LeagueEndpoint):
def __init__(self, url, **kwargs):
nurl = f"/spectator/v4{url}"
super().__init__(nurl, **kwargs)
class SpectatorApiV4Urls:
by_summoner = SpecatorV4Endpoint(
"/active-games/by-summoner/{encrypted_summ... | pseudonym117/Riot-Watcher | src/riotwatcher/_apis/league_of_legends/urls/SpectatorApiUrls.py | Python | mit | 395 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
# ... | SKIRT/PTS | magic/config/find_extended.py | Python | agpl-3.0 | 5,377 |
import process
import os
if __name__ == '__main__':
datadir = os.path.join('..', 'data')
resultdir = os.path.join('..', 'result')
src_lists = ['Big_City_Lights', 'Hall', 'High_Five', 'Izmir_Harbor', 'The_Marble_Hall']
for src in src_lists:
print('processing {}'.format(src))
process.pr... | GUG11/HDR | python/batch.py | Python | gpl-3.0 | 351 |
from gettext import gettext as _
from gi.repository import Gio, Gtk
from lutris import settings
from lutris.gui.widgets.common import VBox
class PreferencesBox(VBox):
settings_options = {
"hide_client_on_game_start": _("Minimize client when a game is launched"),
"hide_text_under_icons": _("Hide ... | lutris/lutris | lutris/gui/config/preferences_box.py | Python | gpl-3.0 | 2,320 |
# Copyright (C) 2008-2010 Adam Olsen
# Copyright (C) 2014-2015 Dustin Spicuzza
#
# 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, or (at your option)
# any later version.
#
# Th... | strahlc/exaile | xl/player/engine.py | Python | gpl-2.0 | 6,100 |
#!/usr/bin/env python3
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
import argparse
import logging
import sys
import os
# our own packages
sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../ext/velib_python'))
from dbusdummyservice import DbusDummyService
from logger import ... | victronenergy/dbus-systemcalc-py | scripts/dummygenset.py | Python | mit | 2,123 |
import pytest
import hubcheck
pytestmark = [ pytest.mark.website,
pytest.mark.reboot,
pytest.mark.upgrade,
pytest.mark.prod_safe_upgrade
]
class TestHubLogin(hubcheck.testcase.TestCase2):
def setup_method(self,method):
self.username,self.userpa... | codedsk/hubcheck-hubzero-tests | hchztests/tests/test_website_login.py | Python | mit | 1,990 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2021 GEM Foundation
#
# OpenQuake 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, either version 3 of the License, o... | gem/oq-engine | openquake/hazardlib/gsim/morikawa_fujiwara_2013.py | Python | agpl-3.0 | 14,534 |
# 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... | Mazecreator/tensorflow | tensorflow/contrib/data/python/kernel_tests/batch_dataset_op_test.py | Python | apache-2.0 | 18,298 |
import re
from abidria.exceptions import InvalidEntityException, NoLoggedException, NoPermissionException, \
EntityDoesNotExistException
class ClientSecretKeyValidator:
def __init__(self, valid_client_secret_key):
self.valid_client_secret_key = valid_client_secret_key
def validate(self, cli... | jordifierro/abidria-api | people/validators.py | Python | mit | 3,285 |
#!/usr/bin/env python
# coding=utf-8
"""This script uploads a plugin package on the server.
Authors: A. Pasotti, V. Picavet
"""
from future import standard_library
import sys
import getpass
import xmlrpc.client
from optparse import OptionParser
from builtins import input
standard_library.install_aliases()
# Confi... | kartoza/stream_feature_extractor | plugin_upload.py | Python | gpl-2.0 | 4,054 |
from __future__ import division
import numpy as np
import multiprocessing as mp
import logging
import util.scrm as scrm
from smcpp.util import sawtooth, human, truncated_sfs
from smcpp.model import PiecewiseModel
from smcpp import _smcpp
np.set_printoptions(suppress=False, linewidth=120)
theta = 1.25e-8
def _scrm_s... | terhorst/psmcpp | test/unit/test_truncated_sfs.py | Python | gpl-3.0 | 1,220 |
from __future__ import absolute_import, division, print_function
from twisted.web.client import Agent
from treq.client import HTTPClient
from treq._utils import default_pool, default_reactor
def head(url, **kwargs):
"""
Make a ``HEAD`` request.
See :py:func:`treq.request`
"""
return _client(**k... | mithrandi/treq | src/treq/api.py | Python | mit | 3,394 |
#!/usr/bin/python
#coding:utf-8
import xml.etree.ElementTree as ET
xml_data="""
<deals>
<data>
<deal>
<deal_id>11111111</deal_id>
<sales_num>120</sales_num>
<price>15.0</price>
</deal>
</data>
</deals>
"""
xml_data1="""
<data>
... | gensmusic/test | l/python/test/xml/xml-test.py | Python | gpl-2.0 | 1,048 |
import os.path
import io
import numpy as np
import tensorflow as tf
# tflearn
import tflearn
from tflearn.data_utils import to_categorical, pad_sequences
from tflearn.datasets import imdb
FLAGS = tf.app.flags.FLAGS
class DataSet(object):
def __init__(self, data, labels):
assert data.shape[0] == labels.s... | dayhaha/Paddle | benchmark/tensorflow/rnn/reader.py | Python | apache-2.0 | 2,335 |
from django.conf import settings
def public_keys(request):
return {
'SHOP_STRIPE_PUBKEY': settings.SHOP_STRIPE['PUBKEY'],
'SHOP_STRIPE_PREFILL': getattr(settings, 'SHOP_STRIPE_PREFILL', False)
}
| jrief/django-shop-stripe | shop_stripe/context_processors.py | Python | mit | 221 |
#!/usr/bin/env python
from __future__ import print_function
"""\
TODO: About
"""
NAME = "bistro"
VERSION = "0.0.2"
__all__ = ["HttpHandler", "ForkingServer", "NonBlockingServer"]
# Standard modules
import socket
import html
import os
import subprocess
import signal
import errno
import sys
import mimetypes
import dat... | thunderstruck47/exercise02 | server.py | Python | mit | 37,529 |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Tests for the engine module
"""
import numpy as np
import scipy.sparse as ssp
import re
import mock
from nipype.pipeline.plugins.tools import report_crash
def test_report_crash... | mick-d/nipype | nipype/pipeline/plugins/tests/test_tools.py | Python | bsd-3-clause | 1,756 |
# -*- coding: utf-8 -*-
#
# 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
#... | sid88in/incubator-airflow | airflow/contrib/example_dags/example_twitter_dag.py | Python | apache-2.0 | 7,310 |
import braintree
import warnings
from braintree.error_result import ErrorResult
from braintree.resource import Resource
from braintree.resource_collection import ResourceCollection
from braintree.successful_result import SuccessfulResult
from braintree.transaction import Transaction
from braintree.exceptions.not_found_... | braintree/braintree_python | braintree/transaction_gateway.py | Python | mit | 9,674 |
#!/usr/bin/env python
import sys
from os.path import join, dirname
sys.path.append(join(dirname(__file__), 'src'))
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
execfile(join(dirname(__file__), 'src', 'Selenium2Library', 'version.py'))
DESCRIPTION = """
Selenium2Library is a web ... | soukingang/robotframework-selenium2library | setup.py | Python | apache-2.0 | 1,819 |
#---------------------------------------------------------------------------------------------------------------|
# Organization: AllenRing |
# -- Created by Ritch ... | AllenRing/ProjectTabulas | sensorFlightTest/MCv9.py | Python | mit | 14,719 |
#!/usr/bin/python
# vim: set fileencoding=utf-8
# see <http://icalendar.readthedocs.org/en/latest/usage.html>
from icalendar import Calendar, Event
from icalendar.prop import vText
from datetime import datetime
import sys
year = 2016
month = 2
daynum = {'PAZARTESİ':8, 'SALI':9, 'ÇARŞAMBA':10, 'PERŞEMBE':11, 'CUMA':1... | anaraven/IU-MBG-calendar | ical-generator.py | Python | unlicense | 1,883 |
#########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | sensusaps/RoboBraille.Web.API | WorkingDirectory/DaisyPipeline/transformers/ca_cnib_rtf2dtbook/rtf2xml-py/rtf2xml/footnote.py | Python | apache-2.0 | 11,498 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, 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 __future__ import unicode_literals
from django.conf import settings
fr... | hrayr-artunyan/shuup | shuup/notify/models/notification.py | Python | agpl-3.0 | 4,213 |
#!/usr/bin/env python
import json
import logging
import tempfile
import unittest
import pytest
from tests.utils.issue_mock import IssueMock
from tests.utils.repo_mock import RepoMock
from tests.utils.helpers import get_issue
from ansibullbot.triagers.plugins.ci_rebuild import get_rebuild_merge_facts
from ansibullbot... | jctanner/ansibullbot | tests/unit/triagers/plugins/test_rebuild_merge.py | Python | gpl-3.0 | 3,614 |
#!/usr/bin/env python3
import os
import signal
pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]
for pid in pids:
try:
text = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()
if 'PyBoof' in str(text):
os.kill(int(pid), signal.SIGTERM)
print("Killed "+pid... | lessthanoptimal/PyBoof | kill_pyboof_jvm.py | Python | apache-2.0 | 403 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010, Dan Eicher.
# 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,
# thi... | jemandez/creaturas-magicas | Configuraciones básicas/scripts/addons/piemenus/pie_tanBrushes.py | Python | gpl-3.0 | 7,795 |
#! /usr/bin/env python
"""
couchbasekit.fields
~~~~~~~~~~~~~~~~~~~
:website: http://github.com/kirpit/couchbasekit
:copyright: Copyright 2013, Roy Enjoy <kirpit *at* gmail.com>, see AUTHORS.txt.
:license: MIT, see LICENSE.txt for details.
* :class:`couchbasekit.fields.CustomField`
* :class:`couchbasekit.fields.Choice... | kirpit/couchbasekit | couchbasekit/fields.py | Python | mit | 6,692 |
class Elf:
def __init__(self, value):
self.value = value
self.next = None
self.prev = None
def remove(self):
self.prev.next = self.next
self.next.prev = self.prev
return self.next
def __repr__(self):
return str(self.value)
n = 3001330
elfs = list(ma... | mofr/advent-of-code | 2016/day19.py | Python | apache-2.0 | 577 |
#!/usr/bin/env python
#
# svnlook_tests.py: testing the 'svnlook' tool.
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2004, 2007-2009 CollabNet. All rights reserve... | bdmod/extreme-subversion | BinarySourcce/subversion-1.6.17/subversion/tests/cmdline/svnlook_tests.py | Python | gpl-2.0 | 22,397 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Event.photo'
db.add_column('events_event', 'photo',
self.gf('django.db... | e-Luminate/eluminate_web | eluminate_web/apps/events/migrations/0006_auto__add_field_event_photo.py | Python | gpl-3.0 | 7,343 |
#---------------------------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
# Adham Lucas da Silva Oliveira 1715310059
# Gabriel Barroso da Silva Lima 1715310011
# Guilherme Silva ... | jucimarjr/IPC_2017-1 | lista06/lista06_lista02_questao21.py | Python | apache-2.0 | 1,697 |
#!usr/bin/python
#-*- coding:utf-8 -*-
import urllib
url = 'http://120.76.114.164:21080/c1/'
#代理服务器
proxies = {'http':'http://127.0.0.1:233'}
#使用代理服务器打开
r = urllib.urlopen(url,proxies = proxies)
print r.info()
print r.getcode()
print r.geturl()
# #打开本地文件
# f = urllib.urlopen(url = 'file:/home/ma6174/a.sh')
# print ... | momomoxiaoxi/security | Scripts/urlread.py | Python | apache-2.0 | 1,703 |
from datetime import datetime
from casexml.apps.phone.models import User
DUMMY_USERNAME = "mclovin"
DUMMY_ID = "foo"
DUMMY_PASSWORD = "changeme"
def dummy_user():
return User(user_id=DUMMY_ID,
username=DUMMY_USERNAME,
password=DUMMY_PASSWORD,
date_joined=datetime(2... | puttarajubr/commcare-hq | corehq/ex-submodules/casexml/apps/phone/tests/dummy.py | Python | bsd-3-clause | 1,561 |
"""
Helper module for captchas from captchas.net
"""
from adhocracy import config
from adhocracy.lib.captchasdotnet import CaptchasDotNet
def get_captchasdotnet():
return CaptchasDotNet(
client=config.get('captchasdotnet.user_name'),
secret=config.get('captchasdotnet.secret'),
alphabet=co... | phihag/adhocracy | src/adhocracy/lib/helpers/captchasdotnet_helper.py | Python | agpl-3.0 | 559 |
""" :mod: RequestTaskTests
=======================
.. module: RequestTaskTests
:synopsis: test cases for RequestTask class
test cases for RequestTask class
"""
from __future__ import print_function
__RCSID__ = "$Id $"
# #
# @file RequestTaskTests.py
# @author Krzysztof.Ciba@NOSPAMgmail.com
# @date 20... | fstagni/DIRAC | RequestManagementSystem/private/test/RequestTaskTests.py | Python | gpl-3.0 | 3,166 |
#!/usr/bin/env python
# coding: UTF-8
# pt-show-locks
#
# Copyright(c) 2015-2018 Uptime Technologies, LLC.
import getopt
import os
import sys
import PsqlWrapper
class ShowLocks:
def __init__(self, psql, debug=False):
self.debug = debug
self.psql = psql
if self.psql.get_version() >= 9.... | uptimejp/postgres-toolkit | postgres_toolkit/pt_show_locks.py | Python | gpl-2.0 | 4,128 |
# -*- coding: utf-8 -*-
"""
Created on Mon May 11 12:43:00 2015
@author: Matti Ropo
@author: Henrik Levämäki
"""
from pyemto.common.common import *
| hpleva/pyemto | pyemto/common/__init__.py | Python | mit | 153 |
#! /usr/bin/env python
#
# Support module generated by PAGE version 4.9
# In conjunction with Tcl version 8.6
# Nov 11, 2017 03:31:55 PM
import sys
try:
from Tkinter import *
except ImportError:
from tkinter import *
try:
import ttk
py3 = 0
except ImportError:
import tkinter.ttk as ttk
py... | fattila16/Block-Chain-Parser | parser_gui_support.py | Python | mit | 650 |
########################################################################
# Rancho - Open Source Group/Project Management Tool
# Copyright (C) 2008 The Rancho Team
#
# 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 t... | joaquimrocha/Rancho | rancho/message/forms.py | Python | agpl-3.0 | 3,709 |
# Generated by Django 2.0.3 on 2018-08-07 12:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0050_auto_20180803_0337'),
('order', '0050_auto_20180803_0528'),
]
operations = [
]
| UITools/saleor | saleor/order/migrations/0051_merge_20180807_0704.py | Python | bsd-3-clause | 269 |
import requests
from urllib.parse import urlparse
from bears.general.URLBear import URLBear, LINK_CONTEXT
from coalib.bears.LocalBear import LocalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.bearlib import deprecate_settings
from coalib.results.HiddenResult import Hidd... | refeed/coala-bears | bears/general/URLHeadBear.py | Python | agpl-3.0 | 5,212 |
""" This module is manily created to test the deep belief and
rbm implementations on MNIST"""
__author__ = "Mihaela Rosca"
__contact__ = "mihaela.c.rosca@gmail.com"
import argparse
import matplotlib.pyplot as plt
import numpy as np
import cPickle as pickle
import readmnist
import restrictedBoltzmannMachine as rbm
imp... | mihaelacr/pydeeplearn | code/old-version/MNISTdigits.py | Python | bsd-3-clause | 9,937 |
from .datalog2sql.datalog2sqlconverter import Datalog2SqlConverter
from .sql_engine.query_evaluator import QueryEvaluator
from .sql_engine.db_state_tracker import DBStateTracker
from colorama import *
from .interpreter.interpreter_parse import *
from .interpreter.syntax_highlighter import SyntaxHighlight
import sys
imp... | saltzm/yadi | yadi/yadi.py | Python | bsd-3-clause | 6,202 |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature,before_method,after_method
LIB_CODE='''
#ifdef _MSC_VER
#define testEXPORT __declspec(dllexport)
#else
#de... | softDi/clusim | ns3/ns-3.26/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Tools/c_tests.py | Python | apache-2.0 | 4,245 |
# -*- 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... | OpusVL/odoo | addons/stock/wizard/make_procurement_product.py | Python | agpl-3.0 | 5,960 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "simple_django_rest_api.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| frnkn/django-simple-rest-api | manage.py | Python | apache-2.0 | 265 |
# -*- encoding: utf-8 -*-
import StringIO
import xlsxwriter
"""
Web app module.
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
def generate_cwr_report_excel(cwr):
output = StringIO.StringIO()
workbook = xlsxwriter.Workbook(output, {'in_memory': True})
_gen... | weso/CWR-WebClient | cwr_webclient/report/cwr.py | Python | mit | 2,566 |
# Copyright 2013 Red Hat, 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 required by... | pshchelo/ironic | ironic/api/controllers/v1/driver.py | Python | apache-2.0 | 18,125 |
from TextEditor import TextEditor
from TextBuffer import TextBuffer
from Annotation import Annotation
import inspect
__all__ = [name for name, obj in locals().items()
if not (name.startswith('_') or inspect.ismodule(obj))]
| knipknap/SpiffGtkWidgets | src/SpiffGtkWidgets/TextEditor/__init__.py | Python | agpl-3.0 | 236 |
from __future__ import absolute_import
import unittest
from datetime import date
from mock import patch
from fakturoid import Fakturoid
from tests.mock import response, FakeResponse
class FakturoidTestCase(unittest.TestCase):
def setUp(self):
self.fa = Fakturoid('myslug', '9ACA7', 'Test App')
class ... | farin/python-fakturoid | tests/test_api.py | Python | mit | 4,107 |
'''longtroll: Notify you when your long-running processes finish.'''
import argparse
import getpass
import os
import pickle
import re
import subprocess
import time
collapse_whitespace_re = re.compile('[ \t][ \t]*')
def spawn_notify(notifier, proc_ended):
cmd = notifier.replace('<cmd>', proc_ended[0])
cmd = cmd.r... | haldean/longtroll | longtroll/longtroll.py | Python | mit | 3,588 |
#!/usr/bin/python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code generator for logs based tests."""
import argparse
import evdev
import os
import sys
# Fix keys with multiple names.
try:
import... | endlessm/chromium-browser | ui/events/ozone/evdev/capture_test_events.py | Python | bsd-3-clause | 1,395 |
#!/usr/bin/env python
# -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
#
# File Name : sn_flx.py
#
# Purpose :
#
# Creation Date : 30-10-2015
#
# Last Modified : Wed 23 Nov 2016 09:42:32 CET
#
# Created By : UMN
#
# Modified: Petr Baklanov
# _._._._._._._._._._._._._._._._._._._._._.
import struct
import numpy as np... | baklanovp/pystella | pystella/model/sn_flx.py | Python | mit | 9,239 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.