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 |
|---|---|---|---|---|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | iwm911/plaso | plaso/winreg/utils.py | Python | apache-2.0 | 1,476 |
#!/usr/bin/env vpython
# Copyright 2013 The LUCI 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.
# Disable 'Access to a protected member ...'. NDB uses '_' for other purposes.
# pylint: disable=W0212
import datetime
imp... | luci/luci-py | appengine/components/components/utils_test.py | Python | apache-2.0 | 15,633 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-22 19:04
from django.db import migrations
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0002_auto_20150616_2121'),
('virtualization', '0005_django2'),
]
operations = [
mi... | digitalocean/netbox | netbox/virtualization/migrations/0006_tags.py | Python | apache-2.0 | 847 |
# -*- coding: utf-8 -*-
# Merge xSopcast and SportsDevil
#http://forum.xbmc.org/showthread.php?tid=100031&pid=1101338#pid1101338
#Freedocast fix
#http://forum.xbmc.org/showthread.php?tid=100597&pid=1094333#pid1094333
import os
import xbmcplugin
import xbmc, xbmcgui
import urllib
import common
from utils import fil... | mrknow/filmkodi | plugin.video.mrknow/lib/main.py | Python | apache-2.0 | 26,509 |
# -*- coding: utf-8 -*-
import datetime
import functools
import logging
import urllib
from bleach import linkify
from bleach.callbacks import nofollow
from website.models import NodeLog
import markdown
from markdown.extensions import codehilite, fenced_code, wikilinks
from modularodm import fields
from framework.mo... | zachjanicki/osf.io | website/addons/wiki/model.py | Python | apache-2.0 | 10,338 |
# Copyright 2017 Red Hat, 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 a... | sundeep-co-in/transtats | dashboard/services/consume/config/damnedlies.py | Python | apache-2.0 | 3,636 |
# Copyright (c) 2014 Red Hat, Inc.
#
# 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 writ... | cneill/barbican | barbican/tests/plugin/test_resource.py | Python | apache-2.0 | 8,764 |
#
# growler/__init__.py
#
# flake8: noqa
#
# Copyright (c) 2020 Andrew Kubera <andrew.kubera@floss.email>
#
# 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.o... | akubera/Growler | growler/__init__.py | Python | apache-2.0 | 2,321 |
import os.path as op
from functools import wraps
from flask import Blueprint, current_app, render_template, abort, g, url_for
from flask_admin import babel
from flask_admin._compat import with_metaclass
from flask_admin import helpers as h
# For compatibility reasons import MenuLink
from flask_admin.menu import Menu... | hexlism/css_platform | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/flask_admin/base.py | Python | apache-2.0 | 20,339 |
#/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
#
#
# Project: ECOOP, sponsored by The National Science Foundation
# Purpose: this code is part of the Cyberinfrastructure developed for the ECOOP project
# http://tw.rpi.edu/web/... | tetherless-world/ecoop | pyecoop/lib/ecoop/ecooprovdict.py | Python | apache-2.0 | 8,675 |
# coding=utf-8
__author__ = 'kohlmannj'
import os
from BaseClass import BaseClass
__all__ = ["BaseClass"]
# The root path to the Ity module's directory.
root = os.path.abspath(os.path.dirname(__file__))
# The path to VEP_Core.
parent_root = os.path.abspath(
os.path.join(root, "..")
)
# The directory containing addi... | uwgraphics/Ubiqu-Ity | Ity/__init__.py | Python | bsd-2-clause | 1,308 |
# doc-export: Split
"""
Splitter widgets are cool!
"""
from flexx import flx
class Split(flx.Widget):
def init(self):
with flx.HSplit():
flx.Widget(style='background:#f00')
with flx.VSplit():
flx.Widget(style='background:#0f0')
with flx.HSplit():
... | zoofIO/flexx | flexxamples/howtos/splitters.py | Python | bsd-2-clause | 715 |
# Copyright (c) 2013-2017 Hewlett Packard Enterprise Development LP
#
# Redistribution and use of this software 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,
# thi... | gholms/euca2ools | euca2ools/commands/bundle/mixins.py | Python | bsd-2-clause | 30,051 |
# -*- coding: UTF-8 -*-
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from conference import models
from assopy.models import Coupon
import string
import random
class Command(BaseCommand):
"""
"""
@transaction.commit_on_success
def handle(self, *... | pythonitalia/pycon_site | p3/management/commands/speakers_coupons.py | Python | bsd-2-clause | 2,632 |
import glob
from fabric.contrib.project import rsync_project
import json
from os.path import splitext
import os
from fabric.api import *
from fabric.colors import *
def error(message):
print red(message)
exit(1)
def info(message):
print green(message)
def action(message):
print cyan(message)
cl... | dmccue/calyptos | calyptos/chefmanager.py | Python | bsd-2-clause | 7,837 |
from django.http import HttpResponseRedirect
from django.conf import settings
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django_images.models import Image
from braces.views import JSONResponseMixin, LoginRequiredMixin
from django_images.models import Thumbnail
from .... | rafirosenberg/pinry | pinry/core/views.py | Python | bsd-2-clause | 1,130 |
"""
$url zattoo.com
$url iptv.glattvision.ch
$url www.saktv.ch
$url www.vtxtv.ch
$url mobiltv.quickline.com
$url www.quantum-tv.com
$url tvonline.ewe.de
$url nettv.netcologne.de
$url tvplus.m-net.de
$url player.waly.tv
$url www.1und1.tv
$url www.netplus.tv
$url www.bbv-tv.net
$url www.meinewelt.cc
$type live, vod
"""
... | chhe/streamlink | src/streamlink/plugins/zattoo.py | Python | bsd-2-clause | 13,122 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# . documentation build configuration file, created by
# sphinx-quickstart on Tue May 12 17:16:21 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
# autogene... | utamaro/StorjNet | docs/reST/conf.py | Python | bsd-3-clause | 10,119 |
"""
==================================
Demonstration of sampling from HMM
==================================
This script shows how to sample points from a Hiden Markov Model (HMM):
we use a 4-components with specified mean and covariance.
The plot show the sequence of observations generated with the transitions
betwe... | stringertheory/hmmlearn | examples/plot_hmm_sampling.py | Python | bsd-3-clause | 2,083 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..preprocess import DegreeCentrality
def test_DegreeCentrality_inputs():
input_map = dict(args=dict(argstr='%s',
),
autoclip=dict(argstr='-autoclip',
),
automask=dict(argstr='-automask',
),
envi... | carolFrohlich/nipype | nipype/interfaces/afni/tests/test_auto_DegreeCentrality.py | Python | bsd-3-clause | 1,494 |
# -*- coding: utf-8 -*-
import taggit.managers
from django.conf import settings
from django.db import migrations, models
import wagtail.search.index
class Migration(migrations.Migration):
dependencies = [
("taggit", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | wagtail/wagtail | wagtail/documents/migrations/0001_initial.py | Python | bsd-3-clause | 1,790 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Classes and utilities that manage fitting models for diffuse analyses
"""
from __future__ import absolute_import, division, print_function
import os
from collections import OrderedDict
import yaml
from fermipy import utils
from fermipy.roi_model imp... | fermiPy/fermipy | fermipy/diffuse/model_manager.py | Python | bsd-3-clause | 20,392 |
import subprocess
import setup_util
import multiprocessing
import os
home = os.path.expanduser('~')
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin')
NCPU = multiprocessing.cpu_count()
proc = None
def start(args):
global proc
setup_util.replace_text("django/hello/hello/settings.py", "HO... | domix/FrameworkBenchmarks | django/setup_py3.py | Python | bsd-3-clause | 868 |
import decimal
from sympy import (Rational, Symbol, Float, I, sqrt, oo, nan, pi, E, Integer,
S, factorial, Catalan, EulerGamma, GoldenRatio, cos, exp,
Number, zoo, log, Mul, Pow, Tuple, latex)
from sympy.core.basic import _aresame
from sympy.core.compatibility import long, u
from s... | ojengwa/sympy | sympy/core/tests/test_numbers.py | Python | bsd-3-clause | 46,296 |
#!/usr/bin/python
# coding: utf-8
from puliclient import Graph
from puliclient.jobs import CommandRunner
#
# Defining the class to execute when the command is assigned and started
# This class is called a runner, it must be accessible to each rendernode.
# Therefore it is stored by convention in a shared folder based... | mikrosimage/OpenRenderManagement | scripts/examples/03_custom_runner.py | Python | bsd-3-clause | 1,616 |
import uuid
from functools import partial
from django.conf import settings
import commonware.log
from mkt.users.models import UserProfile
log = commonware.log.getLogger('z.users')
def get_task_user():
"""
Returns a user object. This user is suitable for assigning to
cron jobs or long running tasks.
... | andymckay/zamboni | mkt/users/utils.py | Python | bsd-3-clause | 1,191 |
'''
MAVLink protocol implementation (auto-generated by mavgen.py)
Generated from: common.xml
Note: this file has been auto-generated. DO NOT EDIT
'''
import struct, array, time, json
from ...generator.mavcrc import x25crc
WIRE_PROTOCOL_VERSION = "1.0"
# some base types from mavlink_types.h
MAVLINK_TYPE_CHAR =... | rileychapman/roscopter-1 | mavlink/pymavlink/dialects/v10/common.py | Python | bsd-3-clause | 376,741 |
# encoding: utf-8
from django.db.models.query import QuerySet
from django.db.models.sql.query import Query
from django.db.models.sql.compiler import SQLCompiler
from django.db import connections
from django.utils.importlib import import_module
class TaxonomyWhere(object):
def __init__(self, table, alias):
... | ludoo/wpkit | attic/ngfrontman/wp_frontman/taxonomy_sql_compiler.py | Python | bsd-3-clause | 3,258 |
from __future__ import absolute_import, print_function
import pytest
import unittest
from copy import copy
import bokeh.document as document
from bokeh.io import curdoc
from bokeh.model import Model
from bokeh.models import ColumnDataSource
from bokeh.core.properties import Int, Instance, String, DistanceSpec
class... | justacec/bokeh | bokeh/tests/test_document.py | Python | bsd-3-clause | 32,371 |
import warnings
from .fetch_assignment import ExchangeFetchAssignment
class ExchangeFetch(ExchangeFetchAssignment):
def __init__(self, *args, **kwargs):
super(ExchangeFetch, self).__init__(*args, **kwargs)
msg = (
"The ExchangeFetch class is now deprecated, please use "
"... | jhamrick/nbgrader | nbgrader/exchange/abc/fetch.py | Python | bsd-3-clause | 507 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Power law model variants
"""
# pylint: disable=invalid-name
import numpy as np
from astropy.units import Quantity
from .core import Fittable1DModel
from .parameters import Parameter, InputParameterError
__all__ = ['PowerLaw1D', 'BrokenPowerLaw1D', '... | dhomeier/astropy | astropy/modeling/powerlaws.py | Python | bsd-3-clause | 15,966 |
"""
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
from pyclaw import data
#------------------------------
def setrun(claw_pkg='classic'):
#------------------------------
... | clawpack/clawpack-4.x | apps/acoustics/2d/example1/1drad/setrun.py | Python | bsd-3-clause | 5,693 |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter as FSF
from matplotlib.ticker import MultipleLocator
from astropy.io import ascii
from scipy.optimize import fmin
from StellarSpectra.spectrum import DataSpectrum
c_ang = 2.99792458e18 #A s^-1
#k.xaxis.set_major_format... | gully/Starfish | attic/plotting.py | Python | bsd-3-clause | 16,042 |
# ActivitySim
# See full license in LICENSE.txt.
import logging
import pandas as pd
from activitysim.core import tracing
from activitysim.core import config
from activitysim.core import inject
from activitysim.core import pipeline
from activitysim.core import simulate
from activitysim.core.util import assign_in_plac... | UDST/activitysim | activitysim/abm/models/non_mandatory_destination.py | Python | bsd-3-clause | 3,776 |
# Copyright (c) 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 unittest
from tracing.build import check_common
class CheckCommonUnittTest(unittest.TestCase):
def test_filesSortedTest(self):
error = c... | dstockwell/catapult | tracing/build/check_common_unittest.py | Python | bsd-3-clause | 816 |
from __future__ import absolute_import
import os
import imp
import importlib
from datetime import datetime
from warnings import warn
from celery import signals
from celery.datastructures import DictAttribute
from celery.loaders.base import BaseLoader
from django import db
from django.conf import settings
from djang... | axiom-data-science/django-celery | djcelery/loaders.py | Python | bsd-3-clause | 6,110 |
import datetime
from decimal import Decimal
from cases_framework import Case, MultiCase
cases = [
Case(doc='union',
sql='select /* union */ eid, id from vtocc_a union select eid, id from vtocc_b',
result=[(1L, 1L), (1L, 2L)],
rewritten=[
'select eid, id from vtocc_a where 1 !... | HeisenbergUncertain/vitess | test/queryservice_tests/nocache_cases.py | Python | bsd-3-clause | 36,421 |
## @package csnPrebuilt
# Definition of the ProjectRelocator class.
import os
import csnUtility
class ProjectRelocator:
"""
This class relocates projects to use the prebuilt projects folder.
It scans a target project for all child projects. For each child project, it checks if the project is available in... | msteghofer/CSnake | src/csnPrebuilt.py | Python | bsd-3-clause | 2,985 |
#!/usr/bin/env python
# Copyright 2015 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.
"""Rolls third_party/boringssl/src in DEPS and updates generated build files."""
import os
import os.path
import shutil
import subproc... | danakj/chromium | third_party/boringssl/roll_boringssl.py | Python | bsd-3-clause | 4,004 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | zfrenchee/pandas | pandas/_version.py | Python | bsd-3-clause | 16,201 |
"""
homeassistant.components.light.isy994
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for ISY994 lights.
"""
import logging
from homeassistant.components.isy994 import (ISYDeviceABC, ISY, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.components.light import ATTR_BRIGHT... | CCOSTAN/home-assistant | homeassistant/components/light/isy994.py | Python | mit | 1,211 |
#! /usr/bin/env python
import os, sys
LOCAL_SUBSTRATE_LIB_PATH = [
os.path.join('.', 'local', 'substrate', 'lib'),
]
sys.path = LOCAL_SUBSTRATE_LIB_PATH + sys.path
from management import *
if __name__ == '__main__':
run_command(__file__, globals())
| xuru/restler | manage.py | Python | mit | 262 |
#----------------------------------------------------------------------
# Copyright (c) 2010-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | tcmitchell/geni-tools | src/gcf/geni/__init__.py | Python | mit | 1,485 |
"""Installers for programming language specific libraries.
"""
import os
from fabric.api import env, cd, settings
from cloudbio import fabutils
from cloudbio.custom import shared
def r_library_installer(config):
"""Install R libraries using CRAN and Bioconductor.
"""
with shared._make_tmp_dir() as tmp_dir... | heuermh/cloudbiolinux | cloudbio/libraries.py | Python | mit | 3,405 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Module for BondDissociationEnergies.
"""
import logging
import networkx as nx
from monty.json import MSONable
from pymatgen.analysis.fragmenter import open_ring
from pymatgen.analysis.graphs import Molec... | gmatteo/pymatgen | pymatgen/analysis/bond_dissociation.py | Python | mit | 21,254 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/colin/Documents/pyqode/python/examples/pynotepad/forms/main_window.ui'
#
# Created: Thu Feb 26 08:16:23 2015
# by: PyQt5 UI code generator 5.4
#
# WARNING! All changes made in this file will be lost!
from pyqode.qt import QtCore,... | mmolero/pyqode.python | examples/pynotepad/pynotepad/forms/main_window_ui.py | Python | mit | 10,537 |
"""GTFS ShapeRow entity; these can be collected into a ShapeLine"""
import entity
import validation
class ShapeLine(entity.Entity):
"""A collection of ShapeRows."""
def rows(self):
return sorted(
self._children,
key=lambda x:int(x.get('shape_pt_sequence',0))
)
def points(self):
return [... | brechtvdv/mapzen-gtfs | mzgtfs/shape.py | Python | mit | 1,762 |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
impor... | nodejs/node-gyp | gyp/pylib/gyp/generator/xcode.py | Python | mit | 66,115 |
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/ebcli/objects/buildconfiguration.py | Python | mit | 1,052 |
#!/usr/bin/env python
"""Sample script of recurrent neural network language model.
This code is ported from the following implementation written in Torch.
https://github.com/tomsercu/lstm
"""
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import chainer
impo... | kiyukuta/chainer | examples/ptb/train_ptb.py | Python | mit | 9,703 |
import re, json
from sublime import Region
from os import path, walk
from ..utils import joinStr, endswith, extract_prefix
from ..interpreter import *
from ..SIMode import SIMode
class JavascriptInterpreter(Interpreter):
cachedModules = {}
def run(self):
self.find_imports_regex = r"(import[\s\n]+((?:(?!from... | vini175pa/simple-import-js | lib/interpreters/JavascriptInterpreter.py | Python | mit | 23,504 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 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 uuid import UUID, uuid4
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.dialects.po... | pferreir/indico | indico/modules/events/models/static_list_links.py | Python | mit | 3,436 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0016_clone_progress'),
]
operations = [
migrations.CreateModel(
name='Distro',
fields=[
... | schleichdi2/OPENNFR-6.3-CORE | bitbake/lib/toaster/orm/migrations/0017_distro_clone.py | Python | gpl-2.0 | 816 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | codificat/sos | sos/plugins/landscape.py | Python | gpl-2.0 | 1,241 |
"""
urlresolver Kodi plugin
Copyright (C) 2011 t0mm0
Updated by Gujal (C) 2016
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... | kreatorkodi/repository.torrentbr | script.module.urlresolver/lib/urlresolver/plugins/nowvideo.py | Python | gpl-2.0 | 2,650 |
class ReferenceFrameValidator:
@staticmethod
def validate(height, width, reference_frames):
max_frames_1280 = [
[720, 9],
[648, 10],
[588, 11],
[540, 12],
[498, 13],
[462, 14],
[432, 15],
[405, 16]
]
... | barisariburnu/xenonmkv | xenonmkv/utils/reference_frame.py | Python | gpl-2.0 | 1,655 |
"""Acknowledge Zenoss events by their EventID"""
from Jabber.Plugins import Plugin
from Jabber.ZenAdapter import ZenAdapter
from Jabber.Options import Options
from optparse import OptionError
import transaction
class Ack(Plugin):
name = 'ack'
capabilities = ['ack', 'acknowledge', 'help']
private = False
def... | zenoss/ZenPacks.chudler.xmppBot | ZenPacks/chudler/xmppBot/Jabber/plugins/ack.py | Python | gpl-2.0 | 4,478 |
from math import sin,pi
total=10000
nr=100
totalRise=3
amplitude=1
alpha=2*pi/(total/float(nr))
for t in range(total):
time=t/float(total)
print "Time =",time
print "Test",totalRise*time+amplitude*sin(t*alpha)
| mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | PlotTest/writeUniform.py | Python | gpl-2.0 | 231 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio 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,... | CERNDocumentServer/invenio | modules/bibformat/lib/elements/bfe_video_sources.py | Python | gpl-2.0 | 2,319 |
# -*- coding: utf-8 -*-
#
# cross_check_mip_corrdet.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the... | SepehrMN/nest-simulator | pynest/examples/cross_check_mip_corrdet.py | Python | gpl-2.0 | 3,497 |
__doc__ = """Event Class Key Map
Map message names to Zenoss mappings
"""
"""
This file doesn't do anything until I figure out how to get appengine logs into zenoss,
then figure out how all this event mapping stuff works.
"""
EVENTCLASSKEY_MAP = dict(
)
| anksp21/Community-Zenpacks | ZenPacks.chudler.GoogleAppEngine/ZenPacks/chudler/GoogleAppEngine/eventclasskey_map.py | Python | gpl-2.0 | 257 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | zozo123/buildbot | master/buildbot/monkeypatches/python14653.py | Python | gpl-3.0 | 1,194 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from extra.safe2bin.safe2bin import safechardecode
from lib.core.agent import agent
from lib.core.bigarray import BigArray
from lib.core.common import Backend
from ... | zhinaonet/sqlmap-z | lib/utils/pivotdumptable.py | Python | gpl-3.0 | 6,811 |
#!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from .encoder import PolarEncoder
from .decode... | skoslowski/gnuradio | gr-fec/python/fec/polar/testbed.py | Python | gpl-3.0 | 11,661 |
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from actstream.actions import action
from notifications.models import notify
def created_gallery(user, instance):
""" Send action about new gallery. Takes ContentObjectGallery as argument.
"""
verb = _(u"created gallery")
pub... | CivilHub/CivilHub | gallery/actions.py | Python | gpl-3.0 | 1,152 |
# (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... | reedloden/ansible | lib/ansible/constants.py | Python | gpl-3.0 | 22,337 |
import mock
from six import binary_type
from wptserve.request import Request, RequestHeaders
class MockHTTPMessage(dict):
"""A minimum (and not completely correctly) mock of HTTPMessage for testing.
Constructing HTTPMessage is annoying and different in Python 2 and 3. This
only implements the parts used... | Acidburn0zzz/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/test_request.py | Python | mpl-2.0 | 2,578 |
#---------------------------------------------------------------------------
# Copyright 2013 The Open Source Electronic Health Record Agent
#
# 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
#
... | vistadataproject/nodeVISTA | setupDocker/pySetup/rasUtilities/OSEHRAMenuTraversal.py | Python | agpl-3.0 | 9,263 |
# -*- coding: utf-8 -*-
from . import res_partner_bank
from . import account_bank_statement_import
from . import account_config_settings
| hbrunn/bank-statement-import | account_bank_statement_import/models/__init__.py | Python | agpl-3.0 | 138 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | odoousers2014/odoo | openerp/cli/server.py | Python | agpl-3.0 | 5,666 |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('verify_student.image', 'lms.djangoapps.verify_stud... | eduNEXT/edunext-platform | import_shims/lms/verify_student/image.py | Python | agpl-3.0 | 383 |
"""
Content rendering functionality
Note that this module is designed to imitate the front end behavior as
implemented in Markdown.Sanitizer.js.
"""
import bleach
import markdown
ALLOWED_TAGS = bleach.ALLOWED_TAGS + [
'br', 'dd', 'del', 'dl', 'dt', 'h1', 'h2', 'h3', 'h4', 'hr', 'img', 'kbd', 'p', 'pre', 's',
... | eduNEXT/edx-platform | lms/djangoapps/discussion/rest_api/render.py | Python | agpl-3.0 | 1,088 |
# -*- coding: utf-8 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.techreceptives.com>)
# Special Credit and Thanks to Thymbra Latinoamericana S.A.
#
# This program is free sof... | jmesteve/medical | openerp/oemedical/oemedical/oemedical_pathology/oemedical_pathology.py | Python | agpl-3.0 | 2,490 |
# -*- coding: utf-8 -*-
import datetime
import werkzeug
from openerp import tools
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug
from openerp.osv.orm import browse_record
from openerp.tools.translate import _
from openerp import S... | poiesisconsulting/openerp-restaurant | website_blog/controllers/main.py | Python | agpl-3.0 | 16,415 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | frankrousseau/weboob | modules/seloger/browser.py | Python | agpl-3.0 | 2,916 |
#encoding: utf8
from nose.tools import *
import os,sys
import mapnik
from utilities import execution_path, run_all
try:
import json
except ImportError:
import simplejson as json
chars = [
{
"name":"single_quote",
"test": "string with ' quote",
"json": '{"type":"Feature","id":1,"geometry":null,"prope... | yiqingj/work | tests/python_tests/json_feature_properties_test.py | Python | lgpl-2.1 | 3,363 |
# encoding: utf-8
"""
The IPython Core Notification Center.
See docs/source/development/notification_blueprint.txt for an overview of the
notification module.
Authors:
* Barry Wark
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPyt... | cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/utils/notification.py | Python | lgpl-3.0 | 4,580 |
# Copyright 2016 Cloudbase Solutions Srl
# 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 r... | phenoxim/nova | nova/policies/floating_ip_dns.py | Python | apache-2.0 | 2,357 |
#!/usr/bin/env python
# encoding: utf-8
# Scott Newton, 2005 (scottn)
# Thomas Nagy, 2006-2010 (ita)
"""
Support for waf command-line options
Provides default command-line options,
as well as custom ones, used by the ``options`` wscript function.
"""
import os, tempfile, optparse, sys, re
from waflib import Logs, U... | mattaw/SoCFoundationFlow | admin/waf/waf-1.8.14/waflib/Options.py | Python | apache-2.0 | 8,831 |
#!/usr/bin/env python
"""
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");... | arenadata/ambari | ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py | Python | apache-2.0 | 2,319 |
# Copyright (C) 2014 OpenStack Foundation
#
# 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 ... | citrix-openstack/nodepool | nodepool/tests/test_allocator.py | Python | apache-2.0 | 17,104 |
# 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... | dmlc/tvm | python/tvm/topi/bifrost/dense.py | Python | apache-2.0 | 4,031 |
# Copyright 2014 PressLabs SRL
#
# 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,... | rowhit/gitfs | tests/integrations/base.py | Python | apache-2.0 | 3,109 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | sparkslabs/kamaelia_ | Code/Python/Kamaelia/Kamaelia/Audio/PyMedia/Input.py | Python | apache-2.0 | 5,130 |
import sys
sys.path.insert(1, "../../../")
import h2o
import pandas as pd
import zipfile
import statsmodels.api as sm
def link_functions_binomial(ip,port):
print("Read in prostate data.")
h2o_data = h2o.import_file(path=h2o.locate("smalldata/prostate/prostate_complete.csv.zip"))
h2o_data.head()
sm_dat... | weaver-viii/h2o-3 | h2o-py/tests/testdir_algos/glm/pyunit_link_functions_binomialGLM.py | Python | apache-2.0 | 1,383 |
#!/usr/bin/env python
# Copyright 2018 Criteo
#
# 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 agree... | iksaif/biggraphite | biggraphite/cli/web/capture.py | Python | apache-2.0 | 2,019 |
# coding: utf-8
#
# Copyright 2014 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... | terrameijar/oppia | extensions/rich_text_components/Image/Image.py | Python | apache-2.0 | 2,068 |
"""
Sensor platform to display the current fuel prices at a NSW fuel station.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.nsw_fuel_station/
"""
import datetime
import logging
from typing import Optional
import voluptuous as vol
import homeass... | PetePriority/home-assistant | homeassistant/components/sensor/nsw_fuel_station.py | Python | apache-2.0 | 5,729 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/function.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf ... | arunchaganty/obviousli | third-party/stanza/stanza/research/templates/third-party/tensorflow/core/framework/function_pb2.py | Python | apache-2.0 | 9,202 |
from __future__ import absolute_import
from __future__ import division
from common import _MM_SHUFFLE
simd_width = YMMRegister.size // float_.size
mr = 4
nr = 3 * simd_width
arg_k = Argument(size_t, "k")
arg_update = Argument(size_t, "update")
arg_a = Argument(ptr(const_float_), "a")
arg_b = Argument(ptr(const_float... | microblink/NNPACK | src/x86_64-fma/blas/sgemm.py | Python | bsd-2-clause | 6,675 |
"""Test praw.reddit."""
import mock
from praw.models import LiveThread
from praw.models.reddit.base import RedditBase
from . import IntegrationTest
class TestReddit(IntegrationTest):
def test_info(self):
bases = ['t1_d7ltv', 't3_5dec', 't5_2qk']
items = []
for i in range(100):
... | RGood/praw | tests/integration/test_reddit.py | Python | bsd-2-clause | 3,510 |
def omp_atomic_sub():
sum = 0.
LOOPCOUNT = 1000
"omp parallel for"
for i in xrange(LOOPCOUNT):
"omp atomic"
sum -= i
return sum == -(LOOPCOUNT*(LOOPCOUNT-1))/2
| hainm/pythran | pythran/tests/openmp.legacy/omp_atomic_sub.py | Python | bsd-3-clause | 196 |
#!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
'sentry>=6.0.0',
'requests>=1.2.0',
'BeautifulSoup>=3.2.1'
]
f = open('README.rst')
readme = f.read()
f.close()
setup(
name='sentry-jira',
version='0.8.0',
author='Adam Thurlow',
author_email='thurloat@... | mapmyfitness/sentry-jira | setup.py | Python | bsd-3-clause | 1,171 |
from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = "*"
def to_internal_value(self, data):
... | mvaled/sentry | src/sentry/api/serializers/rest_framework/origin.py | Python | bsd-3-clause | 851 |
import sys
import os
import marshal
import importlib
import importlib.util
import struct
import time
import unittest
from test import support
from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
import zipimport
import linecache
import doctest
import inspect
import io
from traceback import extract_tb, extr... | yotchang4s/cafebabepy | src/main/python/test/test_zipimport.py | Python | bsd-3-clause | 28,568 |
# -*- coding: utf-8 -*-
tests = r"""
>>> from django.forms import *
>>> from django.core.files.uploadedfile import SimpleUploadedFile
# CharField ###################################################################
>>> e = {'required': 'REQUIRED'}
>>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s'
>>> e['ma... | grangier/django-11599 | tests/regressiontests/forms/error_messages.py | Python | bsd-3-clause | 11,655 |
import itertools
import tempfile
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
from scipy.spatial import distance
from scipy.cluster import hierarchy
import nose.tools as nt
import numpy.testing as npt
import pandas.util.testing as pdt
from numpy.testing.decorators im... | ischwabacher/seaborn | seaborn/tests/test_matrix.py | Python | bsd-3-clause | 29,184 |
"""
homeassistant.components.camera.mjpeg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for IP Cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.mjpeg/
"""
from contextlib import closing
import logging
import requests
from requests.auth i... | zwb800/home-assistant | homeassistant/components/camera/mjpeg.py | Python | mit | 2,471 |
class LandingType(object):
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
INSIGHTS = 5
CHAMPS = 6
NAMES = {
KICKOFF: 'Kickoff',
BUILDSEASON: 'Build Season',
COMPETITIONSEASON: 'Competition Seas... | jaredhasenklein/the-blue-alliance | consts/landing_type.py | Python | mit | 425 |
# -*- coding: utf-8 -*-
# Copyright © 2014 Puneeth Chaganti
# 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, mo... | getnikola/plugins | v7/spell_check/spell_check.py | Python | mit | 3,572 |