code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 18 09:29:56 2015
@author: monteiro
"""
from thermopy.iapws import Water
from thermopy.units import Pressure, Temperature
def test_iapws():
"""
Tests are given inside the IAPWS document. See references for more details.
"""
#test Tsat given P
assert r... | guillemborrell/Thermopy | test/test_iapws.py | Python | bsd-3-clause | 9,460 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import mysql.connector
#from token find userId
#return 0 for error
def findUser(userToken, cnx):
userQuery = 'SELECT user_id FROM user_token WHERE user_token = %s'
try:
userCursor = cnx.cursor()
userCursor.execute(userQuery, (userToken, ))
retur... | byn9826/Thousand-Day | handlers/token.py | Python | bsd-3-clause | 1,530 |
#!/usr/bin/python
#-------------------------------------------------------------------------------
#License GPL v3.0
#Author: Alexandre Manhaes Savio <alexsavio@gmail.com>
#Grupo de Inteligencia Computational <www.ehu.es/ccwintco>
#Universidad del Pais Vasco UPV/EHU
#Use this at your own risk!
#-----------------------... | alexsavio/aizkolari | matrans.py | Python | bsd-3-clause | 10,313 |
from airflow.models import DAG
from airflow.operators.dummy_operator import DummyOperator
from datetime import datetime, timedelta
from airflow.operators import PythonOperator
from airflow.hooks import RedisHook
from airflow.models import Variable
from airflow.hooks import MemcacheHook
from etl_tasks_functions import... | vipul-tm/DAG | dags-ttpl/subdags/utilization_kpi_subdag.py | Python | bsd-3-clause | 17,641 |
# coding: utf-8
from django import VERSION
from django.core.management import call_command
from ._compat import patch
CELERYD_COMMAND = 'djcelery.management.commands.celeryd.Command.handle'
def test_celeryd_command():
if VERSION >= (1, 10):
traceback = False
else:
traceback = None
with ... | kanemra/django-celery | djcelery/tests/test_commands.py | Python | bsd-3-clause | 1,278 |
from sqlalchemy.orm import sessionmaker as sqla_sessionmaker
from sqlalchemy import engine_from_config
import zope.sqlalchemy
import transaction
from .meta import Base
from .user import (
User,
UserTickets,
)
from .domain import Domain
from .record import Record
from .types import (
... | bertjwregeer/alexandria | alexandria/models/__init__.py | Python | isc | 1,257 |
"""
None of the functions/objects in this module need be passed `db`.
Naming convention: a `pub` is either a pubkey or a pubkeyhash
"""
import hashlib
import bitcoin as bitcoinlib
import binascii
from bitcoin.core.key import CPubKey
from counterpartylib.lib import util
from counterpartylib.lib import config
from co... | tokenly/counterparty-lib | counterpartylib/lib/script.py | Python | mit | 10,947 |
from bank_CI import BankCI
from bank_controller import BankController
from settings import DB_NAME, CREATE_TABLES, DROP_DATABASE
from sql_manager import BankDatabaseManager
def main():
manager = BankDatabaseManager.create_from_db_and_sql(DB_NAME, CREATE_TABLES, DROP_DATABASE, create_if_exists=False)
controlle... | pepincho/Python101-and-Algo1-Courses | Programming-101-v3/week9/1-Money-In-The-Bank/start.py | Python | mit | 465 |
from rpython.flowspace.model import Variable
from rpython.rtyper.lltypesystem import lltype
from rpython.translator.simplify import get_graph
from rpython.tool.uid import uid
class CreationPoint(object):
def __init__(self, creation_method, TYPE, op=None):
self.escapes = False
self.returns = False
... | oblique-labs/pyVM | rpython/translator/backendopt/escape.py | Python | mit | 12,552 |
import sys
import os
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from workshops.models import Award, Badge, Person
SKIP_DIRS = ['class']
class Command(BaseCommand):
args = '/path/to/site'
help = 'Report inconsistencies in badges.'
... | shapiromatron/amy | workshops/management/commands/check_badges.py | Python | mit | 1,785 |
# django-salesforce
#
# by Phil Christensen
# (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org)
# See LICENSE.md for details
#
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your applicatio... | django-salesforce/django-salesforce | salesforce/testrunner/example/tests.py | Python | mit | 363 |
def is_integer(nr):
try:
int(nr)
return True
except ValueError:
return False
| leyyin/university-SE | school/util.py | Python | mit | 110 |
#!/usr/bin/env python
import os
import sys
import argparse
import traceback
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir))
from toollib.group import Group,UnsortedInputGrouper
import scipy.stats as ss
class KSGroup(Group):
def __init__(self, tup):
super(KSGroup, self).__init__(tup)... | scoky/pytools | curve/ks_test.py | Python | mit | 2,158 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Score.created_at'
db.add_column(u'core_score', 'created_a... | SM2015/orchid | core/migrations/0002_auto__add_field_score_created_at__add_field_score_updated_at__add_fiel.py | Python | mit | 11,751 |
class Solution(object):
def multiply(self, num1, num2):
"""
:type num1: str
:type num2: str
:rtype: str
"""
return str(int(num1) * int(num2))
| SF-Zhou/LeetCode.Solutions | solutions/multiply_strings.py | Python | mit | 194 |
from transmute_core import *
from .route import route
from .swagger import add_swagger
| toumorokoshi/web-transmute | transmute_core/frameworks/flask/__init__.py | Python | mit | 87 |
from voluptuous import Invalid
import re
def Url(msg=None):
def f(v):
regex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
r'localhost|' #localhost...
... | sparwelt/bitool | sparweltbitool/validation.py | Python | mit | 914 |
"""Support for vacuum cleaner robots (botvacs)."""
from dataclasses import dataclass
from datetime import timedelta
from functools import partial
import logging
from typing import final
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( # noqa: F401 # STAT... | rohitranjan1991/home-assistant | homeassistant/components/vacuum/__init__.py | Python | mit | 11,915 |
# -*- coding: UTF-8 -*-
#############################################
## (C)opyright by Dirk Holtwick, 2008 ##
## All rights reserved ##
#############################################
from pyxer.base import *
@controller
def index():
return "/index" | holtwick/pyxer | tests/public/__init__.py | Python | mit | 279 |
import sys
import requests
from urllib.parse import urlparse
docs_repos = [
"frappe_docs",
"erpnext_documentation",
"erpnext_com",
"frappe_io",
]
def uri_validator(x):
result = urlparse(x)
return all([result.scheme, result.netloc, result.path])
def docs_link_exists(body):
for line in body.splitlines():
fo... | mhbu50/frappe | .github/helper/documentation.py | Python | mit | 1,220 |
from django.template import Library
register = Library()
def filer_actions(context):
"""
Track the number of times the action field has been rendered on the page,
so we know which value to use.
"""
context['action_index'] = context.get('action_index', -1) + 1
return context
filer_actions = reg... | croepha/django-filer | filer/templatetags/filer_admin_tags.py | Python | mit | 403 |
#!/usr/bin/env python3.2
import argparse
import os
import re
import sqlite3
from collections import OrderedDict
from biocode.utils import read_list_file
def main():
"""This is the second script I've written in Python. I'm sure it shows."""
parser = argparse.ArgumentParser( description='Reads a BLAST m8 fil... | jorvis/biocode | taxonomy/create_taxonomic_profile_from_blast.py | Python | mit | 11,261 |
"""
Outlier Detection using Tukeys Filter Class
"""
import sys
import itertools
from time import time
from lib.modules.base_task import BaseTask
from lib.modules.helper import extract_service_name, get_closest_datapoint
from lib.modules.models import TimeSeriesTuple
class TukeysFilter(BaseTask):
def __init__(se... | trademob/anna-molly | lib/plugins/tukeys_filter.py | Python | mit | 5,255 |
"""
Mapzen geocoder, contributed by Michal Migurski of Mapzen.
"""
from geopy.geocoders.base import (
Geocoder,
DEFAULT_FORMAT_STRING,
DEFAULT_TIMEOUT
)
from geopy.compat import urlencode
from geopy.location import Location
from geopy.util import logger
__all__ = ("Mapzen", )
class Mapzen(Geocoder):
... | mthh/geopy | geopy/geocoders/mapzen.py | Python | mit | 5,724 |
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'gae.settings.settings'
# ===========
# Add any python 3rd party module that doesnt exist at
# https://developers.google.com/appengine/docs/python/tools/libraries27
# ===========
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
# ===========
#... | paulormart/gae-project-skeleton-100 | gae/main.py | Python | mit | 936 |
#-------------------------------------------------------------------------------
# Uppod decoder
#-------------------------------------------------------------------------------
import urllib2
def decode(param):
try:
#-- define variables
loc_3 = [0,0,0,0]
loc_4 =... | mrstealth/kodi-isengard | plugin.video.mrstealth.fepcom.net/uppod.py | Python | mit | 2,232 |
"""
This module implement a filesystem storage adapter.
"""
from __future__ import unicode_literals
import errno
import logging
import os
from flask import current_app
from .interface import ImagineAdapterInterface
from PIL import Image
LOGGER = logging.getLogger(__name__)
class ImagineFilesystemAdapter(ImagineAdapt... | FlaskGuys/Flask-Imagine | flask_imagine/adapters/filesystem.py | Python | mit | 4,244 |
# Django settings for opendata project.
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
from django.core.urlresolvers import reverse_lazy
PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PROJECT_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, os.pardir... | openrural/open-data-nc | opendata/settings/base.py | Python | mit | 7,040 |
"""
Data and methods to retrieve app specific configuration
"""
import json
import requests
APP_BACKDROP = "E8C28D3C"
APP_YOUTUBE = "233637DE"
APP_MEDIA_RECEIVER = "CC1AD845"
APP_PLEX = "06ee44ee-e7e3-4249-83b6-f5d0b6f07f34_1"
APP_DASHCAST = "84912283"
APP_SPOTIFY = "CC32E753"
APP_HOME_ASSISTANT = "B12CE3CA"
APP_SUPL... | dominikkarall/pychromecast | pychromecast/config.py | Python | mit | 1,167 |
from collections import OrderedDict
from datetime import date
from nose.tools import eq_, assert_true, assert_false
from mosql.compat import binary_type, text_type
from mosql.util import (
autoparam, build_set, build_where, param, ___,
_is_iterable_not_str,
)
def test_is_iterable_not_str():
# Iterable o... | moskytw/mosql | tests/test_util.py | Python | mit | 1,969 |
"""
Virtual environment (venv) package for Python. Based on PEP 405.
Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
"""
import logging
import os
import shutil
import subprocess
import sys
import types
logger = logging.getLogger(__name__)
class EnvBuilder:
"""
This cl... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.6.0/Lib/venv/__init__.py | Python | mit | 18,240 |
__all__ = ["Initiator","Simulator","Evaluator","Modelator","Validator"] | joebowen/ChannelWorm | channelworm/fitter/__init__.py | Python | mit | 71 |
from StringIO import StringIO
import textwrap
import importer
def test_import_csv():
current = StringIO(textwrap.dedent('''\
status,qty,type,transaction_date,posting_date,description,amount
A,,,2016/11/02,,This is a test,$4.53
'''))
new = StringIO(textwrap.dedent('''\
... | kalafut/go-ledger | importer_test.py | Python | mit | 1,021 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/decorative/shared_radio.iff"
result.attribute_template_id... | anhstudios/swganh | data/scripts/templates/object/tangible/furniture/decorative/shared_radio.py | Python | mit | 440 |
#
# Code by Alexander Pruss and under the MIT license
#
#
# pysanka.py [filename [height [oval|N]]]
# oval: wrap an oval image onto an egg
# N: wrap a rectangular image onto an egg N times (N is an integer)
#
# Yeah, these arguments are a mess!
from mine import *
import colors
import sys
import os
... | arpruss/raspberryjam-pe | p2/scripts3/pysanka.py | Python | mit | 4,144 |
"""
DGL-based PAGTN for graph property prediction.
"""
import torch.nn as nn
import torch.nn.functional as F
from deepchem.models.losses import Loss, L2Loss, SparseSoftmaxCrossEntropy
from deepchem.models.torch_models.torch_model import TorchModel
class Pagtn(nn.Module):
"""Model for Graph Property Prediction
T... | deepchem/deepchem | deepchem/models/torch_models/pagtn.py | Python | mit | 10,872 |
#!/usr/bin/env python
import json
import dateutil.parser
import datetime
import numpy as np
import calendar
import itertools
from flask import Flask, request, Response, render_template, redirect, url_for
import Uber
app = Flask(__name__)
'''
The index page has links to the from_file API and the from_stream API.
'''... | mksachs/UberCC | uber_API.py | Python | mit | 3,244 |
import pandas as pd
from datetime import date, timedelta
import time
import numpy as np
import re
import psycopg2
import ConfigParser
import argparse
from sqlalchemy import create_engine
import random
import sql
parser = argparse.ArgumentParser()
parser.add_argument('-cf','--contract_file',help='Contract data file')
... | eredmiles/GeneralDataScienceToolsDSSG2015 | WorldBank2015/Code/data_pipeline_src/supplier_feature_gen.py | Python | mit | 24,730 |
__author__ = 'Xsank'
from handlers import IndexHandler
from handlers import WSHandler
handlers=[
(r"/",IndexHandler),
(r"/ws",WSHandler),
] | hanmichael/Pyrumpetroll | urls.py | Python | mit | 153 |
import numpy as N
class Binner(object):
"""Class to perform averages of arbitary variables over some bin
(i.e. range) of a coordinate.
An example:
r, u = calculateVelocitiesAtPositions()
# r is nx X ny X nz X 3 array of positions
# v is the same but for velocities at the corresp... | rupertnash/subgrid | python/dqTools/binner.py | Python | mit | 4,769 |
from __future__ import division, absolute_import, print_function,\
unicode_literals
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup, Extension
from distutils.core import Extension
from distutils.errors import DistutilsError
from distutils.command.bui... | romanoved/nanomsg-python | setup.py | Python | mit | 2,912 |
"""Unit tests for the copy module."""
import sys
import copy
import copy_reg
import unittest
from test import test_support
class TestCopy(unittest.TestCase):
# Attempt full line coverage of copy.py from top to bottom
def test_exceptions(self):
self.assert_(copy.Error is copy.error)
self.ass... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4/Lib/test/test_copy.py | Python | mit | 17,174 |
import logging
from django.core.management.base import BaseCommand
from waldur_rancher.utils import SyncUser
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = """Sync users from Waldur to Rancher."""
def handle(self, *args, **options):
def print_message(count, action, name='u... | opennode/nodeconductor-assembly-waldur | src/waldur_rancher/management/commands/sync_users.py | Python | mit | 986 |
# -*- coding: utf-8 -*-
#
# romeo documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 19 15:51:40 2015.
#
# 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... | eerimoq/robomower | romeo/romeo/doc/conf.py | Python | mit | 9,686 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Ship()
result.template = "object/ship/shared_hutt_heavy_s02_tier4.iff"
result.attribute_template_id = -1
result.... | anhstudios/swganh | data/scripts/templates/object/ship/shared_hutt_heavy_s02_tier4.py | Python | mit | 417 |
from __future__ import absolute_import
import pytest
from qtpy import PYQT5, PYSIDE2
@pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings")
def test_qt3dinput():
"""Test the qtpy.Qt3DInput namespace"""
Qt3DInput = pytest.importorskip("qtpy.Qt3DInput")
assert Qt3DInput.QAxisA... | sserrot/champion_relationships | venv/Lib/site-packages/qtpy/tests/test_qt3dinput.py | Python | mit | 1,343 |
from django.shortcuts import render
from django.http import HttpResponse,JsonResponse
from django.views import generic
from django.views.generic.edit import FormView, CreateView
from django.core.urlresolvers import reverse_lazy
from django.core.mail import send_mail
from hacks.models import Hackathon, CodeMania, SendR... | jsshack15/hackathon-2015 | hacks/views.py | Python | mit | 6,441 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/reactor/shared_rct_sds_imperial_1.iff"
result.attri... | anhstudios/swganh | data/scripts/templates/object/tangible/ship/components/reactor/shared_rct_sds_imperial_1.py | Python | mit | 482 |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -alertnotify, -blocknotify and -walletnotify options."""
import os
from test_framework.test_frame... | starwels/starwels | test/functional/feature_notifications.py | Python | mit | 4,003 |
"""pint_journal_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/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='hom... | daterrell2/pint_journal_project | pint_journal_project/urls.py | Python | mit | 863 |
#! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
distribution = ClaytonCopula(1.5)
size = 1000
sample = distribution.getSample(size)
factory = ClaytonCopulaFactory()
estimatedDistribution = factory.build(sample)
print "distribution=", repr(distribu... | sofianehaddad/ot-svn | python/test/t_ClaytonCopulaFactory_std.py | Python | mit | 1,214 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_nightspider.iff"
result.attribute_template_id = 9
result.stfN... | obi-two/Rebelion | data/scripts/templates/object/mobile/shared_nightspider.py | Python | mit | 438 |
#! /usr/bin/python
#-*- coding:utf-8 -*
import csv
from werkzeug import generate_password_hash
from web.models import User
from bootstrap import db
def create_user(email, name, password):
user = User(email=email,
name=name,
pwdhash=generate_password_hash(password),
... | rodekruis/shelter-database | src/scripts/create_user.py | Python | mit | 386 |
"""
Utilities for Caltech BE/Bi 103.
Author: Justin Bois
"""
import collections
import random
import warnings
import numbers
import matplotlib.path as path
import numpy as np
import pandas as pd
import scipy.odr
import scipy.stats as st
import statsmodels.tools.numdiff as smnd
import skimage.io
import skimage.measu... | justinbois/bebi103_utils | legacy/bebi103.py | Python | mit | 61,231 |
# Generator package
| brextonpham/python-Ultron | python-vlc-master/generator/__init__.py | Python | mit | 20 |
import os, os.path
import subprocess
import shutil
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--make", help="run make clean && make on all files",
action="store_true")
parser.add_argument("-c", "--check", help="run ./check.sh on all files",
... | dikujepsen/OpenTran | v3.0/test/C/run.py | Python | mit | 4,191 |
import warnings
from functools import wraps
def deprecated(func):
"""
Generates a deprecation warning
"""
@wraps(func)
def wrapper(*args, **kwargs):
msg = "'{}' is deprecated".format(func.__name__)
warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
return func(*... | nerandell/vyked | vyked/utils/decorators.py | Python | mit | 356 |
""" Custom fields used in InvenTree """
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from .validators import allowable_url_schemes
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import URLField as FormURLField
from django.db import models as models
fro... | inventree/InvenTree | InvenTree/InvenTree/fields.py | Python | mit | 4,623 |
#!/usr/bin/python
# Copyright (c) 2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | nf-dj/cellpilot | drone/scripts/set_led.py | Python | mit | 1,239 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Daniel and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CotizacionItemRecursosHumanos(Document):
pass
| Init-7/demoest | demoest/demoest/doctype/cotizacion_item_recursos_humanos/cotizacion_item_recursos_humanos.py | Python | mit | 272 |
"""Record information about how a game finished.
Revision ID: 4623531fa2b
Revises: 9aec2a74d9
Create Date: 2016-04-16 12:27:45.788322
"""
# revision identifiers, used by Alembic.
revision = '4623531fa2b'
down_revision = '9aec2a74d9'
from alembic import op
import sqlalchemy as sa
import app.go as go
# A kind of hyb... | karlorg/drunken-octo-avenger | migrations/versions/4623531fa2b_record_information_about_how_a_game_.py | Python | cc0-1.0 | 1,921 |
"""Functional tests for URIEval Plugin"""
from __future__ import absolute_import
import random
import sys
import unittest
from string import ascii_letters
from string import digits
import tests.util
# Load plugin and report matched RULES and SCORE
PRE_CONFIG = """
loadplugin oa.plugins.uri_eval.URIEvalPlugin
repor... | SpamExperts/SpamPAD | tests/functional/test_plugins/test_uri_eval.py | Python | gpl-2.0 | 31,989 |
# -*- coding: utf-8 -*-
#
# test_connect_helpers.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Li... | lekshmideepu/nest-simulator | testsuite/pytests/test_connect_helpers.py | Python | gpl-2.0 | 10,549 |
# -*- coding: utf-8 -*-
#pylint: skip-file
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather th... | gttechsign/iris-panel | iris/core/migrations/0004_remove_redundant_packs.py | Python | gpl-2.0 | 15,684 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | wbyne/QGIS | python/plugins/processing/algs/help/__init__.py | Python | gpl-2.0 | 2,053 |
# Library for RTS2 JSON calls.
# (C) 2012 Petr Kubanek, Institute of Physics
#
# 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... | zguangyu/rts2 | python/rts2/target.py | Python | gpl-2.0 | 1,526 |
#!/usr/bin/env python
from runtest import TestBase
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'longjmp3', """
# DURATION TID FUNCTION
1.164 us [ 4107] | __monstartup();
0.657 us [ 4107] | __cxa_atexit();
[ 4107] | main() {
0.705 us [ 4107] | _setjmp... | JIMyungSik/uftrace | tests/t145_longjmp3.py | Python | gpl-2.0 | 1,447 |
# -*- coding: utf-8 -*-
#
from django.urls import path
from . import views
urlpatterns = [
path('login/', views.OpenIDLoginView.as_view(), name='openid-login'),
path('login/complete/', views.OpenIDLoginCompleteView.as_view(),
name='openid-login-complete'),
]
| eli261/jumpserver | apps/authentication/backends/openid/urls.py | Python | gpl-2.0 | 278 |
#
# Copyright (c) 2008--2012 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... | dmacvicar/spacewalk | backend/server/rhnServer/server_kickstart.py | Python | gpl-2.0 | 28,246 |
"""
Binary 16 byte is an export plugin to convert gcode into 16 byte binary segments.
An export plugin is a script in the export_plugins folder which has the functions getOuput, isArchivable and writeOutput. It is
meant to be run from the export tool. To ensure that the plugin works on platforms which do not handle ... | natetrue/ReplicatorG | skein_engines/skeinforge-0006/skeinforge_tools/export_plugins/binary_16_byte.py | Python | gpl-2.0 | 10,998 |
# Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# 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 ver... | google/rekall | rekall-core/rekall/plugins/response/interpolators.py | Python | gpl-2.0 | 3,264 |
import json, sys, re
def printString(s, begin, end):
if not re.match(r'^(\*.*\*|CAM[0-9] .*|Z ?NULL.*)$', s):
sys.stdout.write('{}_({}){}'.format(begin, json.dumps(s, ensure_ascii=False), end))
def parse(obj):
if isinstance(obj, dict):
for k, v in obj.items():
parse(v)
if k == 'name' and isinstance(v, str... | Zabanya/warzone2100 | po/parseJson.py | Python | gpl-2.0 | 571 |
__all__ = ('db', 'format', 'query', 'sync') | Timdawson264/acd_cli | acdcli/cache/__init__.py | Python | gpl-2.0 | 43 |
import time
import logging
from autotest.client.shared import error
from virttest import utils_test
from generic.tests import file_transfer
def run(test, params, env):
"""
live_snapshot test:
1). Create live snapshot during big file creating
2). Create live snapshot when guest reboot
3). Check if ... | ypu/tp-qemu | qemu/tests/live_snapshot.py | Python | gpl-2.0 | 3,334 |
# upgrade.py - test the upgrade transaction using RPM
#
# Copyright (C) 2012 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option)... | dashea/redhat-upgrade-tool | redhat_upgrade_tool/upgrade.py | Python | gpl-2.0 | 9,234 |
import attr
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from widgetastic.widget import NoSuchElementException
from widgetastic.widget import Text
from widgetastic.widget import View
from widgetastic_patternfly import BreadCrumb
from widgetastic_patternfly import Button
from widgeta... | nachandr/cfme_tests | cfme/storage/manager.py | Python | gpl-2.0 | 11,178 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.abstract_variables.abstract_travel_time_variable import abstract_travel_time_variable
class travel_time_hbw_am_drive_alone_from_home_to_work_alt(abstract_travel_time_variable):
... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/psrc/household_x_zone/travel_time_hbw_am_drive_alone_from_home_to_work_alt.py | Python | gpl-2.0 | 2,397 |
# partitioning.py
# Disk partitioning functions.
#
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any... | karmix/blivet | blivet/partitioning.py | Python | gpl-2.0 | 81,110 |
# Copyright 1999 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Code for more fancy file handles.
Classes:
UndoHandle File object decorator with sup... | BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/File.py | Python | gpl-2.0 | 4,640 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:/Users/Gaspar/.qgis/python/plugins/delPropiedad/forms_ui/frmSelec.ui'
#
# Created: Wed Jul 18 12:50:20 2012
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCor... | gasparmoranavarro/TopoDelProp | forms/frmSelec.py | Python | gpl-2.0 | 2,643 |
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... | qtproject/qt-creator | tests/system/suite_CCOM/tst_CCOM02/test.py | Python | gpl-3.0 | 2,818 |
import numpy as np
import bpy
from bpy.props import FloatProperty, EnumProperty, IntProperty, BoolProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level
from sverchok.utils.curve import SvCurveLengthSolver, SvCurve
from sverch... | nortikin/sverchok | nodes/curve/length_parameter.py | Python | gpl-3.0 | 5,754 |
import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = '25174c22'.decode('hex')
P2P_PORT = 8698
ADDRESS_VERSION = 0
RPC_PORT = 8697
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
(yield helper.check_genesi... | ptcrypto/p2pool-adaptive | p2pool/bitcoin/networks/titcoin.py | Python | gpl-3.0 | 1,188 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MessageRecord'
db.create_table(u'nuntium_messagerecord', (
(u'id', self.gf('djan... | TEDICpy/write-it | nuntium/migrations/0007_auto__add_messagerecord.py | Python | gpl-3.0 | 5,320 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys, os
from calibre.customize.conversion import OutputFormatPlugin
from cal... | jelly/calibre | src/calibre/ebooks/conversion/plugins/lrf_output.py | Python | gpl-3.0 | 7,750 |
"""This will perform basic enrichment on a given IP."""
import csv
import json
import mmap
import os
import socket
import urllib
import dns.resolver
import dns.reversename
from geoip import geolite2
from IPy import IP
from joblib import Parallel, delayed
from netaddr import AddrFormatError, IPSet
torcsv = 'Tor_ip_li... | zebde/RobIP | iplookup.py | Python | gpl-3.0 | 6,811 |
import math
def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False):
"""
Add suffix to value, transform value to match new suffix and round it.
Keyword arguments:
val -- value to process
prec -- precision of final number (number of significant positions to show)
lo... | bsmr-eve/Pyfa | gui/utils/numberFormatter.py | Python | gpl-3.0 | 5,541 |
#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Licens... | nijel/weblate | weblate/metrics/apps.py | Python | gpl-3.0 | 906 |
#!/usr/bin/env python
import matplotlib as mpl
from matplotlib import pyplot as plt
import argparse
def add_adiabatic_map_to_axis(axis, style, energies, color):
""" add single set of energies to plot """
# Energy horizontal decks
x = style['START']
for energy in energies:
axis.plot([x, x+styl... | eduardoftoliveira/qt_scripts | scripts/draw_PES.py | Python | gpl-3.0 | 3,836 |
#
# Copyright (C) 2016 Dang Duong
#
# This file is part of Open Tux World.
#
# Open Tux World 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 op... | khanhduong95/Open-Tux-World | scripts/fall.py | Python | gpl-3.0 | 1,747 |
# This file is part of profileNJ
#
# Date: 02/2014
# ClusterUtils contain implementation of nj and upgma clustering algo, and
# required methods
__author__ = "Emmanuel Noutahi"
from TreeClass import TreeClass
import os
import numpy as np
from StringIO import StringIO
import random
try:
from lxml import etree
... | maclandrol/profileNJ | profileNJ/TreeLib/ClusterUtils.py | Python | gpl-3.0 | 11,942 |
# -*- coding: utf-8 -*-
from .__version__ import __version__
| GjjvdBurg/HugoPhotoSwipe | hugophotoswipe/__init__.py | Python | gpl-3.0 | 62 |
from __future__ import absolute_import
import csv
from datetime import datetime
import httplib
from itertools import count
import logging
import smtplib
from xml.dom.minidom import Document
from django.conf import settings
from django.core.exceptions import FieldError
from django.core.mail import EmailMultiAlternativ... | wmde/do-index | crowdsourcing/views.py | Python | gpl-3.0 | 27,746 |
import collections
import os
import codecs
from .top_block import TopBlockGenerator
from .. import Constants
from ..io import yaml
class HierBlockGenerator(TopBlockGenerator):
"""Extends the top block generator to also generate a block YML file"""
def __init__(self, flow_graph, _):
"""
Ini... | mrjacobagilbert/gnuradio | grc/core/generator/hier_block.py | Python | gpl-3.0 | 6,202 |
#!/usr/bin/env python
"""Allows functions from coot_utils to be imported"""
# Copyright 2011, 2012 Kevin Keating
#
# Licensed under the Educational Community 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://w... | jlec/coot | rcrane/coot_utils_adapter.py | Python | gpl-3.0 | 1,561 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Iztok Jeras <iztok.jeras@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the... | salberin/libsigrokdecode | decoders/onewire_network/pd.py | Python | gpl-3.0 | 7,048 |
# Import classes
from idtxl.active_information_storage import ActiveInformationStorage
from idtxl.data import Data
# a) Generate test data
data = Data()
data.generate_mute_data(n_samples=1000, n_replications=5)
# b) Initialise analysis object and define settings
network_analysis = ActiveInformationStorage()
settings ... | pwollstadt/IDTxl | demos/demo_active_information_storage.py | Python | gpl-3.0 | 591 |
# -*- coding: utf-8 -*-
# hhfit.py ---
# Description:
# Author:
# Maintainer:
# Created: Tue May 21 16:31:56 2013 (+0530)
# Commentary:
# Functions for fitting common equations for Hodgkin-Huxley type gate
# equations.
import traceback
import warnings
import numpy as np
import logging
logger_ = logging.getLogger('moo... | dilawar/moose-core | python/moose/neuroml2/hhfit.py | Python | gpl-3.0 | 8,486 |
#!/usr/bin/env python
# APM automatic test suite
# Andrew Tridgell, October 2011
import pexpect, os, sys, shutil, atexit
import optparse, fnmatch, time, glob, traceback, signal
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pysim'))
sys.path.insert(0, os.path.join(os.path.dirname(os.pat... | GekoCH/HighAltitudeArduPlane20130613 | Tools/autotest/autotest.py | Python | gpl-3.0 | 14,291 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017,2020 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | chipaca/snapcraft | tests/unit/plugins/v1/python/test_sitecustomize.py | Python | gpl-3.0 | 5,261 |