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 |
|---|---|---|---|---|---|
# hg.py - hg backend for convert extension
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# Notes for hg->hg conversion:
#
# * Old versions of Mercurial didn't tr... | sitano/hgext | convert/hg.py | Python | gpl-2.0 | 14,825 |
#!/usr/bin/env python
# --------------------------------------------------------------
# Script used to write commit time for each file
# --------------------------------------------------------------
import os, sys
path_sct = os.environ.get("SCT_DIR", os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.... | neuropoly/spinalcordtoolbox | dev/githook/pre_commit_hook.py | Python | mit | 2,812 |
import os
from .base import cli
@cli.command()
def shell():
import IPython
from zeus.app import app
from zeus.config import db
ctx = app.make_shell_context()
ctx["app"].test_request_context().push()
ctx["db"] = db
# Import all models into the shell context
ctx.update(db.Model._decl_c... | getsentry/zeus | zeus/cli/shell.py | Python | apache-2.0 | 572 |
"""
Tests for orm module.
"""
from datetime import datetime
from copy import copy
from unittest import mock
import numpy
import pandas
import redpanda
import sqlalchemy
from pandas.testing import assert_frame_equal
from pytest import raises
from redpanda.example import Widget, create_widgets
ENGINE = redpanda.create... | amancevice/redpanda | tests/orm_test.py | Python | mit | 6,163 |
from scipy.optimize import leastsq
import numpy as np
import matplotlib.pyplot as plt
def residual(vars, x, data):
amp = vars[0]
phaseshift = vars[1]
freq = vars[2]
decay = vars[3]
model = amp * np.sin(x * freq + phaseshift) * np.exp(-x*x*decay)
return (data-model)
vars = [10.... | cbosoft/pi_rheo_proj | etc/lmftest.py | Python | gpl-3.0 | 1,062 |
"""
WSGI config for spielberg_proj project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | carlmjohnson/spielberg | spielberg_proj/wsgi.py | Python | mit | 405 |
from unittest import (
TestCase,
mock,
)
from lxml import etree
from pcs import settings
from pcs.common import reports
from pcs.common.fencing_topology import (
TARGET_TYPE_ATTRIBUTE,
TARGET_TYPE_NODE,
TARGET_TYPE_REGEXP,
)
from pcs.common.reports import ReportItemSeverity as severity
from pcs.co... | tomjelinek/pcs | pcs_test/tier0/lib/cib/test_fencing_topology.py | Python | gpl-2.0 | 37,225 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
fixedwidth.py:
Read or write a table with fixed width columns.
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
from . import core
from ... | StuartLittlefair/astropy | astropy/io/ascii/fixedwidth.py | Python | bsd-3-clause | 15,472 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_entries... | suyashphadtare/sajil-final-erp | erpnext/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py | Python | agpl-3.0 | 1,433 |
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
#
# 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... | UstadMobile/eXePUB | exe/webui/packageredirectpage.py | Python | gpl-2.0 | 6,036 |
"""
Functions to visualize an Experiment.
"""
__authors__ = "James Bergstra"
__license__ = "3-clause BSD License"
__contact__ = "James Bergstra <pylearn-dev@googlegroups.com>"
import cPickle
import math
import sys
# -- don't import this here because it locks in the backend
# and we want the unittests to be... | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/hyperopt-0.0.2/hyperopt/plotting.py | Python | bsd-3-clause | 19,952 |
# Code for NATs and the like. Also includes code for determining local IP
# address (suprisingly tricky, in the presence of STUPID STUPID STUPID
# networking stacks)
from twisted.internet import defer
from twisted.internet.protocol import DatagramProtocol
import random, socket
from twisted.python import log
from xsht... | twisted/sine | xshtoom/nat.py | Python | mit | 14,206 |
import stackless # @UnresolvedImport
import random
import unittest
import logging
import actor # @UnusedImport
from world import SWorld
from home import SHome
from woodcutter import SWoodcutter
from tree import STree
import level
def getRandomLoc():
return (random.randrange(50, 450), random.randrange(50, 450))
... | gasbank/fallingsun | fallingsun/test.py | Python | unlicense | 17,916 |
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | waveform80/picamera | picamera/array.py | Python | bsd-3-clause | 36,543 |
from setuptools import setup
setup(name='proto',
version='0.1',
description='a project solution builder',
url='http://github.com/imgaray/Proto',
author='Ignacio Garay',
author_email='imgarayojeda@gmail.com',
license='MIT',
packages=['proto'],
test_suite='nose.collector',... | imgaray/Proto | setup.py | Python | gpl-2.0 | 373 |
#!/usr/bin/python
import minimalmodbus
import sys
value=['low','boost','bypass']
instrument = minimalmodbus.Instrument('/dev/ttyVMC1',0)
instrument.serial.baudrate = 19200
instrument.serial.bytesize = 8
instrument.serial.parity = 'E'
instrument.serial.stopbits = 1
if len(sys.argv) == 2:
newvalue=int(sys.argv[1])
... | dsacchet/scripting | modbus/vmc_unelvent/airflow_set.py | Python | bsd-3-clause | 718 |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | detiber/lib_openshift | test/test_v1_build_config_spec.py | Python | apache-2.0 | 1,304 |
"""
WSGI config for main project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhi... | reiniervdwindt/power-rangers-api | src/main/wsgi.py | Python | mit | 476 |
from django.conf import settings
from django.apps import apps as django_apps
class TenantSyncRouter(object):
"""
A router to control which applications will be synced,
depending if we are syncing the shared apps or the tenant apps.
"""
def app_in_list(self, app_label, apps_list):
"""
... | sigma-geosistemas/django-tenants | django_tenants/routers.py | Python | mit | 1,528 |
from django.core.exceptions import PermissionDenied, ImproperlyConfigured
from mellow.roles import Role
def minimum_role_required(role):
def _minimum_role_required(view_func):
def wrapped_view_func(request, *args, **kwargs):
# Ensure that the user is authenticated
if not request.u... | flagshipenterprise/django-mellow-auth | mellow/mixins.py | Python | mit | 1,641 |
#
# license-generator
# Copyright (C) 2016 Walter Dolce <walterdolce@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | walterdolce/python-package-license-generator | test/test_transliterator.py | Python | gpl-3.0 | 1,295 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import hs_core.models
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
('pages', '__first__'),
migrations.swappable_d... | RENCI/xDCIShare | hs_app_timeseries/migrations/0001_initial.py | Python | bsd-3-clause | 9,652 |
#!/usr/bin/env python
"""A class for handling 5C analysis."""
import os
import sys
from math import log
import numpy
from scipy.stats import linregress
import h5py
from scipy.optimize import fmin_l_bfgs_b as bfgs
import libraries._fivec_binning as _binning
import libraries._fivec_optimize as _optimize
import fivec_... | bxlab/HiFive_Paper | Scripts/hifive-1.1.3/hifive/fivec.py | Python | bsd-3-clause | 100,404 |
import os
import base64
import logging
import platform
from datetime import date, timedelta
from invoke import run, task
# from elasticsearch import helpers
# from dateutil.parser import parse
# from six.moves.urllib import parse as urllib_parse
# import scrapi.harvesters # noqa
# from scrapi import linter
# from sc... | fabianvf/scrapi | tasks.py | Python | apache-2.0 | 10,077 |
# Author: echel0n <echel0n@sickrage.ca>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage 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... | SickRage/SickRage | sickrage/providers/torrent/rarbg.py | Python | gpl-3.0 | 5,606 |
PLUGINS = (
'actions',
'filters',
'bookmark',
'export',
'layout',
'refresh',
'details',
'editable',
'relate',
'chart',
'ajax',
'relfield',
'inline',
'topnav',
'portal',
'quickform',
'wizard',
'images',
'auth',
'multiselect'... | shishengjia/OnlineCourses | extra_apps/xadmin/plugins/__init__.py | Python | apache-2.0 | 771 |
from django.conf.urls.defaults import *
from courant.core.staff.views import *
urlpatterns = patterns('',
url(r'^(?P<slug>[-\w]+)/$', staffer_detailed, name="staffer_detailed"),
)
| maxcutler/Courant-News | courant/core/staff/urls.py | Python | bsd-3-clause | 185 |
# -*- coding: utf-8 -*-
from myot.schedule import Schedule
from myot.block import Block
from myot.series import Series
from myot.timer import Timer
from myot import settings
if __name__ == "__main__":
scheduler = Schedule()
block = Block()
block.picker = 'random'
block.new_episodes = True
series = Series()
... | bombpersons/MYOT | test.py | Python | gpl-3.0 | 537 |
#!/usr/bin/env python
# -*- mode: Python; 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 Apa... | apache/zest-qi4j | buildSrc/src/asciidoc/filters/snippet/snippet.py | Python | apache-2.0 | 3,582 |
import json
import os
import sys
import math
import glob
import numpy as np
import random
import csv
import subprocess
import time
#Before using, open Dream3D and set the folder that you want the output files in.
#Functions here used to change the pipeline only affect the name of the output file
#not the directory.
... | selwyni/evpFFT---HDF5 | PipelineRunner 3-17.py | Python | mit | 25,225 |
from kivy.app import App
from kivy.utils import platform
from kivy.properties import ObjectProperty
from kivy.uix.tabbedpanel import TabbedPanel, TabbedPanelItem
from kivy.uix.label import Label
from kivy.logger import Logger
import MysteryOnline
from MysteryOnline.utils import binary_search
from kivy.clock import Clo... | Moe-Team/MysteryOnline | MysteryOnline/left_tab.py | Python | gpl-3.0 | 14,809 |
# PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2019 Hannu Parviainen
#
# 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 Licen... | hpparvi/PyTransit | pytransit/param/__init__.py | Python | gpl-2.0 | 996 |
import ConfigParser
from weasyl import macro
_in_test = False
config_obj = ConfigParser.ConfigParser()
config_obj.read([macro.MACRO_CFG_SITE_CONFIG])
def config_read():
return dict(config_obj.items('general'))
def config_read_setting(setting, value=None, section='general'):
"""
Retrieves a value fr... | dzamie/weasyl | weasyl/config.py | Python | apache-2.0 | 1,045 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
================================================================================
mingus - Music theory Python package, MIDI File Out
Copyright (C) 2008-2009, Bart Spaans
This program is free software: you can redistribute it and/or modify
it under the ter... | edudobay/mingus | mingus/midi/MidiFileOut.py | Python | gpl-3.0 | 5,709 |
# -*- coding: utf-8 -*-
#
# This tool helps you rebase your package to the latest version
# Copyright (C) 2013-2019 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... | rebase-helper/rebase-helper | rebasehelper/helpers/input_helper.py | Python | gpl-2.0 | 3,222 |
"""
Builds out filesystem trees/data based on the object tree.
This is the code behind 'cobbler sync'.
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
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 Fre... | ssalevan/cobbler | cobbler/action_sync.py | Python | gpl-2.0 | 8,836 |
# GENERATED FROM postgresql/src/backend/utils/errcodes.txt
# DO NOT MODIFY, use tools/generate_exceptions.py to update
from ._base import * # NOQA
from . import _base
class PostgresWarning(_base.PostgresLogMessage, Warning):
sqlstate = '01000'
class DynamicResultSetsReturned(PostgresWarning):
sqlstate = '... | MagicStack/asyncpg | asyncpg/exceptions/__init__.py | Python | apache-2.0 | 28,694 |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from collections.abc import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from sci... | bnaul/scikit-learn | sklearn/utils/multiclass.py | Python | bsd-3-clause | 15,311 |
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Python rendering engine for OpenStreetMap data
#
# Input: OSM XML files
# Output: 256x256px PNG images in slippy-map format
#----------------------------------------------------------------------------
# Copyright 2... | ryfx/modrana | modules/pyrender/render_cairo_base.py | Python | gpl-3.0 | 7,115 |
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import re
import shutil
from pants.base.build_environment import get_buildroot
from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest
class DepExportsIn... | tdyas/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/test_dep_exports_integration.py | Python | apache-2.0 | 2,976 |
import os
import sys
import tempfile
import subprocess
import shutil
import multiprocessing
import pytest
import collections
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
SCRIPTS_DIR = os.path.join(CURRENT_DIR, '..', 'scripts')
EXAMPLES_DIR = os.path.join(CURRENT_DIR, '..', 'examples')
DB_DIR = os.path.join... | ppericard/matamog | tests/test_functional.py | Python | agpl-3.0 | 4,070 |
"""
Count the number of occurrences of each major code in a file.
Authors: #FIXME
Credits: #FIXME
Input is a file in which major codes (e.g., "CIS", "UNDL", "GEOG")
appear one to a line. Output is a sequence of lines containing major code
and count, one per major.
"""
import argparse
def count_codes(majors_file):
... | TomRowland/University-of-Oregon | CIS_210/fall_2015/week_2/counting_majors/counts.py | Python | gpl-2.0 | 1,513 |
from layer.basic.lstm import LstmLayer as LstmLayerBase
class LstmLayer(LstmLayerBase):
def info(self):
return [
("x", "input", ["samples", "features", "length"]),
("mask", "input", ["samples", "length"]),
("W_i", "weight", ["hidden+features", "hidden"]),
(... | wrongtest/nnlight | src/computation_on_java_impl/layers/lstm.py | Python | gpl-2.0 | 5,785 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_v1_generated_index_endpoint_service_delete_index_endpoint_async.py | Python | apache-2.0 | 1,623 |
# coding: utf-8
# This file is a part of VK4XMPP transport
# © simpleApps, 2020.
def parseReplyMessages(self, msg):
body = ""
result = (MSG_APPEND, "")
if msg.get("reply_message"):
# todo: add date if the message wasn't sent today
reply = msg["reply_message"]
text = escape("", uhtml(reply["text"]))
attach... | mrDoctorWho/vk4xmpp | extensions/reply.py | Python | mit | 689 |
#!/usr/bin/env python3.6
#########################################################################
# File Name: 12306.py
# Author: dangxiaojun
# mail: admin@dxjun.cn
# Created Time: Fri 12 Jan 2018 10:28:10 AM CST
# Description: 12306抢票工具
#########################################################################
impor... | dangxiaojun/python | 12306/12306.py | Python | gpl-3.0 | 6,313 |
#!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 LeanIX GmbH
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,... | leanix/leanix-sdk-python | src/leanix/models/ProjectHasConsumer.py | Python | mit | 1,781 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | wadobo/suds | suds/mx/__init__.py | Python | lgpl-3.0 | 1,878 |
# -*- coding: UTF-8 -*-
# This file is part of Beppo.
#
# Beppo is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Beppo is distribute... | mgaitan/beppo | beppo/server/WBServer.py | Python | gpl-2.0 | 25,794 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyCorrectionlib(PythonPackage):
"""A generic correction library"""
homepage = "https:... | LLNL/spack | var/spack/repos/builtin/packages/py-correctionlib/package.py | Python | lgpl-2.1 | 1,692 |
"""Component to configure Home Assistant via an API."""
import asyncio
from http import HTTPStatus
import importlib
import os
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import CONF_ID, EVENT_COMPONENT_LOADED
from homeassistant.core import callback
fro... | aronsky/home-assistant | homeassistant/components/config/__init__.py | Python | apache-2.0 | 7,765 |
import unittest, time, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_glm, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
# assume we're at 0xdata wi... | janezhango/BigDataMachineLearning | py/testdir_single_jvm/test_parse_manyfiles_1_fvec.py | Python | apache-2.0 | 3,537 |
# -*- coding: utf-8 -*-
from uamobile.base import UserAgent, Display
from uamobile.docomodisplaymap import DISPLAYMAP_DOCOMO
class DoCoMoUserAgent(UserAgent):
"""
NTT DoCoMo implementation
see also http://www.nttdocomo.co.jp/service/imode/make/content/spec/useragent/index.html
property "cache" returns... | TheProjecter/wsgiuseragentmobile | uamobile/docomo.py | Python | mit | 3,470 |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lordmos/blink | Tools/Scripts/webkitpy/layout_tests/port/test.py | Python | mit | 29,134 |
from flask import Flask, request, render_template, jsonify, g, current_app
from flask.ext.classy import FlaskView
class HomeView(FlaskView):
def index(self):
return render_template('home/index.html')
def about(self):
return render_template('home/about.html')
| gmoshe27/gadberger.com | app/views/home_view.py | Python | mit | 285 |
# -*- coding: utf-8 -*-
#
# textblob documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 5 01:41:33 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
# autogenerated file.
#
# Al... | bbengfort/TextBlob | docs/conf.py | Python | mit | 8,246 |
# -*- encoding: utf-8 -*-
# Module iablob
import numpy as np
from string import upper
import ia870
def iablob(fr, measurement, option="image"):
measurement = upper(measurement)
option = upper(option)
if len(fr.shape) == 1: fr = fr[newaxis,:]
n = fr.max()
if option == 'DATA': y ... | mariecpereira/IA369Z | deliver/ia870/iablob.py | Python | mit | 4,146 |
from __future__ import unicode_literals
from netmiko.fortinet.fortinet_ssh import FortinetSSH
__all__ = ['FortinetSSH']
| michaelrosejr/pyaos6 | netmiko/fortinet/__init__.py | Python | mit | 121 |
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it w... | jwagner/lanshark | lanshark/keepalive.py | Python | gpl-3.0 | 21,240 |
import mock
from shade_janitor import cleanup
from shade_janitor.tests.unit import base
class TestCleanupInstance(base.BaseTestCase):
def setUp(self):
super(TestCleanupInstance, self).setUp()
self.cloud.delete_server = mock.Mock()
self.instance = mock.Mock()
def add_single(self):
... | yazug/shade_janitor | shade_janitor/tests/unit/cleanup/test_cleanup_instance.py | Python | gpl-3.0 | 2,257 |
import pytest
from ..profiles import profile_from_dict
from ..profiles import PointProfile
from ..profiles import ExtendedProfile
def test_profiles_from_dict():
with pytest.raises(KeyError):
profile_from_dict({})
def test_profiles_point():
prof = profile_from_dict({'name': 'point'})
assert i... | sergiopasra/megaracte | megaracte/tests/test_profiles.py | Python | gpl-3.0 | 495 |
import click
from arrow.cli import pass_context, json_loads
from arrow.decorators import custom_exception, list_output
@click.command('delete_organism')
@click.argument("organism_id", type=str)
@click.option(
"--suppress_output",
help="Suppress return of all organisms (true / false) (default false)",
is_f... | galaxy-genome-annotation/python-apollo | arrow/commands/organisms/delete_organism.py | Python | mit | 598 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-11 04:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0082_merge'),
]
operations = [
migrations.AlterUniqueTogether(
... | shirishgoyal/crowdsource-platform | crowdsourcing/migrations/0083_auto_20160511_0437.py | Python | mit | 953 |
## Copyright (c) 2003 Henk Punt
## 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,
#... | toymachine/venster | test/test_browser.py | Python | mit | 4,848 |
import logging
from django.core.management import BaseCommand
from ...tasks import send_message
from ...models.models import EmailOutboxMessage
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = """Resend en emailmessage that is stuck in the outbox table
E.g.:
* rese... | HelloLily/hellolily | lily/messaging/email/management/commands/resend_email.py | Python | agpl-3.0 | 896 |
'''This is the index view'''
import pylw.resource
import cgi
import json
import os, sys
class FormUpload(pylw.resource.DefaultResource):
'''A page for handling uploads via post'''
def on_get(self,req,resp,user_objects=None):
resp.add_header('Content-Type','text/html')
resp.status = '404 NOT F... | michaelgugino/blastoff | blastoff/views/upload_view.py | Python | apache-2.0 | 1,910 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "rplidar_ros"
PROJECT_SPACE_DIR = "/ho... | MONUNITH/A.R.E.S | catkin_ws/build/rplidar_ros-slam/catkin_generated/pkg.develspace.context.pc.py | Python | gpl-3.0 | 371 |
"""
jobber.api.jobber
~~~~~~~~~~~~~~~~~
Functions making up the Jobber API
"""
import connexion
import datetime
import logging
from os import getenv
from collections import defaultdict
import jobber_orm as jorm
import jobber_api_utils as jau
db_session = None
nested_dict = lambda: defaultdict(nested_dict)
def get... | rdempsey/jobber | jobber/api/jobber.py | Python | mit | 8,719 |
#!/usr/bin/env python
# encoding: utf-8
from flask.ext.restful import Resource, fields, marshal_with, marshal
from .base import BaseArgs, LengthField, ChannelKey
from database.channel.channel_model import get_channel_status, get_channel, update_channel, delete_channel
class ChannelQueryArgs(BaseArgs):
def rules(... | hellolintong/LinDouFm | resource/channel.py | Python | mit | 1,825 |
from __future__ import print_function
import sys
from cffi import FFI
is_64b = sys.maxsize > 2**32
ffi = FFI()
if is_64b: ffi.cdef("typedef long GoInt;\n")
else: ffi.cdef("typedef int GoInt;\n")
ffi.cdef("""
typedef struct {
void* data;
GoInt len;
GoInt cap;
} GoSlice;
typedef struct {
const ch... | vladimirvivien/go-cshared-examples | client-cffi.py | Python | mit | 971 |
import os.path
import shutil
import subprocess
from collections import namedtuple
from pipes import quote
from gerrit import model
class ExecutionError(Exception):
def __init__(self, cmd, stdin, code, out, err):
self.cmd = cmd,
self.stdin = stdin
self.code = code
self.out = out
... | bcwaldon/python-gerrit | gerrit/util.py | Python | apache-2.0 | 1,785 |
"""Development settings and globals."""
from __future__ import absolute_import
from .base import *
import os
########## DEBUG CONFIGURATION
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
########## END DEBUG CONFIGURATION
########## DATABASE CONFIGURATION
# https://docs.djangoproject.co... | dhirajt/NotificationDashboard | notificationdashboard/notificationdashboard/settings/dev.py | Python | gpl-3.0 | 1,402 |
# -*- coding: utf-8 -*-
"""This file contains BagMRU Windows Registry plugins (shellbags)."""
import construct
from plaso.containers import windows_events
from plaso.parsers.shared import shell_items
from plaso.parsers import winreg
from plaso.parsers.winreg_plugins import interface
class BagMRUPlugin(interface.Win... | dc3-plaso/plaso | plaso/parsers/winreg_plugins/bagmru.py | Python | apache-2.0 | 7,318 |
# -*coding: utf-8-*-
from collections import Iterable
from . import ResourcesQueryBuilder
from ...models.resource import Resource
from ...models.order import Order
from ...models.person import Person
from ...models.advsource import Advsource
class OrdersQueryBuilder(ResourcesQueryBuilder):
def __init__(self, c... | mazvv/travelcrm | travelcrm/lib/qb/orders.py | Python | gpl-3.0 | 1,209 |
#!flask/bin/python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from webapp import db
import os.path
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
api.create(SQLALCHEMY_MIGRATE_REPO,'db repository')
api.version_control... | air01a/pimusic | db_create.py | Python | gpl-2.0 | 489 |
#!/usr/bin/env python2
# 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 "Lice... | thrill/HiBench | bin/functions/hibench_prop_env_mapping.py | Python | apache-2.0 | 7,162 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
# Copyright © 2013 eNovance
# Copyright © 2014 Red Hat, Inc
#
# Authors: Doug Hellmann <doug.hellmann@dreamhost.com>
# Julien Danjou <julien@danjou.info>
# Eoghan Glynn <eglynn@redhat.com>
#
# Licensed under the Apache L... | tanglei528/ceilometer | ceilometer/storage/impl_mongodb.py | Python | apache-2.0 | 38,605 |
"""Interface for package data stored in the "data" folder, providing methods to
both resolve and load data. For Pyroclast servers, this module supports
importing and serving data files contained in (or under) this directory.
"""
import os
import shutil
def get_path(data_path):
"""Returns the absolute path to t... | Tythos/pyroclast | data/__init__.py | Python | mit | 1,123 |
from autosar.base import splitRef
from autosar.element import Element
import sys
class SystemSignal(Element):
def __init__(self,name,dataTypeRef,initValueRef,length,desc=None,parent=None):
super().__init__(name,parent)
self.dataTypeRef=dataTypeRef
self.initValueRef=initValueRef
... | cogu/autosar | autosar/signal.py | Python | mit | 1,012 |
from __future__ import division
import matplotlib.pyplot as plt
import geopy
from geopy.distance import vincenty
import pandas as pd
import linecache
import numpy as np
import scipy as sc
import scipy.spatial.distance as spd
import os
import sys
import skbio
import skbio.stats.ordination as ord
import statsmodels.... | klocey/Dimensions | Aim3/papers/DD/PythonScripts/DDR.py | Python | gpl-3.0 | 3,971 |
#! /usr/bin/env/python
# import necessary modules
import polyadcirc.pyADCIRC.plotADCIRC as pa
import polyadcirc.run_framework.random_manningsn as rmn
# setup and load from shelf
# set up saving
save_file = 'py_save_file.mat'
base_dir = '/h1/lgraham/workspace'
grid_dir = base_dir+'/ADCIRC_landuse/Inlet/inputs/tides'
... | UT-CHG/PolyADCIRC | examples/run_framework/load_random_manningsn.py | Python | bsd-3-clause | 589 |
from .models import sagemaker_backends
sagemaker_backend = sagemaker_backends["us-east-1"]
mock_sagemaker = sagemaker_backend.decorator
| spulec/moto | moto/sagemaker/__init__.py | Python | apache-2.0 | 137 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | fharenheit/template-spark-app | src/main/python/mllib/multi_label_metrics_example.py | Python | apache-2.0 | 2,277 |
# Copyright 2015 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.
"""Task queue task which migrates a Test and its Rows to a new name.
A rename consists of listing all Test entities which match the old_name,
and then, for ... | SummerLW/Perf-Insight-Report | dashboard/dashboard/migrate_test_names.py | Python | bsd-3-clause | 16,847 |
"""
Copyright (C) 2014 Pietro Sormanni (for s2D) and Piero Fariselli (for PyELM) (Also David T. Jones for pfilt and chkparse included in 'extra/')
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 ... | hmc-cs-rkretsch/Secondary-Protein-Structure | Lit/s2Dv2/setup.py | Python | mit | 8,069 |
# -*- coding: utf-8 -*-
#
# highlight.js documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 12 23:48:27 2012.
#
# 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
# autogenerated file.
#
... | mizu5/mizu_php | js/highlight.js-master/docs/conf.py | Python | mit | 7,782 |
"""
This module contains general purpose URL functions not found in the standard
library.
Some of the functions that used to be imported from this module have been moved
to the w3lib.url module. Always import those from there instead.
"""
import posixpath
from six.moves.urllib.parse import ParseResult, urlunparse, url... | cortext/crawtextV2 | utils/url.py | Python | mit | 6,945 |
"""
FEniCS tutorial demo program: Poisson equation with Dirichlet conditions.
As d4_p2D.py, but with computations and visualizations of grad(u).
-Laplace(u) = f on the unit square.
u = u0 on the boundary.
u0 = u = 1 + x^2 + 2y^2, f = -6.
"""
from dolfin import *
import numpy
# Create mesh and define function space
#... | maciekswat/dolfin_1.3.0 | test/unit/book/python/chapter_1_files/stationary/poisson/d5_p2D.py | Python | gpl-3.0 | 3,065 |
""" The CLI entry point for exporting projects from the mbed tools to any of the
supported IDEs or project structures.
"""
import sys
from os.path import join, abspath, dirname, exists, basename
ROOT = abspath(join(dirname(__file__), ".."))
sys.path.insert(0, ROOT)
from shutil import move, rmtree
from argparse import ... | screamerbg/mbed | tools/project.py | Python | apache-2.0 | 9,660 |
from collections import defaultdict
from distutils.version import StrictVersion
from django_bulk_update.helper import bulk_update
from django.conf import settings as django_settings
from django.db import transaction
from django.db.models import F, Q
from django.http import JsonResponse
from django.contrib.contenttypes... | pattisdr/osf.io | api/base/views.py | Python | apache-2.0 | 29,505 |
from datetime import datetime, date, time
from decimal import Decimal
from operator import itemgetter
import six
from django import forms
from django.contrib import admin, messages
from django.contrib.admin import widgets
from django.contrib.admin.options import csrf_protect_m
from django.core.exceptions import Permis... | abendleiter/django-constance | constance/admin.py | Python | bsd-3-clause | 5,569 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-28 16:48
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gestioneide', '0002_auto_20160223_1743'),
]
operations = [
m... | Etxea/gestioneide | gestioneide/migrations/0003_auto_20160228_1748.py | Python | gpl-3.0 | 768 |
# -*-coding:utf8-*-#
__author__ = 'play4fun'
"""
create time:15-10-25 下午12:09
任何一副灰度图像 可以 看成拓扑平面
灰度值 的区域可以 看成是 山峰
灰度值低的区域可以 看成是山谷。
我们向每一个山谷中灌不同颜色的水。随着水的位的升 不同山谷的水就会相遇汇合
为了防止不同山 的水 汇合 我们需要在水汇合的地方构建 堤坝。不停的灌水 不停的构建堤坝
直到所有的山峰都被水淹没。
我们构建好的堤坝就是对图像的分割。
这就是分水岭算法的背后哲理。
每一次灌水 我们的标签就会 更新 当两个不同 色的标签相 时就构建堤 坝 直到将所有山峰淹没 最后我们得到... | makelove/OpenCV-Python-Tutorial | ch27-分水岭算法图像分割/watershed.py | Python | mit | 2,806 |
# Copyright 2011 Eldar Nugaev
# 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 ... | phenoxim/nova | nova/tests/unit/api/openstack/compute/test_server_diagnostics.py | Python | apache-2.0 | 7,791 |
#! /usr/bin/env python
# -*- coding: Utf8 -*-
def convMajMin(ch):
"échange les majuscules et les minuscules dans la chaîne ch"
nouvC = "" # chaîne à construire
for car in ch:
code = ord(car)
# les codes numériques des caractères majuscules et minuscules
... | widowild/messcripts | exercice/python3/solutions_exercices/exercice_10_16.py | Python | gpl-3.0 | 987 |
# Copyright 2016 by Dai Trying
#
# This file is part of daixmms2client.
#
# daixmms2client 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 opti... | Dai-trying/daixmms2client | connector.py | Python | gpl-3.0 | 1,747 |
from unittest import TestCase
from sqlalchemy.ext.declarative import declarative_base
from history_meta import Versioned, versioned_session
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey
from sqlalchemy.orm import clear_mappers, sessionmaker, deferred, relationship
from _lib import Comparable... | ioram7/keystone-federado-pgid2013 | build/sqlalchemy/examples/versioning/test_versioning.py | Python | apache-2.0 | 10,503 |
import OOMP
newPart = OOMP.oompItem(9179)
newPart.addTag("oompType", "OPAM")
newPart.addTag("oompSize", "SC14")
newPart.addTag("oompColor", "X")
newPart.addTag("oompDesc", "KLMV324")
newPart.addTag("oompIndex", "01")
OOMP.parts.append(newPart)
| oomlout/oomlout-OOMP | old/OOMPpart_OPAM_SC14_X_KLMV324_01.py | Python | cc0-1.0 | 246 |
import tensorflow as tf
import numpy as np
def dnn_model(x, training=False):
hidden1 = tf.layers.dense(x, units=10, activation=tf.nn.relu)
dropout = tf.layers.dropout(inputs=hidden1, rate=0.7, training=training)
hidden2 = tf.layers.dense(hidden1, units=10, activation=tf.nn.relu)
dropout = tf.layers.dr... | liulohua/ml_tutorial | abalone_example/dnn_regression.py | Python | apache-2.0 | 2,672 |
#!/usr/bin/python
from PIL import Image
import os, sys
import glob
import cv2
sys.path.append('..')
from py.Rectangle import Rectangle
from scipy import misc
import numpy as np
import os.path
import math
# filepath = "/Users/juliusskye/COMP4120.Car.Detection.Research/car-classifier-research/src/hyp.verification.tools... | jskye/car-classifier-research | src/hyp.verification.tools/py/test/testcoord.py | Python | mit | 5,100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.