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 -*- from orgmode import ORGMODE, repeat from orgmode.menu import Submenu, ActionEntry from orgmode.keybinding import Keybinding, Plug, Command from orgmode import settings import vim class TagsProperties(object): u""" TagsProperties plugin """ def __init__(self): u""" Initialize plugin """ ...
kratob/dotfiles
vim/.vim.symlink/ftplugin/orgmode/plugins/TagsProperties.py
Python
mit
4,531
"""Administration form for search settings.""" from __future__ import unicode_literals from django import forms from django.core.exceptions import ValidationError from django.utils.translation import (ugettext, ugettext_lazy as _) from djblets.siteconfig.forms import SiteSettings...
chipx86/reviewboard
reviewboard/admin/forms/search_settings.py
Python
mit
6,654
''' Created on Feb 8, 2011 @author: vgapeyev ''' import csv, re __nonspace_whitespace = re.compile(r"[\t\n\r\f\v]") __long_whitespace = re.compile(r"[ ]{2,}") def normalize_whitespace(str): str = re.sub(__nonspace_whitespace, " ", str) str = re.sub(__long_whitespace, " ", str) return str def empty_line(...
NESCent/Chimp-Recs-FieldObservations
ObservationParsing/src/obsparser/app.py
Python
cc0-1.0
4,869
#!/usr/bin/env python # coding=utf-8 """316. Numbers in decimal expansions https://projecteuler.net/problem=316 Let p = p1 p2 p3 ... be an infinite sequence of random digits, selected from {0,1,2,3,4,5,6,7,8,9} with equal probability. It can be seen that p corresponds to the real number 0.p1 p2 p3 .... It can als...
openqt/algorithms
projecteuler/pe316-numbers-in-decimal-expansions.py
Python
gpl-3.0
1,292
#!/usr/bin/python2.7 import os, ast, time, sys, re, inspect, traceback, time, subprocess, json, requests from threading import Thread from subprocess import Popen, PIPE import multiprocessing as mp from multiprocessing import Pool # magia: BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) proj_pat...
limbail/ceamon
pandorabox/ceamon/management/commands/m_ceamon_alerts_worker.py
Python
mit
4,124
import pickle import pytest from praw.models import Subreddit, WikiPage from ... import UnitTest class TestSubreddit(UnitTest): def test_equality(self): subreddit1 = Subreddit( self.reddit, _data={"display_name": "dummy1", "n": 1} ) subreddit2 = Subreddit( self.re...
leviroth/praw
tests/unit/models/reddit/test_subreddit.py
Python
bsd-2-clause
6,349
# -*- encoding: utf-8 -*- # Module iaendpoints from numpy import * from string import upper def iaendpoints(OPTION="LOOP"): from iase2hmt import iase2hmt from iabinary import iabinary Iab = None OPTION = upper(OPTION) if OPTION == 'LOOP': Iab = iase2hmt( iabinary([[0,0,0], ...
mariecpereira/IA369Z
deliver/ia870/iaendpoints.py
Python
mit
837
# -*- coding: utf-8 -*- # flake8: noqa from __future__ import unicode_literals from .__about__ import __version__, __description__, __author__, __url__ from .benchmark import Benchmark, RunResult, DEFAULT_TIMES from .report import BaseReporter, JsonReporter, CsvReporter, MarkdownReporter, RstReporter, FileReporter, Fi...
noirbizarre/minibench
minibench/__init__.py
Python
mit
365
#!/usr/bin/env python import codecs, os, shutil, subprocess, sys, tempfile mteval_pl = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'mt-diff', 'files', 'mteval-v13m.pl') def main(argv): if len(argv[1:]) < 2: print 'Score with NIST BLEU' print '' print 'usage: {0} <hyp> ...
qingsongma/blend
tools/meteor-1.4/scripts/bleu.py
Python
gpl-3.0
1,540
# -*- 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 'UserProfile' db.create_table(u'ecg_balancing_userprofile', ( (u'id', self.gf('dj...
sinnwerkstatt/ecg-balancing
ecg_balancing/migrations/0007_auto__add_userprofile.py
Python
mit
11,373
# Copyright (C) 2010-2011 Richard Lincoln # # 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, merge, publish...
rwl/PyCIM
CIM14/CPSM/Equipment/Core/GeographicalRegion.py
Python
mit
2,316
""" Read rules from all cubes and sort cubes by some metrics (Number rows, Number feeders,... ) """ import configparser from TM1py.Services import TM1Service config = configparser.ConfigParser() # storing the credentials in a file is not recommended for purposes other than testing. # it's better to setup CAM with SSO...
cubewise-code/TM1py-samples
Administration/cube_rules_stats.py
Python
mit
1,421
import os import synapse.exc as s_exc import synapse.common as s_common import synapse.cortex as s_cortex import synapse.tests.utils as s_tests import synapse.lib.modelrev as s_modelrev def nope(*args, **kwargs): raise Exception('nope was called') class ModelRevTest(s_tests.SynTest): async def test_cortex_m...
vertexproject/synapse
synapse/tests/test_lib_modelrev.py
Python
apache-2.0
6,599
# Copyright (c) OpenMMLab. All rights reserved. import random import warnings import torch from mmcv.runner import get_dist_info from mmcv.runner.hooks import HOOKS, Hook from torch import distributed as dist @HOOKS.register_module() class SyncRandomSizeHook(Hook): """Change and synchronize the random image size...
open-mmlab/mmdetection
mmdet/core/hook/sync_random_size_hook.py
Python
apache-2.0
3,061
from .base import * import logging SITE_NAME = "Development" DEBUG = True DEBUG_TOOLBAR = False LIVE_GO_CARDLESS = False LIVE_MAIL = False env_path = os.path.join(BASE_DIR, ".env") environ.Env.read_env(env_path) INSTALLED_APPS += ["coverage", "django_waitress"] if DEBUG_TOOLBAR: INSTALLED_APPS += ["debug_toolba...
ianastewart/cwltc-admin
mysite/settings/dev.py
Python
mit
3,231
__author__ = 'benji'
oldm/OldMan
oldman/validation/__init__.py
Python
bsd-3-clause
21
import random from unittest import TestCase from hamcrest import * from chapter14.exercise14_1_4 import os_key_rank from tree_util import get_random_os_tree class TestExercise14_1_4(TestCase): def test_os_key_rank(self): tree, nodes, keys = get_random_os_tree() key_to_find = random.choice(keys)...
wojtask/CormenPy
test/test_chapter14/test_exercise14_1_4.py
Python
gpl-3.0
564
#!/usr/bin/env python from pprint import pprint import pyeapi pynet_sw = pyeapi.connect_to("pynet-sw2") show_version = pynet_sw.enable("show version") pprint(show_version)
ktbyers/pynet-ons-nov16
arista_pyeapi_example/arista_pyeapi.py
Python
apache-2.0
174
from __future__ import absolute_import # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU Gener...
fmaguire/ete
ete3/tools/phylobuild_lib/task/jmodeltest.py
Python
gpl-3.0
4,185
# Copyright (C) 2017 Szymon Nieznański (s.nez@member.fsf.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 License, or (at your option) any later version. # # T...
s-nez/service-monitor
SimpleLabel.py
Python
gpl-3.0
1,275
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals; # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os; import sys; sys.path.append(os.curdir); from pelicanconf import *; ## Publish Config ---------------------------------...
benrbray/benrbray.github.io-source
publishconf.py
Python
mit
882
#!/usr/bin/env python2 import os import subprocess import argparse from lib import builder from lib import promote current_directory = os.path.realpath(os.path.dirname(__file__)) parser = argparse.ArgumentParser() description = "Used to promote from one branch to another. For example, from 2.6-dev to " \ ...
rbarlow/pulp_packaging
ci/promote-brach.py
Python
gpl-2.0
3,501
from pyxb_114.bundles.wssplat.raw.wscoor import *
msherry/PyXB-1.1.4
pyxb_114/bundles/wssplat/wscoor.py
Python
apache-2.0
50
from extra.utils import strToBool class Machine(object): """ Provides the implementation of a Machine in a Plant. """ def __init__(self, name, quantity = 1, canUnhook = False, precedence = False, breaks = []): """ name is the unique Machine name. precedence is whether the quantity should be dealt with as ...
fredmorcos/attic
projects/plantmaker/archive/20100531/src/plant/machine.py
Python
isc
1,470
# Copyright 2013 IBM Corp. from powervc.common import config from powervc.common import netutils CONF = config.CONF # http client opts from config file normalized # to keystone client form OS_OPTS = None PVC_OPTS = None def _build_base_http_opts(config_section, opt_map): configuration = CONF[config_section] ...
openstack/powervc-driver
common-powervc/powervc/common/client/config.py
Python
apache-2.0
1,125
#!/usr/bin/env python # -*- coding: utf-8 -*- import warnings from py.test import mark from translate.tools import pretranslate from translate.convert import test_convert from translate.misc import wStringIO from translate.storage import po from translate.storage import xliff class TestPretranslate: xliff_skel...
jagg81/translate-toolkit
translate/tools/test_pretranslate.py
Python
gpl-2.0
14,227
from base import StreetAddressValidation, AddressValidation UPS_XAV_CONNECTION = 'https://onlinetools.ups.com/ups.app/xml/XAV' UPS_XAV_CONNECTION_TEST = 'https://wwwcie.ups.com/ups.app/xml/XAV' UPS_AV_CONNECTION = 'https://onlinetools.ups.com/ups.app/xml/AV' UPS_AV_CONNECTION_TEST = 'https://wwwcie.ups.com/ups.app/xm...
cuker/python-ups
ups/addressvalidation/__init__.py
Python
bsd-3-clause
326
"""This module provides the BET calculations on isotherm data. See: http://micro.edu/calculations/bet.html for details. """ import numpy as np import math from . import constants as const from . import util def Isotherm2BET(Qads, Prel) : """Calculate the BET Transform Arguments: Qads: Quauntity of g...
lowks/micromeritics
micromeritics/bet.py
Python
gpl-3.0
2,286
#!/usr/bin/env python # encoding: utf-8 """ update/disease.py Update the disease terms in database Created by Måns Magnusson on 2017-04-03. Copyright (c) 2017 __MoonsoInc__. All rights reserved. """ import logging import os import click from flask.cli import current_app, with_appcontext from scout.constants import...
Clinical-Genomics/scout
scout/commands/update/disease.py
Python
bsd-3-clause
3,712
## # Copyright 2002-2012 Ilja Livenson, PDC KTH # # 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...
livenson/vcdm
src/vcdm/server/cdmi/blob.py
Python
bsd-3-clause
9,373
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from RBMlib import RBM from tqdm import tqdm import matplotlib.pylab as plt nvis = 8 nhid = 2 nsmpl = 5000 k = 10 batchsz = 100 epochs = 100 hbias = np.zeros( nhid ) vbias = np.zeros( nvis ) W = np.random.uniform( low=-1, high=+1, size=(nhid, nvis) ) ...
shouno/RBMsample
rbmtest.py
Python
bsd-3-clause
2,152
#--------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #---------------------------------------------------------------------...
BurtBiel/azure-cli
src/command_modules/azure-cli-network/azure/cli/command_modules/network/mgmt_local_gateway/lib/operations/__init__.py
Python
mit
794
import matplotlib.pyplot as plt from scipy import io from Tkinter import Tk from tkFileDialog import askopenfilename from tkFileDialog import asksaveasfilename if __name__ == '__main__': root=Tk() in_file = askopenfilename() out_file = asksaveasfilename() root.destroy() print in_file a = i...
robintw/WernerModel
plot_figure.py
Python
bsd-3-clause
649
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Calculates the Wigner-Seitz projection of cube file data of periodic data. .. autofunction:: main Command Line Interface ---------------------- .. program:: es_fitting.py .. option:: filename The cubefile to read from. Both Bohr and Angstrom units are supported...
ferchault/euston
src/tools/es_fitting.py
Python
lgpl-3.0
3,000
# coding: UTF-8 # # Copyright 2014 by SCSK Corporation. # # This file is part of PrimeCloud Controller(TM). # # PrimeCloud Controller(TM) 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 versi...
aigamo/primecloud-controller
iaas-gw/src/DescribeKeyPairs.py
Python
gpl-2.0
1,656
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "NNO" addresses_name = "2021-03-25T13:58:54.180597/Democracy_Club__06May2021.CSV" stations_name = "2021-03-25T13:58:54.180597/Democracy_Club__06May2021.CSV" ...
DemocracyClub/UK-Polling-Stations
polling_stations/apps/data_importers/management/commands/import_north_norfolk.py
Python
bsd-3-clause
1,890
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # 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 res...
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/gslib/vendored/boto/boto/exception.py
Python
bsd-3-clause
17,799
# -*- 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): # Changing field 'Diploma.hours' db.alter_column('nmadb_students_diploma', 'hours', self.gf('django.db.mode...
vakaras/nmadb-students
src/nmadb_students/migrations/0003_auto__chg_field_diploma_hours__chg_field_diploma_tasks_solved.py
Python
lgpl-3.0
9,381
# -*- coding: utf-8 -*- # # Flask-Micropub documentation build configuration file, created by # sphinx-quickstart on Wed Dec 16 17:53:24 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...
kylewm/flask-micropub
docs/conf.py
Python
bsd-2-clause
9,728
#!/usr/bin/env python # -*- coding:utf-8 -*- import pika import time connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) channel = connection.channel() channel.queue_declare(queue='rpc_queue') def fib(n): if n == 0: return 0 elif n == 1: return 1 else:...
dianshen/python_day
s12day10/rabbitMQ_rpc_serverl.py
Python
apache-2.0
951
__all__ = ['ewsum', 'ewsum_back', 'softmax_back', 'rectify_back'] import os import math import numpy import pycuda.gpuarray as gpuarray import pycuda.autoinit from pycuda.compiler import SourceModule from .matrix import matrix_addition from .utils import gpu_func from .enums import MAX_BLOCK_SIZE, CUR_DIR, CACHE_DIR ...
Captricity/sciguppy
sciguppy/misc.py
Python
mit
3,415
# Copyright (c) 2018 PaddlePaddle 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 app...
luotao1/Paddle
python/paddle/fluid/tests/unittests/test_dist_transformer.py
Python
apache-2.0
3,034
import sys import os import struct import leb128 from exception import UnknownMagic, UnsupportBindOpcode from macho import MACH_O_CPU_TYPE from fat_header import FatHeader from mach_header import * from objc import * class MachOAnalyzer: def __init__(self, file, cpu_type=MACH_O_CPU_TYPE.ARM64): self.__fd =...
py-ir0nf1st/objc_class_dump
objc_class_dump.py
Python
mit
44,790
#!/usr/bin/python import re import probe_config as conf import socket import os import tempfile import time class Cassandra: def __init__(self, myname): self.myname = myname self.allnodes = conf.cassandra_nodes self.idx = self.allnodes.index(myname) self.base_dir = '/mnt/%s1' % conf.data_disk def _...
SimbaService/Simba
server/scripts/probe/cassandra.py
Python
apache-2.0
3,363
import unittest from nose.tools import raises from vmf_converter.core.dynamic_converter import DynamicConverter class DynamicConverterTest(unittest.TestCase): """Test Class for DynamicConverter module""" def test_velocity_to_vmf_001(self): """ Tests the Velocity to VMF conversion for pppp dyn...
project-schumann/vmf-converter
tests/dynamic_converter_test.py
Python
mit
4,528
# 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...
mufaddalq/cloudstack-datera-driver
test/integration/smoke/test_loadbalance.py
Python
apache-2.0
25,268
from OpenSSL.SSL import SSL_CB_HANDSHAKE_DONE from twisted.internet._sslverify import OpenSSLCertificateOptions, ClientTLSOptions from twisted.internet.interfaces import IOpenSSLClientConnectionCreator from twisted.web.client import _requireSSL from twisted.web.iweb import IPolicyForHTTPS from zope.interface import imp...
NetKnights-GmbH/privacyidea-ldap-proxy
pi_ldapproxy/util.py
Python
agpl-3.0
1,817
import _minqlx import re as _re __version__ = _minqlx.__version__ temp = _re.search("([0-9]+)\.([0-9]+)\.([0-9]+)", __version__) try: __version_info__ = tuple(map(lambda i: int(temp.group(i)), [1, 2, 3])) except: __version_info__ = (999, 999, 999) del temp # Put everything into a single module. from _minqlx ...
MinoMino/minqlx
python/minqlx/__init__.py
Python
gpl-3.0
510
""" An example of how to send and receive arbitrary python objects, such as dictionaries. """ import pickle import mpi somedata = ["hello","world","!"] somedict = {} i = 0 for item in somedata: somedict[i] = item i += 1 def main(): rank,size = mpi.init() serial_dict = pickle.dumps(somedict) ...
steder/maroonmpi
examples/serialize.py
Python
gpl-2.0
658
import os import nose #import subprocess import pickle import cle TESTS_BASE = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.join('..', '..', 'binaries')) TESTS_ARCHES = [os.path.join('i386', 'libc.so.6'), os.path.join('i386', 'fauxware'), ...
Ruide/angr-dev
cle/tests/test_plt.py
Python
bsd-2-clause
4,343
# Copyright 2011-2012 OpenStack Foundation # 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...
jumpstarter-io/nova
nova/tests/scheduler/test_weights.py
Python
apache-2.0
9,359
rules = { "Author": { "email": { "type": "string", }, "password": { "type": "string", "required": True, }, "username": { "type": "string", "required": True, }, }, }
peterdemin/mutant
tests/regression/author/cerberus.py
Python
isc
281
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ from sleekxmpp.plugins.google.settings import stanza from sleekxmpp.plugins.google.settings.settings import GoogleSettings
danielvdao/facebookMacBot
venv/lib/python2.7/site-packages/sleekxmpp/plugins/google/settings/__init__.py
Python
mit
316
import unittest import json from datetime import datetime from pymongo import MongoClient from apps.basic_resource import server from apps.basic_resource.documents import Article, Comment class ResourcePutIdentifierField(unittest.TestCase): """ Test if a HTTP PUT that updates a resource that has an embedded ...
caiiiyua/monkful
tests/tests/basic_resource/put_identifier_field.py
Python
lgpl-3.0
5,212
from __future__ import absolute_import import logging import time from collections import namedtuple from multiprocessing import Process, Manager as MPManager try: from Queue import Empty, Full except ImportError: # python 2 from queue import Empty, Full from .base import ( AUTO_COMMIT_MSG_COUNT, AUTO_...
vshlapakov/kafka-python
kafka/consumer/multiprocess.py
Python
apache-2.0
10,236
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('experiments', '0001_initial'), ] opera...
ESOedX/edx-platform
lms/djangoapps/experiments/migrations/0002_auto_20170627_1402.py
Python
agpl-3.0
1,376
# -*- coding: utf-8 -*- """ Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U. This file is part of Toolium. 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...
Telefonica/toolium
toolium/test/behave/test_environment.py
Python
apache-2.0
10,130
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflow/tensorflow
tensorflow/python/ops/ragged/ragged_math_ops.py
Python
apache-2.0
46,928
from netforce.model import Model,fields,get_model class Settings(Model): _name="ecom2.settings" _string="Settings" _fields={ "delivery_slot_discount": fields.Decimal("Same Delivery Slot Discount"), "delivery_max_days": fields.Integer("Delivery Max Days"), "delivery_min_hours": field...
anastue/netforce
netforce_ecom2/netforce_ecom2/models/ecom2_settings.py
Python
mit
458
#!/usr/bin/python for letter in 'Python': if letter == 'h': pass print 'This is pass block' print 'Current Letter :', letter print "Good bye!" # Current Letter : P # Current Letter : y # Current Letter : t # This is pass block # Current Letter : h # Current Letter : o # Current Letter : n # Good by...
TheShellLand/pies
v3/Libraries/builtin/statement/pass.py
Python
mit
322
from node_user import UserAttribute
xii/xii
src/xii/builtin/components/node/attributes/user/__init__.py
Python
apache-2.0
36
# 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...
DaanHoogland/cloudstack
systemvm/debian/opt/cloud/bin/cs/CsLoadBalancer.py
Python
apache-2.0
3,393
#!/usr/bin/env python ############################################################################ ## ## Copyright (C) 2006-2006 Trolltech ASA. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## Licensees holding a valid Qt License Agreement may use this file in ## ac...
cherry-wb/SideTools
examples/graphicsview/collidingmice/collidingmice.py
Python
apache-2.0
7,219
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lothian/psi4
psi4/driver/driver.py
Python
lgpl-3.0
120,682
import sys, os import subprocess import traceback import urllib import zipfile import ontology_to_daikon import common daikon_jar = common.get_jar("daikon.jar") DAIKON_SPLITTER = "=====================" def run_daikon_on_dtrace_file(dtrace_file, classpath=daikon_jar, checked_invariant=None): cmd = ["java", "-class...
aas-integration/integration-test2
inv_check/inv_check.py
Python
mit
2,879
try: from setuptools import setup except ImportError: from distutils.core import setup setup(name='GradespeedScraper', version='0.1-dev', description='Scrapes Gradespeed', author='Davis Robertson', author_email='davis@daviskr.com', license='MIT', url='https://github.com/ep...
EpicDavi/GradespeedScraper
setup.py
Python
mit
430
# -*- coding: utf-8 -*- from .base import * DEBUG = True
memnonila/taskbuster-boilerplate
taskbuster/taskbuster/settings/testing.py
Python
mit
57
# -*- 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 model 'Node' db.create_table(u'data_node', ( ('node_...
clairityproject/backend
data/migrations/0001_initial.py
Python
mit
29,927
from django.conf import settings from django.template import Library from ..utils import get_oauth_handler, get_gravatar_url register = Library() @register.simple_tag def github_auth_url(): oauth_handler = get_oauth_handler() return oauth_handler.authorize_url(settings.GITHUB['SCOPES']) @register.simple_...
beni55/djangolint
project/oauth/templatetags/oauth.py
Python
isc
396
from random import Random from collections_extended import setlist # The version of seeding to use for random SEED_VERSION = 2 # Common alphabets to use ALPHANUM = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' def shuffle(key...
mlenzen/flask-obfuscateids
flask_obfuscateids/lib.py
Python
bsd-3-clause
6,881
import time import math import rospy import sys from classes.BNO055 import * from tf.transformations import quaternion_from_euler, euler_from_quaternion class ImuDriver(object): def __init__(self, serial_port="/dev/ttyUSB0", calibration_vector=[]): self.degrees2rad = math.pi / 180.0 self.debug = ...
francisc0garcia/autonomous_bicycle
src/classes/ImuDriver.py
Python
apache-2.0
7,759
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-09 20:52 from __future__ import unicode_literals import django.contrib.auth.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0003_user_staged'), ] operations = [...
amstart/demo
demoslogic/users/migrations/0004_auto_20161009_2252.py
Python
mit
747
from alerts import Alerter, BasicMatchString import requests import json class ServiceNowAlerter(Alerter): required_options = set(['username', 'password', 'servicenow_rest_url', 'short_description', 'comments', 'assignment_group', 'category', 'subcategory', 'cmdb_ci', 'caller_id']) # Alert is called def a...
Vitiate/ShellScripts
ElastAlert/elastalert_modules/servicenow_alert.py
Python
gpl-2.0
1,758
""" Common tests shared by test_unicode, test_userstring and test_string. """ import unittest, string, sys, struct from test import support from collections import UserList class Sequence: def __init__(self, seq='wxyz'): self.seq = seq def __len__(self): return len(self.seq) def __getitem__(self, i): retu...
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/string_tests.py
Python
gpl-2.0
64,766
# Copyright 2016-2017 University of Pittsburgh # 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 agr...
dbmi-pitt/dbmi-annotator
translation/mp-evidence-base-ETL/postgres/omopConceptQry.py
Python
apache-2.0
1,265
from django.conf import settings from django.http import Http404 from django.test import TestCase from django.utils import timezone from cradmin_legacy import cradmin_testhelpers from model_bakery import baker from devilry.devilry_dbcache.customsql import AssignmentGroupDbCacheCustomSql from devilry.devilry_group impo...
devilry/devilry-django
devilry/devilry_group/tests/test_feedbackfeed/admin/test_comment_edit_history.py
Python
bsd-3-clause
8,010
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file # with open(path.join(here, 'README.rst'), encoding='utf-8') as f: # long_description = f.read() setup( name='bkmaker', # Versions should c...
bjtox/rds-bk-maker
setup.py
Python
mit
2,162
# Copyright (c) 2014-2016 Cedric Bellegarde <cedric.bellegarde@adishatz.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 License, or # (at your option) any later vers...
kerimlcr/ab2017-dpyo
ornek/lollypop/lollypop-0.9.229/src/search_spotify.py
Python
gpl-3.0
12,425
# Copyright (c) 2013 Hesky Fisher # See LICENSE.txt for details. # TODO: maybe move this code into the StenoDictionary itself. The current saver # structure is odd and awkward. # TODO: write tests for this file """Common elements to all dictionary formats.""" from os.path import splitext import shutil import thread...
dragon788/plover
plover/dictionary/base.py
Python
gpl-2.0
2,132
# coding: utf-8 import logging logger = logging.getLogger() pool = None def init(host, port, db, passwd): import redis global pool pool = redis.ConnectionPool(host=host, port=port, db=db, password=passwd, max_connections=3) def get_redis_client(): import redis r = redis.Redis(connection_pool=...
slin1972/unity
unity/service/redis_service.py
Python
apache-2.0
814
""" Handle file opening for read/write """ from numpy.lib._iotools import _is_string_like from statsmodels.compat.python import PY3 class EmptyContextManager(object): """ This class is needed to allow file-like object to be used as context manager, but without getting closed. """ def __init__(self,...
kiyoto/statsmodels
statsmodels/iolib/openfile.py
Python
bsd-3-clause
2,064
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import migrations def update_site_forward(apps, schema_editor): """Set site domain and name.""" Site = apps.get_model("sites", "Site") Site.objects.update_or_create( id=settings.SITE_ID...
andkon/cookietester
cookietester/contrib/sites/migrations/0002_set_site_domain_and_name.py
Python
bsd-3-clause
947
#!/usr/bin/python # -*- coding: utf-8 -*- # # Get MSRC documents from MSRC REST and attempt to annotate them # against Bioportal # import msrcrest, restkit #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ API_KEY = '2b8a2949-2c4f-48db-a884-de9cf1e35bcc' EMAIL = 'caseyamcl@gmail.com' #~~~~~~~~~~...
idiginfo/scholar2text
python/bioportalmeshtest.py
Python
gpl-2.0
1,746
class Solution: # @return a list of lists of integers # S[i][j] if j == 0 or j == i # S[i][j] = S[i-1][j-1]+S[i-1][j] def generate(self, numRows): res = [] for i in range(numRows) : cur = [] for j in range(i+1) : if j == 0 or j == i : ...
yelu/leetcode
Pascal0.py
Python
gpl-2.0
662
# Portions Copyright (C) 2015 Intel Corporation ''' Powerflow results for one Gridlab instance. ''' import sys import shutil import os import datetime import multiprocessing import pprint import json import math import traceback import __metaModel__ import logging from os.path import join as pJoin from os.path import ...
geomf/omf-fork
omf/models/gridlabMulti.py
Python
gpl-2.0
26,721
""" GitDoUtils contain functions for use in GitDo""" from colorama import Fore import datetime import os import os.path import re import subprocess from colorama import init # Back, init() from glt.PrintUtils import print_error, print_list from glt.PrintUtils import get_logger logger = get_logger(__name__) def run_...
MikeTheGreat/GLT
glt/GitLocalUtils.py
Python
gpl-3.0
20,763
# -*- coding: utf-8 -*- """ Elo ~~~ An implementation of the Elo algorithm for Python. Elo is a rating system among game players and it is used on many chess tournaments to rank. .. sourcecode:: pycon >>> from elo import rate_1vs1 >>> rate_1vs1(800, 1200) (809.091, 1190.909) Links ````` - `GitHub reposito...
sublee/elo
setup.py
Python
bsd-3-clause
2,485
import prett from .. import QTimeEdit, QDate from .. import QDateEdit from .. import ui_extension from .. import BaseInterface @ui_extension class TimeEdit(QTimeEdit, BaseInterface, prett.WidgetStringInterface): class StringItem(prett.WidgetStringItem): def __init__(self, parent: 'TimeEdit'): ...
SF-Zhou/quite
quite/gui/widgets/time_edit.py
Python
mit
906
""" Test cases for tabs. """ from mock import MagicMock, Mock, patch from courseware.courses import get_course_by_id from courseware.views import get_static_tab_contents from django.test.utils import override_settings from django.core.urlresolvers import reverse from student.tests.factories import UserFactory from x...
huchoi/edx-platform
lms/djangoapps/courseware/tests/test_tabs.py
Python
agpl-3.0
4,042
### # Copyright (c) 2012, Frumious Bandersnatch # 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 co...
kg-bot/SupyBot
plugins/Survey/config.py
Python
gpl-3.0
2,482
## # Generate symbal for memory profile info. # # This tool depends on DIA2Dump.exe (VS) or nm (gcc) to parse debug entry. # # Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials are licensed and made available under # the terms and conditions of the BSD License...
intel/ipmctl
BaseTools/Scripts/MemoryProfileSymbolGen.py
Python
bsd-3-clause
10,174
# -*- coding: utf-8 -*- """ werkzeug.utils ~~~~~~~~~~~~~~ This module implements various utilities for WSGI applications. Most of them are used by the request and response wrappers but especially for middleware development it makes sense to use them without the wrappers. :copyright: (c) 2011 ...
r-kitaev/lucid-python-werkzeug
werkzeug/utils.py
Python
bsd-3-clause
23,011
# -*- coding: utf-8 -*- first_line = raw_input().split() N = int(first_line[0]) #Longitud secuencia M = int(first_line[1]) #Longitud subsecuencia K = int(first_line[2]) n = raw_input().split() #secuencia menor = 2147483647 #mayor numero posible for i in range(N): num = int(n[i]) if num < menor: men...
ieeeugrsb/ieeextreme8
Teams/MineCoders/01_IEEE Electronic Devices Society/01_alternativo.py
Python
gpl-3.0
342
import copy from SDWLE.cards.base import SpellCard from SDWLE.tags.action import Damage, Draw, RemoveFromHand from SDWLE.tags.base import AuraUntil, Buff, Effect, ActionTag from SDWLE.tags.card_source import Same from SDWLE.tags.condition import GreaterThan, IsDamaged from SDWLE.tags.event import TurnEnded, Drawn from ...
jomyhuang/sdwle
SDWLE/cards_copy/spells/warrior.py
Python
mit
9,699
"""Base class for Bundle and Partition databases. This module also includes interfaces for temporary CSV files and HDF files. Copyright (c) 2013 Clarinova. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ import h5py import os.path from numpy import * ...
treyhunner/databundles
databundles/hdf5.py
Python
bsd-3-clause
3,289
#!/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...
wbsavage/shinken
shinken/daemons/pollerdaemon.py
Python
agpl-3.0
1,555
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json from telemetry.internal.results import output_formatter def ResultsAsDict(page_test_results, benchmark_metadata): """Takes PageTestResults t...
catapult-project/catapult-csm
telemetry/telemetry/internal/results/json_output_formatter.py
Python
bsd-3-clause
2,173
# ------------------------------------------------------------------ # Copyright (c) 2020 PyInstaller Development Team. # # This file is distributed under the terms of the GNU General Public # License (version 2.0 or later). # # The full license is available in LICENSE.GPL.txt, distributed with # this software. # # SPD...
etherkit/OpenBeacon2
macos/venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-lxml.objectify.py
Python
gpl-3.0
461
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
unt-libraries/catalog-api
django/sierra/export/migrations/0001_initial.py
Python
bsd-3-clause
2,987
#!/usr/bin/env python ############################################################### ### NZBGET POST-PROCESSING SCRIPT ### # Convert a Blu-Ray to MKV. # # This script converts a Blu-Ray disc to MKV file with MakeMKV. # Blu-Ray ISOs and directories can be processed. #######################...
alexandre-figura/nzbget-pp-script_bluray-to-mkv
script/bluray_to_mkv.py
Python
gpl-3.0
6,687