code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
from setuptools import setup
setup(
name='suds_requests',
version='0.1',
description=open('README.rst').read(),
author='Jason Michalski',
author_email='armooo@armooo.net',
py_modules=['suds_requests'],
install_requires=['requests', 'suds'],
)
| chrcoe/suds_requests | setup.py | Python | bsd-3-clause | 273 |
#!/usr/bin/env python
"""FlickrGettr, a simple little script for caching lots of images on a Flickr account to a filesystem.
Copyright (c) 2012 Andrew Rowson. Licensed under the BSD two-clause license. See LICENSE.md for details."""
import logging
import os
import argparse
import flickrapi
import json
def curl_pro... | growse/FlickrPuttr | FlickrGettr.py | Python | bsd-3-clause | 8,377 |
import logging
from parsing.read_FEC_settings import LOG_DIRECTORY, LOG_NAME
""" Set up a logger with settings from the settings file. Will log info and anything higher.
from utils.fec_logging import fec_logger
my_logger=fec_logger()
my_logger.info('my_logger.info')
my_logger.warn('my_logger.warn')
my_logger.error(... | sunlightlabs/read_FEC | fecreader/fec_alerts/utils/fec_logging.py | Python | bsd-3-clause | 891 |
# Copyright (c) 2015, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
import unittest
# External library imports
import vtk
# Enthought library imports
from mayavi.sources.vtk_file_reader import VTKFileReader
# Local imports.
from .common import get_example_data
vtk_major_version = vtk.vtkVersio... | dmsurti/mayavi | mayavi/tests/test_vtk_file_reader.py | Python | bsd-3-clause | 1,930 |
# Copyright 2013 University of Maryland. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE.TXT file.
import sys
import os
import time
import selenium.common.exceptions
import framework
class Exploit (framework.Exploit):
attributes = {'Name' :... | UMD-SEAM/bugbox | framework/Exploits/CVE_2012_2903_E.py | Python | bsd-3-clause | 2,220 |
#!/usr/bin/env python
# @file wilson_score.py
# @author Michael Foukarakis
# @version 0.1
# @date Created: Fri Sep 01, 2017 10:19 EEST
# Last Update: Fri Sep 01, 2017 16:40 EEST
#------------------------------------------------------------------------
# Description: Wilson score ... | mfukar/mflib | wilson_score.py | Python | bsd-3-clause | 1,257 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_None/trend_ConstantTrend/cycle_30/ar_/test_artificial_32_None_ConstantTrend_30__20.py | Python | bsd-3-clause | 263 |
# -*- coding: utf-8 -*-
from django.contrib.auth.models import Group
from django.utils.translation import gettext_lazy as _
from django.utils.translation import activate, get_language
from django.urls import reverse
from actstream.models import (Action, Follow, model_stream, user_stream,
... | justquick/django-activity-stream | actstream/tests/test_activity.py | Python | bsd-3-clause | 11,966 |
#!/usr/bin/env python
import asyncio
import sys
import websockets
URI = "ws://localhost:32080"
async def run(client_id, messages):
async with websockets.connect(URI) as websocket:
for message_id in range(messages):
await websocket.send("{client_id}:{message_id}")
await websocket... | aaugustin/websockets | example/deployment/kubernetes/benchmark.py | Python | bsd-3-clause | 630 |
import json
import pprint
import operator
from itertools import groupby
from flask import Flask, render_template, make_response, request
from flask import redirect, flash
import settings
from core import mongo
app = Flask(__name__, static_folder='static')
app.debug = settings.DEBUG
app.secret_key = settings.SECRET_... | datamade/bubs | bubs/app.py | Python | bsd-3-clause | 3,007 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | nuagenetworks/vspk-python | vspk/v5_0/nuusercontext.py | Python | bsd-3-clause | 15,060 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['LinearTrend'] , ['BestCycle'] , ['SVR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_LinearTrend_BestCycle_SVR.py | Python | bsd-3-clause | 155 |
from __future__ import division
import json
import argparse
import numpy as np
import matplotlib
matplotlib.use('Qt4Agg')
from matplotlib import pyplot as plt
from sirl.domains.navigation.social_navigation import SocialNavMDP
from sirl.domains.navigation.local_controllers import POSQLocalController
from sirl.doma... | makokal/scalable-irl | examples/social_navigation/learn_representation.py | Python | bsd-3-clause | 3,002 |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 10 14:58:01 2021
@author: Lucian
"""
import tellurium as te
import phrasedml
import libsedml
import sys
import os
r = te.loada ('''
$S1 -> S2; k1*S1/(0.1 + S4^n)
S2 -> S3; k2*S2
S3 -> S4; k3*S3;
S4 ->; k4*S4
k1 = 0.1; k2 = 0.4;
... | luciansmith/sedml-test-suite | contributions/HARMONY 2021/create_sedml_surface_mesh.py | Python | bsd-3-clause | 1,250 |
from flask.ext.mail import Message
from flask import render_template
from app import mail
from config import ADMINS
from threading import Thread
from app import app
from .decorators import async
import uuid
@async
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subjec... | Timojarv/microblag | app/emails.py | Python | bsd-3-clause | 847 |
import warnings
import math
import re
from functools import wraps
from collections import namedtuple
from datetime import datetime
import urllib
import pytz
import cherrypy
import gnupg
from jinja2 import Environment, PackageLoader
from dateutil import parser as date_parser
from wtforms import Form, TextField, Passwor... | EliAndrewC/ensconce | ensconce/webapp/tree/__init__.py | Python | bsd-3-clause | 14,470 |
from __future__ import absolute_import
import gc
import sys
import time
from celery.utils.dispatch import Signal
from celery.tests.utils import Case
if sys.platform.startswith('java'):
def garbage_collect():
# Some JVM GCs will execute finalizers in a different thread, meaning
# we need to wai... | mozilla/firefox-flicks | vendor-local/lib/python/celery/tests/utilities/test_dispatcher.py | Python | bsd-3-clause | 3,906 |
from haystack import views
from oscar.apps.search.signals import user_search
from oscar.core.loading import get_class, get_model
Product = get_model('catalogue', 'Product')
FacetMunger = get_class('search.facets', 'FacetMunger')
class FacetedSearchView(views.FacetedSearchView):
"""
A modified version of Hay... | sonofatailor/django-oscar | src/oscar/apps/search/views.py | Python | bsd-3-clause | 2,680 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Post(models.Model):
title = models.CharField(max_length=128)
text = models.TextField(blank=True)
author = models.ForeignKey(User)
created_date = models.DateTimeField(auto_now_add=True)
modifie... | robalford/reConstruct | myblog/models.py | Python | bsd-3-clause | 828 |
# -*- coding: utf-8 -*-
from cms.forms.utils import get_site_choices, get_page_choices
from cms.models import Page, PageUser, Placeholder
from cms.plugin_pool import plugin_pool
from cms.utils import get_language_from_request
from django.conf import settings
from django.contrib.sites.models import Site
from django.form... | jalaziz/django-cms-grappelli-old | cms/forms/widgets.py | Python | bsd-3-clause | 8,844 |
import numpy as np
from numpy.testing import assert_allclose
from nose.tools import raises
from menpo.transform import Rotation
def test_basic_2d_rotation():
rotation_matrix = np.array([[0, 1],
[-1, 0]])
rotation = Rotation(rotation_matrix)
assert_allclose(np.array([0, -1]... | yuxiang-zhou/menpo | menpo/transform/test/h_rotation_test.py | Python | bsd-3-clause | 2,855 |
#!/usr/bin/env python
import smach
# define state Foo
class Foo(smach.State):
def __init__(self, name, outcome):
smach.State.__init__(self, outcomes=['outcome_a','outcome_b'])
self._name = name
self._outcome = outcome
def execute(self, userdata):
smach.loginfo('Executing stat... | ReconCell/smacha | smacha/test/smacha_test_examples/seq_concurrence_1.py | Python | bsd-3-clause | 1,707 |
"""
The reduced intrinsic mutual information.
Note: this code is nowhere near efficient enough to actually run. Don't try it.
"""
from .base_skar_optimizers import BaseReducedIntrinsicMutualInformation
from .intrinsic_mutual_informations import (intrinsic_total_correlation,
... | dit/dit | dit/multivariate/secret_key_agreement/reduced_intrinsic_mutual_informations.py | Python | bsd-3-clause | 3,326 |
# -*- coding: utf-8 -*-
# BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# 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 ... | beniwohli/apm-agent-python | tests/instrumentation/mysql_tests.py | Python | bsd-3-clause | 4,804 |
"""Tests for Table Schema integration."""
from collections import OrderedDict
import json
import sys
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype, PeriodDtype
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
from pandas.io.json... | jreback/pandas | pandas/tests/io/json/test_json_table_schema.py | Python | bsd-3-clause | 28,126 |
#!/usr/bin/env python
import subprocess
import numpy as np
import os
import sys
import argparse
import multiprocessing
import time
import glob
from XtDac.data_files import get_data_file_path
from XtDac.ChandraUtils.work_within_directory import work_within_directory
from XtDac.ChandraUtils.logging_system import get_lo... | giacomov/XtDac | bin/chandra/xtc_download_region_files.py | Python | bsd-3-clause | 3,545 |
# -*- coding: utf-8 -*-
from datetime import datetime
from ..core import db
from .repository import ProjectRepository
from sqlalchemy import event
class Project(db.Model):
__tablename__ = 'projects'
id = db.Column(db.Integer(), primary_key=True)
name = db.Column(db.String(200))
description = db.Colu... | xtao/vilya | vilya/projects/models.py | Python | bsd-3-clause | 2,583 |
"""
The ``zen.io`` package provides functions for reading and writing networks to and from storage (whether files, databases, or otherwise).
The only IO functionality that is not explicitly provided here is the pickling capability that is built directly into the
:py:class:`zen.Graph` and :py:class:`DiGraph` base classe... | networkdynamics/zenlib | src/zen/io/__init__.py | Python | bsd-3-clause | 3,572 |
import datetime
import os
import shutil
try:
import json
loads = json.loads
dumps = json.dumps
except ImportError:
from django.core import serializers
from functools import partial
loads = partial(serializers.deserialize, 'json')
dumps = serializers.serialize('json')()
from django.conf imp... | jtrain/django-cloud-media | cloud_media/tests/local_tests.py | Python | bsd-3-clause | 2,924 |
"""
Defines simple controls with extensions to wx functionality.
"""
import ceGUI
import cx_Exceptions
import datetime
import decimal
import wx
import wx.calendar
__all__ = ["BaseControl", "CalendarField", "Choice", "DateField",
"DecimalField", "IntegerField", "Notebook", "TextField",
"UpperCase... | marhar/cx_OracleTools | cx_PyGenLib/ceGUI/SimpleControls.py | Python | bsd-3-clause | 10,949 |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Mainak Jas <mainak@neuro.hut.fi>
# Mark Wronkiewicz <wronk.mark@gmail.com>
#
# Lice... | cjayb/mne-python | mne/viz/tests/test_3d.py | Python | bsd-3-clause | 39,200 |
#####################################################################
##### IMPORT STANDARD MODULES
#####################################################################
from ..data import DataBlock
import pandas as pd
from sklearn.datasets import load_iris
import pytest
#############################################... | aarshayj/easyML | easyML/tests/conftest.py | Python | bsd-3-clause | 791 |
# proxy module
from pyface.tasks.action.task_action_controller import *
| enthought/etsproxy | enthought/pyface/tasks/action/task_action_controller.py | Python | bsd-3-clause | 72 |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | openx/python3-protobuf | python/google/protobuf/internal/containers.py | Python | bsd-3-clause | 9,710 |
from django.forms import widgets
from rest_framework import serializers
from .models import Transcript
class TranscriptSerializer(serializers.ModelSerializer):
class Meta:
model = Transcript
fields = ('pk', 'datapoint', 'owner', 'name', 'text')
| allyjweir/lackawanna | lackawanna/transcript/serializers.py | Python | bsd-3-clause | 267 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import signal
import time
import json
import sqlite3
import threading
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
from StringIO import StringIO
# restrict to a particular path
class Requ... | mitjafelicijan/sqlite-xmlrpc | server/sharedb.py | Python | bsd-3-clause | 5,699 |
"""
tests for magic_gui
"""
import wx
import unittest
import os
from programs import magic_gui
from pmagpy import new_builder as nb
from dialogs import grid_frame3 as grid_frame
#import dialogs.pmag_widgets as pmag_widgets
from pmagpy import pmag
from pmagpy import data_model3 as data_model
# set constants
DMODEL = d... | Caoimhinmg/PmagPy | pmagpy_tests/test_magic_gui.py | Python | bsd-3-clause | 6,462 |
from django.test import SimpleTestCase
from dimagi.ext.couchdbkit import (
DocumentSchema,
SchemaDictProperty,
SchemaProperty,
StringProperty,
)
class Ham(DocumentSchema):
eggs = StringProperty()
def __eq__(self, other):
return self.doc_type == other.doc_type and self.eggs == other.e... | dimagi/commcare-hq | corehq/ex-submodules/dimagi/ext/tests/test_schema.py | Python | bsd-3-clause | 994 |
import datetime
from io import BytesIO
from unittest import mock
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.test import TestCase
from django.utils.timezone import make_aware
from openpyxl import load_workbook
from... | zerolab/wagtail | wagtail/contrib/modeladmin/tests/test_simple_modeladmin.py | Python | bsd-3-clause | 31,071 |
# Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of so... | mcr/ietfdb | ietf/idrfc/idrfc_wrapper.py | Python | bsd-3-clause | 36,313 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# ----------------------------------------------------------------------------... | duyuan11/glumpy | examples/collection-markers.py | Python | bsd-3-clause | 963 |
"""Base classes / Design
The design is that there are three components fitting together in this project:
- Trials - a list of documents including at least sub-documents:
['spec'] - the specification of hyper-parameters for a job
['result'] - the result of Domain.evaluate(). Typically includes:
['statu... | dudalev/hyperopt | hyperopt/base.py | Python | bsd-3-clause | 31,730 |
class Sorter(list):
"""
Class that defines the basic functionality of SorterDist for
serial sorting. We are deriving from list so sort() is built
in.
"""
def __init__(self, data=None, comp=None):
list.__init__(self, data)
self._comp = comp
def sorted(self):
retur... | cmcantalupo/SorterDist | sorterdistpy/sorterdist.py | Python | bsd-3-clause | 3,044 |
import os
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Clear supervisor confs for the given environment"
def add_arguments(self, parser):
parser.add_argument('--conf_location', help='Supervisor configuration file ... | dimagi/commcare-hq | corehq/apps/hqadmin/management/commands/clear_supervisor_confs.py | Python | bsd-3-clause | 930 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sql_proxy_accessors', '0004_get_modified_since_functions'),
]
operations = []
| dimagi/commcare-hq | corehq/sql_proxy_accessors/migrations/0005_rename_get_case_attachment_by_name.py | Python | bsd-3-clause | 193 |
#!/usr/bin/env python
# Copyright (C) 2011 Alejandro Blanco <ablanco@yaco.es>
"""
wrapper for JSLint
"""
import os
import sys
import subprocess
from optparse import OptionParser
from tempfile import NamedTemporaryFile
try:
from urllib2 import urlopen # Python 2
except ImportError:
from urllib.request impo... | Yaco-Sistemas/pyjslint | pyjslint.py | Python | bsd-3-clause | 3,647 |
import sys
sys.path.append('..')
from helpers import render_frames
from graphs.ForwardRendering import ForwardRendering as g
from falcor import *
m.addGraph(g)
m.loadScene('Arcade/Arcade.pyscene')
# default
render_frames(m, 'default', frames=[1,16,64])
exit()
| NVIDIAGameWorks/Falcor | Tests/image_tests/renderpasses/test_ForwardRendering.py | Python | bsd-3-clause | 263 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2014, Martín Gaitán
# Copyright (c) 2012-2013, Alexander Jung-Loddenkemper
# This file is part of Waliki (http://waliki.nqnwebs.com/)
# License: BSD (https://github.com/mgaitan/waliki/blob/master/LICENSE)
#=============================================... | mgaitan/waliki_flask | waliki/core.py | Python | bsd-3-clause | 2,067 |
"""Tools for spectral analysis.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy import fftpack
from . import signaltools
from .windows import get_window
from ._spectral import _lombscargle
from ._arraytools import const_ext, even_ext, odd_ext, zero_ext
import warning... | apbard/scipy | scipy/signal/spectral.py | Python | bsd-3-clause | 66,503 |
"""python-rtmixer interface for sound output."""
# Authors: Eric Larson <larsoner@uw.edu>
#
# License: BSD (3-clause)
import atexit
import sys
import numpy as np
from rtmixer import Mixer, RingBuffer
import sounddevice
from .._utils import logger, get_config
_PRIORITY = 100
_DEFAULT_NAME = None
# only initialize ... | drammock/expyfun | expyfun/_sound_controllers/_rtmixer.py | Python | bsd-3-clause | 6,543 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010 - 2011 -- Lars Heuer - Semagia <http://www.semagia.com/>.
# 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 ... | heuer/nodo | nodo/tests/test_func_redis.py | Python | bsd-3-clause | 2,246 |
# -*- 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 model 'Calendar'
db.create_table(u'events_calendar', (
(u'id', self.gf('django.db.model... | theherk/django-theherk-events | events/migrations/0001_initial.py | Python | bsd-3-clause | 8,343 |
"""
Generate random NormalFormGame instances.
"""
import numpy as np
from .normal_form_game import Player, NormalFormGame
from ..util import check_random_state
from ..random.utilities import _probvec_cpu
def random_game(nums_actions, random_state=None):
"""
Return a random NormalFormGame instance where the... | oyamad/QuantEcon.py | quantecon/game_theory/random.py | Python | bsd-3-clause | 5,126 |
# Copyright (c) 2011 Edward Langley
# 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... | fiddlerwoaroof/sandbox | hier.py | Python | bsd-3-clause | 3,113 |
from sqlalchemy.testing import eq_, assert_raises, assert_raises_message
import operator
from sqlalchemy import *
from sqlalchemy import exc as sa_exc, util
from sqlalchemy.sql import compiler, table, column
from sqlalchemy.engine import default
from sqlalchemy.orm import *
from sqlalchemy.orm import attributes
from s... | alex/sqlalchemy | test/orm/test_joins.py | Python | mit | 94,839 |
# -*- coding: utf-8 -*-
"""DepthDependentTaylorNonLinearDiffuser Component.
@author: R Glade
@author: K Barnhart
@author: G Tucker
"""
import numpy as np
from landlab import Component, LinkStatus
class DepthDependentTaylorDiffuser(Component):
r"""
This component implements a depth-dependent Taylor series ... | cmshobe/landlab | landlab/components/depth_dependent_taylor_soil_creep/hillslope_depth_dependent_taylor_flux.py | Python | mit | 18,021 |
"""
Extending on demo-03, implements an event callback we can use to process the
incoming data.
"""
import sys
import time
from ant.core import driver
from ant.core import node
from ant.core import event
from ant.core import message
from ant.core.constants import *
from config import *
NETKEY = '\xB9\xA5\x21\xFB\x... | ramunasd/python-ant | demos/ant.core/04-processevents.py | Python | mit | 1,339 |
# -*- coding: utf-8 -*-
"""
tipfy.ext.auth.google
~~~~~~~~~~~~~~~~~~~~~
Implementation of Google authentication scheme.
Ported from `tornado.auth <http://github.com/facebook/tornado/blob/master/tornado/auth.py>`_.
:copyright: 2009 Facebook.
:copyright: 2010 tipfy.org.
:license: Apache Lic... | toomoresuch/pysonengine | eggs/tipfy.ext.auth.google-0.1-py2.6.egg/tipfy/ext/auth/google.py | Python | mit | 4,407 |
from mk_survey import *
from data_handler import *
import multiprocessing
import numpy as np
def mp_worker((ra, dec, ramax, decmax)):
tile = np.unique(find_tile(ra, dec, data=data))
# These are the individual IFUs, 96 of them
for ifu in gen_ifus(ra, dec):
try:
result = np.append(result,... | boada/desCluster | legacy/fullcontrol.py | Python | mit | 2,152 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
from datetime import datetime
from functools import wraps
from typing import Union, Callable
from werkzeug.wrappers import Response
import frappe
from frappe import _
from frappe.utils import cint... | frappe/frappe | frappe/rate_limiter.py | Python | mit | 4,074 |
# -*- coding: utf-8 -*-
"""
Python Flight Mechanics Engine (PyFME).
Copyright (c) AeroPython Development Team.
Distributed under the terms of the MIT License.
Test functions for trimmer
--------------------------
These values are hardcoded from the function results with the current
constants.
"""
from itertools impo... | AlexS12/PyFME | src/pyfme/utils/tests/test_trimmer.py | Python | mit | 3,723 |
#!/usr/bin/python
__author__ = "bt3"
class Node(object):
def __init__(self, item=None,):
self.item = item
self.left = None
self.right = None
def __repr__(self):
return '{}'.format(self.item)
def _add(self, value):
new_node = Node(value)
if not self.ite... | switchkiller/Python-and-Algorithms-and-Data-Structures | src/trees/binary_tree.py | Python | mit | 1,812 |
# Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import numpy.testing as npt
import astropy.units as u
import os
from astropy.io import fits
try:
import pyfftw
PYFFTW_INSTALLED = True
except ImportError:
PYFFTW_INSTAL... | e-koch/TurbuStat | turbustat/tests/test_delvar.py | Python | mit | 7,476 |
import os
from setuptools import setup, find_packages
from distutils.extension import Extension
from Cython.Distutils import build_ext
from glob import glob
long_description = """.. -*-rst-*-
MDF - Data Flow Programming Toolkit
=======================================
"""
version = '2.2.1'
cython_profile = False
cd... | tonyroberts/mdf | setup.py | Python | mit | 1,781 |
import json
import os
import subprocess
import sys
from distutils.spawn import find_executable
import click
import frappe
from frappe.commands import get_site, pass_context
from frappe.exceptions import SiteNotSpecifiedError
from frappe.utils import update_progress_bar, cint
from frappe.coverage import CodeCoverage
... | frappe/frappe | frappe/commands/utils.py | Python | mit | 29,245 |
"""Interact with functions using widgets."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
from __future__ import division
try: # Python >= 3.3
from inspect import signature, Parameter
except ImportError:
from IPyth... | lancezlin/ml_template_py | lib/python2.7/site-packages/ipywidgets/widgets/interaction.py | Python | mit | 14,474 |
import os
# Add parent directory for imports
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)
import boto.swf
import log
import json
import random
from optparse import OptionParser
"""
Amazon SWF Sum workflow starter
"""
class starter_Sum():
def start(self... | gnott/elife-bot | starter/starter_Sum.py | Python | mit | 2,942 |
# -*- coding: utf-8 -*-
from sympy.matrices import Matrix
from sympy.core import Add, diff, Symbol
from sympy.simplify import simplify
from tensor_analysis.arraypy import Arraypy, TensorArray, matrix2arraypy, \
matrix2tensor, list2arraypy, list2tensor
from tensor_analysis.tensor_methods import is_symmetric
from te... | AunShiLord/Tensor-analysis | tensor_analysis/riemannian_geometry.py | Python | mit | 61,932 |
# -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... | immanetize/nikola | nikola/winutils.py | Python | mit | 4,643 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
# def closestValue(self, root, target):
# """
# :type root: TreeNode
# :type target: float
# ... | qiyuangong/leetcode | python/270_Closest_Binary_Search_Tree_Value.py | Python | mit | 1,612 |
import sys
import time
class Graph(object):
"""
Defines an undirected graph with dictionary structure {}
"""
def __init__(self):
self._edges = dict()
self._nodes = list()
def _add_node(self, node):
"""
Adds a node to the list of nodes in a Graph.
:type n... | FirstSanny/appfs | tapia/exercise7/ex7.py | Python | mit | 6,980 |
#!/usr/bin/env python2
#
# Copyright (C) Microsoft Corporation, All rights reserved.
# this init file exists for unit tests for the unlock_node method
from scripts import require_runbook_signature
from scripts.require_runbook_signature import set_signature_enforcement_policy
| MSFTOSSMgmt/WPSDSCLinux | Providers/nxOMSAutomationWorker/automationworker/scripts/__init__.py | Python | mit | 280 |
#!/usr/local/bin/python
# script to remove all MACs older than 12 hours
# add this to
import db as database
from iptables import IPTables
ipt = IPTables()
db = database.DB()
# remove all MACs older than 12 hours from db and iptables
for mac in db.getExpiredMACs():
print("removed: " + mac)
db.rmMAC(mac)
ipt... | Freifunk-Rhein-Neckar/ffrn-gw-splash | cleanup.py | Python | mit | 334 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2015 Matthew Stone <mstone5@mgh.harvard.edu>
# Distributed under terms of the MIT license.
"""
"""
from collections import defaultdict, OrderedDict
import numpy as np
from .rpc import RPCNode
from .svcf import SVCFRecord
class JointVCFError(Exception):
... | talkowski-lab/Holmes | readpaircluster/svcf/svcall.py | Python | mit | 17,243 |
#!/usr/bin/env python3
"""Generate an updated requirements_all.txt."""
import difflib
import importlib
import os
from pathlib import Path
import pkgutil
import re
import sys
from script.hassfest.model import Integration
from homeassistant.util.yaml.loader import load_yaml
COMMENT_REQUIREMENTS = (
"Adafruit_BBIO"... | mKeRix/home-assistant | script/gen_requirements_all.py | Python | mit | 10,342 |
from pygame_transform import *
| gmittal/aar-nlp-research-2016 | src/pygame-pygame-6625feb3fc7f/symbian/lib/transform.py | Python | mit | 32 |
#!/usr/bin/env python3
# vim: set fileencoding=utf-8 :
"""
Reads a regular text corpus where the relevant units (usually paragraphs)
are separated by newlines.
"""
from __future__ import absolute_import, division, print_function
from contextlib import contextmanager
from emLam.corpus.corpus_base import RawCorpus
fro... | DavidNemeskey/emLam | emLam/corpus/text_corpus.py | Python | mit | 1,822 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestLogSettingUser(unittest.TestCase):
pass
| adityahase/frappe | frappe/core/doctype/log_setting_user/test_log_setting_user.py | Python | mit | 226 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_businessman_human_male_01.iff"
result.attribute_templa... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_businessman_human_male_01.py | Python | mit | 458 |
import datetime
from HoverSpace.models import ANSWERS_COLLECTION, QUESTIONS_COLLECTION
from HoverSpace.user import User
from HoverSpace.questions import QuestionMethods
from bson.objectid import ObjectId
class Answers():
# quesID, short_description, long_description, postedBy, timestamp, ansID, upvotes, downvotes... | shubh1m/HoverSpace | HoverSpace/answers.py | Python | mit | 3,101 |
"""
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
"""
class Solution:
# @param A, a list of integers
# @return an integer
def firstMissingPositive(self... | cyandterry/Python-Study | Ninja/Leetcode/41_First_Missing_Positive.py | Python | mit | 965 |
# -*- coding: utf-8 -*-
'''
Local Configurations
- Runs in Debug mode
- Uses console backend for emails
- Use Django Debug Toolbar
'''
from configurations import values
from .common import Common, BASE_DIR
from os.path import join
class Local(Common):
# DEBUG
DEBUG = values.BooleanValue(True)
TEMPLATE_... | mayapurmedia/cookiecutter-django-jingo | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/local.py | Python | mit | 1,572 |
import warnings
import h5py
import keras.backend as K
from keras import optimizers
from keras.engine import saving
def save_all_weights(model, filepath, include_optimizer=True):
"""
Save model weights and optimizer weights but not configuration to a HDF5 file.
Functionally between `save` and `save_weight... | keras-team/keras-contrib | keras_contrib/utils/save_load_utils.py | Python | mit | 4,905 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_commoner_tatooine_ishitib_male_03.iff"
result.attribut... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_commoner_tatooine_ishitib_male_03.py | Python | mit | 469 |
from .cltk_corpus import CLTKCorpus
class GreekCorpus(CLTKCorpus):
language = 'greek'
def normalize(self):
new_docs = []
counter = 0
for doc in self.data:
counter += 1
self.update('Normalizing text', counter)
new_docs.append(doc.normalize())
... | thePortus/arakhne | build/lib/arakhne/corpus/greek_corpus.py | Python | mit | 997 |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Transform a roidb into a trainable roidb by adding a bunch of metada... | Zardinality/TF_Deformable_Net | lib/roi_data_layer/roidb.py | Python | mit | 6,129 |
# Auto generated configuration file
# using:
# Revision: 1.168
# Source: /cvs_server/repositories/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v
# with command line options: GeneratorInterface/AMPTInterface/amptDefault_cfi.py -s GEN --conditions auto:mc --datatier GEN --eventcontent RAWSIM -... | tuos/FlowAndCorrelations | model/ampt/production/v1B/run0ppv1/energy200GeVv2/ampt_StringMelting_pp200GeV_cfg.py | Python | mit | 5,882 |
"""Implements a HD44780 character LCD connected via PCF8574 on I2C."""
# The following import was needed on my OpenMV board
from lcd_api import LcdApi
from pyb import I2C, delay, millis
from pyb_i2c_lcd import I2cLcd
# The PCF8574 has a jumper selectable address: 0x20 - 0x27
DEFAULT_I2C_ADDR = 0x27
def test_main():... | dhylands/python_lcd | lcd/pyb_i2c_lcd_test.py | Python | mit | 1,426 |
from sahanaTest import SahanaTest
import actions
class DeleteTestAccount(SahanaTest):
""" Delete the common accounts that were created for the suite of test classes """
_sortList = ("deleteAll",)
def deleteAll(self):
""" Delete the standard testing account: user@example.com """
# sel = self... | sinsai/Sahana_eden | static/selenium/scripts/deleteTestAccount.py | Python | mit | 719 |
# pylint: disable=invalid-name
from http import HTTPStatus
from django.conf import settings
from django.contrib.auth import get_user_model
from django.http import HttpResponseForbidden
from django.urls import reverse
from django.utils.text import capfirst
from django.utils.translation import gettext_lazy as _
from tc... | kiwitcms/Kiwi | tcms/kiwi_auth/tests/test_admin.py | Python | gpl-2.0 | 10,662 |
# Copyright (C) 2011 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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
# ... | bks/veusz | veusz/utils/colormap.py | Python | gpl-2.0 | 18,043 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.configuration import Configuration
from urbansim.configurations.distribute_unplaced_jobs_model_configuration_creator import DistributeUnplacedJobsModelConfigurationCreator
class... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/washtenaw/configurations/regional_distribute_unplaced_jobs_model_configuration_creator.py | Python | gpl-2.0 | 2,085 |
class Type:
SUBSCRIPTION_PAYMENT = 'subscription_payment'
SUBSCRIPTION_PAYMENT_TO_REIMBURSE = 'subscription_payment_to_reimburse'
COURSE_PAYMENT_TRANSFER = 'course_payment_transfer'
IRRELEVANT = 'irrelevant'
UNKNOWN = 'unknown'
CHOICES = (
(SUBSCRIPTION_PAYMENT, 'subscription payment')... | gitsimon/tq_website | payment/models/choices/type.py | Python | gpl-2.0 | 538 |
#!/usr/bin/python3
from gi.repository import Gio, GObject
from SettingsWidgets import *
from TreeListWidgets import List
import collections
import json
import operator
CAN_BACKEND.append("List")
JSON_SETTINGS_PROPERTIES_MAP = {
"description" : "label",
"min" : "mini",
"max" : "maxi"... | Curly060/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/bin/JsonSettingsWidgets.py | Python | gpl-2.0 | 11,418 |
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import logging
from portage.util import writemsg_level
def create_depgraph_params(myopts, myaction):
#configure emerge engine parameters
#
# self: include _this_ package regardless of if it is merged.
#... | nullishzero/Portage | pym/_emerge/create_depgraph_params.py | Python | gpl-2.0 | 3,934 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from numpy import where, zeros
from urbansim.functions import attribute_label
def my_attribute_label(attribute_name):
"""Return a triple (package, dataset_name, attribute_name).
""... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim_parcel/household/variable_functions.py | Python | gpl-2.0 | 387 |
# vim:ts=4:et
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 option) any later version.
#
# This prog... | taniwha/io_object_mu | model/__init__.py | Python | gpl-2.0 | 994 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | tplusx/ns3-gpsr | src/dsdv/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 360,144 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Semestre'
db.create_table(u'semestre_semestre', (
... | agendaTCC/AgendaTCC | tccweb/apps/semestre/migrations_/0002_initial.py | Python | gpl-2.0 | 11,003 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Douglas S. Blank <doug.blank@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 2 of the License... | gramps-project/addons-source | Sqlite/ImportSql.py | Python | gpl-2.0 | 36,898 |