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 |
|---|---|---|---|---|---|
#
# University of Luxembourg
# Laboratory of Algorithmics, Cryptology and Security (LACS)
#
# FigureOfMerit (FOM)
#
# Copyright (C) 2015 University of Luxembourg
#
# Written in 2015 by Daniel Dinu <dumitru-daniel.dinu@uni.lu>
#
# This file is part of FigureOfMerit.
#
# This program is free software: you can redistribut... | GaloisInc/hacrypto | src/Tools/FigureOfMerit/FigureOfMerit/BlockCiphers/Scenario2/CipherImplementationMetrics.py | Python | bsd-3-clause | 1,891 |
import uuid
import warnings
from enum import Enum, auto, unique
from ocdsmerge.exceptions import DuplicateIdValueWarning, InconsistentTypeError
VERSIONED_VALUE_KEYS = frozenset(['releaseID', 'releaseDate', 'releaseTag', 'value'])
@unique
class MergeStrategy(Enum):
APPEND = auto()
MERGE_BY_POSITION = auto()
... | open-contracting/ocds-merge | ocdsmerge/flatten.py | Python | bsd-3-clause | 8,273 |
#!/usr/bin/env python
from boomslang import Bar, ClusteredBars, Plot
import unittest
from ImageComparisonTestCase import ImageComparisonTestCase
class ClusteredBarsTest(ImageComparisonTestCase, unittest.TestCase):
def __init__(self, testCaseName):
super(ClusteredBarsTest,self).__init__(testCaseName)
... | alexras/boomslang | tests/test_clusteredbars.py | Python | bsd-3-clause | 1,377 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
from auto_nag import utils
from auto_nag.bzcleaner import BzCleaner
from auto_nag.scripts.regression_set... | mozilla/relman-auto-nag | auto_nag/tests/test_regression_set_status_flags.py | Python | bsd-3-clause | 3,826 |
# Copyright 2017 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | google/deepvariant | deepvariant/data_providers.py | Python | bsd-3-clause | 19,622 |
'''run all examples to make sure we don't get an exception
Note:
If an example contaings plt.show(), then all plot windows have to be closed
manually, at least in my setup.
uncomment plt.show() to show all plot windows
'''
stop_on_error = True
filelist = ['example_glsar.py', 'example_wls.py', 'example_gls.py',
... | pprett/statsmodels | examples/run_all.py | Python | bsd-3-clause | 1,704 |
from cumulusci.cli.cci import main
main()
| SalesforceFoundation/CumulusCI | cumulusci/__main__.py | Python | bsd-3-clause | 43 |
# Generated by Django 2.2.14 on 2020-07-10 08:53
from django.db import migrations, models
class Migration(migrations.Migration):
def set_default_to_low(apps, schema_editor):
system_settings = apps.get_model('dojo', 'system_settings')
try:
ss = system_settings.objects.all().first()
... | rackerlabs/django-DefectDojo | dojo/db_migrations/0047_jira_minimum_severity_default.py | Python | bsd-3-clause | 1,084 |
from django.conf import settings
from django.core.cache import cache
from django.test import TestCase
from ultracache import _thread_locals
from ultracache.utils import Ultracache
from ultracache.tests.models import DummyModel
class UtilsTestCase(TestCase):
if "django.contrib.sites" in settings.INSTALLED_APPS:
... | praekelt/django-ultracache | ultracache/tests/test_utils.py | Python | bsd-3-clause | 1,505 |
# Django settings for {{ project_name }} project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | alex/django-old | django/conf/project_template/settings.py | Python | bsd-3-clause | 4,751 |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/surface/compute/routes/describe.py | Python | bsd-3-clause | 1,244 |
from pydeo.app.controllers.assets_controller import AssetsController
from pydeo.app.controllers.errors_controller import ErrorsController
from pydeo.app.controllers.files_controller import FilesController
from pydeo.app.controllers.index_controller import IndexController
from pydeo.app.controllers.movies_controller imp... | Rolinh/pydeo | pydeo/config/routes.py | Python | bsd-3-clause | 2,442 |
"""
redrock.rebin
=============
Tools for binning data.
"""
from __future__ import absolute_import, division, print_function
import numpy as np
import numba
def centers2edges(centers):
"""Convert bin centers to bin edges, guessing at what you probably meant
Args:
centers (array): bin centers,
... | sbailey/redrock | py/redrock/rebin.py | Python | bsd-3-clause | 4,560 |
import unittest
import sys
import py65.assembler
import py65.devices.mpu6502
class Common6502Tests:
"""Tests common to 6502-based microprocessors"""
# Reset
def test_reset_sets_registers_to_initial_states(self):
mpu = self._make_mpu()
mpu.reset()
self.assertEqual(0xFF, mpu.sp)
... | mkeller0815/py65 | py65/tests/devices/test_mpu6502.py | Python | bsd-3-clause | 203,687 |
# -*- coding: utf-8 -*-
from django.db import models
from django.core.urlresolvers import reverse
from irpmemr.models import CommonModel
class PatientVisit(CommonModel):
patient = models.OneToOneField('patient.PatientInformation')
first_visit = models.DateTimeField(null=True, blank=True)
second_visit = m... | aazhbd/medical_info01 | admission/models.py | Python | bsd-3-clause | 1,166 |
from json import loads
from cms.api import create_page
from cms.models import Page
from cms.models.fields import PageField
from django.core.files import File as DjangoFile
from django.core.files.temp import NamedTemporaryFile
from django.db import models
from django.utils.encoding import force_bytes, python_2_unicode_... | misli/django-cms-articles | cms_articles/import_wordpress/models.py | Python | bsd-3-clause | 14,142 |
# Django settings for dojo project.
import os
DEBUG = True
LOGIN_REDIRECT_URL = '/'
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
# SECURE_SSL_REDIRECT = True
# SECURE_BROWSER_XSS_FILTER = True
SESSION_COOKIE_HTTPONLY = True
CSRF_COOKIE_HTTPONLY = True
TEST_RUNNER = 'django.test.runner.DiscoverRun... | grendel513/django-DefectDojo | dojo/settings.dist.py | Python | bsd-3-clause | 8,264 |
# Copyright (c) 2012 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... | v-legoff/pa-poc3 | src/dc/yaml/connector.py | Python | bsd-3-clause | 2,500 |
#!/usr/bin/env python3
import numpy
from copy import deepcopy
visitedStates = []
nodeNumber = 0
class State():
"""Lol"""
def __init__(self, floor, genM, chM):
self.floor = floor
self.genM = genM
self.chM = chM
self.pairVector = numpy.sum(numpy.logical_and(genM, chM), 1)
... | znuxor/aoc2016 | 11b.py | Python | bsd-3-clause | 9,276 |
from rest_framework.serializers import ModelSerializer, WritableField
from openbudget.apps.contexts.models import Context
class ContextBaseSerializer(ModelSerializer):
"""Base Context serializer, exposing our defaults for contexts."""
data = WritableField()
class Meta:
model = Context
| nborwankar/open-budgets | openbudget/apps/contexts/serializers.py | Python | bsd-3-clause | 310 |
# -*- coding: utf-8 -*-
import sys
import os
import os.path
# installation directory is relative to current script location
# DIRINST=os.path.dirname(sys.argv[0])+"/../"
def usage():
MSG("usage mkax first_step step_incr n_step [ax_unit]")
DST=CURDATA()
if len(sys.argv)<4:
usage()
EXIT()
if len(sys.argv)==5:
... | jtrebosc/JTutils | TSpy/mkax.py | Python | bsd-3-clause | 961 |
"""
Next steps:
- translate the tests so that they comply with Hematite's URL
- path and query string autounquoting
- relative paths autoresolution
- add more positive tests (all of the tests below are for valid urls)
- add negative tests
"""
from hematite.url import URL
TEST_DATA = u"""\
# Based on https:/... | mahmoud/hematite | hematite/tests/test_url_w3c.py | Python | bsd-3-clause | 4,082 |
import contextlib
import warnings
import weakref
import xml.etree.ElementTree
from itertools import product
from operator import add
import numpy as np
import pandas as pd
import pytest
from pandas.io.formats import format as pandas_format
import dask
import dask.array as da
import dask.dataframe as dd
import dask.da... | blaze/dask | dask/dataframe/tests/test_dataframe.py | Python | bsd-3-clause | 159,857 |
# Copyright (C) 2015, Pauli Virtanen <pav@iki.fi>
# Distributed under the same license as SciPy.
import warnings
import numpy as np
from numpy.linalg import LinAlgError
from scipy.linalg import (get_blas_funcs, qr, solve, svd, qr_insert, lstsq)
from scipy.sparse.linalg.isolve.utils import make_system
__all__ = ['gcr... | grlee77/scipy | scipy/sparse/linalg/isolve/_gcrotmk.py | Python | bsd-3-clause | 15,556 |
#!/usr/bin/env python
# Copyright 2012 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
"""Reads a .isolated, creates a tree of hardlinks and runs the test.
To improve performance, it keeps a local cache. Th... | sgraham/nope | tools/swarming_client/run_isolated.py | Python | bsd-3-clause | 11,215 |
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import os
import shutil
import tempfile
import pytest
import coremltools.converters as converter
fr... | apple/coremltools | coremltools/converters/mil/frontend/tensorflow2/test/test_v2_load.py | Python | bsd-3-clause | 7,681 |
# -*- coding: utf-8 -*-
from .cryptol import (Cryptol, Provers,
ProofResult, SatResult, AllSatResult,
CryptolError, CryptolServerError, ProverError)
| GaloisInc/pycryptol | cryptol/__init__.py | Python | bsd-3-clause | 194 |
VERSION = (0,1,4)
| Axilent/Dox | dox/__init__.py | Python | bsd-3-clause | 20 |
import template_to_pdf
def render(report):
template = template_to_pdf.Template('job_discovery/print.html')
context = {
"jobs": report.liked_jobs,
"job_pool_location": report.location.adzuna_locations,
}
return template.render(context)
| lm-tools/situational | situational/apps/job_discovery/pdf.py | Python | bsd-3-clause | 269 |
# _*_ coding: utf-8 _*_
"""
@copyright Copyright (c) 2014 Submit Consulting
@author Angel Sullon (@asullom)
@package sad
Descripcion: Registro de modelos para la administracion con django de la app sad
"""
from django.contrib import admin
from apps.sad.models import Module, Menu, UserProfileEnterprise, User... | submitconsulting/backenddj | apps/sad/admin.py | Python | bsd-3-clause | 1,077 |
#!/usr/bin/env python
from setuptools import setup
from subprocess import call
def convert_readme():
try:
call(["pandoc", "-f", "markdown_github", "-t", "rst", "-o", "README.txt", "readme.md"])
except OSError:
pass
return open('README.txt').read()
setup(name='mongodbforms',
version=... | fmoro/django-mongodbforms | setup.py | Python | bsd-3-clause | 1,096 |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... | cournape/numscons | numscons/scons-local/scons-local-1.2.0/SCons/CacheDir.py | Python | bsd-3-clause | 8,002 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/unittest_import.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
f... | sklearn-theano/sklearn-theano | sklearn_theano/externals/google/protobuf/unittest_import_pb2.py | Python | bsd-3-clause | 3,453 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Author: Tim Henderson
#Email: tim.tadh@hackthology.com
#For licensing see the LICENSE file in the top level directory.
'''
A copy of recursive.py with a lot of debug information added. The debug information
should indicate how the parser works.
'''
import lexer as lx
fro... | timtadh/PyOhio2011 | recursive_verbose.py | Python | bsd-3-clause | 7,503 |
# -*- encoding: utf-8 -*-
# pylint: skip-file
from __future__ import absolute_import
import logging
import time
import unittest
import warnings
import json
from requests.utils import quote
from jose.exceptions import JWTError
import six
import httmock
from esipy import EsiSecurity
from esipy.events import Signal
fro... | Kyria/EsiPy | test/test_security.py | Python | bsd-3-clause | 14,211 |
from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms.validators import DataRequired, Email, EqualTo, Length
from .models import Meeting_Action_Item_User | phamtrisi/metapp2 | metapp2/meeting_action_item_user/forms.py | Python | bsd-3-clause | 185 |
import redis
server = redis.Redis(host='localhost', port=6379, db=0)
while True:
message = raw_input("What to say: ")
server.publish('messages', message)
if message == 'quit':
break
| toastdriven/wsgi_longpolling | messager.py | Python | bsd-3-clause | 205 |
from djviewmodels.views import View, Redirect
from djviewmodels.viewmodels import Viewmodel
class Item(object):
def __init__(self, id):
self.cost = 40 * id
self.wh_markup = 10
self.retail_markup = 500
class ItemViewmodel(Viewmodel):
model = Item
wrap_each = True
class WholesalerI... | freyley/django-viewmodels | djviewmodels/test_views.py | Python | bsd-3-clause | 1,979 |
presets = {
'glider': {
'first_generation': set([(0, 0), (1, 0), (2, 0), (2, 1), (1, 2)]),
'board_size': (20,20)
},
'flasher': {
'first_generation': set([(5,5),(5,6),(5,7)]),
'board_size': (20,20)
},
'beacon': {
'first_generation': set([(5,1),(5,2),(6,1),(6,2),(7,3),(8,3),(7,4),(8,4)]),
'board_size':... | missterr/gol | gol/presets.py | Python | bsd-3-clause | 818 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def update_artists(apps, schema_editor):
Artist = apps.get_model("fma", "Artist")
db_alias = schema_editor.connection.alias
for artist in Artist.objects.using(db_alias).all():
artist.save(usin... | FreeMusicNinja/api.freemusic.ninja | fma/migrations/0003_auto_20150203_0725.py | Python | bsd-3-clause | 540 |
# This is your project's main settings file that can be committed to your
# repo. If you need to override a setting locally, use settings/local.py
import os
from bundles import PIPELINE_CSS, PIPELINE_JS
ROOT = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
'..'
))
d... | blossomica/airmozilla | airmozilla/settings/base.py | Python | bsd-3-clause | 15,787 |
# Copyright 2018 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.
"""Implements commands for running and interacting with Fuchsia on QEMU."""
import boot_data
import common
import emu_target
import hashlib
import logging
i... | ric2b/Vivaldi-browser | chromium/build/fuchsia/qemu_target.py | Python | bsd-3-clause | 8,672 |
# Copyright (c) 2012 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.
# TODO(nduca): Rewrite what some of these tests to use mocks instead of
# actually talking to the device. This would improve our coverage quite
# a bit.
... | junmin-zhu/chromium-rivertrail | tools/chrome_remote_control/chrome_remote_control/cros_interface_unittest.py | Python | bsd-3-clause | 4,005 |
'''Extron USB Switcher - see https://www.extron.com/download/files/userman/68-1517-01_F_SW_USB_UG_f.pdf'''
# <!-- parameters
param_disabled = Parameter({'desc': 'Disables this node', 'schema': {'type': 'boolean'}})
param_ipAddress = Parameter({ 'title': 'IP Address (normally of serial bridge)', 'schema': {'type': '... | museumvictoria/nodel-recipes | Extron USB Series USB Switcher/script.py | Python | mit | 6,816 |
#!/usr/bin/env python
"""
Created on Fri Jun 28 14:48:56 2013
@author: jb
"""
def sqlQueryMetatags(style,f):
import sqlalchemy
orcl_engine = sqlalchemy.create_engine('oracle+cx_oracle://jbragato:Blu3f!y@192.168.30.66:1531/dssprd1')
connection = orcl_engine.connect()
querymake_metatags="""SELECT DISTIN... | relic7/prodimages | python/mtags_multifile_RAWJPG.py | Python | mit | 8,244 |
"""
Lesson 5 - fly at given height
"""
import sys
sys.path.append('..') # access to drone source without installation
from ardrone2 import ARDrone2, ManualControlException
def testLesson5( drone ):
desiredSpeed = 0.8 # in meters per second
desiredHeight = 1.5
try:
drone.takeoff()
startTim... | TeaPackCZ/heidi | guide/lesson5.py | Python | mit | 1,545 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2015-2019 The Mincoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test multiple rpc user config option rpcauth
#
... | xieta/mincoin | qa/rpc-tests/multi_rpc.py | Python | mit | 4,629 |
# Copyright (c) 2021, Frappe Technologies and contributors
# License: MIT. See LICENSE
import hashlib
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder import DocType
from frappe.utils import cint, now_datetime
class TransactionLog(Document):
def before_insert(... | almeidapaulopt/frappe | frappe/core/doctype/transaction_log/transaction_log.py | Python | mit | 1,734 |
import os
import sys
import re
import types
import itertools
import math
import numpy
from PeakcallingReport import *
class PeakCallingStatus(DefaultTracker, Status):
'''status information for mapping stage.'''
def testCalling(self, track):
'''number of peaks called. The number of peaks expected in... | CGATOxford/CGATPipelines | obsolete/reports/pipeline_peakcalling_obsolete/trackers/Status.py | Python | mit | 3,244 |
"""
WSGI config for odm2testsite 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
os.environ.setdefault("DJANGO_S... | ocefpaf/ODM2-Admin | templatesAndSettings/wsgi.py | Python | mit | 428 |
#### 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 = Intangible()
result.template = "object/draft_schematic/structure/component/shared_structure_light_ore_mining_unit.... | anhstudios/swganh | data/scripts/templates/object/draft_schematic/structure/component/shared_structure_light_ore_mining_unit.py | Python | mit | 480 |
#### 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_dressed_ewok_m_12.iff"
result.attribute_template_id = 9
resul... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_ewok_m_12.py | Python | mit | 441 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stuff.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| hnaoto/CS4501-ISA-Models | manage.py | Python | mit | 248 |
##############################################################################################
# FIXME List:
#
##############################################################################################
import logging
import warnings
from enum import Enum
from dpl.core.things import Actuator
logger = logging.getL... | dot-cat/dotcat_platform | dpl/core/things/trigger.py | Python | mit | 3,799 |
from sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi
from sympy.functions import sqrt, exp, erf
from sympy.printing import sstr
import random
class Sample(tuple):
"""
Sample([x1, x2, x3, ...]) represents a collection of samples.
Sample parameters like mean, variance and stddev c... | Cuuuurzel/KiPyCalc | sympy_old/statistics/distributions.py | Python | mit | 11,156 |
from . ops import Ops
from . editor import Editor
from . receiver import Receiver
from .. util import deprecated
class Action(Receiver):
"""
An Action takes an incoming message, applies Ops to it, and then
uses it to set a value on a Editor.
"""
def __init__(self, address, ops=()):
self.a... | rec/BiblioPixel | bibliopixel/control/action.py | Python | mit | 1,836 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('twilio', '0001_initial'),
]
operations = [
migrations.AddField(
... | oscar8771p/python1987 | PySms/twilio/migrations/0002_sms_pub_date.py | Python | mit | 568 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from flask import request
from werkzeug.exceptions import BadRequ... | mvidalgarcia/indico | indico/modules/events/abstracts/controllers/email_templates.py | Python | mit | 5,238 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running dashd with the -rpcbind and -rpcallowip options."""
import sys
from test_framework.test_... | dashpay/dash | test/functional/rpc_bind.py | Python | mit | 6,265 |
# coding=utf-8
# Copyright 2018 Google LLC & Hwalsuk Lee.
#
# 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 ... | ifding/ifding.github.io | gans/ops.py | Python | mit | 866 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2016-2017 Alex Forencich
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... | alexforencich/python-ivi | ivi/tektronix/tektronixMDO4014B.py | Python | mit | 1,564 |
# $Id: octopus_conf_handler.py 2016-12-17 $
# Author: Coen Meerbeek <coen@buzzardlabs.com>
# Copyright: BuzzardLabs 2016
import splunk.admin as admin
import splunk.entity as en
# import your required python modules
'''
Copyright (C) 2005 - 2010 Splunk Inc. All Rights Reserved.
Description: This skeleton python scrip... | cmeerbeek/splunk-addon-octopus-deploy | TA-OctopusNT-Fwd/bin/octopus_conf_handler.py | Python | mit | 2,769 |
from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LINK
descripti... | bunchesofdonald/django-hermes | hermes/feeds.py | Python | mit | 1,090 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import warnings
from string import Template
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.c... | PokaInc/django-js-reverse | tests/unit_tests.py | Python | mit | 8,888 |
#!/usr/bin/env python3
# This script is executed by Jasy during creating new applications
# Test for custom questions
config.set("custom", [1,2,3])
# config.ask("What's your name", "user.name", "String")
# config.ask("How old are you", "user.age", "Integer")
# config.ask("What's PI", "pi", "Float", default=3.14, requ... | dadicool/jasy-skeleton | skeleton/test/test-yaml-project/jasycreate.py | Python | mit | 451 |
import datetime
import unittest
from twilio.base import serialize, values
class Iso8601DateTestCase(unittest.TestCase):
def test_unset(self):
value = values.unset
actual = serialize.iso8601_date(value)
self.assertEqual(values.unset, actual)
def test_datetime(self):
value = d... | tysonholub/twilio-python | tests/unit/base/test_serialize.py | Python | mit | 4,219 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from six import iteritems
import frappe
from frappe import _
field_map = {
"Contact": ["first_name", "last_name", "address", "phone", "mobile_no", "email_id",... | adityahase/frappe | frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.py | Python | mit | 3,308 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from setuptools import Extension
from setuptools import setup
setup(
name=str('project_with_c'),
version='0.1.0',
url='example.com',
author='nobody',
author_email='nobody@example.c... | Yelp/venv-update | tests/testing/packages/project_with_c/setup.py | Python | mit | 535 |
#!/usr/bin/env python2
# coding: utf-8
# vim: set ts=4 sw=4 expandtab sts=4:
# Copyright (c) 2011-2014 Christian Geier & contributors
#
# 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... | Savar/pycarddav | pycarddav/controllers/sync.py | Python | mit | 5,056 |
#### 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 = Intangible()
result.template = "object/draft_schematic/space/weapon/missile/shared_wpn_imagerec_missile_mk1.iff"
... | anhstudios/swganh | data/scripts/templates/object/draft_schematic/space/weapon/missile/shared_wpn_imagerec_missile_mk1.py | Python | mit | 474 |
from botnet.helpers import load_json, save_json, is_channel_name
def test_load_save_json(tmp_file):
data = {'key': 'value'}
save_json(tmp_file, data)
loaded_data = load_json(tmp_file)
assert loaded_data == data
def test_is_channel_name():
assert is_channel_name('#channel')
assert not is_chan... | boreq/botnet | tests/test_helpers.py | Python | mit | 377 |
import json
import io
from copy import deepcopy
import pytest
from NetscoutArborSightline import NetscoutClient, \
fetch_incidents_command, list_alerts_command, alert_annotation_list_command, mitigation_list_command, \
mitigation_template_list_command, router_list_command, tms_group_list_command, managed_objec... | demisto/content | Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline_test.py | Python | mit | 12,191 |
"""
Experiment with the Python debugger, pdb, from the command line
"""
def combine(s1,s2): # define subroutine combine, which...
s3 = s1 + s2 + s1 # sandwiches s2 between copies of s1, ...
s3 = '"' + s3 +'"' # encloses it in double quotes,...
return s3 # and returns it.
a = ... | sharkySharks/PythonForDevs | DemoProgs/pdb2.py | Python | mit | 384 |
"""
@file comm_zigbee_basic.py
"""
##
# @addtogroup zigbee
# @brief This is component
# @{
# @addtogroup comm_zigbee
# @brief This is comm_zigbee module
# @{
##
import time
import os
import string
from oeqa.runtime.zigbee import zigbee
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.helper import shell_cmd_time... | ostroproject/meta-iotqa | lib/oeqa/runtime/zigbee/comm_zigbee_basic.py | Python | mit | 1,113 |
#### 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_dressed_bth_spynet_pilot_m_03.iff"
result.attribute_template_i... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_bth_spynet_pilot_m_03.py | Python | mit | 452 |
# -*- coding: utf-8 -*-
import demistomock as demisto
from ExtractDomainAndFQDNFromUrlAndEmail import extract_fqdn, main
import pytest
@pytest.mark.parametrize('input,fqdn', [ # noqa: E501 disable-secrets-detection
('www.static.attackiqtes.com', 'www.static.attackiqtes.com'),
('http:www.static.attackiqtes.co... | demisto/content | Packs/CommonScripts/Scripts/ExtractDomainAndFQDNFromUrlAndEmail/ExtractDomainAndFQDNFromUrlAndEmail_test.py | Python | mit | 2,497 |
"""
Tests for the application infrastructure
"""
from flask import json
from nose.tools import assert_equal
from .helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def test_index(self):
response = self.client.get('/')
assert 200 == response.status_code
assert ... | mtekel/digitalmarketplace-api | tests/app/test_application.py | Python | mit | 1,102 |
for i in range(1<<16):
print(bin(i).count("1"),end=",")
| yekm/bench | tasks/despace/despacer/scripts/counts.py | Python | mit | 59 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2012 University of Oxford
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 t... | benosteen/RDFDatabank | message_workers/redisqueue.py | Python | mit | 4,630 |
import praw
import re
import requests
import imgurpython as imgur
urls = ['rateme']
CLIENT_ID = ""
CLIENT_SECRET = ""
r = praw.Reddit(user_agent='punchable_faces_hackbu2016')
with open("imgur_secrets.txt", "r") as secrets:
li = secrets.readline().strip()
CLIENT_ID = li[li.find("=")+1:]
li = secrets.readl... | jpalazz2/punchable-faces | scripts/collect_neutral_faces.py | Python | mit | 1,889 |
class Conf(object):
_render_url = 'http://127.0.0.1:9009/render'
_render = True
# Indicates that we should rely on Django's settings as the
# canonical reference and use the above defaults as fallbacks.
# Proxying to django.conf.settings allows us to swap out Django's
# tests during tests
_... | markfinger/python-react | react/conf.py | Python | mit | 1,159 |
import os
import json
from glob import iglob
from decimal import Decimal, InvalidOperation
try:
from collections import OrderedDict
except ImportError:
# Fallback for python 2.6
from ordereddict import OrderedDict
from cnab240 import errors
class CampoBase(object):
def __init__(self):
self.... | TracyWebTech/cnab240 | cnab240/registro.py | Python | mit | 6,411 |
# 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 ... | John-Hart/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/queries.py | Python | mit | 55,660 |
# -*- coding: utf-8 -*-
__version__ = '$Id$'
# The wikis of Chapters of the Wikimedia Foundation living at a xy.wikimedia.org url
from pywikibot import family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikimediachapter'
self.countries = [
... | pywikibot/core-migration-example | pywikibot/families/wikimedia_family.py | Python | mit | 882 |
import cv2
import numpy as np
from cam import OpenCV_Cam
def get_mask(img, lower, upper, blur=0):
if lower[0] < 0:
offset = -lower[0]
else:
offset = 0
lower[0] = lower[0] + offset
upper[0] = upper[0] + offset
hsv_img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
hsv_img = cv2.blur(h... | ironbox360/PyCV-time | experiments/red-green-heading/get_color_mask.py | Python | mit | 1,237 |
# *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | ibm-watson-iot/iot-python | src/wiotp/sdk/api/actions/__init__.py | Python | epl-1.0 | 516 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'snow'
| fairy-rui/oj | core/judgesite/__init__.py | Python | gpl-2.0 | 67 |
import os
try:
import autotest.common as common
except ImportError:
import common
# High level way of installing each autotest component
import client.setup
import frontend.setup
import cli.setup
import server.setup
import scheduler.setup
import database_legacy.setup
import tko.setup
import utils.setup
import... | yangdongsheng/autotest | setup.py | Python | gpl-2.0 | 4,500 |
from func import *
logger = logging.getLogger('neuromodulation')
startbuild = datetime.datetime.now()
# Connect the volume transmitter to the parts
vt_dopa_ex = nest.Create('volume_transmitter')
vt_dopa_in = nest.Create('volume_transmitter')
vt_sero_ex = nest.Create('volume_transmitter')
vt_sero_in = nest.Create('vo... | vitaliykomarov/NEUCOGAR | nest/serotonin/scripts/generated_scripts/neuromodulaton.py | Python | gpl-2.0 | 14,235 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | MoRgUiJu/morguiju.repo | plugin.video.exodus/resources/lib/modules/cleantitle.py | Python | gpl-2.0 | 2,253 |
#mouseHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2007 NVDA Contributors <http://www.nvda-project.org/>
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import time
import tones
import ctypes
import winUser
import queueHandler
imp... | ckundo/nvda | source/mouseHandler.py | Python | gpl-2.0 | 4,705 |
from pyx import *
c = canvas.canvas()
c.stroke(path.curve(0, 0, 0, 4, 2, 4, 3, 3),
[style.linewidth.THICK, style.linestyle.dashed, color.rgb.blue,
deco.earrow([deco.stroked([color.rgb.red, style.linejoin.round]),
deco.filled([color.rgb.green])], size=1)])
c.writeEPSfile("arrow... | mjg/PyX-svn | examples/drawing/arrow.py | Python | gpl-2.0 | 371 |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | varunagrawal/azure-services | varunagrawal/site-packages/azure/http/winhttp.py | Python | gpl-2.0 | 14,499 |
# -*- coding: utf-8 -*-
# Sid Meier's Civilization 4
# Copyright Firaxis Games 2005
#
# Pitboss admin framework
# Dan McGarry 3-24-05
#
import sys
import os
import time
import string
from threading import Thread
import wx
import wx.lib.scrolledpanel
from CvPythonExtensions import * # Do not remove this
import CvPytho... | YggdrasiI/PBStats | PBs/Python/v9/PbAdmin.py | Python | gpl-2.0 | 29,412 |
#******************************************************************************
# *
# * ** * * * * *
# * * * * * * * * * *
... | sanguinariojoe/aquagpusph | examples/3D/spheric_testcase10_waveimpact/cMake/plot_p.py | Python | gpl-3.0 | 4,496 |
#!/usr/bin/env python2.7
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
import sys
import compoundsuper as supermod
from compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
def ... | daniestevez/gr-ao40 | docs/doxygen/doxyxml/generated/compound.py | Python | gpl-3.0 | 20,299 |
"""
:mod: DataManager
.. module: DataManager
:synopsis: DataManager links the functionalities of StorageElement and FileCatalog.
This module consists of DataManager and related classes.
"""
# # RSCID
__RCSID__ = "$Id$"
# # imports
from datetime import datetime, timedelta
import fnmatch
import os
import time
from ... | miloszz/DIRAC | DataManagementSystem/Client/DataManager.py | Python | gpl-3.0 | 71,261 |
# -*- test-case-name: twisted.test.test_defer -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Support for results that aren't immediately available.
API Stability: stable
Maintainer: U{Glyph Lefkowitz<mailto:glyph@twistedmatrix.com>}
"""
from __future__ import nested_scop... | kenorb-contrib/BitTorrent | twisted/internet/defer.py | Python | gpl-3.0 | 28,690 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | dmccue/ansible | lib/ansible/executor/task_executor.py | Python | gpl-3.0 | 20,470 |
'''
This file is part of TvTumbler.
@author: Dermot Buckley
@copyright: Copyright (c) 2013, Dermot Buckley
@license: GPL
@contact: info@tvtumbler.com
'''
import time
import xbmc
from . import logger, fastcache, blacklist, epdb, showsettings
from .names import scene
_fastcache_expire_last_run = time.time()
_blacklis... | maliciamrg/xbmc-addon-tvtumbler | tvtumbler/housekeeper.py | Python | gpl-3.0 | 1,946 |