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
from rhumba import plugin, crontab cron = crontab.cron RhumbaPlugin = plugin.RhumbaPlugin
calston/rhumba
rhumba/__init__.py
Python
mit
92
import sqlite3 conn = sqlite3.connect(":memory:") cur = conn.cursor() cur.execute("create table stocks (symbol text, shares integer, price real)") conn.commit()
MailG/code_py
sqlite3/memory_db.py
Python
mit
163
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['previe...
tsdmgz/ansible
lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py
Python
gpl-3.0
21,505
from __future__ import absolute_import from sentry import options from sentry.integrations import OAuth2Integration options.register('slack.client-id') options.register('slack.client-secret') options.register('slack.verification-token') class SlackIntegration(OAuth2Integration): id = 'slack' name = 'Slack' ...
gencer/sentry
src/sentry/integrations/slack/integration.py
Python
bsd-3-clause
2,169
import model import argparse from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import random import timeit from LimitMatrix import LimitMatrix from pprint import pprint parser = argparse.ArgumentParser(description='Setup simulation.') parser.add_argument('--db', default='sqlite:///:memory:'...
sostenibilidad-unam/abm2
abmpy/sim_run_single.py
Python
gpl-3.0
2,961
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercise 10.15 from Kane 1985.""" from __future__ import division from sympy import expand, sin, cos, solve, symbols, trigsimp, together from sympy.physics.mechanics import ReferenceFrame, Point, Particle from sympy.physics.mechanics import dot, dynamicsymbols, msprint ...
skidzo/pydy
examples/Kane1985/Chapter5/Ex10.15.py
Python
bsd-3-clause
2,656
#!/usr/bin/env python #coding:utf-8 import sys,socket,json if sys.version_info[0] == 2: import urllib2 as request else: import urllib.request as request try: socket.setdefaulttimeout(5) if len(sys.argv) == 1: apiurl = "http://ip-api.com/json" elif len(sys.argv) == 2: apiurl = "http://ip-api.com/json...
kaneawk/oneinstack
include/get_ipaddr_state.py
Python
apache-2.0
585
# flake8: noqa import numpy as np from scipy.special import kv, iv # Needed for K1 in Well class, and in CircInhom from .aquifer import AquiferData from .element import Element from .equation import InhomEquation class CircInhomData(AquiferData): def __init__(self, model, x0=0, y0=0, R=1, kaq=[1], Haq=[1], c=[1]...
mbakker7/ttim
ttim/circinhom.py
Python
mit
32,556
"""Constants for the SolarEdge Monitoring API.""" from datetime import timedelta from homeassistant.const import ENERGY_WATT_HOUR, POWER_WATT DOMAIN = "solaredge" # Config for solaredge monitoring api requests. CONF_SITE_ID = "site_id" DEFAULT_NAME = "SolarEdge" OVERVIEW_UPDATE_DELAY = timedelta(minutes=10) DETAIL...
leppa/home-assistant
homeassistant/components/solaredge/const.py
Python
apache-2.0
2,014
from __future__ import print_function import aaf import aaf.mob import aaf.define import aaf.iterator import aaf.dictionary import aaf.storage import aaf.component import aaf.util import traceback from aaf.util import AUID, MobID import unittest import os cur_dir = os.path.dirname(os.path.abspath(__file__)) sandbo...
markreidvfx/pyaaf
tests/test_TypeDefExtEnum.py
Python
mit
1,156
# -*- coding: utf-8 -*- # Copyright (c) 2010 Tom Burdick <thomas.burdick@gmail.com> # # 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 rig...
bfrog/whizzer
whizzer/server.py
Python
mit
7,298
"""Test map_variable.""" # --- import -------------------------------------------------------------------------------------- import numpy as np import pytest import WrightTools as wt from WrightTools import datasets # --- test --------------------------------------------------------------------------------------...
wright-group/WrightTools
tests/data/map_variable.py
Python
mit
1,580
#! /usr/bin/env python from base_ai import BaseAI import math import numpy as np class LazyAI(BaseAI): def __init__(self): super(LazyAI, self).__init__("lazy_ai") #Les angles ou le robot peut aller (A gauche seulement dans cet AI) self.priority_angles = [int(v.strip()) for v in self.get_...
clubcapra/Ibex
src/capra_ai/scripts/lazy_ai.py
Python
gpl-3.0
3,252
#!python # Implement a lot of different networks from abc import ABC, abstractmethod class BaseModel(ABC): @abstractmethod def __init__(self, mode): self.mode = mode @abstractmethod def build(self): pass @abstractmethod def __repr__(self): pass @abstractmethod ...
vingtfranc/LoLAnalyzer
Networks.py
Python
mit
4,286
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
google-research/google-research
eeg_modelling/eeg_viewer/prediction_data_service.py
Python
apache-2.0
9,679
#!/usr/bin/env python import sys if __name__ == '__main__': for line in sys.stdin: n = int(line) break; n = n - 1 mydict = dict() for i, line in enumerate(sys.stdin): key, value = line.rstrip().split() mydict[key] = value if i >= n: break for l...
selavy/ku-acm-2016
03_complex_complex_complex/solution.py
Python
gpl-3.0
507
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Josh Durgin # 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/lic...
NewpTone/stacklab-cinder
cinder/tests/test_rbd.py
Python
apache-2.0
6,861
from sqlalchemy.ext.compiler import compiles from .. import util from .impl import DefaultImpl from .base import alter_table, AddColumn, ColumnName, \ format_table_name, format_column_name, ColumnNullable, alter_column,\ format_server_default,ColumnDefault, format_type, ColumnType class MSSQLImpl(DefaultImpl)...
goFrendiAsgard/kokoropy
kokoropy/packages/alembic/ddl/mssql.py
Python
mit
7,575
import os import glob # User can set solutions and problems dir and server/port for lovelace engine if it's different # from the default. Don't forget http:// at the beginning of the engine URI # export LOVELACE_ENGINE_URI="https://custom-url:12345" # export LOVELACE_SOLUTIONS_DIR="/home/myuser/lovelace/solutions" # e...
project-lovelace/lovelace-engine
tests/helpers.py
Python
mit
2,184
from __future__ import print_function from six import iteritems from six.moves import zip import os import unittest from math import sqrt from numpy import array, array_equiv, array_equal, allclose from itertools import count #class DummyWriter(object): #def __init__(self, *args): #pass #def open(se...
saullocastro/pyNastran
pyNastran/f06/test/f06_unit_tests.py
Python
lgpl-3.0
31,378
# Single Color RGB565 Blob Tracking Example # # This example shows off single color RGB565 tracking using the OpenMV Cam. import sensor, image, time, math threshold_index = 0 # 0 for red, 1 for green, 2 for blue # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max) # The below thresholds track in ge...
openmv/openmv
scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_rgb565_blob_tracking.py
Python
mit
1,883
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
axinging/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py
Python
bsd-3-clause
2,557
#!/usr/bin/env python # coding=utf-8 # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
corona10/grumpy
grumpy-tools-src/grumpy_tools/grumpc.py
Python
apache-2.0
6,825
# -*- coding: utf-8 -*- from __future__ import absolute_import import datetime from celery.task.base import periodic_task from django.contrib.auth.models import timezone from .models import CloseAccountDemand @periodic_task(run_every=datetime.timedelta(hours=12)) def clear_accounts(): """ Check account delete...
CivilHub/CivilHub
userspace/tasks.py
Python
gpl-3.0
583
from templateReplace import templateReplace import os #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class BeamerPresentation: def __init__(self, title, name='Nick Edwards', institute='University of Edinburgh', email='nedwards@cern.ch', shorttitle='', headers=''): self.content = {} ...
nickcedwards/BeamerPresentation
BeamerPresentation.py
Python
gpl-2.0
5,930
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
Azure/azure-sdk-for-python
sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/aio/operations_async/_configuration_profile_preferences_operations_async.py
Python
mit
22,105
# encoding: utf8 # # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version...
deevarvar/myLab
baidu_code/soap_mockserver/spyne/protocol/cloth/to_parent.py
Python
mit
14,759
"""The tests for Home Assistant ffmpeg.""" import os import shutil import tempfile import unittest from unittest.mock import patch, MagicMock import homeassistant.components.kira as kira from homeassistant.setup import setup_component from tests.common import get_test_home_assistant TEST_CONFIG = {kira.DOMAIN: { ...
tinloaf/home-assistant
tests/components/test_kira.py
Python
apache-2.0
2,805
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistribu...
DoubleNegativeVisualEffects/cortex
test/IECoreHoudini/ToHoudiniCompoundObjectConverter.py
Python
bsd-3-clause
15,781
import unittest import re import os from unittest.mock import patch from pyprint.NullPrinter import NullPrinter from coalib.misc.Caching import FileCache from coalib.misc.CachingUtilities import pickle_load, pickle_dump from coalib.output.printers.LogPrinter import LogPrinter from coalib import coala from coala_utils...
Balaji2198/coala
tests/misc/CachingTest.py
Python
agpl-3.0
7,150
import mock import unittest from vnc_api.vnc_api import * from svc_monitor.virtual_machine_manager import VirtualMachineManager from svc_monitor.config_db import * import test_common_utils as test_utils class VirtualMachineManagerTest(unittest.TestCase): def setUp(self): VirtualMachineSM._object_db = mock....
nischalsheth/contrail-controller
src/config/svc-monitor/svc_monitor/tests/test_virtual_machine_manager.py
Python
apache-2.0
12,302
#!/usr/bin/env python from collections import deque from flask import Flask, render_template from flask_uwsgi_websocket import GeventWebSocket app = Flask(__name__) ws = GeventWebSocket(app) users = {} backlog = deque(maxlen=10) @app.route('/') def index(): return render_template('index.html') @ws.route('/webso...
zeekay/flask-uwsgi-websocket
examples/chat-gevent/chat.py
Python
mit
732
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('groups', '0007_change_ordering'), ] operations = [ migrations.AddField( model_name='comment', name='...
incuna/incuna-groups
groups/migrations/0008_comment_state.py
Python
bsd-2-clause
494
# 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...
zhreshold/mxnet
tests/python/mkl/test_contrib_amp.py
Python
apache-2.0
27,116
# -*- coding: utf-8 -*- # OpenDKIM genkeys tool, CloudFlare API # Copyright (C) 2016 Todd Knarr <tknarr@silverglass.org> # Copyright (C) 2017 Zachary Schneider (https://github.com/wackywired135) # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
tknarr/opendkim-genkeys
src/dnsapi_cloudflareapi.py
Python
gpl-3.0
3,326
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import datetime import json import pytz _LOCAL_TZ = pytz.timezone('Europe/Bucharest') _DEFAULT_DURATION = str(int(datetime.timedelta(hours=3).total_seconds()) * 1000) def _composeMeetupVenueAddress(venue): result = [] for k in ('address_1', 'address_2', 'addre...
it-events-ro/scripts
merge-sources.py
Python
agpl-3.0
6,378
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-08-17 12:26 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Icon', ...
BDMADE/resume
icon/migrations/0001_initial.py
Python
gpl-3.0
618
#!/usr/bin/env python # Copyright 2021 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. # This is generated, do not edit. Update BuildConfigGenerator.groovy and # 3ppFetch.template instead. from __future__ import print_fun...
nwjs/chromium.src
third_party/android_deps/libs/javax_annotation_jsr250_api/3pp/fetch.py
Python
bsd-3-clause
1,347
#! /usr/bin/env python '''predicates that can be chained together with boolean expressions before evaluation e.g. a = predicate(lambda s: 'a' in s) b = predicate(lambda s: 'b' in s) c = predicate(lambda s: 'c' in s) anyof = a | b | c allof = a & b & c not_anyof = anyof != True assert anyof('--a--') assert al...
dbasden/python-digraphtools
digraphtools/predicate.py
Python
bsd-3-clause
10,355
# -*- coding: Latin-1 -*- """ @file CalcTime.py @author Sascha Krieg @author Daniel Krajzewicz @author Michael Behrisch @date 2008-04-17 @version $Id: CalcTime.py 22608 2017-01-17 06:28:54Z behrisch $ SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (C) 2008-2017 DLR (http://www.dlr.de/)...
702nADOS/sumo
tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py
Python
gpl-3.0
1,722
# -*- coding: utf-8 -*- import requests class BaseRequest(object): BASE_URL_API = 'https://api.artsy.net/api' def __init__(self, client_id, client_secret, grant_type='credentials', **kwargs): self.xapp_token = self.get_xapp_token(client_id, client_s...
rodrigosavian/python-artsy
artsy/api.py
Python
mit
4,971
from django.core.exceptions import FieldError from django.db import connection from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP class SQLEvaluator(object): def __init__(self, expression, query, allow_joins=True): self.expression = expression ...
CollabQ/CollabQ
vendor/django/db/models/sql/expressions.py
Python
apache-2.0
3,294
#!/usr/bin/env python # _*_ coding:utf-8 _* from commands import StartCommand from commands import StopCommand from commands import TwitterCommand from handlers.ExceptionHandler import ExceptionHandler COMMANDS = { '/start': StartCommand.process_message, '/stop': StopCommand.process_message, '/tweet': Tw...
CorunaDevelopers/teleTweetBot
teleTweetBot/handlers/TelegramMessageHandler.py
Python
gpl-3.0
632
from email.mime.text import MIMEText import logging from smtplib import SMTP, SMTPException from django.conf import settings from zentral.core.actions.backends.base import BaseAction logger = logging.getLogger('zentral.core.actions.backends.email') class Action(BaseAction): def __init__(self, config_d): ...
zentralopensource/zentral
zentral/core/actions/backends/email.py
Python
apache-2.0
1,824
"""Compressed Sparse Row matrix format""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['csr_matrix', 'isspmatrix_csr'] from warnings import warn import numpy as np from scipy.lib.six.moves import xrange from .sparsetools import cs...
beiko-lab/gengis
bin/Lib/site-packages/scipy/sparse/csr.py
Python
gpl-3.0
14,181
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCU...
bregman-arie/ansible
lib/ansible/modules/windows/win_certificate_store.py
Python
gpl-3.0
6,282
"""Config flow for Home Assistant Supervisor integration.""" import logging from homeassistant import config_entries from . import DOMAIN _LOGGER = logging.getLogger(__name__) class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Handle a config flow for Home Assistant Supervisor.""" VERSION = 1 ...
jawilson/home-assistant
homeassistant/components/hassio/config_flow.py
Python
apache-2.0
625
# In order to avoid hard-coded configuration variables, importing os in order # to use settings from the environment import os # Configuration file for ipython-qtconsole. c = get_config() #------------------------------------------------------------------------------ # IPythonQtConsoleApp configuration #------------...
alphabetum/dotfiles
home/.ipython/profile_default/ipython_qtconsole_config.py
Python
mit
24,832
"""The WaveBlocks Project This file contains code for the representation of potentials for three and more components. @author: R. Bourquin @copyright: Copyright (C) 2010, 2011 R. Bourquin @license: Modified BSD License """ from functools import partial import sympy import numpy from scipy import linalg import numdif...
WaveBlocks/WaveBlocks
src/WaveBlocks/MatrixPotentialMS.py
Python
bsd-3-clause
22,140
"""market 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') Class-bas...
PikaDm/clave-online-shop-template
market/urls.py
Python
mit
1,344
from SingleStageDetector import SingleStageDetector from ExampleBuilders.UnmergingExampleBuilder import UnmergingExampleBuilder from ExampleWriters.UnmergingExampleWriter import UnmergingExampleWriter from Classifiers.SVMMultiClassClassifier import SVMMultiClassClassifier from Evaluators.AveragingMultiClassEvaluator im...
ashishbaghudana/mthesis-ashish
resources/tees/Detectors/UnmergingDetector.py
Python
mit
2,126
""" TODO: DOC """ from nunchuck_driver import NunchuckDriver from robot_comm import RobotComm from delay_sim import Delayer from time import sleep """ Commands available in robot driver: stop forward backward left right arm_left arm_right arm_up arm_down arm_h_pos arm_v_pos wrist_left wrist_right wrist...
Butakus/RobertoJitterSimulator
interface.py
Python
gpl-3.0
3,779
try: import cProfile as profile except ImportError: import profile import pstats from io import StringIO from django.conf import settings class ProfilerMiddleware(object): """ Simple profile middleware to profile django views. To run it, add ?prof to the URL like this: http://localhost:80...
kansanmuisti/kamu
profiler/middleware.py
Python
agpl-3.0
2,022
#!/usr/bin/env python3 """ Assignment 1, Exercise 1, INF1340, Fall, 2014. Grade to gpa conversion This module contains one function grade_to_gpa. It can be passed a parameter that is an integer (0-100) or a letter grade (A+, A, A-, B+, B, B-, or FZ). All other inputs will result in an error. Example: $ python ex...
jkolbe/INF1340-Fall14-A1
exercise1.py
Python
mit
2,920
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2017 David Price # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
dwprice56/QtHEP
AppInit.py
Python
lgpl-3.0
778
import pytest import numpy as np from .. import PlotChecker def test_color2rgb(): assert PlotChecker._color2rgb('r') == (1, 0, 0) assert PlotChecker._color2rgb('black') == (0, 0, 0) assert PlotChecker._color2rgb([0, 1, 0]) == (0, 1, 0) assert PlotChecker._color2rgb([0, 1, 0, 1]) == (0, 1, 0) wit...
jhamrick/plotchecker
plotchecker/tests/test_base.py
Python
bsd-3-clause
4,812
# encoding: utf-8 from setuptools import setup from harpoon import __version__ setup( name="harpoon", author="Andreas Stührk", author_email="andy@hammerhartes.de", license="MIT", version=__version__, url="https://github.com/Trundle/harpoon", packages=["harpoon", "harpoon.bot", "harpoon.h...
Trundle/harpoon
setup.py
Python
mit
693
import os import sys import tempfile import shutil import random import tarfile from copy import deepcopy from unittest import TestCase from mock import Mock, patch from base import ServerTests import mock from nectar.downloaders.local import LocalFileDownloader from nectar.config import DownloaderConfig sys.path.i...
nthien/pulp
nodes/test/nodes_tests/test_plugins.py
Python
gpl-2.0
37,679
#!/usr/bin/env python import heapq import rospy import roslib import time import math import Queue from nav_msgs.msg import OccupancyGrid, GridCells, Path, Odometry from geometry_msgs.msg import Point, Pose, PoseStamped, Twist, PoseWithCovarianceStamped, Quaternion from tf.transformations import euler_from_quaternion ...
kyleyoung14/RBE3002
Lab4.py
Python
gpl-2.0
17,637
# Generated by Django 2.2.18 on 2021-03-01 19:38 from string import Template from django.db import migrations, models WATER_639_USER = 'WATER-639' UPDATE_ARTESIAN_CONDITIONS_BASE = Template("""UPDATE $table_name SET artesian_conditions = true, update_user = '$update_user', update_date = now() ...
bcgov/gwells
app/backend/wells/migrations/0124_create_artesian_conditions_col_update_data_water_639.py
Python
apache-2.0
6,077
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import os import logging from textwrap import dedent import collections import pytest import mock from gcdt_testtools.helpers import temp_folder, create_tempfile, cleanup_tempfiles from gcdt_testtools import helpers from gcdt_bundler.pyth...
glomex/gcdt-bundler
tests/test_python_bundler.py
Python
mit
7,149
# -*- coding: utf-8 -*- from django.forms import fields from django.forms import widgets from djng.forms import field_mixins from . import widgets as bs3widgets class BooleanFieldMixin(field_mixins.BooleanFieldMixin): def get_converted_widget(self): assert(isinstance(self, fields.BooleanField)) if...
dpetzold/django-angular
djng/styling/bootstrap3/field_mixins.py
Python
mit
1,771
from datetime import datetime import time import uuid import hashlib from urlparse import urlparse from tornado.options import options from lib.flyingcow import Model, Property from lib.utilities import base36encode, base36decode import user import accesstoken class App(Model): user_id = Property() tit...
MLTSHP/mltshp
models/app.py
Python
mpl-2.0
3,998
import os import vaping.daemon import vaping.plugins.fping_mtr from vaping import plugin expect_verbose = { "10.130.133.1 : 273.89 298.10 322.58": { "host": "10.130.133.1", "min": 273.89, "max": 322.58, "avg": 298.19, "cnt": 3, "loss": 0.0, # "last" :...
20c/vaping
tests/test_fping_mtr.py
Python
apache-2.0
1,681
# This file is part of pydpc. # # Copyright 2016 Christoph Wehmeyer # # pydpc 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. # ...
cwehmeyer/pydpc
pydpc/dpc.py
Python
lgpl-3.0
4,325
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2011 VoltDB Inc. # # 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 limitati...
ifcharming/original2.0
tests/ee/indexes/index_scripted_test.py
Python
gpl-3.0
2,325
#!/usr/bin/python3 """ test-inquisit.py APP: Inquisition DESC: Unit test for Inquisit.py library CREATION_DATE: 2017-05-13 """ # MODULES # | Native import configparser import logging import unittest # | Third-Party import pymysql # | Custom from lib.inquisit.Inquisit import Inquisit # METADATA __author__ = 'Josh...
magneticstain/Inquisition
build/tests/test_inquisit.py
Python
mit
1,110
# """cmdline - Command line functionality for versionah.""" # Copyright © 2014-2018 James Rowe <jnrowe@gmail.com> # # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of versionah. # # versionah is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public Licens...
JNRowe/versionah
versionah/cmdline.py
Python
gpl-3.0
11,273
# Copyright 2015-2016 Hewlett Packard Enterprise Development Company, LP # # 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/li...
openstack/neutron-lib
neutron_lib/api/definitions/auto_allocated_topology.py
Python
apache-2.0
2,069
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import absolute_import, print_function import time import numpy as np from .. import copy_vector def time_ratio(t0,t1): if t1==0: return np.inf else: return t0/t...
alexis-roche/nipy
nipy/labs/bindings/benchmarks/bench_numpy.py
Python
bsd-3-clause
1,008
import application.admin.view import application.api.view import application.api.view.cms import application.api.view.general import application.app.view import application.manager.view import application.manager.view.cms from application import blueprint, flask_app, wsgi_app flask_app.register_blueprint(blueprint.ad...
glennyonemitsu/MarkupHiveServer
src/server_all.py
Python
mit
727
#!/usr/bin/env python3 import dns.query import dns.update from dnstest.utils import * class Update(object): '''DNS update context''' def __init__(self, server, upd): self.server = server self.upd = upd self.rc = None def add(self, owner, ttl, rtype, rdata): self.upd.add(...
CZ-NIC/knot
tests-extra/tools/dnstest/update.py
Python
gpl-3.0
1,656
import re from codecs import open from setuptools import setup version = '' with open('rasa/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) if not version: raise RuntimeError('Cannot find version information') ...
networklore/rasa
setup.py
Python
apache-2.0
1,057
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
cc1-cloud/cc1
src/wi/utils/exceptions.py
Python
apache-2.0
1,046
# encoding: utf-8 # module termios # from /usr/lib/python2.7/lib-dynload/termios.x86_64-linux-gnu.so # by generator 1.135 """ This module provides an interface to the Posix calls for tty I/O control. For a complete description of these calls, see the Posix or Unix manual pages. It is only available for those Unix versi...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/termios.py
Python
gpl-2.0
6,448
from django.contrib import admin from cc.account.models import Account, CreditLine admin.site.register(Account) admin.site.register(CreditLine)
rfugger/villagescc
cc/account/admin.py
Python
agpl-3.0
146
""" *********************************************************************** **ftrobopy** - Ansteuerung des fischertechnik TXT Controllers in Python *********************************************************************** (c) 2016 by Torsten Stuehn """ from __future__ import print_function from os import system import s...
rkunze/ft-robo-snap
ftrobopy/ftrobopy.py
Python
agpl-3.0
59,725
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103 from __future__ import absolute_import, division, print_function import pytest from .. import qtutil from ...external.qt import QtGui from ...external.qt.QtCore import Qt from mock import MagicMock, patch from ..qtutil import GlueDataDialog from ..qtutil import pr...
JudoWill/glue
glue/qt/tests/test_qtutil.py
Python
bsd-3-clause
13,748
import time import math start = time.time() def wordvalue(s): c = 0 for i in range(0, len(s)): c += ord(s[i]) - 64 return c # Read and calculate word value for each word # Store the maximum word value so we don't need to generate more triange values words = open('42.txt', 'r').read().split(",") m =...
jannekai/project-euler
042.py
Python
mit
728
# -*- coding=utf-8 -*- import requests from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time driver = webdriver.PhantomJS() driver.get("https://www.linkedin.com/?trk=baidubrand-mainlink") time.sleep(2) inpu...
snakedragon/scrapy-hive
starlord/test/linkedin-demo.py
Python
apache-2.0
631
short_name="godot" name="Godot Engine" major=1 minor=0 revision="$Rev: 3917 $" status="beta1"
mikica1986vee/godot_build_fix
version.py
Python
mit
96
# -*- coding: utf-8 -*- import os import re from genshi.core import Markup from genshi.builder import tag from trac.core import * from trac.resource import get_resource_url from trac.util.compat import sorted from trac.wiki.formatter import OutlineFormatter, system_message from trac.wiki.api import WikiSystem, parse_...
naokits/adminkun_viewer_old
Server/gaeo/macro.py
Python
mit
9,905
from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from django.db.models.fields.related import RelatedField from django.db.models.fields import FieldDoesNotExist from is_core.filters.exceptions import FilterException def get_model_field_or_method_filter(full_field_term, ...
asgeirrr/django-is-core
is_core/filters/__init__.py
Python
lgpl-3.0
1,614
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
vizvayu/mod-webui
module/plugins/graphs/graphs.py
Python
agpl-3.0
3,288
""" SWEET dataset loader. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import numpy as np import shutil import deepchem as dc def load_sweet(base_dir, frac_train=.8): """Load sweet datasets. Does not do train/test split""" current_dir ...
Agent007/deepchem
examples/sweetlead/sweetlead_datasets.py
Python
mit
1,183
#!/usr/bin/python3 import sys import argparse import re import codecs def main(argv): # TODO: Reduce complexity parser = argparse.ArgumentParser(description='Translate islands-id') parser.add_argument("-i", "--input", dest="input", help="File with list of islands-id to translate", met...
I-sektionen/i-portalen
wsgi/iportalen_django/iportalen/tools/convert_island_to_liu.py
Python
mit
2,950
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2017-05-25 22:07 import django.core.files.storage from django.db import migrations, models import easy_thumbnails.fields class Migration(migrations.Migration): dependencies = [ ('accounts', '0027_auto_20170423_2126'), ] operations = [ ...
MuckRock/muckrock
muckrock/accounts/migrations/0028_auto_20170525_2207.py
Python
agpl-3.0
512
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. """This module defines StoragePluginManager which loads and provides access to StoragePlugins and their StorageResources""" import sys import traceback from django.conf...
intel-hpdd/intel-manager-for-lustre
chroma_core/lib/storage_plugin/manager.py
Python
mit
14,650
# Copyright 2015 Intel Corporation. # Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com> # <isaku.yamahata at gmail com> # All Rights Reserved. # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Lic...
paninetworks/neutron
neutron/tests/functional/agent/linux/test_iptables_firewall.py
Python
apache-2.0
3,600
#!/usr/bin/env python # # 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 o...
googleads/googleads-python-lib
examples/ad_manager/v202108/adjustment_service/create_traffic_forecast_segments.py
Python
apache-2.0
2,258
# Author: Joan Massich <mailsik@gmail.com> # # License: BSD-3-Clause import numpy as np import os.path as op from io import BytesIO from ...annotations import Annotations from .res4 import _read_res4 from .info import _convert_time def _get_markers(fname): def consume(fid, predicate): # just a consumer to move...
pravsripad/mne-python
mne/io/ctf/markers.py
Python
bsd-3-clause
2,884
import platform from storlever.rest.common import get_view, post_view, put_view, delete_view from storlever.lib.exception import StorLeverError def includeme(config): config.add_route('smart', '/partials/smart') @get_view(route_name='smart', renderer='storlever:templates/partials/smart.pt') def interface_get(req...
OpenSight/StorLever
storlever/web/partials/smart.py
Python
agpl-3.0
340
# Copyright 2014 M. A. Zentile, J. Keaveney, L. Weller, D. Whiting, # C. S. Adams and I. G. Hughes. # 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/LICENS...
jameskeaveney/ElecSus
elecsus/libs/durhamcolours.py
Python
apache-2.0
3,270
from __future__ import print_function from __future__ import unicode_literals from rtmbot.core import Plugin import json import re import requests import pyrebase from secrets import secrets firebaseConfig = secrets["firebase"] fire = pyrebase.initialize_app(firebaseConfig) class Request(Plugin): def process_...
garr741/mr_meeseeks
rtmbot/plugins/request.py
Python
mit
902
from app import db, steam from steam.api import HTTPError, HTTPTimeoutError from flask.ext.login import AnonymousUserMixin import datetime from app.emoticharms.models import UserPack class AnonymousUser(AnonymousUserMixin): user_class = 0 @staticmethod def update_steam(): return False @stati...
Arcana/emoticharms.trade
app/users/models.py
Python
gpl-2.0
3,953
"""Unittest for datakick.api module.""" import copy import datakick.api as dk import six import sys import unittest try: import unittest.mock as mock except ImportError: import mock from datakick.exceptions import ImageTooLargeError, InvalidImageFormatError from datakick.models import DatakickProduct class...
carlos-a-rodriguez/datakick
tests/test_datakick.py
Python
mit
6,354
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflow/tensorflow
tensorflow/python/training/saver_large_variable_test.py
Python
apache-2.0
2,214
from discord.ext.commands import CommandError class RocketNotFound(CommandError): 'Exception raised, Rocket Type not found' pass
FoglyOgly/Meowth
meowth/exts/rocket/errors.py
Python
gpl-3.0
137
""" Parser for HTML forms, that fills in defaults and errors. See ``render``. """ from __future__ import absolute_import import re from formencode.rewritingparser import RewritingParser, html_quote import six __all__ = ['render', 'htmlliteral', 'default_formatter', 'none_formatter', 'escape_formatter', ...
formencode/formencode
src/formencode/htmlfill.py
Python
mit
23,202
import kii import copy class KiiObject(dict): """ >>> import json >>> from bucket import * >>> obj = KiiObject(KiiBucket(kii.APP_SCOPE, "mybucket"), "id", f1="value1", f2=2) >>> json.dumps(obj) == json.dumps(dict(f1="value1", f2=2)) True """ def __init__(self, bucket, id, **data): ...
fkmhrk/kiilib_python
kiilib/kiiobject.py
Python
apache-2.0
4,564