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 |
|---|---|---|---|---|---|
'''
Test Cases for DocumentConverter Class for WordCloud Project
Daniel Klein
Computer-Based Honors Program
The University of Alabama
9.27.2013
'''
import unittest
import os, os.path
from src.core.python.SupremeCourtOpinionFileConverter import SupremeCourtOpinionFileConverter
##### Here are all the global variables ... | dmarklein/WordCloud | test/unit/python/DocumentConverterTest.py | Python | apache-2.0 | 18,681 |
from ..fields.chart_field import ChartField
from ..fields.title_field import TitleField
from ..fields.series_field import SeriesField
from ..fields.series.series import Series
from ..fields.plot_options_field import PlotOptionsField
from ..fields.plot_options.pie_plot_options import PiePlotOptions
from highchart import... | jpmfribeiro/PyCharts | pycharts/charts/pie_chart.py | Python | mit | 1,329 |
from __future__ import division, print_function
import numpy as np
np.random.seed(1337)
from copy import deepcopy
from numpy import log, sqrt
from numpy.random import choice
from time import time
from keras.models import load_model
import keras
import numba as nb
from numba import jit
from heuristic_agent import *
siz... | EterniusVGM/Renju | renju/MCTS.py | Python | mit | 16,077 |
# -*- 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-dataproc-metastore | samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_backup_sync.py | Python | apache-2.0 | 1,611 |
from collections import namedtuple
import sublime
from sublime_plugin import WindowCommand
from ..git_command import GitCommand
from ...common import util
MenuOption = namedtuple("MenuOption", ["requires_action", "menu_text", "filename", "is_untracked"])
CLEAN_WORKING_DIR = "Nothing to commit, working directory cl... | divmain/GitSavvy | core/commands/quick_stage.py | Python | mit | 4,843 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import configargparse
import os
import math
import json
import logging
import random
import time
import socket
import struct
import zipfile
import requests
from uuid import uuid4
from s2sphere import CellId, LatLng
from . import config
log = logging.getLogger(__na... | pgandev/RocketMap | pogom/utils.py | Python | agpl-3.0 | 43,916 |
"""Define patches used for androidtv tests."""
from unittest.mock import mock_open, patch
KEY_PYTHON = "python"
KEY_SERVER = "server"
ADB_DEVICE_TCP_ASYNC_FAKE = "AdbDeviceTcpAsyncFake"
DEVICE_ASYNC_FAKE = "DeviceAsyncFake"
class AdbDeviceTcpAsyncFake:
"""A fake of the `adb_shell.adb_device_async.AdbDeviceTcpA... | jawilson/home-assistant | tests/components/androidtv/patchers.py | Python | apache-2.0 | 6,081 |
#!/usr/bin/env python
from distutils.core import setup
import fedex
LONG_DESCRIPTION = open('README.rst').read()
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Op... | obr/python-fedex | setup.py | Python | bsd-3-clause | 1,212 |
# This is the Twisted Get Poetry Now! client, version 1.0.
# NOTE: This should not be used as the basis for production code.
# It uses low-level Twisted APIs as a learning exercise.
import datetime, errno, optparse, socket
from twisted.internet import main
def parse_args():
usage = """usage: %prog [options] [h... | GavinCando/twisted_test | twisted-client-1/get-poetry.py | Python | mit | 3,576 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# --... | MoRgUiJu/morguiju.repo | plugin.video.pelisalacarta/platformcode/mct.py | Python | gpl-2.0 | 29,761 |
# -*- coding: utf-8 -*-
import re
from datetime import datetime
from django.apps import apps
from django.db.models import Q
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.http import QueryDict
from django.shortcuts import get_object_or_404
from django.urls import r... | migasfree/migasfree | migasfree/server/views/token.py | Python | gpl-3.0 | 34,742 |
#
# 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 agreed to in writing, software
# ... | cwolferh/heat-scratch | heat/db/sqlalchemy/api.py | Python | apache-2.0 | 57,779 |
#!/usr/bin/env python
#
# Copyright 2008, 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... | grpc/grpc-ios | native_src/third_party/googletest/googlemock/test/gmock_output_test.py | Python | apache-2.0 | 6,175 |
import numpy as np
from nilearn.image.image import check_niimg
from nilearn.image.resampling import get_bounds
from nilearn.image.image import _crop_img_to as crop_img_to
def crop_img(img, rtol=1e-8, copy=True, return_slices=False, pad=True, percentile=None, return_affine=False):
"""Crops img as much as possible
... | ellisdg/3DUnetCNN | unet3d/utils/nilearn_custom_utils/nilearn_utils.py | Python | mit | 4,512 |
from cyder.api.v1.tests.base import APITests
from cyder.core.system.models import System
from cyder.cydns.nameserver.models import Nameserver
from cyder.cydns.soa.models import SOA
from cyder.cydns.tests.utils import create_zone
from cyder.cydhcp.interface.static_intr.models import StaticInterface
from cyder.cydhcp.ran... | murrown/cyder | cyder/api/v1/endpoints/dhcp/static_interface/tests.py | Python | bsd-3-clause | 2,278 |
__author__ = 'RajivSubramanian'
| rajivm1991/django-materialize-form | materializeform/templatetags/__init__.py | Python | mit | 32 |
""" DIRECT Nine DoF Manipulation Panel """
__all__ = ['Placer', 'place']
# Import Tkinter, Pmw, and the dial code from this directory tree.
from pandac.PandaModules import *
from direct.showbase.TkGlobal import *
from direct.tkwidgets.AppShell import *
from direct.tkwidgets import Dial
from direct.tkwidgets import Fl... | toontownfunserver/Panda3D-1.9.0 | direct/tkpanels/Placer.py | Python | bsd-3-clause | 32,632 |
# -*- coding: utf-8 -*-
#
# PyMW documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 30 11:57:17 2009.
#
# 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.
#
# All co... | eheien/pymw | doc/conf.py | Python | mit | 6,272 |
"""
Minimal (and limited) RPython version of some functions contained in os.path.
"""
import os, stat
from rpython.rlib import rposix
# ____________________________________________________________
#
# Generic implementations in RPython for both POSIX and NT
#
def risdir(s):
"""Return true if the pathname refers... | jptomo/rpython-lang-scheme | rpython/rlib/rpath.py | Python | mit | 7,407 |
from mediadrop.lib.auth.group_based_policy import *
| kgao/MediaDrop | mediacore/lib/auth/group_based_policy.py | Python | gpl-3.0 | 52 |
# Copyright 2016 RedHat, inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible i... | bjolivot/ansible | lib/ansible/inventory/yaml.py | Python | gpl-3.0 | 6,240 |
#!/usr/bin/python
from pisi.actionsapi import shelltools, get, autotools, pisitools
def setup():
autotools.configure ("--prefix=/usr\
--disable-static\
--disable-docs\
--docdir=/usr/share/doc/fontconfig-2.10.2")
def build():
aut... | richard-fisher/repository | system/base/fontconfig/actions.py | Python | gpl-2.0 | 410 |
# coding=utf-8
import threading
from flask_babel import lazy_gettext
from mycodo.databases.models import Actions
from mycodo.databases.models import Input
from mycodo.function_actions.base_function_action import AbstractFunctionAction
from mycodo.utils.database import db_retrieve_table_daemon
FUNCTION_ACTION_INFORMA... | kizniche/Mycodo | mycodo/function_actions/clear_total_volume.py | Python | gpl-3.0 | 2,924 |
"""Array printing function
$Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $
"""
from __future__ import division, absolute_import, print_function
__all__ = ["array2string", "set_printoptions", "get_printoptions"]
__docformat__ = 'restructuredtext'
#
# Written by Konrad Hinsen <hinsenk@ere.umontreal.ca>
... | tdsmith/numpy | numpy/core/arrayprint.py | Python | bsd-3-clause | 26,098 |
from validate_app import validateApp
import os
from distutils import spawn
import sys
from parse_files import parseOutHTseq, bringTogether
from bashSub import bashSub
def checkPreprocessApplications():
applications = ["spades.py"]
source = ["http://bioinf.spbau.ru/spades"]
i = 0;
for app in applicatio... | msettles/expHTS | expHTS/spadesCMD.py | Python | apache-2.0 | 3,121 |
# Copyright 2016 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.
import argparse
import os.path
import sys
_SRC_DIR = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..'))
sys.path.append(os.path... | junhuac/MQUIC | src/tools/android/loading/options.py | Python | mit | 6,296 |
import datetime
import httplib
import urllib
import os.path
import csv
import time
from datetime import timedelta
import pandas as pd
import numpy as np
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
def totimestamp(dt, epoch=datetime.date(1970,1,1)):... | kaija/tw-stock | stock.py | Python | mit | 11,215 |
# encoding: utf-8
from __future__ import absolute_import, division, print_function
# Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved
# Copyright (C) 2008-2013 Vicent Mas. All rights reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... | liam2/liam2 | liam2/view.py | Python | gpl-3.0 | 2,740 |
from PyQt5.QtCore import *
from PyDesignData.PyDesignObject import *
from PyDesignModel.PyDesignCalcSheetsItem import PyDesignCalcSheetsItem
from PyDesignModel.PyDesignIcons import *
from PyDesignModel.PyDesignMaterialsItem import PyDesignMaterialsItem
from PyDesignModel.PyDesignModelItem import PyDesignModelItem
from ... | pracedru/pyDesign | PyDesignModel/PyDesignAnalysisItem.py | Python | mit | 5,100 |
from __future__ import division, print_function, absolute_import
import numpy as np
import numpy.testing as npt
import pytest
from pytest import raises as assert_raises
from scipy._lib._numpy_compat import suppress_warnings
from scipy.integrate import IntegrationWarning
from scipy import stats
from scipy.special impo... | Eric89GXL/scipy | scipy/stats/tests/test_continuous_basic.py | Python | bsd-3-clause | 16,318 |
"""
We try to be very hygienic regarding the exceptions we throw:
Every Exception mitmproxy raises shall be a subclass of ProxyException.
See also: http://lucumr.pocoo.org/2014/10/16/on-error-handling/
"""
from __future__ import absolute_import, print_function, division
import sys
import traceback
class ProxyExcep... | jvillacorta/mitmproxy | mitmproxy/exceptions.py | Python | mit | 2,225 |
from mongoWork import MongoWork
from flask import Flask, request, session, render_template, url_for, redirect, jsonify
from json import loads
app = Flask('lc-server')
app.secret_key = 'developerkey'
config = {}
mongo = None
@app.route('/', methods=['GET', 'POST'])
def index():
if session.get('logged') is not None:
... | arseniypetrikor/lc-server | main.py | Python | gpl-3.0 | 2,557 |
import _plotly_utils.basevalidators
class YcalendarValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="ycalendar", parent_name="histogram", **kwargs):
super(YcalendarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | plotly/python-api | packages/python/plotly/plotly/validators/histogram/_ycalendar.py | Python | mit | 1,058 |
# Copyright (C) 2016 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General... | nijinashok/sos | sos/plugins/dracut.py | Python | gpl-2.0 | 862 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
from googletrans import Translator
translator = Translator()
line = sys.stdin.readline()
while line:
match = re.search('^:([^\s]+) PRIVMSG (#[^\s]+) :(.+)', line)
if not match:
line = sys.stdin.readline()
continue
who = mat... | fridim/cabot | plugins_examples/translate.py | Python | mit | 1,141 |
"""
Hooks to change class:`.PathSimulator` behavior.
These hooks group several methods together for use as part of a
:class:`.PathSimulator` ``run`` method. They allow for additional
calculations or output at several points in the simulation.
"""
import re
import time
import logging
import openpathsampling as paths
fr... | choderalab/openpathsampling | openpathsampling/beta/hooks.py | Python | lgpl-2.1 | 16,334 |
"""Simple script to walk the lights up and down"""
import time
# exit_event is passed in from the pre/post show script as is required
# if an exit_event is generated the pre/post show script can terminate the script
# Do not forget to include it, if you do not sms commands will not be able
# to end the script and yo... | wheeldog515/lightshowPi | py/examples/ladder.py | Python | bsd-2-clause | 1,958 |
from __future__ import division
import numpy
import scipy.misc
import operator
import math
from util import memoize_instance
import warnings
from size_history import ConstantTruncatedSizeHistory
import numpy as np
from convolution_momi import convolve_chen
math_mod = math
myint,myfloat = int,float
## UN... | jackkamm/momi | momi/huachen_eqs.py | Python | gpl-3.0 | 11,877 |
#!/usr/bin/env python
people = 30
cars = 40
trucks = 15
if cars > people:
print("We should take the cars.")
elif cars < people:
print("We should not take the cars")
else:
print("We can't decide.")
if trucks > cars:
print("That's too many trucks.")
elif trucks < cars:
print("Maybe we coudl take th... | davvi/Hardway3 | ex30.py | Python | mit | 492 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
import gpg
import os.path
import sys
del absolute_import, division, unicode_literals
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
#
# This program is free software; you can redistribute it and/or m... | gpg/gpgme | lang/python/examples/howto/import-key.py | Python | lgpl-2.1 | 3,060 |
#
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | mcalmer/spacewalk | client/tools/rhn-virtualization/virtualization/notification.py | Python | gpl-2.0 | 2,598 |
from django.shortcuts import resolve_url
from django.test import TestCase
from InternetSemLimites.core.models import Provider, State
class TestGet(TestCase):
def setUp(self):
sc, *_ = State.objects.get_or_create(abbr='SC', name='Santa Catarina')
go, *_ = State.objects.get_or_create(abbr='GO', nam... | InternetSemLimites/PublicAPI | InternetSemLimites/markdown/tests/test_readme_view.py | Python | mit | 1,892 |
import click
from arrow.cli import pass_context, json_loads
from arrow.decorators import custom_exception, list_output
@click.command('get_group_creator')
@click.argument("group", type=str)
@pass_context
@custom_exception
@list_output
def cli(ctx, group):
"""Get the group's creator
Output:
creator userId
... | galaxy-genome-annotation/python-apollo | arrow/commands/groups/get_group_creator.py | Python | mit | 376 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | marmyshev/transitions | openlp/core/lib/theme.py | Python | gpl-2.0 | 23,608 |
# -*- coding: utf-8 -*-
"""
Tests for auth manager PKI access to postgres.
This is an integration test for QGIS Desktop Auth Manager postgres provider that
checks if QGIS can use a stored auth manager auth configuration to access
a PKI protected postgres.
Configuration from the environment:
* QGIS_POSTGRES_SERVE... | geopython/QGIS | tests/src/python/test_authmanager_pki_postgres.py | Python | gpl-2.0 | 9,727 |
#!/usr/bin/python
# This script looks up every pair team that exists.
# It then,for each pair team
# (4) creates a repo for the team (if it doesn't already exist)
# (5) populates it, but only if it was JUST created.
import getpass
import argparse
import os
import sys
from github_acadwf import addPyGithubToPath
fro... | UCSB-CS-Using-GitHub-In-Courses/github-acad-scripts | updatePairsForLab.py | Python | mit | 2,129 |
# -*- coding: utf-8 -*-
""" Auxiliary functions for light curve file handling.
Contains functions to extract Kepler PDCSAP and user-provided K2SFF light
curves.
"""
import numpy as np
from astropy.table import Table
from astropy.io import fits, ascii
import warnings
from astropy.utils.exceptions import AstropyUserW... | matiscke/lcps | lcps/lcps_io.py | Python | mit | 3,351 |
from django.conf.urls import url
from apps.comment import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^captcha/$', views.captcha, name='captcha'),
url(r'^(\d+)/$', views.comment, name='comment'),
] | blackholll/loonblog | apps/comment/urls.py | Python | mit | 234 |
import importlib
import os
import re
import socket
import sys
from django.utils.termcolors import colorize
def log(s):
sys.stdout.write(colorize(s, fg='cyan') + '\n')
# The normal scenario is that we use the hostname, but let's make it
# overridable, this is useful for dev and debugging.
IDEASCUBE_HOSTNAME = s... | ideascube/ideascube | ideascube/settings.py | Python | agpl-3.0 | 2,561 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Gruik coded by GuiguiAbloc
# http://blog.guiguiabloc.fr
# http://api.domogeek.fr
#
import web, sys, time
import json,hashlib,socket
from datetime import datetime,date,timedelta
import urllib, urllib2
from Daemon import Daemon
from xml.dom.minidom import parseString
import ... | guiguiabloc/api-domogeek | apidomogeek.py | Python | gpl-2.0 | 51,860 |
from setuptools import setup, find_packages
setup(
name = "dwpwg",
use_scm_version = True,
author = "Raspberry Aether",
author_email = "raspberryaether@riseup.net",
description = "(d)ice(w)are (p)ass(w)ord (g)enerator",
keywords = ("diceware password passwords passphrase passphrases " +
... | raspberryaether/dwpwg | setup.py | Python | gpl-2.0 | 1,336 |
# -*- coding: utf-8 -*-
"""
Plex Server
Who is watching what?
"""
import os
from plexapi.server import PlexServer
from plexapi.exceptions import NotFound, Unauthorized
from plexapi.myplex import MyPlexAccount
from pkm import log, utils, SHAREDIR
from pkm.decorators import never_raise, threaded_method
from pkm.exception... | mjs7231/pkmeter | pkm/plugins/plexserver.py | Python | bsd-3-clause | 4,435 |
import numpy as np
import os
import pandas as pd
import rpc
import sys
from sklearn_cifar_container import SklearnCifarContainer
from sklearn.metrics import accuracy_score
classes = [
'airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse',
'ship', 'truck'
]
positive_class = classes.index('airp... | dubeyabhi07/clipper | containers/python/test_sklearn_cifar_container.py | Python | apache-2.0 | 1,871 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
"""Script to checkout a sprout appliance
Usage:
sprout.py checkout
"""
import click
import os
import signal
import sys
import time
import yaml
from cfme.test_framework.sprout.client import AuthException
from cfme.test_framework... | anurag03/integration_tests | cfme/scripting/sprout.py | Python | gpl-2.0 | 5,048 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from .utils import SubdueTestCase, TempSub
class TestCommandExecution(SubdueTestCase):
def test_simple_command(self):
with TempSub(self, name='simple', thin=False) as s:
s.crea... | jdevera/subdue | test/test_command_execution.py | Python | mit | 1,116 |
import sys
try:
from django.conf import settings
from django.test.utils import get_runner
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="cbh_dat... | thesgc/cbh_datastore_model | runtests.py | Python | mit | 1,196 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import warnings
from datetime import timedelta
import operator
import pytest
from string import ascii_lowercase
from numpy import nan
from numpy.random import randn
import numpy as np
from pandas.compat import lrange, PY35
from pandas import (compat, isn... | pratapvardhan/pandas | pandas/tests/frame/test_analytics.py | Python | bsd-3-clause | 94,264 |
#!/usr/bin/python
# Copyright (c) 2014 Wladmir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory ... | VsyncCrypto/Vsync | share/seeds/generate-seeds.py | Python | mit | 4,187 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def DVSNameArrayUplinkPortPolicy(vim, *args, **kwargs):
'''The uplink port policy specifi... | xuru/pyvisdk | pyvisdk/do/dvs_name_array_uplink_port_policy.py | Python | mit | 1,743 |
# Copyright 2016 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... | nburn42/tensorflow | tensorflow/contrib/autograph/utils/__init__.py | Python | apache-2.0 | 1,825 |
import struct
import sys
import tempfile
import unittest
from mock import Mock, patch
from nose.tools import eq_
from beehive.formatter import formatters
from beehive.formatter import pretty
# from beehive.formatter import tags
from beehive.formatter.base import StreamOpener
from beehive.model import Tag, Feature, Mat... | vrutkovs/beehive | test/test_formatter.py | Python | bsd-2-clause | 7,335 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: tasking_ur.py
import mcl.framework
import mcl.tasking
class ur:
LP_MODULE_ID = 34825
TARGET_MODULE_ID = 34824
LP_RPC_INFO_LIST_DRIVERS =... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/ScRe/PyScripts/Lib/scre/mca/scre/cmd/sql/tasking_ur.py | Python | unlicense | 3,341 |
#task_H
def dijkstra(start, graph):
n = len(graph)
D = [None] * n
D[start] = 0
index = 0
Q = [start]
while index < len(Q):
v = Q[index]
index += 1
for u in graph[v]:
if D[u] == None or D[v] + min(graph[v][u]) < D[u]:
D[u] = D[v] + min(graph[v][u])
Q.append(u)
return D
def reverse(graph):
n = l... | Senbjorn/mipt_lab_2016 | lab_19/task_H.py | Python | gpl-3.0 | 1,281 |
from microbit import uart
# global constants
NOTE_OFF = 0x80
NOTE_ON = 0x90
CONTROLLER_CHANGE = 0xB0
PROGRAM_CHANGE = 0xC0
class MidiOut:
def __init__(self, device=None, channel=1):
if device is None:
self.device = uart
self.device.init(baudrate=31250)
elif not hasattr(devi... | SpotlightKid/microbit-worldtour-monifa | test_midiout.py | Python | mit | 2,125 |
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
FILE:... | Azure/azure-sdk-for-python | sdk/eventgrid/azure-eventgrid/samples/async_samples/sample_publish_events_to_a_topic_using_sas_credential_async.py | Python | mit | 1,719 |
class UserNotFoundException(Exception):
...
| SamR1/FitTrackee | fittrackee/users/exceptions.py | Python | agpl-3.0 | 48 |
#!/usr/bin/env python
# 12.01.2007, c
import os.path as op
import shutil
from optparse import OptionParser
import sfepy
from sfepy.base.base import *
from sfepy.base.conf import ProblemConf, get_standard_keywords
from sfepy.fem import ProblemDefinition
from sfepy.fem.evaluate import assemble_by_blocks
from sfepy.homo... | olivierverdier/sfepy | eigen.py | Python | bsd-3-clause | 24,663 |
#!/usr/bin/python
#
# Copyright (C) 2011 Google 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 2 of the License, or
# (at your option) any later version.
#
# This program... | badp/ganeti | test/py/ganeti.hypervisor.hv_lxc_unittest.py | Python | gpl-2.0 | 1,688 |
#
# Vagoth Cluster Management Framework
# Copyright (C) 2013 Robert Thomson
#
# 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... | sippeproject/vagoth | vagoth/virt/actions.py | Python | lgpl-2.1 | 4,887 |
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool, PoolMeta
__metaclass__ = PoolMeta
__all__ = ['Sale']
class Sale:
__name__ = 'sale.sale'
@property
def invoice_grouping_method(se... | kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/modules/sale_invoice_grouping/sale.py | Python | gpl-3.0 | 1,791 |
# coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_qc.configuration import Configuration
class... | Telestream/telestream-cloud-python-sdk | telestream_cloud_qc_sdk/telestream_cloud_qc/models/audio_channels_test.py | Python | mit | 5,000 |
from __future__ import division, print_function, absolute_import
import itertools
from numpy.testing import (assert_, assert_equal, assert_almost_equal,
assert_array_almost_equal, assert_array_equal,
assert_allclose)
from pytest import raises as assert_raises
from numpy import mgrid, pi, sin, ogrid, ... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/interpolate/tests/test_interpolate.py | Python | mit | 102,313 |
# -*- coding: utf-8 -*-
#
# Rule
#
# Blueprint for rule administration.
#
# Created by dp on 2014-12-25.
# ================================================================================ #
from flask.blueprints import Blueprint
from flask.globals import g
from wtforms.fields.core import SelectField
from wtforms.fields... | dpetter/Eowyne | src/core/administration/rules.py | Python | gpl-2.0 | 4,258 |
"""Functions to plot M/EEG data e.g. topographies
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com... | yousrabk/mne-python | mne/viz/topomap.py | Python | bsd-3-clause | 66,755 |
from floyd.client.base import FloydHttpClient
from floyd.model.version import CliVersion
from floyd.log import logger as floyd_logger
class VersionClient(FloydHttpClient):
"""
Client to get API version from the server
"""
def __init__(self):
self.url = "/cli_version"
super(VersionClien... | houqp/floyd-cli | floyd/client/version.py | Python | apache-2.0 | 580 |
import sqlalchemy as sa
from sqlalchemy_utils import table_name
from tests import TestCase
class TestTableName(TestCase):
def create_models(self):
class Building(self.Base):
__tablename__ = 'building'
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.Unic... | tonyseek/sqlalchemy-utils | tests/functions/test_table_name.py | Python | bsd-3-clause | 775 |
import logging
import six
from ray.tune.error import TuneError
from ray.tune.experiment import convert_to_experiment_list, Experiment
from ray.tune.analysis import ExperimentAnalysis
from ray.tune.suggest import BasicVariantGenerator
from ray.tune.trial import Trial
from ray.tune.trainable import Trainable
from ray.tu... | stephanie-wang/ray | python/ray/tune/tune.py | Python | apache-2.0 | 18,227 |
import sys, os
import subprocess
nw_exe = os.path.normpath(sys.argv[1])
nw_dll = os.path.normpath(sys.argv[2])
node_dll = os.path.normpath(sys.argv[3])
out_file = os.path.normpath(sys.argv[4])
sym_file = nw_exe + ".sym"
dll_sym_file = nw_dll + ".sym"
node_sym_file = node_dll + ".sym"
dump_exe = os.path.join(os.path.di... | nwjs/nw.js | tools/dump_win_syms.py | Python | mit | 804 |
# ICE Revision: $Id$
"""Watches output and analyzes it"""
from .BasicWatcher import BasicWatcher
from .AnalyzedCommon import AnalyzedCommon
class AnalyzedWatcher(BasicWatcher,AnalyzedCommon):
def __init__(self,filename,analyzer,silent=False,tailLength=1000,sleep=0.1):
"""@param analyzer: analyzer
... | takaakiaoki/PyFoam | PyFoam/Execution/AnalyzedWatcher.py | Python | gpl-2.0 | 827 |
#!/usr/bin/env python
"""
Loads a json molecule and draws atoms in Blender.
Blender scripts are weird. Either run this inside of Blender or in a shell with
blender foo.blend -P molecule_to_blender.py
The script expects an input file named "molecule.json" and should be in the
same directory as "atoms.json"
Writte... | patrickfuller/blender-chemicals | blender_chemicals/draw.py | Python | mit | 7,037 |
'''Class for pickling and encrypting data'''
__title__ = 'EncryptedPickle'
__version__ = '0.1.4'
__author__ = 'Vingd, Inc.'
__author_email__ = 'developers@vingd.com'
__url__ = 'https://github.com/vingd/encrypted-pickle-python'
__copyright__ = 'Copyright 2013 Vingd, Inc.'
__license__ = 'MIT License'
| vingd/encrypted-pickle-python | encryptedpickle/__init__.py | Python | mit | 301 |
import _plotly_utils.basevalidators
class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="bgcolor", parent_name="ohlc.hoverlabel", **kwargs):
super(BgcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/ohlc/hoverlabel/_bgcolor.py | Python | mit | 500 |
#!/usr/bin/env python3
import argparse
import matplotlib.pyplot as plot
import matplotlib.ticker as ticker
import re
import scipy
import wells.publisher as publisher
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--interactive",
help="Interactive mode",
action... | ioreshnikov/wells | timedomain2.py | Python | mit | 5,970 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | ingenioustechie/zamboni | mkt/access/migrations/0001_initial.py | Python | bsd-3-clause | 1,814 |
#!/usr/bin/python
import os, subprocess, datetime, time
class zxinghost:
__java_host__ = "zxingHost"
def __init__(self, loc = './', zxing_libs = ["core.jar", "javase.jar"]):
libs = [loc + l for l in zxing_libs]
libs.insert(0, loc)
cmd = ["java", "-cp", os.pathsep.join(libs), self.__... | Jarrey/python-ipc-zxing | zxinghost.py | Python | apache-2.0 | 2,827 |
# -*- coding: utf-8 -*-
import os
import re
import sys
import time
import shutil
import select
import subprocess
import nixops.util
import nixops.resources
class MachineDefinition(nixops.resources.ResourceDefinition):
"""Base class for NixOps machine definitions."""
def __init__(self, xml):
nixops.r... | garbas/nixops | nixops/backends/__init__.py | Python | lgpl-3.0 | 17,426 |
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | intel-analytics/BigDL | python/chronos/src/bigdl/chronos/model/VanillaLSTM.py | Python | apache-2.0 | 4,224 |
SUB_PACKET_SIZE = 5 # [ax, ay, az, pressure, t]
PACKET_DELIMINATOR = "<>"
SUB_PACKET_DELIMINATOR = " "
SAMPLE_MEMORY = 21
PRESSURE_NORMALIZER = 2.3 * 14.0
WINDOW_SIZE = 1000
# FIFO_SAMPLE_PERIOD = 1.0 / 100.0
SEND_POSITION_THRESHOLD = 60
ACCEL_G = 9.832
# LSB_G = 16384.0 / 2.0
LSB_G = 4096.0 / 8.0 # I think
KILL_T... | GEverding/touchVision | io/cleaner/constants.py | Python | mit | 390 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2013 Tobias Weber <tobi-weber@gmx.de>
#
# 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 ... | tobi-weber/levitas | src/levitas/server/eventletServer.py | Python | apache-2.0 | 1,391 |
# Copyright 2018 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... | mlperf/training_results_v0.5 | v0.5.0/google/cloud_v3.8/resnet-tpuv3-8/code/resnet/model/staging/models/rough/resnet/resnet_model.py | Python | apache-2.0 | 16,310 |
"""Basic checks for HomeKitSwitch."""
from tests.components.homekit_controller.common import (
setup_test_component)
async def test_switch_change_outlet_state(hass, utcnow):
"""Test that we can turn a HomeKit outlet on and off again."""
from homekit.model.services import OutletService
helper = await ... | MartinHjelmare/home-assistant | tests/components/homekit_controller/test_switch.py | Python | apache-2.0 | 1,974 |
import random
from testcases.testcases_base import TestcasesBase
import unittest, time
class TestStoragepoolsAPI(TestcasesBase):
def setUp(self):
super().setUp()
self.freeDisks = [x['name'] for x in self.core0_client.getFreeDisks()]
if self.freeDisks == []:
self.skipTest(' [*] N... | zero-os/0-orchestrator | tests/0_orchestrator/test_suite/testcases/basic_tests/test05_storagepools_apis.py | Python | apache-2.0 | 34,991 |
#
# Plot dimuon mass distribution for SWC HEP 2015
#
from ROOT import TFile, TBrowser, TH1D
file_events = TFile("test_data/events.root")
tree = file_events.Get("events")
nEvents = tree.GetEntries()
print 'Number of events = '+ str(nEvents)
# xrange(n) = 0,1,2,...,n-1
#for iEv in xrange(nEvents):
# tree.GetEntry(i... | denglert/dimuon | dimuon.py | Python | mit | 695 |
#!/usr/bin/python
from aws_client import AWSClient
import json
class BasicDiscoverer(AWSClient):
def get_instances(self, *args):
"Runs discovery method and packs result into JSON"
data = self.discovery(*args)
return json.dumps({"data": data})
def discovery(self, *args):
"Metho... | wawastein/zabbix-cloudwatch | zabbix-scripts/scripts/discovery/basic_discovery.py | Python | gpl-3.0 | 386 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains the class describing the coordination geometries that can exist in a given structure. These
"model" coordination geometries are described in the following articles :
- Pure Appl. Chem... | dongsenfo/pymatgen | pymatgen/analysis/chemenv/coordination_environments/coordination_geometries.py | Python | mit | 52,397 |
"""ControlPrestamo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | marvinAlvarenga/ControlPrestamo | ControlPrestamo/urls.py | Python | gpl-2.0 | 865 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v8/services/types/feed_mapping_service.py | Python | apache-2.0 | 5,553 |
from .service import Fullcontact
| ducksboard/libsaas | libsaas/services/fullcontact/__init__.py | Python | mit | 33 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/oval_5/defs/windows/RegKeyEffectiveRights53ObjectElement.py | Python | gpl-3.0 | 1,362 |
import os
import sys
import pandas as pd
import numpy as np
from numpy.random import poisson, uniform
from numpy import mean
import time
import math
po = True
teamsheetpath = sys.path[0] + '/teamcsvs/'
compstat = {'TDF': 'TDA', 'TDA': 'TDF', #Dictionary to use to compare team stats with opponent stats
'F... | JoeJimFlood/NFLPrediction2014 | matchup.py | Python | mit | 10,272 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.