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
# -*- coding: utf-8 -*- """ Created on Thu Sep 08 15:09:49 2016 @author: tih """ import numpy as np import os import scipy.interpolate import gdal from openpyxl import load_workbook import osr from datetime import datetime, timedelta import pandas as pd import shutil import glob from netCDF4 import Dataset import warn...
wateraccounting/SEBAL
PreSEBAL/preSEBAL_Vcrts.py
Python
apache-2.0
117,033
""" Vault interactions """ from __future__ import print_function import os import socket import logging import requests from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry import hvac import yaml from aomi.helpers import normalize_vault_path from aomi.util import token_file, appid_file, appro...
otakup0pe/aomi
aomi/vault.py
Python
mit
13,090
"""Align multiple structures with TMalign.""" from __future__ import division import itertools import logging import math import os import subprocess import tempfile from cStringIO import StringIO import networkx from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from biofrills import...
etal/fammer
fammerlib/tmalign.py
Python
bsd-2-clause
6,484
# -*- coding: utf-8 -*- class AttributeDict(dict): # pylint: disable=too-many-instance-attributes """ This class internally stores values in a dictionary, but exposes the keys also as attributes, i.e. asking for attrdict.key will return the value of attrdict['key'] and so on. Raises an Attribut...
lorisercole/thermocepstrum
sportran/utils/attributedict.py
Python
gpl-3.0
2,592
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
prasanna08/oppia
scripts/linters/general_purpose_linter.py
Python
apache-2.0
31,872
import os, re, sys, time import MaKaC.conference as conference import MaKaC.common.indexes as indexes from db_classes import * from datetime import datetime from MaKaC.webinterface import displayMgr from MaKaC.user import LoginInfo, Group, GroupHolder, Avatar, AvatarHolder ...
belokop-an/agenda-tools
tools/recovery/fixIndexes.py
Python
gpl-2.0
1,447
# IfcOpenShell - IFC toolkit and geometry engine # Copyright (C) 2021 Dion Moult <dion@thinkmoult.com> # # This file is part of IfcOpenShell. # # IfcOpenShell 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 Foundat...
IfcOpenShell/IfcOpenShell
src/ifcopenshell-python/test/api/unit/test_remove_unit.py
Python
lgpl-3.0
2,276
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import pbm.plugins import pbm.utils class ChromeFolderPlugin(pbm.plugins.PromiumPlugin): folder_name = 'chrome' urls = [ "chrome://bookmarks", "chrome://history", "chrome://extensions", "chrome:...
westurner/pbm
pbm/plugins/chromefolder.py
Python
bsd-3-clause
1,239
# coding=utf-8 """ Collect metrics from Puppet DB Dashboard #### Dependencies * urllib2 * json """ import urllib2 import diamond.collector from diamond.convertor import time as time_convertor try: import json except ImportError: import simplejson as json class PuppetDBCollector(diamond.collector.Colle...
tsheasha/fullerite
src/diamond/collectors/puppetdb/puppetdb.py
Python
apache-2.0
6,535
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
subutai/htmresearch
htmresearch/frameworks/thalamus/thalamus_utils.py
Python
agpl-3.0
3,123
import argparse import os import re from pathlib import Path from typing import Optional import py.path import pytest from _pytest.config import ExitCode from _pytest.config import UsageError from _pytest.main import resolve_collection_argument from _pytest.main import validate_basetemp from _pytest.pytester import T...
pexip/os-pytest
testing/test_main.py
Python
mit
8,774
""" Profiling hooks This module contains a couple of decorators (`profile` and `coverage`) that can be used to wrap functions and/or methods to produce profiles and line coverage reports. There's a third convenient decorator (`timecall`) that measures the duration of function execution without the extra profiling ove...
Aleks31/pychess
lib/pychess/Database/profilehooks.py
Python
gpl-3.0
24,872
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-03-05 13:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('elearning', '0027_auto_20160305_1333'), ] operations = [ migrations.AlterFie...
tkupek/tkupek-elearning
tkupek_elearning/elearning/migrations/0028_auto_20160305_1338.py
Python
gpl-3.0
456
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from toontown.toonbase.ToonBaseGlobal import * from toontown.toonbase.ToontownGlobals import * from direct.gui.DirectGui import * from direct.distributed.ClockDelta import * from toontown.hood import Place from direct.directnotify import Dir...
Spiderlover/Toontown
toontown/estate/Estate.py
Python
mit
15,440
""" Copyright (c) 2017-2022, Jairus Martin. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on May 20, 2017 @author: jrm """ from atom.api import Typed from enamlnative.widgets.radio_button import ProxyRadioButton from .android_compoun...
codelv/enaml-native
src/enamlnative/android/android_radio_button.py
Python
mit
1,092
# # The MIT License (MIT) # # Copyright (c) 2014 William T. James # # 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...
Storj/heartbeat
tests/correctness.py
Python
mit
1,941
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
trondhindenes/ansible-modules-core
cloud/amazon/ec2.py
Python
gpl-3.0
61,264
"""Init Revision ID: 4feb484b3fd4 Revises: None Create Date: 2014-06-20 21:57:46.271797 """ # revision identifiers, used by Alembic. revision = '4feb484b3fd4' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.c...
grafgustav/accessmail
alembic/versions/4feb484b3fd4_init.py
Python
mit
3,441
#!/usr/bin/env python3 # Copyright (c) 2009-2019 The Bitcoin Core developers # Copyright (c) 2014-2019 The DigiByte Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests NODE_NETWORK_LIMITED. Tests that a node c...
digibyte/digibyte
test/functional/p2p_node_network_limited.py
Python
mit
4,934
from ._base import DanubeCloudCommand, CommandOption, CommandError class Command(DanubeCloudCommand): help = 'Check connection to internal/admin services.' options = ( CommandOption('-q', '--que', '--node', action='store_true', dest='que_only', default=False, help='Check only ser...
erigones/esdc-ce
core/management/commands/service_check.py
Python
apache-2.0
2,406
from django.core.urlresolvers import reverse from django.db.models import Value from django.db.models.functions import Concat from ..main.tables_ajax import SecuredTableJson from ..main.mixins import capitalize from .models import Contractor, Contract, SupportContract, ContractorContact class ContractTableJson(Secu...
mpdevilleres/tbpc_app
tbpc/contract_mgt/tables_ajax.py
Python
mit
12,161
import pytest from tests.algorithms_tests.factories import AlgorithmFactory from tests.archives_tests.factories import ArchiveFactory from tests.evaluation_tests.test_permissions import get_groups_with_set_perms from tests.factories import ChallengeFactory, ExternalChallengeFactory from tests.organizations_tests.facto...
comic/comic-django
app/tests/organizations_tests/test_signals.py
Python
apache-2.0
2,610
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
eort/OpenSesame
libqtopensesame/_input/item_combobox.py
Python
gpl-3.0
1,970
#!/usr/bin/env python from tables import * import numarray as NA import struct, sys import shelve import psyco # This class is accessible only for the examples class Small(IsDescription): """ A record has several columns. They are represented here as class attributes, whose names are the column names and thei...
cpcloud/PyTables
bench/shelve-bench.py
Python
bsd-3-clause
6,421
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os f...
amagdas/superdesk
server/features/steps/steps.py
Python
agpl-3.0
69,302
import numpy as np from astropy.coordinates import SkyCoord from astropy import units as u from astropy.table import Table from matplotlib import pyplot as plt import pdb from frb.surveys import des import sys,os import progressbar as pb #pip install progressbar2 from matplotlib import pyplot as plt import seaborn as s...
FRBs/DM
frb/scripts/random_assoc.py
Python
bsd-3-clause
4,628
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
NoBodyCam/TftpPxeBootBareMetal
nova/api/openstack/compute/contrib/quotas.py
Python
apache-2.0
6,594
# This Python file uses the following encoding: utf-8 """ Subject line. Main text. """ from unittest import TestCase import numpy as np from classes.Factor import Factor from classes.Variable import Variable __author__ = 'Chao Li' class TestFactor(TestCase): def setUp(self): self.A = Variable(1, "A", ...
chaoli314/openbn
classes/test_factor.py
Python
apache-2.0
3,632
''' #/** #* @@@ START COPYRIGHT @@@ # #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....
robertamarton/incubator-trafodion
dcs/src/test/pytests/test_p2.py
Python
apache-2.0
13,579
import threading, time from httplib2 import Http from urllib.parse import urlencode from queue import Queue from utils import tools, env from utils.log import logger masterips = env.getenv("MASTER_IPS").split(",") G_masterips = [] for masterip in masterips: G_masterips.append(masterip.split("@")[0] + ":" + str(env...
FirmlyReality/docklet
user/stopreqmgr.py
Python
bsd-3-clause
1,591
import unittest import copy import json import os from mock import patch, MagicMock from common import RESOURCE_3, SQS_MESSAGE_5 from c7n_mailer.slack_delivery import SlackDelivery from c7n_mailer.email_delivery import EmailDelivery SLACK_TOKEN = "slack-token" SLACK_POST_MESSAGE_API = "https://slack.com/api/chat.pos...
capitalone/cloud-custodian
tools/c7n_mailer/tests/test_slack.py
Python
apache-2.0
8,070
import codegen import dataset import utils.backend as backends_common def _casekey(size, kind): return size + '_' + kind def gen_code(backend, size, kind): key = _casekey(size, kind) if key in backend.case_to_code: return backend.case_to_code[key] raise RuntimeError('Unrecognized configurat...
ivafanas/sltbench
tools/metrics/benchbench/impl/backend.py
Python
apache-2.0
3,383
# -*- coding: utf-8 -*- """ Created on 11 janv. 2012 @author: Xavier HINAUT xavier.hinaut #/at\# inserm.fr """ import mdp import numpy as np import random import reservoir import sys def write3DArrays(data, fileToCreate): # Write the array to disk if len(data) > 0: with file(fileToCreate, 'w') as ...
FlorianLance/neuron-computing-cuda
scripts/python/generate_stim.py
Python
lgpl-2.1
25,674
#!/bin/python3 import os, shutil import xml.etree.ElementTree as ET NAME = 'programmer_beop' DESCRIPTION = 'Francais (Programmer Beop, ergonomique, derive de Bpo)' LANGUAGE = 'fr' def install_symbols(): temp_file = './new_symbols' symbols_file = '/usr/share/X11/xkb/symbols/fr' symbols_layout = './symbols...
luxcem/programmer-beop
install.py
Python
gpl-3.0
3,457
""" Test for allantools (https://github.com/aewallin/allantools) Stable32 was used to calculate the deviations we compare against. AW2015-06-26 The dataset is from the 10 MHz output at the back of an HP Impedance Analyzer measured with Keysight 53230A counter, 1.0s gate, RCON mode, with H-maser 10MHz refe...
aewallin/allantools
tests/ocxo/test_ocxo.py
Python
lgpl-3.0
12,692
#!/usr/bin/env python from collections import deque import rospy import numpy import tf import actionlib import yaml from math import sqrt, cos from collections import * from sklearn.cluster import KMeans from std_msgs.msg import * from geometry_msgs.msg import * from move_base_msgs.msg import * from nav_msgs.msg im...
kekraft/contamination_stack
scrubber_decontamination/scripts/path_planner.py
Python
bsd-3-clause
8,714
""" Test finding orphans via the view and django config """ import json from contentstore.tests.utils import CourseTestCase from student.models import CourseEnrollment from xmodule.modulestore.django import modulestore from contentstore.utils import reverse_course_url class TestOrphan(CourseTestCase): """ Tes...
wwj718/murp-edx
cms/djangoapps/contentstore/tests/test_orphan.py
Python
agpl-3.0
4,054
#!/usr/bin/python # -*- coding: UTF-8 -*- #https://www.kaggle.com/dansbecker/handling-missing-values # one tree import pandas as pd from sklearn.model_selection import cross_val_score from sklearn.model_selection import train_test_split #from sklearn.model_selection import score_dataset from sklearn.preprocessing impor...
muxiaobai/CourseExercises
python/kaggle/learn2/one-hot.py
Python
gpl-2.0
4,135
""" This package contains tests for the credit mining-related code of Tribler. """
vandenheuvel/tribler
Tribler/Test/Core/CreditMining/__init__.py
Python
lgpl-3.0
83
# Copyright 2013 Douglas Linder # 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...
shadowmint/nwidget
samples/snake/views/game_view.py
Python
apache-2.0
5,269
# 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/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_network_management_client.py
Python
mit
29,817
#!/usr/bin/env python # Copyright (c) PLUMgrid, Inc. # Licensed under the Apache License, Version 2.0 (the "License") # This program implements a topology likes below: # pem: physical endpoint manager, implemented as a bpf program # # vm1 <--------+ +----> bridge1 <----+ # V V ...
romain-intel/bcc
tests/python/test_brb2.py
Python
apache-2.0
9,233
from girder_worker.utils import girder_job from girder_worker.app import app @girder_job(title='Fibonacci Job') @app.task def fibonacci(n, **kwargs): if n == 1 or n == 2: return 1 return fibonacci(n-1) + fibonacci(n-2) @app.task(bind=True) def fib_seq(self, n, **kwargs): if n < 0: raise ...
girder/girder_worker
tests/integration/common_tasks/common_tasks/test_tasks/fib.py
Python
apache-2.0
440
# Glumol - An adventure game creator # Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour # This file is part of Glumol. # Glumol 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 th...
lebauce/artub
pypoujol/font.py
Python
gpl-2.0
1,217
# Copyright 2019 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...
gunan/tensorflow
tensorflow/lite/testing/op_tests/reduce.py
Python
apache-2.0
7,523
from Products.CMFCore.utils import getToolByName def install(context): site = context.getSite() form = site['parasite-resources']['requisitionUpdate']['filarial-research-materials-parasite-division-requisition-form'] if not form.hasObject('order-forms'): folder = form[form.invokeFac...
uwosh/uwosh.filariasis
uwosh/filariasis/importexport.py
Python
gpl-2.0
1,058
import faker generator = faker.Factory.create() def test_imports_bulk_get(api, given, verifier): # preconditions total = 10 file_ids = [generator.uuid4() for _ in range(total)] _import = { 'id': generator.uuid4(), 'result': [ {'resource': {'id': _id, 'href': generator.url(...
sbg/sevenbridges-python
tests/test_drs_import.py
Python
apache-2.0
1,299
""" Base service for authenticating rinzler's requests """ from django.http.request import HttpRequest class BaseAuthService(object): """ BaseAuthService """ auth_data: dict = {} # Your authenticated data goes here def authenticate(self, request: HttpRequest, auth_route: str, actual_params: dict...
feliphebueno/Rinzler
rinzler/auth/base_auth_service.py
Python
mit
756
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from django.db.models import Avg, Count, Sum from django.utils.tra...
shoopio/shoop
shuup/default_reports/reports/customer_sales.py
Python
agpl-3.0
2,407
#!/usr/bin/ #-*- coding: iso-8859-1 -*- #=============================================================================== # __________ ________________ __ _______ # / ____/ __ \/ ____/ ____/ __ )/ / / / ___/ # / /_ / /_/ / __/ / __/ / __ / / / /\__ \ # / __/ / _, _/ /___/ /___/ /_/ / /_/ /___/ /...
Makki1/old-svn
avr/sketchbook/GiraRM_Debug/freebus/freebus_ets/software/freebus-ets/src/build/XML/FB_XMLDataModel.py
Python
gpl-3.0
8,588
"""Tests for the humidifier intents.""" from homeassistant.components.humidifier import ( ATTR_AVAILABLE_MODES, ATTR_HUMIDITY, DOMAIN, SERVICE_SET_HUMIDITY, SERVICE_SET_MODE, intent, ) from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_MODE, ATTR_SUPPORTED_FEATURES, SERVICE_T...
jawilson/home-assistant
tests/components/humidifier/test_intent.py
Python
apache-2.0
6,859
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Blackbox Hardware Driver', 'category': 'Point of Sale', 'sequence': 6, 'summary': 'Hardware Driver for Belgian Fiscal Data Modules', 'website': 'https://www.odoo.com/page/point-of-sale', ...
chienlieu2017/it_management
odoo/addons/hw_blackbox_be/__manifest__.py
Python
gpl-3.0
826
#pylint: disable=E1101,W0703,W0212,W0232, R0914,R0915,W0105 """ Package.py Class to handle the downloading of the package """ import urlparse import re import json import os import fnmatch from agent.lib.utils import md5sum from agent.lib.errors import Errors, PackagePathError, PackageScriptNotFound from agent.lib.er...
cronuspaas/cronusagent
agent/agent/lib/package.py
Python
apache-2.0
12,966
""" WSGI config for iam_manager project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import Dj...
MicroPyramid/IAM-Manager
iam_manager/wsgi.py
Python
mit
490
#!/usr/bin/env python3 # Copyright 2016 The Fontbakery Authors # Copyright 2017 The Google Font Tools 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/lice...
googlefonts/gftools
bin/gftools-family-html-snippet.py
Python
apache-2.0
6,090
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import numpy as np from numpy.testing import assert_allclose import pytest import jax from jax import jit, random, value_and_grad import jax.numpy as jnp from jax.test_util import check_close from numpyro.util import _versiontuple i...
pyro-ppl/numpyro
test/infer/test_svi.py
Python
apache-2.0
19,631
#!/usr/bin/env python # coding: utf8 # """ cd /Users/brunoflaven/Documents/02_copy/_000_IA_bruno_light/_my_article_python-explorations/git_repo_python_explorations_nlp/article_6_chatbot_with_pytorch python 00_train.py """ # VALUE JSONFILE="intents-backoffice-1.json" FILE = "data-backoffice-2.pth" import numpy a...
bflaven/BlogArticlesExamples
python_nlp_explorations_chatbot_keywords_extraction/article_6_chatbot_with_pytorch/00_train.py
Python
mit
3,740
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
allenlavoie/tensorflow
tensorflow/contrib/autograph/impl/conversion.py
Python
apache-2.0
12,675
# automate/server/user/views.py ################# #### imports #### ################# #from flask import render_template, Blueprint, url_for, \ # redirect, flash, request #from flask_login import login_user, logout_user, login_required #from automate.server import bcrypt, db #from automate.server import db #from...
JeromeErasmus/browserstack_automate
automate/server/user/views.py
Python
apache-2.0
2,112
# Simple wrapper script needed to run epydoc import sys try: from epydoc.cli import cli except ImportError: print>>sys.stderr, "No epydoc installed (see http://epydoc.sourceforge.net)" sys.exit(2) # Epydoc 3.0.1 has some trouble running with recent Docutils (>= 0.6), # so we work around this bug, follow...
dinhkhanh/trac
doc/utils/runepydoc.py
Python
bsd-3-clause
1,792
#-*- coding:utf-8 -*- from django.conf import settings from django.db import models, transaction from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from bookshare.apps.books.models import Book class BookShareModel(models.Model): pub_date = models.DateTimeField(_('Published ...
SungJinYoo/BookShare
bookshare/apps/core/models.py
Python
gpl-2.0
7,322
import numpy as np class CrossValidationResult(): """ Container for the results of a cross validation. Works only for binary classification. This could be generalized further if need be. """ SEPARATOR = '-' * 80 def __init__(self, folds, fold_size, feature_labels): """ Creates a new CrossValidat...
furgerf/kaggle-projects
common/cross_validation_result.py
Python
apache-2.0
5,228
from sympy.core import (Basic, Expr, S, C, Symbol, Wild, Add, sympify, diff, oo, Tuple, Interval) from sympy.core.symbol import Dummy from sympy.core.compatibility import is_sequence from sympy.integrals.trigonometry import trigintegrate from sympy.integrals.deltafunctions import deltaintegrate...
srjoglekar246/sympy
sympy/integrals/integrals.py
Python
bsd-3-clause
50,685
from sympy.polys.rings import ring from sympy.polys.domains import ZZ, QQ, AlgebraicField from sympy.polys.modulargcd import ( modgcd_univariate, modgcd_bivariate, _chinese_remainder_reconstruction_multivariate, modgcd_multivariate, _to_ZZ_poly, _to_ANP_poly, func_field_modgcd, _func_fie...
wxgeo/geophar
wxgeometrie/sympy/polys/tests/test_modulargcd.py
Python
gpl-2.0
9,007
# 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 ...
SUSE/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateway_connections_operations.py
Python
mit
28,692
import boto3 from decEncoder import * from DynamoTable import * def handler(event, context): """Dynamo resource""" buildingTable = DynamoTable('Buildings') return getBuildingId(event, buildingTable) """Lambda handler function for /buildings/{buildingId} API call Returns building with the buildingId spe...
jcolekaplan/WNCYC
src/main/api/getBuildingId.py
Python
mit
1,479
import hashlib from datetime import datetime, timedelta import struct import argparse def get_seed(seq_nr, date): key = "\x01\x05\x19\x35" seq_nr = struct.pack('<I', seq_nr) year = struct.pack('<H', date.year) month = struct.pack('<H', date.month) day = struct.pack('<H', date.day) m = hashlib....
baderj/domain_generation_algorithms
newgoz/dga.py
Python
gpl-2.0
2,689
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import os.path from UM.Application import Application from UM.Math.Color import Color from UM.PluginRegistry import PluginRegistry from UM.Event import Event from UM.View.View import View from UM.Scene.Iterator.BreadthFirs...
ynotstartups/Wanhao
plugins/XRayView/XRayView.py
Python
agpl-3.0
3,779
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-12 22:20 from __future__ import unicode_literals import autoslug.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('semesterpage', '0008_auto_20160812_2305'), ] operations = [ m...
afriestad/WikiLinks
semesterpage/migrations/0009_auto_20160813_0020.py
Python
mit
803
# -*- coding: utf-8 -*- # utils.py # Copyright (C) 2013 LEAP # # 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 version. # # This ...
leapcode/leap_mail
pkg/utils.py
Python
gpl-3.0
3,401
# # 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 us...
TK-TarunW/ecosystem
spark-2.0.2-bin-hadoop2.7/python/pyspark/mllib/regression.py
Python
apache-2.0
30,567
import Adafruit_DHT from datetime import datetime from elasticsearch import Elasticsearch import RPi.GPIO as GPIO import sys import util DEVICE = 'raspberrypi1' PIN = 20 SENSOR = Adafruit_DHT.DHT22 BLUE_LED = 19 GREEN_LED = 26 GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.setup(GREEN_LED, GPIO.OUT) GPIO.setup...
chuajiesheng/raspberrypi
Ambience/create.py
Python
gpl-2.0
1,676
#!/usr/bin/env python # barrier.py import time from mpi4py import MPI comm = MPI.COMM_WORLD rank = comm.Get_rank() if rank == 0: time.sleep(5) comm.Barrier() print ("process " + str(rank) + " is here")
linhbngo/cpsc-4770_6770
codes/mpi4py/barrier.py
Python
gpl-3.0
205
from tasty.types import conversions from tasty.types import * from tasty.types.driver import TestDriver __params__ = {'la': 32, 'lb': 32, 'dima': 10, 'dimb': 10} driver = TestDriver() def protocol(client, server, params): conversions.Paillier_Garbled_receive(server.hb, client.gb, 233, [1], False) client.sc = U...
tastyproject/tasty
tasty/tests/functional/protocols/conversions/unsigned-homomorphic-garbled-unsigned/protocol_setup_client.py
Python
gpl-3.0
378
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from scipy.special import cbrt from .config import * _lim_val = np.finfo(np.float64).max _lim_val_exp = np.log(_lim_val) _lim_val_square = np.sqrt(_lim_val) #_lim_val_cube = cbrt(_lim_va...
beckdaniel/GPy
GPy/util/misc.py
Python
bsd-3-clause
5,919
"""Gammas This module implements simulation of interactions of gamma photons with a scintillator. Used in groundparticle simulations. """ from __future__ import division from random import expovariate import numpy as np SCINTILLATOR_THICKNESS = 2.0 # cm MAX_DEPTH = 112. # longest straight path in scintillator in...
HiSPARC/sapphire
sapphire/simulations/gammas.py
Python
gpl-3.0
7,878
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
QISKit/qiskit-sdk-py
test/python/transpiler/test_barrier_before_final_measurements.py
Python
apache-2.0
14,581
# coding=utf-8 import cherrypy from cherrypy import Tool class SPARedirectTool(Tool): """ Single Page Application redirect tool. This makes sure that single page application routing works (404 redirect to index.html). This replaces the usage of custom error page, which also works, but gives 404 erro...
h3llrais3r/Auto-Subliminal
autosubliminal/server/tool.py
Python
gpl-3.0
650
"""Tests for display of certificates on the student dashboard. """ import unittest import datetime import ddt import mock from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from mock import patch from pytz import UTC from certificates.api imp...
lduarte1991/edx-platform
common/djangoapps/student/tests/test_certificates.py
Python
agpl-3.0
11,733
import sqlite3 as lite import db class GlobalSettings(object): lite_schema = "CREATE TABLE IF NOT EXISTS GlobalSettings (key STRING UNIQUE, value STRING)" indexes = [] def __init__(self, gh_username): self.key = key self.value = value @classmethod def set(self, key, value): ...
mikewesner-wf/glasshouse
glasshouse.indigoPlugin/Contents/Server Plugin/model.py
Python
apache-2.0
670
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division from builtins import str import sys import unittest import re import os dirname = os.path.dirname(__file__) sys.path.insert(0, os.path.join(dirname, '..', '..', '..')) import uuid from SpiffWorkflow.serializer.dict import Dictiona...
knipknap/SpiffWorkflow
tests/SpiffWorkflow/serializer/dictTest.py
Python
lgpl-3.0
2,803
from django.conf.urls.defaults import patterns, url urlpatterns = patterns( 'show.views', url(r'^radioshow/entrylist/$', 'radioshow_entryitem_list', name='radioshow_entryitem_list'), url(r'^showcontributor/list/(?P<slug>[\w-]+)/$', 'showcontributor_content_list', name='showcontributor_content_list'), u...
praekelt/panya-show
show/urls.py
Python
bsd-3-clause
804
# -*- coding: utf-8 -*- """ tests.conftest ~~~~~~~~~~~~~~ configuriation for pytests """ import os import pytest # from alembic.command import upgrade # from alembic.config import Config from uru_crm.factory import create_app from uru_crm.config import TestConfig from uru_crm.extensions import db as _db...
gitbenji/uru-crm
tests/conftest.py
Python
mit
1,851
# pylint: disable=C0111 # pylint: disable=W0621 #EVERY PROBLEM TYPE MUST HAVE THE FOLLOWING: # -Section in Dictionary containing: # -factory # -kwargs # -(optional metadata) # -Correct, Incorrect and Unanswered CSS selectors # -A way to answer the problem correctly and incorrectly # -A way to check the problem...
jswope00/GAI
lms/djangoapps/courseware/features/problems_setup.py
Python
agpl-3.0
17,403
import pyopus.wxmplplot as pyopl from numpy import arange, sin, cos, exp, pi, e, linspace, outer, ones, size if __name__ == '__main__': # Initialize gui thread, clean up. pyopl.init() pyopl.close() # Plot data - sin(x), cos(x), exp(x/pi) .. for x in [0, 2pi] with 0.2 step. x = arange(0.0, 2*pi, 0.2) ...
blorgon9000/pyopus
demo/plotting/10-3d.py
Python
gpl-3.0
1,443
import os import sys above_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, above_dir) from tools import ProgressIterator, random_target_function, random_set, second_order, pla, linear_percepton, weight_error, output, experiment import numpy as np np.random.seed(0) # HOEFFDING IN...
zhiyanfoo/caltech-machine-learning
ass2/hw2.py
Python
mit
4,126
""" Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled uniquely. We use # as a separator for each node, and , as a separator for node label and each neighbor of the node. As an example, consider the serialized graph {...
dichen001/Go4Jobs
JackChen/Google/133. Clone Graph.py
Python
gpl-3.0
1,949
#!/usr/bin/env python import argparse from collections import defaultdict from itertools import combinations import os import datetime import time import random import numpy as np from scipy.optimize import minimize, check_grad import networkx as nx from lib.graph import make_edge, read_graph_from_file, cosh_d, dis...
horoshenkih/rgg
fit.py
Python
mit
14,528
from vmwaremirage import VmwareMirageClient import config import config_secure import os vm = VmwareMirageClient(server=config_secure.server, username=config_secure.username, password=os.environ['VMWARE_MIRAGE_PASSWORD']) def test_reauth(): # Cofirm we are working...
jay-tuckey/python-vmwaremirage
tests/test_main_functions.py
Python
mit
4,514
# jhbuild - a build script for GNOME 1.x and 2.x # Copyright (C) 2001-2006 James Henstridge # # httpcache.py: a simple HTTP cache # # 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 vers...
rpavlik/jhbuild-vrjuggler
jhbuild/utils/httpcache.py
Python
gpl-2.0
8,664
"""bill do the dan flan dance""" from urllib import quote import re import requests from random import shuffle def gif(unsafe=False): return "https://raw.githubusercontent.com/BobbyJohansen/imgs/master/dan.png" def on_message(msg, server): text = msg.get("text", "") match = re.findall(r"bill do the dan ...
BobbyJohansen/BillBot
plugins/thedanflandance.py
Python
mit
408
#Backend tests to be implemented #Test 1 - Succesful setup/running of server #Test 2 - Succesful retrieval of query #Test 3 - Correct query return #Test 4 - Succesful upload of POST request #Test 5 - Succesful retrieval of newly inserted Rice #Test 6 - Succesful filtering of spam requests
install-logos/RiceBE
test.py
Python
mit
293
import os import datetime import sys import time import string import random import pandas as pd import numpy as np import gc if(len(sys.argv) < 2): print('Usage: CSVTrainer.py train.csv validation.csv model.h5 log.txt') sys.exit(1) trainingName = sys.argv[1] validationName = sys.argv[2] modelName = sys....
rboyes/KerasScripts
CSVTrainer.py
Python
apache-2.0
5,321
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from setuptools import setup _PUBLISH_WARNING = ''' ****************** !!! DEPRECATED !!! ****************** Use twine to publish packages to pypi now. Ensure you have the `wheel` and `twine` packages installed with pip install wheel twine Then create...
lpomfrey/django-taggit-machinetags
setup.py
Python
bsd-2-clause
551
# c1219/access/telephone.py # # Copyright 2011 Spencer J. McIntyre <SMcIntyre [at] SecureState [dot] net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, ...
firebitsbr/termineter
c1219/access/telephone.py
Python
gpl-3.0
6,917
from base import * import os DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Audrey Roy', 'audreyr@cartwheelweb.com'), ('Daniel Greenfeld', 'pydanny@cartwheelweb.com'), ) MANAGERS = ADMINS DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', 'roda <info@roda.com>') EMAIL_BACKEND = 'django.co...
pydanny/roda
roda/roda/settings/heroku.py
Python
mit
1,814
from compare import expect from django.contrib.auth.models import User from django.test import TestCase from django.test.client import Client from django.core.management import call_command import sys from tardis.tardis_portal.models import \ Experiment, Dataset, Dataset_File, ExperimentACL, License, UserProfile...
steveandroulakis/mytardis
tardis/tardis_portal/tests/test_rmexperiment.py
Python
bsd-3-clause
4,827
#!/usr/bin/env python from distutils.core import setup setup(name='WebScrape', version='0.1.2', description='A tool for data mining, tailored for RateMyProfessors.com', author='Nick Rebhun', author_email='nrfactor@gmail.com', url='https://www.nrebhun.com', packages=['beautifulsoup4...
nrebhun/RMPScrape
setup.py
Python
mit
341
from __future__ import unicode_literals import ast import os.path import dj_database_url import dj_email_url from django.contrib.messages import constants as messages import django_cache_url DEBUG = ast.literal_eval(os.environ.get('DEBUG', 'True')) SITE_ID = 1 PROJECT_ROOT = os.path.normpath(os.path.join(os.path....
itbabu/saleor
saleor/settings.py
Python
bsd-3-clause
12,155
from collections import defaultdict import logging import Pyro4 from pyage.core.agent.agent import AGENT from pyage.core.inject import Inject from pyage_forams.solutions.agent.shadow_cell import ShadowCell from pyage_forams.solutions.distributed.request import Request logger = logging.getLogger(__name__) class Ne...
maciek123/pyage-forams
pyage_forams/solutions/distributed/neighbour_matcher.py
Python
gpl-2.0
6,823