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
# ####### # Copyright (c) 2016-2020 Cloudify Platform Ltd. 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...
cloudify-cosmo/cloudify-azure-plugin
cloudify_azure/resources/storage/file.py
Python
apache-2.0
4,418
import asyncio import json from discord.ext import commands from utils.config import Config from utils.logger import log from utils import checks from utils.tools import * from gw2api import GuildWars2Client config = Config() gw2 = GuildWars2Client(api_key=config._gw2Key) log.info("[Guild Wars 2] Getting Guild Wars...
robingall2910/RobTheBoat
commands/gw2.py
Python
mit
1,888
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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...
robk5uj/invenio
modules/websubmit/lib/websubmit_config.py
Python
gpl-2.0
10,125
"""Connection Manager Module """ import importlib import ashaw_notes.utils.configuration class ConnectionManager: """Connection Manager Class""" connectors = None def __init__(self): if not self.connectors: self.load_connectors() def load_connectors(self): """Returns all ...
follower46/ashaw-notes
ashaw_notes/utils/connection_manager.py
Python
mit
992
from apiwrapper.endpoints.endpoint import Endpoint from apiwrapper.endpoints.user import User class CertificatePinned(Endpoint): __endpoint_user_pinned_certificates = "certificate-pinned" @classmethod def _get_base_endpoint(cls, user_id, certificate_id=None): endpoint = User._get_base_endpoint(u...
OGKevin/ComBunqWebApp
apiwrapper/endpoints/certificate_pinned.py
Python
mit
856
#! /usr/bin/env python from __future__ import print_function, absolute_import import argparse import numpy as np import ase.atoms import ase.build import ase.visualize def atoms_from_sqs(filename): with open(filename, 'r') as f: lines = f.readlines() lines = [line.split() for line in lines] basi...
ajjackson/mctools
mctools/sqs_read.py
Python
gpl-3.0
1,925
from django.apps import AppConfig class MainConfig(AppConfig): name = 'main' verbose_name = 'Общее'
PhobosXIII/qc
main/apps.py
Python
apache-2.0
115
import os from paraview import simple # ----------------------------------------------------------------------------- MODULE_PATH = os.path.dirname(os.path.abspath(__file__)) PLUGINS = [ 'parflow.py' ] FULL_PATHS = [ '/Applications/ParaView-5.6.0-1626-g52acf2f741.app/Contents/Plugins/ParFlow.so', ] # -----...
Kitware/HPCCloud
pvw-dependencies/pv-flow/flow/plugins/__init__.py
Python
apache-2.0
626
#!/usr/bin/env python # encoding: utf-8 """ Author(s): Matthew Loper See LICENCE.txt for licensing and contact information. """ import unittest from .ch import Ch, depends_on class TestInnerComposition(unittest.TestCase): def test_ic(self): child = Child(a=Ch(10)) parent = Parent(child=child, al...
mattloper/chumpy
chumpy/test_inner_composition.py
Python
mit
2,079
# #calibrate.py # #calibrate fits images using darks, flats, and bias frames #corrected image = (image - bias - k(dark-bias))/flat #for k=1, i.e. image exp = dark exp, corrected image = (image - dark)/flat import os import glob import math import subprocess import re import sys import datetime import shutil from decim...
mcnowinski/various-and-sundry
lightcurve/super.calibrate.py
Python
mit
10,853
import logging import os import aexpect from autotest.client.shared import error from autotest.client import utils from virttest import data_dir from virttest import utils_misc @error.context_aware def run(test, params, env): """ Timer device check clock frequency offset using NTP on CPU starved guest: ...
tolimit/tp-qemu
qemu/tests/timerdevice_clock_drift_with_ntp.py
Python
gpl-2.0
4,079
from datetime import datetime import pytz from django.contrib.auth.models import Group from django.test import TestCase, RequestFactory from .forms import CollectionSetForm, ExportForm, CredentialWeiboForm, CredentialFlickrForm, \ CredentialTwitterForm, CollectionTwitterSearchForm, SeedTwitterUserTimelineForm fro...
gwu-libraries/sfm-ui
sfm/ui/test_forms.py
Python
mit
13,815
import mock import pytest from pytwitcherapi import models from test import conftest @pytest.fixture(scope='function') def game(): n = 'Test Game' g = models.Game(name=n, box={}, logo={}, twitchid=312, viewers=1, channels=1) return g def test_repr(game): assert repr(game) == '<Game %s, id: %s>' % (...
Pytwitcher/pytwitcherapi
test/test_models_game.py
Python
bsd-3-clause
1,267
question_list = [ # (mark, count, [directories]) (1, 3, 'eop/chapter3/div_mod_io_'), ] practice_mode = True standalone = False logged = False log_dir = ''
stryder199/RyarkAssignments
Assignment2/quizzes/eop/chapter3/div_mod.py
Python
mit
158
# -*- coding: utf-8 -*- """ Created on Wed Apr 13 04:40:26 2016 @author: santiago """ import unittest from petroSym.petroSym import * import time import subprocess import signal import os class TestOpenGui(unittest.TestCase): """ Test case for open_gui """ def test_open(self): #Ejecuto el comando petroSy...
jmarcelogimenez/petroSym
petroSym/tests/test_open_petroSym.py
Python
gpl-2.0
670
#!/usr/bin/env python ''' work out total flight time for a mavlink log ''' import sys, time, os, glob import os, sys from math import * from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--condition", default=None, help="condition for packets") parser.add_argument("...
kuri-kustar/pixhawk_plotting_tools
scripts/mavflighttime.py
Python
lgpl-3.0
3,316
from unittest import TestCase import numpy as np from pyatac.chunkmat2d import FragmentMat2D, BiasMat2D from pyatac.chunk import ChunkList from pyatac.bias import InsertionBiasTrack from pyatac.fragmentsizes import FragmentSizes from pyatac.tracks import InsertionTrack, Track class Test_FragmentMat2D(TestCase): ...
GreenleafLab/NucleoATAC
tests/test_chunkmat2d.py
Python
mit
2,286
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. try: from thread import get_ident as _get_ident except ImportError: from dummy_thread import get_ident as _get_ident try: from _abcoll import KeysView...
moneymaker365/plugin.video.ustvvod
resources/lib/ordereddict.py
Python
gpl-2.0
8,821
############################################# # datify-tweetalyzer # reads multiple tweetalyzer output files and creates a date-aligned set of term counts # it uses the date of each file automatically import sys import operator import argparse import csv import glob import os.path import time #######################...
sidprobstein/datify-tweetalyzer
src/datify-tweetalyzer/datify-tweetalyzer.py
Python
mit
2,787
#!/usr/bin/python # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE.txt or copy at # https://www.bfgroup.xyz/b2/LICENSE.txt) # Test the 'libraries' example. import BoostBuild t = BoostBuild.Tester(use_test_config=False) t.set_tree("../...
davehorton/drachtio-server
deps/boost_1_77_0/tools/build/test/example_libraries.py
Python
mit
490
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software #...
eonpatapon/rally
rally/plugins/openstack/scenarios/ec2/servers.py
Python
apache-2.0
1,964
from __future__ import unicode_literals from __future__ import print_function import matplotlib.pyplot as plt from mpi4py import MPI import numpy as np from sklearn.neighbors import KernelDensity from scipy.stats import binom from .XSample import XSample from .lambda_alphas_access import save_lambda from ..critical_b...
kjohnsson/modality
modality/calibration/bandwidth.py
Python
mit
10,325
import sys import sqlite3 import os import os.path def main(dbname): con = sqlite3.connect(dbname) con.execute("CREATE TABLE IF NOT EXISTS rooms(id INTEGER PRIMARY KEY, name TEXT NOT NULL," " description TEXT NOT NULL)") con.commit() path = "./rooms" for f in os.listdir(path): ...
L0st1nC0d3/TextAdventure
todb.py
Python
epl-1.0
1,112
import pandas as pd def retvoldf(ret, vol, v): """ :param ret: returns (pd.dataframe) :param vol: vol (pd.dataframe) :param v: v is from v.csv given to us :return: Dataframe """ # this line below creates a DataFrame obj that intersects the dates from vol and v.csv. It then arranges t...
mannyfin/VolatilityForecasting
src/returnvoldf.py
Python
gpl-3.0
729
import logging import logging.config import os import urllib # get the right settings module settingmodule = os.environ.get('DJANGO_SETTINGS_MODULE', 'settings_local') if settingmodule.startswith(('zamboni', # typical git clone destination 'workspace', # Jenkins ...
harikishen/addons-server
services/utils.py
Python
bsd-3-clause
4,239
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013-2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
jorsea/vertical-ngo
framework_agreement_sourcing/model/logistic_requisition.py
Python
agpl-3.0
1,988
from __future__ import unicode_literals import re from django.core.exceptions import ValidationError from django.utils.deconstruct import deconstructible from django.utils.translation import ugettext_lazy as _, ungettext_lazy from django.utils.encoding import force_text from django.utils.ipv6 import is_valid_ipv6_add...
912/M-new
virtualenvironment/experimental/lib/python2.7/site-packages/django/core/validators.py
Python
gpl-2.0
10,424
# $Id$ # # Copyright (C) 2000-2010 Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ Configuration for the RDKit Python...
AlexanderSavelyev/rdkit
rdkit/RDConfig.py
Python
bsd-3-clause
2,009
from flask import Flask import rpyc import json app = Flask(__name__) rpc = rpyc.connect("localhost", port=18861) @app.route('/') def hello_world(): return 'Hello, World! %s' % rpc.root.get_answer(json.dumps({'to_return': 42}))
woqs/POC_RPC
flask/hello.py
Python
gpl-3.0
234
import datetime import re import socket from jsonschema.compat import str_types from jsonschema.exceptions import FormatError class FormatChecker(object): """ A ``format`` property checker. JSON Schema does not mandate that the ``format`` property actually do any validation. If validation is desired...
ARMmbed/yotta_osx_installer
workspace/lib/python2.7/site-packages/jsonschema/_format.py
Python
apache-2.0
6,881
#!/usr/bin/env python from __future__ import print_function import argparse import csv import os.path import re import sys from collections import defaultdict from collections import namedtuple from collections import OrderedDict __author__ = "Eldar Abusalimov" def outerr(*args, **kwargs): kwargs.setdefault('f...
abusalimov/sdf-csv-join
sdf-csv-join.py
Python
mit
5,891
# 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 u...
airbnb/airflow
docs/exts/docs_build/dev_index_generator.py
Python
apache-2.0
2,803
import numpy as np import pytest pytestmark = pytest.mark.gpu import dask.array as da from dask.array.gufunc import apply_gufunc from dask.array.utils import assert_eq cupy = pytest.importorskip("cupy") def test_apply_gufunc_axis(): def mydiff(x): return np.diff(x) a = cupy.random.randn(3, 6, 4) ...
dask/dask
dask/array/tests/test_cupy_gufunc.py
Python
bsd-3-clause
532
from Speech import say, play import HostInfo import Config from TeamCity import TeamCity, NoConnection, NoBuild import Lights import Display import datetime import time import Missile def initialize(): Display.rgb(255, 255, 255) say('Hello') Display.clear() Display.write(" Hello! ") def go_to_...
JohnStov/buildmon
Monitor.py
Python
mit
4,570
# Copyright 2015, Oliver Nagy <olitheolix@gmail.com> # # This file is part of Azrael (https://github.com/olitheolix/azrael) # # Azrael is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of...
daviddeng/azrael
azrael/test/test.py
Python
agpl-3.0
6,059
from dronekit import connect, VehicleMode, LocationGlobal, LocationGlobalRelative from pymavlink import mavutil # Needed for command message definitions from Find_serial_ports import serial_ports import time import math import argparse parser = argparse.ArgumentParser(description='Control Copter and send comman...
sassystacks/DASS
Simulation/fly_come_back.py
Python
mit
6,298
""" An implementation of the Discourse SSO protocol [1] using webapp2 handlers. [1] https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045 """ import hashlib import hmac import itertools import urllib import urlparse import logging import webapp2 def _equalsSlowly(a, b): """Constant time equal...
udacity/gae-discourse-sso
__init__.py
Python
apache-2.0
3,095
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-03-17 22:37 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('collection', '0004_social'), ] ...
hellowebapp/hellowebapp-ic-code
collection/migrations/0005_auto_20160317_2237.py
Python
mit
1,547
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
dietrichc/streamline-ppc-reports
examples/dfp/v201405/team_service/create_teams.py
Python
apache-2.0
1,855
#!/usr/bin/env python # Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 # # Unles...
gooddata/zuul
tests/test_zuultrigger.py
Python
apache-2.0
6,248
from enum import Enum # Used for the --wrap-mode command-line argument # # Special wrap modes: # nofallback: Don't download wraps for dependency() fallbacks # nodownload: Don't download wraps for all subproject() calls # # subprojects are used for two purposes: # 1. To download and build dependencies by using .wra...
jeandet/meson
mesonbuild/wrap/__init__.py
Python
apache-2.0
1,595
# This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the ...
sevein/archivematica
src/dashboard/src/components/ingest/forms.py
Python
agpl-3.0
3,672
import app_info import loggers import plist_editor __version__ = '1.9.1' __all__ = ['app_info', 'fs_analysis', 'loggers', 'plist_editor', 'slack'] # This provides the ability to get the version from the command line. # Do something like: # $ python -m management_tools.__init__ if __name__ == "__main__": pri...
univ-of-utah-marriott-library-apple/management_tools
management_tools/__init__.py
Python
mit
376
########################################################################## # Copyright (C) 2009 - 2014 Huygens ING & Gerbrandy S.R.L. # # This file is part of bioport. # # bioport 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 So...
HuygensING/bioport-repository
bioport_repository/source.py
Python
gpl-3.0
5,287
from __future__ import print_function, absolute_import, division import sys import argparse from .. import __version__ from . import parser_dump from . import parser_skeleton from . import parser_worker from . import parser_plot from . import parser_currentbest def main(): help = 'osprey is a tool for machine l...
rmcgibbo/osprey
osprey/cli/main.py
Python
apache-2.0
1,526
""" The rechunk module defines: intersect_chunks: a function for converting chunks to new dimensions rechunk: a function to convert the blocks of an existing dask array to new chunks or blockshape """ from __future__ import absolute_import, division, print_function from itertools import product...
cowlicks/dask
dask/array/rechunk.py
Python
bsd-3-clause
8,121
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
zen/openstack-dashboard
django-openstack/django_openstack/dash/urls.py
Python
apache-2.0
4,628
# Copyright (c) 2016 b<>com # # 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, softw...
openstack/watcher-dashboard
watcher_dashboard/content/strategies/tabs.py
Python
apache-2.0
1,021
#!/usr/bin/env python """Plotting example Demonstrates simple plotting. """ from sympy import Symbol, cos, sin, Plot, log, tan from sympy.abc import x, y def main(): fun1 = cos(x)*sin(y) fun2 = sin(x)*sin(y) fun3 = cos(y) + log(tan(y/2)) + 0.2*x Plot(fun1, fun2, fun3, [x, -0.00, 12.4, 40], [y, 0.1...
ojengwa/sympy
examples/beginner/plotting_nice_plot.py
Python
bsd-3-clause
369
# -*- coding: utf-8 -*- """This module supports the relation parser by handling statements.""" import logging import re from typing import Mapping, Optional, Pattern, Set from pyparsing import And, MatchFirst, ParseResults, Suppress, Word from .baseparser import BaseParser from .constants import NamespaceTermEncodi...
pybel/pybel
src/pybel/parser/parse_metadata.py
Python
mit
13,428
import click from textkit.utils import output, read_tokens @click.command() @click.argument('tokens', type=click.File('r'), default=click.open_file('-')) @click.option('-m', '--minimum', default=3, help='Minimum length of token to not filter.', show_default=True) def filterlengths(minimum, tokens): ...
learntextvis/textkit
textkit/filter/filter_lengths.py
Python
mit
491
from django.conf.urls import include, url from rest_framework.routers import DefaultRouter from example_app.views import PlayersViewSet, TeamsViewSet # Create a router and register our viewsets with it. router = DefaultRouter() router.register(r'players', PlayersViewSet, base_name='players') router.register(r'teams...
manjitkumar/drf-url-filters
example_app/urls.py
Python
mit
416
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
joshmoore/zeroc-ice
rb/allTests.py
Python
gpl-2.0
1,389
from setuptools import setup setup( name="pipeline_auth", version="0.0.1", author="Greg Thole", packages=[ 'pipeline_auth', ], install_requires=[ 'requests==2.3.0', 'github3.py==0.9.0', ], description="Two step client authentication class for OAuth login with " ...
allclasses/pipeline_auth
setup.py
Python
mit
381
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Author: Corentin Arnaud Module: ReadXmlFile Description: reads a global xml setup file ''' from lxml import etree from os import path import math from Cost.CostType import CostType from Experiments.StateEstimatorType import StateEstimatorType class ReadXmlFile(obje...
osigaud/ArmModelPython
Control/Utils/ReadXmlFile.py
Python
gpl-2.0
4,546
""" ============================================== Plot randomly generated classification dataset ============================================== Plot several randomly generated 2D classification datasets. This example illustrates the `datasets.make_classification` function. Three binary and two multi-class classifica...
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/datasets/plot_random_dataset.py
Python
bsd-3-clause
1,668
#! /usr/bin/env python # # Copyright (c) 2008-2010 University of Utah and the Flux Group. # # {{{GENIPUBLIC-LICENSE # # GENI Public License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without rest...
nmc-probe/emulab-nome
protogeni/tutorial/linktest.py
Python
agpl-3.0
4,917
""" Get/Insert library gene counts """ import logging import os import re from .. import parsing from .. import database from .. import postprocessing from .. import model as docs logger = logging.getLogger(__name__) class LibraryGeneCountAnnotator(object): """ Identifies, stores, and updates information ab...
jaeddy/bripipetools
bripipetools/annotation/librarygenecounts.py
Python
mit
2,667
#!/usr/bin/env python3 """ A script for aggregating statistics on the duration of audio files which have corresponding Higgins Annotation Tool (HAT) <http://www.speech.kth.se/hat/> XML annotation files found underneath a given directory or directories. """ __author__ = "Todd Shore <errantlinguist+github@gmail.com>" _...
errantlinguist/tangrams-restricted
analysis/scripts/recording_durations.py
Python
gpl-3.0
3,031
"""Test whether all elements of cls.args are instances of Basic.""" # NOTE: keep tests sorted by (module, class name) key. import inspect import io import os import re import warnings from diofant import (ITE, Add, Adjoint, And, Atom, AtomicExpr, Basic, BlockDiagMatrix, BlockMatrix, Complement, ...
skirpichev/omg
diofant/tests/core/test_args.py
Python
bsd-3-clause
64,534
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : """Fail2Ban exceptions used by both client and server """ # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publ...
TylerMoeller/fail2ban
fail2ban/exceptions.py
Python
gpl-2.0
1,164
from __future__ import unicode_literals from django.conf.urls import patterns, include, url from django.contrib.admin.sites import AdminSite from mezzanine.utils.importing import import_dotted_path from mezzanine.utils.models import get_user_model class LazyAdminSite(AdminSite): """ Defers calls to register...
fusionbox/mezzanine
mezzanine/boot/lazy_admin.py
Python
bsd-2-clause
2,515
#!/usr/bin/env python2 import os import sys import tempfile from optparse import OptionParser # Assembler BIN_AS = '/usr/bin/arm-linux-gnueabi-as' ALTER_BIN_AS = 'as' # Linker BIN_LD = '/usr/bin/arm-linux-gnueabi-ld' ALTER_BIN_LD = 'ld' # Objcopy BIN_OC = '/usr/bin/arm-linux-gnueabi-objcopy' ALTER_BIN_OC = 'objcopy' ...
alexpark07/ARMSCGen
xorencoder/XOREncoder.py
Python
gpl-2.0
6,815
from hiclib.hicShared import byChrEig from mirnylib.genome import Genome import matplotlib.pyplot as plt from mirnylib.systemutils import setExceptionHook from mirnylib.plotting import nicePlot, maximumContrastList setExceptionHook() gen = Genome('../../../../hg19', readChrms=["#","X"]) mychroms = [0,2,5,13,20] eigs ...
bxlab/HiFive_Paper
Scripts/HiCLib/mirnylab-hiclib-460c3fbc0f72/tests/testEig/testEig.py
Python
bsd-3-clause
607
""" Tests for SARIMAX models Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np import pandas as pd import os import warnings from statsmodels.tsa.statespace import sarimax, tools from statsmodels.tsa import arima_model as arima from .r...
yl565/statsmodels
statsmodels/tsa/statespace/tests/test_sarimax.py
Python
bsd-3-clause
76,262
class Tile: map_word = "Top cliff" def describe(self): print("You have reached the top of the cliff! You feel the fresh " "breeze in your face and you smell the salty sea! The view and " "the weather here are wonderful! You'd like to stay but the " "adventu...
jantuomi/weatbag
weatbag/tiles/n1w6.py
Python
mit
809
import usbrelay import androidServer import clap import sys def main(): if(len(sys.argv) == 2): port = int(sys.argv[1]) else: port = 20000 relay = usbrelay.Relay() relay.open() server = androidServer.Server(port, relay) server.run() clapListener = clap.ClapLi...
jpedrorl/LightSwitch
main.py
Python
mit
622
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/managedservices/_params.py
Python
mit
1,527
#!/usr/bin/env python3 import argparse from sys import argv from .actions import add as add_action from .actions import commit as commit_action from .actions import diff as diff_action from .actions import gettest as get_test_action from .actions import init as init_action from .actions import list as list_action from...
kunyavskiy/polygon-cli
polygon_cli/polygon_cli.py
Python
mit
2,177
"""Test zha sensor.""" from unittest import mock import pytest import zigpy.zcl.clusters.general as general import zigpy.zcl.clusters.homeautomation as homeautomation import zigpy.zcl.clusters.measurement as measurement import zigpy.zcl.clusters.smartenergy as smartenergy from homeassistant.components.sensor import D...
titilambert/home-assistant
tests/components/zha/test_sensor.py
Python
apache-2.0
10,606
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-23 08:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='HelloW...
baby5/Django-httpbin
httpbin/bin/migrations/0001_initial.py
Python
mit
554
"""Tools file for HassIO.""" import asyncio from contextlib import suppress import json import logging import socket import aiohttp import async_timeout import pytz import voluptuous as vol from .const import URL_HASSIO_VERSION, URL_HASSIO_VERSION_BETA _LOGGER = logging.getLogger(__name__) FREEGEOIP_URL = "https://...
pvizeli/hassio
hassio/tools.py
Python
bsd-3-clause
2,785
# Copyright 2016 Casey Jaymes # This file is part of Expatriate. # # Expatriate 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 3 of the License, or # (at your option) any later version....
cjaymes/expatriate
tests/xpath/test_predicates.py
Python
lgpl-3.0
1,657
import urllib,urllib2,sys,re,xbmcplugin,xbmcgui,xbmcaddon,xbmc,os import datetime import time import net net=net.Net() PLUGIN='plugin.video.footballreplays' ADDON = xbmcaddon.Addon(id='plugin.video.footballreplays') maxVideoQuality = ADDON.getSetting("maxVideoQuality") qual = ["480p", "720p", "1080p"] maxVideoQuality ...
odicraig/kodi2odi
addons/plugin.video.footballreplays/default.py
Python
gpl-3.0
23,230
#!/usr/bin/python # # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
Eforcers/inbox-cleaner
src/lib/gdata/docs/service.py
Python
mit
23,152
# coding=utf-8 """ trajectory_ingestor.py Library for trajectory data import functions """ import numpy as np import pandas as pd from pandas.tseries.offsets import Milli from .time_utils import leap_seconds, convert_gps_time, datenum_to_datetime TRAJECTORY_INTERP_FIELDS = {'lat', 'long', 'ell_ht'} def import_tr...
DynamicGravitySystems/DGP
dgp/lib/trajectory_ingestor.py
Python
apache-2.0
5,101
# References: # # https://www.tensorflow.org/guide/low_level_intro # # only needed for python 2.7 # from __future__ import absolute_import # from __future__ import division # from __future__ import print_function import numpy as np from numpy import array from numpy import float32 # a complete input set on 7 bits # ...
WmHHooper/aima-python
submissions/aardvark/myNN.py
Python
mit
8,182
# # Usage: # - python src/python/dart/tool/export_swagger_definitions.py src/python/dart/web/api/swagger.yaml # from __future__ import print_function import filecmp import os import sys from yaml import dump try: from yaml import CDumper as Dumper except ImportError: from yaml import Dumper from dart.model.qu...
RetailMeNotSandbox/dart
src/python/dart/tool/export_swagger_definitions.py
Python
mit
13,610
# -*- coding: utf-8 -*- # Copyright(C) 2010-2013 Christophe Benz, Romain Bignon, Laurent Bachelier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either ver...
frankrousseau/weboob
modules/youtube/pages.py
Python
agpl-3.0
51,843
from django.conf.urls import * from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic import TemplateView from django.views.static import serve from home.views import homepage import settings admin.autodiscover() urlpatterns = [ url(r'^$', ho...
SushiTee/teerace
teerace/urls.py
Python
bsd-3-clause
1,518
""" Created on Dec 20, 2011 @author: StarlitGhost """ from twisted.plugin import IPlugin from zope.interface import implementer from desertbot.message import IRCMessage from desertbot.moduleinterface import IModule from desertbot.modules.commandinterface import BotCommand from desertbot.response import IRCResponse, R...
DesertBot/DesertBot
desertbot/modules/commands/Join.py
Python
mit
1,084
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
skypigr/shadowsocks
shadowsocks/tcprelay.py
Python
apache-2.0
35,099
# -*- coding: utf-8 -*- # © 2016 Comunitea - Javier Colmenero <javier@comunitea.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, api class StockPickingUnreserveMulti(models.TransientModel): _name = 'stock.picking.unreserve.multi' @api.multi def unreserve(...
Comunitea/CMNT_00040_2016_ELN_addons
eln_stock/wizard/stock_picking_unreserve_multi.py
Python
agpl-3.0
688
##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms below apply. # # Should you enter into a separate licen...
w1z2g3/crossbar
crossbar/router/cookiestore.py
Python
agpl-3.0
11,262
from functools import wraps from operator import attrgetter from django.db import connections, transaction, IntegrityError from django.db.models import signals, sql from django.utils.datastructures import SortedDict class ProtectedError(IntegrityError): def __init__(self, msg, protected_objects): self.pr...
weidongxu84/info-gatherer
django/db/models/deletion.py
Python
mit
10,800
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Alex Li
XiaJieCom/change
stu103151/days22/project/bbs/templatetags/__init__.py
Python
lgpl-2.1
65
# # Copyright (C) 2010 Sorcerer # # This file is part of UrTSB. # # UrTSB 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. # # UrTSB is...
anthonynguyen/UrTSB
urtsb_src/ui/favoritesfilter.py
Python
gpl-3.0
3,337
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from unittest import TestCase import mock from preggy import expect ...
2947721120/thumbor
tests/test_app.py
Python
mit
1,660
# 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 u...
apache/airflow
tests/charts/test_create_user_job.py
Python
apache-2.0
9,661
import argparse import os import sys from time import sleep import yaml import generate_post_file as generator import kijiji_api if sys.version_info < (3, 0): raise Exception("This program requires Python 3.0 or greater") def main(): parser = argparse.ArgumentParser(description="Post ads on Kijiji") pa...
jackm/Kijiji-Repost-Headless
kijiji_repost_headless/__main__.py
Python
mit
6,246
# Generated by Django 2.0.3 on 2018-03-29 06:42 from decimal import Decimal import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("order", "0045_auto_20180329_0142"), ("product", "0057_auto_20180403_0852"), ] ope...
maferelo/saleor
saleor/product/migrations/0058_auto_20180329_0142.py
Python
bsd-3-clause
1,451
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 1998-2021 Stephane Galland <galland@arakhne.org> # # This program is free library; 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 3 of the ...
gallandarakhneorg/autolatex
src/autolatex2/cli/commands/commit.py
Python
lgpl-3.0
1,823
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import from django.conf import settings from django.core.management import execute_from_command_line import sys if not settings.configured: test_runners_args = {} settings.configure( DATABASES={ ...
climapulse/dj-labeler
runtests.py
Python
bsd-3-clause
999
import logging import subprocess import sys from typing import List def set_up_logging(output_file_path: str): log_level = logging.INFO logging.basicConfig(level=log_level, format='%(message)s', filename=output_file_path, filemode='w') console = logging.StreamHandler() console.setLevel(log_level) ...
P4ELTE/t4p4s
examples/test_scripts/timeoutee/timeoutee.py
Python
apache-2.0
1,536
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import math from django.db.models import Q from .models import Policy, Enforcement from apps.front.paging import ProducerFactory # PAGING PRODUCER policy_producer_factory = ProducerFactory(Policy, 'name__ico...
strongswan/strongTNC
apps/policies/paging.py
Python
agpl-3.0
1,728
import beanstalkc import sqlite3 import os import msgpack from time import sleep import zlib class SeedMinimizer: def __init__(self, config): self.sql = sqlite3.connect(config['db_path'], check_same_thread=False) self.c = self.sql.cursor() self.min_dir = os.path.join(config['output_path']...
pyoor/distiller
server/minimizer.py
Python
mit
2,802
class Solution(object): # Op1: Dynamic programming def maxProduct(self, nums): """ :type nums: List[int] :rtype: int """ # f(k) = max( f(k-1) * A[k], A[k], g(k-1) * A[k] ) # g(k) = min( g(k-1) * A[k], A[k], f(k-1) * A[k] ) max_ = min_ = ans = nums[0] ...
rx2130/Leetcode
python/152 Maximum Product Subarray.py
Python
apache-2.0
531
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
eliasdesousa/indico
indico/modules/events/reminders/__init__.py
Python
gpl-3.0
3,918
# -*- coding: utf-8 -*- """ Data engine implementation based on lighting memory database (http://symas.com/mdb/). The Lmdb is initialized, the access needs to use its binding API, though. Extension packages may provide higher-level APIs based on this. """ from __future__ import absolute_import, division, unicode_litera...
eavatar/ava
src/eavatar.ava/ava/core/data.py
Python
bsd-3-clause
8,549
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('smartsnippets', '0002_change_smartsnippetvariable_description'), ] operations = [ migrations.AlterModelOptions( ...
pbs/django-cms-smartsnippets
smartsnippets/migrations/0003_auto_20151008_1050.py
Python
bsd-3-clause
566