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/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... | sagiss/sardana | src/sardana/taurus/qt/qtgui/extra_sardana/expdescription.py | Python | lgpl-3.0 | 19,906 |
###################################################################################
## MODULE : spell.lang.helpers.genhelper
## DATE : Mar 18, 2011
## PROJECT : SPELL
## DESCRIPTION: Helpers for generic features
## --------------------------------------------------------------------------------
##
## Cop... | Spacecraft-Code/SPELL | src/spell/spell/lang/helpers/genhelper.py | Python | lgpl-3.0 | 21,984 |
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
... | chrys87/fenrir | src/fenrirscreenreader/commands/onSwitchApplicationProfile/inactive/bash.py | Python | lgpl-3.0 | 853 |
# Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2016,2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
from odoo.addons.base.models.assetsbundle import Asse... | yelizariev/addons-yelizariev | theme_kit/models/theme.py | Python | lgpl-3.0 | 41,736 |
#
#
# BBBBBBBBBBBBBBBBB OOOOOOOOO XXXXXXX XXXXXXX
# B::::::::::::::::B OO:::::::::OO X:::::X X:::::X
# B::::::BBBBBB:::::B OO:::::::::::::OO X:::::X X:::::X
# BB:::::B B:::::BO:::::::OOO:::::::OX::::::X X::::::X
# B::::B B:::::BO::::::O O::::::OXXX:::::... | Marocco2/EpicRace | BOX/box.py | Python | lgpl-3.0 | 10,406 |
# Copyright 2017 The Tangram Developers. See the AUTHORS file at the
# top-level directory of this distribution and at
# https://github.com/renatoGarcia/tangram/blob/master/AUTHORS.
#
# This file is part of Tangram.
#
# Tangram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... | renatoGarcia/tangram | test/manual/input_surface.py | Python | lgpl-3.0 | 1,951 |
"""
Enable basic CAN over a PCAN USB device.
"""
import logging
import time
from datetime import datetime
import platform
from typing import Optional
from packaging import version
from ...message import Message
from ...bus import BusABC, BusState
from ...util import len2dlc, dlc2len
from ...exceptions import CanErr... | hardbyte/python-can | can/interfaces/pcan/pcan.py | Python | lgpl-3.0 | 21,138 |
__all__ = ["remove_bumps", "filter_outliers"]
from .preprocessing import (
remove_bumps, filter_outliers, filter_outliersnew, calibration_curve)
| ibis-inria/wellFARE | wellfare/preprocessing/__init__.py | Python | lgpl-3.0 | 150 |
# -*- coding: utf-8 -*-
#
# Copyright 2019, 2020 Ramil Nugmanov <nougmanoff@protonmail.com>
# Copyright 2019 Tagir Akhmetshin <tagirshin@gmail.com>
# Copyright 2019 Tansu Nasyrova <tansu.nasurova@gmail.com>
# This file is part of CGRtools.
#
# CGRtools is free software; you can redistribute it and/or modify
# it ... | stsouko/CGRtools | CGRtools/periodictable/groupIX.py | Python | lgpl-3.0 | 6,672 |
from pycp2k.inputsection import InputSection
from ._qm_kind1 import _qm_kind1
class _qm_non_adaptive1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.QM_KIND_list = []
self._name = "QM_NON_ADAPTIVE"
self._repeated_subsections = {'QM_KIND': '_qm_kind1'}
s... | SINGROUP/pycp2k | pycp2k/classes/_qm_non_adaptive1.py | Python | lgpl-3.0 | 686 |
# -*- coding: utf-8 -*-
# Copyright(C) 2016 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | vicnet/weboob | weboob/applications/qbooblyrics/main_window.py | Python | lgpl-3.0 | 11,785 |
###############################################################################
# lazyflow: data flow based lazy parallel computation framework
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/o... | stuarteberg/lazyflow | tests/testRESTfulBlockwiseFileset.py | Python | lgpl-3.0 | 7,468 |
from os.path import join
from tempfile import mkdtemp
from twisted.internet.defer import inlineCallbacks, Deferred
from Tribler.community.triblertunnel.community import TriblerTunnelCommunity
from Tribler.Core.Modules.wallet.tc_wallet import TrustchainWallet
from Tribler.Test.Core.base_test import MockObject
from Trib... | Captain-Coder/tribler | Tribler/Test/Community/Tunnel/test_community.py | Python | lgpl-3.0 | 19,701 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright 2013 to 2017 University of Manchester
#
# HydraPlatform is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or... | hydraplatform/hydra-base | hydra_base/lib/service.py | Python | lgpl-3.0 | 3,820 |
########################################################################
# File name: xso.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, ... | horazont/aioxmpp | aioxmpp/version/xso.py | Python | lgpl-3.0 | 1,795 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Romain Bignon, Julien Hébert
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License... | laurentb/weboob | weboob/applications/traveloob/traveloob.py | Python | lgpl-3.0 | 6,806 |
#!/usr/bin/env python
from plasTeX import Command, Environment, sourceChildren
from plasTeX.Base.LaTeX.Arrays import Array
from plasTeX.Base.LaTeX.Math import EqnarrayStar, equation, eqnarray, MathEnvironment
#### Imports Added by Tim ####
from plasTeX.Base.LaTeX.Math import math
class pmatrix(Array):
pass
class... | marcio-curl/EPUB-plasTeX | pacotes/amsmath.py | Python | lgpl-3.0 | 2,208 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: tkFileDialog.py
from tkCommonDialog import Dialog
class _Dialog(Dialog):
def _fixoptions(self):
try:
self.options['filetype... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/lib-tk/tkFileDialog.py | Python | unlicense | 3,898 |
import re
import sys
def get_wire(input_value):
try:
int(input_value)
return int(input_value)
except ValueError:
if callable(wires[input_value]):
wires[input_value] = wires[input_value]()
return wires[input_value]
class Gate:
def __init__(self, first_input, oper... | twrightsman/advent-of-code-2015 | advent_day7_pt2.py | Python | unlicense | 2,686 |
"""
Generates 40 random numbers and writes them
to a file. No number is repeated.
~ Created by Elijah Wilson 2014 ~
"""
# used for generating random integers
from random import randint
# open the output file -> "in.data"
f = open("in.data", "w")
# create an empty list
succ = []
# loops through 40 times for gene... | tizz98/cs216 | p11/rand.py | Python | unlicense | 1,083 |
import csv
import json
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
from enum import Enum
from sys import exit, stdin
from .formatters import DefaultFormatter, HeadlessFormatter, MdFormatter, RstFormatter
from .table import TextTable
class Formatter(Enum):
default = DefaultFormatter
hea... | atomgomba/txtable | txtable/__main__.py | Python | unlicense | 3,048 |
import unittest
import pdb
from day13 import *
class TestDay13(unittest.TestCase):
def test_is_wall(self):
tests = (
(0, 0, False),
(1, 0, True),
(2, 0, False),
(-1, 0, True),
(0, -1, True),
)
for x, y, expected in tests:
self.assertEqual(
is_wall(x, y, 10),
expected,
"(%d,%d) s... | chrisb87/advent_of_code_2016 | day13/test_day13.py | Python | unlicense | 783 |
#!/usr/bin/env python
from efl import evas
import unittest
class TestBoxBasics(unittest.TestCase):
def setUp(self):
self.canvas = evas.Canvas(method="buffer",
size=(400, 500),
viewport=(0, 0, 400, 500))
self.canvas.engine_info_se... | maikodaraine/EnlightenmentUbuntu | bindings/python/python-efl/tests/evas/test_04_object_box.py | Python | unlicense | 1,720 |
# CTCI 3.1
# Three in One
import unittest
class MultiStack():
def __init__(self, capacity):
self.capacity = capacity
self.stacks = []
def push(self, item):
if len(self.stacks) and (len(self.stacks[-1]) < self.capacity):
self.stacks[-1].append(item)
else:
... | kyle8998/Practice-Coding-Questions | CTCI/Chapter3/3.3-Stack_Of_Plates.py | Python | unlicense | 1,838 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
print("Hello world!")
| djrlj694/Python-Demo | hello_world.py | Python | unlicense | 65 |
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
| masci/toodo | toodo/appengine_config.py | Python | unlicense | 85 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | google-research/google-research | es_maml/zero_order/adaptation_optimizers.py | Python | apache-2.0 | 6,752 |
# Copyright 2017 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... | asimshankar/tensorflow | tensorflow/python/data/experimental/benchmarks/rejection_resample_benchmark.py | Python | apache-2.0 | 2,449 |
#-*-coding:utf-8-*-
#coding=utf-8
print "you enter a dark room with two doors. Do you go through door #1 or door #2"
door = raw_input(">>>")
if door == "1":
print "there's a glant bear here eating a cheese cake. What do you do?"
print "1,Take the cake"
print "2,Scream at the bear"
bear = raw_in... | Jumpers/MysoftAutoTest | Step1-PythonBasic/Practices/wangr/31-35/ex31.py | Python | apache-2.0 | 1,033 |
from boto import (
elasticache as ec,
route53 as r53
)
from majorkirby import CustomActionNode
class CachePrivateDNSRecord(CustomActionNode):
"""Represents a private DNS record for the ElastiCache cache cluster"""
INPUTS = {
'Region': ['global:Region'],
'CacheCluster': ['global:CacheC... | mmcfarland/model-my-watershed | deployment/cfn/cache_private_dns_record.py | Python | apache-2.0 | 2,548 |
import pytest
from testutils import get_co, get_bytecode
from equip import BytecodeObject, BlockVisitor
from equip.bytecode import MethodDeclaration, TypeDeclaration, ModuleDeclaration
from equip.bytecode.utils import show_bytecode
import equip.utils.log as logutils
from equip.utils.log import logger
logutils.enableL... | neuroo/equip | tests/test_visitors.py | Python | apache-2.0 | 2,730 |
# Copyright 2019, Google LLC.
#
# 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... | google-research/federated | targeted_attack/attacked_fedavg.py | Python | apache-2.0 | 24,990 |
"""Default tags used by the template system, available to all templates."""
import sys
import re
from itertools import groupby, cycle as itertools_cycle
from google.appengine._internal.django.template import Node, NodeList, Template, Context, Variable
from google.appengine._internal.django.template import TemplateSyn... | tungvx/deploy | .google_appengine/google/appengine/_internal/django/template/defaulttags.py | Python | apache-2.0 | 42,800 |
from grafo import Digraph
from CaminoMinimo import CaminoMinimo
import heapq
class Dijkstra(CaminoMinimo):
def __init__(self, grafo, origen, destino):
CaminoMinimo.__init__(self, grafo, origen, destino)
self.dist_heap = []
#heapq.heapify(self.dist_heap)
for i in xrange(self.grafo.V... | GFibrizo/TPS_7529 | TDA Grafo/Dijkstra.py | Python | apache-2.0 | 1,960 |
#
# 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... | owlabs/incubator-airflow | airflow/example_dags/example_nested_branch_dag.py | Python | apache-2.0 | 2,028 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | google-research/google-research | persistent_es/plot_uci.py | Python | apache-2.0 | 7,347 |
import codecs
import pathlib
import re
import sys
from distutils.command.build_ext import build_ext
from distutils.errors import (CCompilerError, DistutilsExecError,
DistutilsPlatformError)
from setuptools import Extension, setup
if sys.version_info < (3, 5, 3):
raise RuntimeError("... | rutsky/aiohttp | setup.py | Python | apache-2.0 | 4,887 |
# Copyright 2015 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 requ... | hanlind/nova | nova/conf/cells.py | Python | apache-2.0 | 15,948 |
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Administrator
#
# Created: 08/10/2011
# Copyright: (c) Administrator 2011
# Licence: <your licence>
#--------------------------------------------------------------------... | hemmerling/codingdojo | src/game_of_life/python_coderetreat_socramob/cr_socramob09/gol01.py | Python | apache-2.0 | 1,168 |
AUTHOR = 'Zachary Priddy. (me@zpriddy.com)'
TITLE = 'Nest Eco Window'
METADATA = {
'title': TITLE,
'author': AUTHOR,
'commands': [],
'interface': {
'devices': {
"windows": {
'context': 'Windows that will trigger this automation.',
'type': 'deviceList',
'filter': {... | Firefly-Automation/Firefly | Firefly/automation/nest_eco_window/metadata.py | Python | apache-2.0 | 862 |
import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
'''
计算在x点,f的数值梯度的简单实现。
-f: 应该是一个只接受一个输入参数的函数
-x: 要评估梯度的点,是numpy的数组
'''
fx = f(x) # 获取源点函数值
grad = np.zeros_like(x)
it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite']... | BoyuanYan/CIFAR-10 | cs231n/gradient_check.py | Python | apache-2.0 | 1,636 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import numpy as np
def sig... | bwasti/caffe2 | caffe2/python/operator_test/cross_entropy_ops_test.py | Python | apache-2.0 | 3,643 |
"""
Delaunay Sampler Module.
Provides the Delaunay Sampler Class which contains the strategies for
active sampling a spatial field
"""
from dora.active_sampling.base_sampler import Sampler, grid_sample
import numpy as np
from scipy.spatial import Delaunay as ScipyDelaunay
class Delaunay(Sampler):
"""
Delau... | NICTA/dora | dora/active_sampling/delaunay_sampler.py | Python | apache-2.0 | 4,870 |
# 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... | MBoustani/climate | ocw/tests/test_utils.py | Python | apache-2.0 | 10,288 |
#!/usr/bin/python
#----------------------------------------------------------------------
# This module is designed to live inside the "lldb" python package
# in the "lldb.macosx" package. To use this in the embedded python
# interpreter using "lldb" just import it:
#
# (lldb) script import lldb.macosx.heap
#-------... | apple/swift-lldb | examples/darwin/heap_find/heap.py | Python | apache-2.0 | 61,389 |
from datetime import datetime
from django.http import Http404
from django.shortcuts import render
# Create your views here.
from api.models import Launch
from app.models import Translator, Staff
def translator_view(request, ):
translators = Translator.objects.all()
previous_launches = Launch.objects.filter(... | ItsCalebJones/SpaceLaunchNow-Server | app/views.py | Python | apache-2.0 | 1,079 |
"""
dqm offline setup:
Sets up CMSSW and the latest code to preduce OfflineDQM plots
Usage:
dqm offline setup
"""
import logging
import os
import string
import hepshell
from hepshell.interpreter import time_function
from l1t_cli.setup import WORKSPACE, INTEGRATION_TAG
LOG = logging.ge... | kreczko/l1t_cli | l1t_cli/commands/dqm/offline/setup/__init__.py | Python | apache-2.0 | 2,339 |
from wtforms import BooleanField, PasswordField, SelectField, StringField
from wtforms.fields.html5 import EmailField, URLField
from wtforms.validators import InputRequired
from CTFd.forms import BaseForm
from CTFd.forms.fields import SubmitField
from CTFd.models import TeamFieldEntries, TeamFields
from CTFd.utils.cou... | LosFuzzys/CTFd | CTFd/forms/teams.py | Python | apache-2.0 | 7,277 |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | tensorflow/datasets | tensorflow_datasets/image/pass_dataset/__init__.py | Python | apache-2.0 | 702 |
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | Triv90/Heat | heat/openstack/common/notifier/api.py | Python | apache-2.0 | 5,770 |
#!/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 A... | RCheungIT/phoenix | bin/queryserver.py | Python | apache-2.0 | 7,659 |
# -*- coding: utf-8 -*-
from sklearn.preprocessing import StandardScaler
from sklearn_pandas import DataFrameMapper
from ..base import FactorTransformer
from ..enums import FactorType
class FactorStandardizer(FactorTransformer):
def __init__(self, copy=True, out_container=False, with_mean=True, with_std=True):
... | iLampard/alphaware | alphaware/preprocess/standardizer.py | Python | apache-2.0 | 996 |
# Copyright (c) 2012 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... | sebrandon1/neutron | neutron/tests/unit/common/test_utils.py | Python | apache-2.0 | 30,791 |
# Copyright 2019,2020,2021 Sony Corporation.
#
# 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... | sony/nnabla | python/test/function/test_rnn.py | Python | apache-2.0 | 8,914 |
"""
WSGI config for mitiyu 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mitiyu.settings")
from django.core.wsg... | geekone/mitiyu | mitiyu/wsgi.py | Python | apache-2.0 | 387 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ray.projects.projects import ProjectDefinition
__all__ = [
"ProjectDefinition",
]
| ujvl/ray-ng | python/ray/projects/__init__.py | Python | apache-2.0 | 202 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1_model_service_get_model_async.py | Python | apache-2.0 | 1,466 |
# Copyright 2016 Twitter. 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 agree... | srkukarni/heron | integration_test/src/python/integration_test/core/integration_test_spout.py | Python | apache-2.0 | 4,617 |
from flask import session
from appconfig import *
class UserModel:
def __init__(self):
from models import Tag
from models import Post
from models import User
self.Tag = Tag.Tag
self.Post = Post.Post
self.User = User.User
def login(self, email, password):
... | goors/flask-microblog | UserModel.py | Python | apache-2.0 | 2,758 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions 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/LICE... | TieWei/nova | nova/tests/virt/hyperv/test_vhdutils.py | Python | apache-2.0 | 3,634 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
cc_plugin_ncei/ncei_trajectory.py
'''
from compliance_checker.base import BaseCheck
from cc_plugin_ncei.ncei_base import TestCtx, NCEI1_1Check, NCEI2_0Check
from cc_plugin_ncei import util
from isodate import parse_duration
class NCEITrajectoryBase(BaseCheck):
_c... | ioos/cc-plugin-ncei | cc_plugin_ncei/ncei_trajectory.py | Python | apache-2.0 | 7,802 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
import traceback
from argparse import ArgumentParser
class SRDKRunError(Exception):
def __init__(self, message):
self.msg = message
def run_commands(cmds):
for cmd in cmds:
cmd = u" ".join(cmd)
print("Rhedeg %s" ... | techiaith/seilwaith | srdk/htk/SRDK_Train.py | Python | apache-2.0 | 1,957 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, print_function
import json
import os
import warnings
from collections import namedtuple
from .common import open_zip
from .compatibility import st... | sixninetynine/pex | pex/pex_info.py | Python | apache-2.0 | 9,898 |
# Copyright 2018 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
"""
Azure Queue Message Processing
==============================
"""
import base64
import json
import zlib
from c7n_mailer.azure_mailer.sendgrid_delivery import SendGridDelivery
from c7n_mailer.s... | capitalone/cloud-custodian | tools/c7n_mailer/c7n_mailer/azure_mailer/azure_queue_processor.py | Python | apache-2.0 | 5,506 |
# 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, software
# d... | mikalstill/nova | nova/tests/functional/notification_sample_tests/test_instance.py | Python | apache-2.0 | 83,743 |
# Copyright (c) 2016 Mirantis 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 require... | openstack/rally | rally/common/db/migrations/env.py | Python | apache-2.0 | 1,541 |
import random
def prio():
action_lst = []
lim = 1000
for _ in range(lim):
k = random.randint(1, 201)
action_lst.append(k)
return action_lst
| VRaviTheja/SDN-policy | flowgenerator/random_priority.py | Python | apache-2.0 | 180 |
from django.test import TestCase
from ocrDoacao.models import Ong
class OngTest(TestCase):
def test_get_path(self):
nome_modulo = __name__.split(".")[0]
ong = Ong()
ong.nome = 'teste_ong'
self.assertEqual(ong.get_path(), nome_modulo + '/static/ongs/teste_ong') | ocr-doacao/ocr | ocrDoacao/testes/teste_ong.py | Python | apache-2.0 | 297 |
# Copyright 2011 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 requ... | luzheqi1987/nova-annotation | nova/tests/unit/api/openstack/compute/contrib/test_simple_tenant_usage.py | Python | apache-2.0 | 21,262 |
# -*- coding: utf-8 -*-
#
# Core documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 12 12:49:48 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | redvox/Eliza | docs/conf.py | Python | apache-2.0 | 9,460 |
# Copyright (c) 2011 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 ... | phenoxim/nova | nova/tests/unit/api/openstack/compute/test_hosts.py | Python | apache-2.0 | 20,319 |
"""
Stat module for flask_restful
"""
import json
import logging
from dotmap import DotMap
from flask import request
from flask_restful import Resource
from es_stats_zabbix.exceptions import EmptyResult
from es_stats_zabbix.helpers.utils import status_map
class Stat(Resource):
"""Stat Resource class for flask_res... | untergeek/es_stats_zabbix | es_stats_zabbix/backend/stat.py | Python | apache-2.0 | 1,693 |
#
# ColorHandPose3DNetwork - Network for estimating 3D Hand Pose from a single RGB Image
# Copyright (C) 2017 Christian Zimmermann
#
# 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, eithe... | dedoogong/asrada | HandPose_Detector/general.py | Python | apache-2.0 | 29,504 |
from django.core.exceptions import ValidationError
from django.db import models
from django.contrib.auth.models import User
from urlparse import urlparse
from repo.models import LearningObjective
def validate_resource_url(u):
o = urlparse(u)
if o.scheme not in ['http', 'https']:
raise ValidationError(... | trawick/edurepo | src/edurepo/resources/models.py | Python | apache-2.0 | 4,199 |
from codecs import open
from os import path
from setuptools import setup, Extension
from Cython.Distutils import build_ext
import numpy
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.... | MicheleDamian/ConnectopicMapping | setup.py | Python | apache-2.0 | 1,540 |
import json
import platform
from datetime import timedelta
from unittest import SkipTest
from nose.tools import nottest
from functools import wraps
from acouchbase.cluster import (Cluster, get_event_loop,
close_event_loop)
from couchbase_tests.async_base import AsyncioTestCase
from couc... | couchbase/couchbase-python-client | acouchbase/tests/cases/transcoder_t.py | Python | apache-2.0 | 31,512 |
#!/usr/bin/env python3
""" Maven pom utilities. """
from glob import glob
from os.path import realpath, normpath
from xml.etree.ElementTree import parse
NAME_SPACES = {'ns': 'http://maven.apache.org/POM/4.0.0'}
def get_pom_paths(root):
""" Returns the absolute path of poms that recursively are found in root"""
... | bjuvensjo/scripts | vang/maven/pom.py | Python | apache-2.0 | 1,319 |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | edgedb/edgedb | edb/pgsql/compiler/config.py | Python | apache-2.0 | 17,269 |
"""Various helper functions"""
import asyncio
import base64
import binascii
import cgi
import datetime
import functools
import io
import os
import re
import warnings
from collections import MutableSequence, namedtuple
from pathlib import Path
from time import gmtime, time
from urllib.parse import urlencode
from async... | moden-py/aiohttp | aiohttp/helpers.py | Python | apache-2.0 | 21,217 |
import SimpleHTTPServer
import SocketServer
import os
if __name__ == "__main__":
PORT = int(os.environ.get("PORT", 8000))
handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), handler)
print("python simple http server started at port ", PORT)
httpd.serve_fo... | suzp1984/web-dev-demos | data-virtualization/d3/server.py | Python | apache-2.0 | 338 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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... | probcomp/bdbcontrib | examples/satellites/build_bdbs.py | Python | apache-2.0 | 9,056 |
#FLM: Simplepolator 5 steps
# Simplepolator v1.1
# Description:
# A simple macro to interpolate compatible glyphs inside FontLab.
# To easily apply the Gunnlaugur SE Briem's method
# http://66.147.242.192/~operinan/2/2.3.3a/2.3.3.02.tests.htm
# Credits:
# Pablo Impallari
# http://www.impallari.com/projects/overview/... | impallari/Impallari-Fontlab-Macros | IMP Simplepolator/Simplepolator 5 steps.py | Python | apache-2.0 | 1,229 |
import jps
import time
def callback(msg):
print(msg)
sub = jps.Subscriber('/hoge1', callback)
try:
while True:
sub.spin_once()
time.sleep(0.1)
except KeyboardInterrupt:
pass
| OTL/jps | samples/subscriber_spin_once.py | Python | apache-2.0 | 205 |
# ==============================================================================
# Copyright 2018-2020 Intel Corporation
#
# 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://ww... | tensorflow/ngraph-bridge | examples/keras_sample.py | Python | apache-2.0 | 1,380 |
from __future__ import print_function, division
import unittest, numpy as np
from pyscf import gto, scf
from pyscf.nao import gw as gw_c
class KnowValues(unittest.TestCase):
def test_rf0_ref(self):
""" This is GW """
mol = gto.M( verbose = 1, atom = '''H 0 0 0; H 0.17 0.7 0.587''', basis = 'cc-pvdz',)
... | gkc1000/pyscf | pyscf/nao/test/test_0052_gw_rf0_ref.py | Python | apache-2.0 | 1,018 |
'''
Created on 28/set/2014
@author: Vincenzo Pirrone <pirrone.v@gmail.com>
'''
import serial, time
class Connector:
def readline(self):
pass
def writeline(self, line):
pass
def close(self):
pass
class FakeSerial(Connector):
def __init__(self, port):
p... | sp4x/osnf | osnf/connectors.py | Python | apache-2.0 | 1,423 |
# 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... | QiJune/Paddle | python/paddle/fluid/tests/unittests/test_merge_ids_op.py | Python | apache-2.0 | 1,489 |
# Copyright 2016 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 agre... | google/openhtf | examples/stop_on_first_failure.py | Python | apache-2.0 | 2,353 |
#!/usr/bin/env python
"""
4c. Create a script that connects to both routers (pynet-rtr1 and pynet-rtr2)
and prints out both the MIB2 sysName and sysDescr.
"""
from snmp_helper import snmp_get_oid, snmp_extract
COMMUNITY_STRING = 'galileo'
SYS_DESCR = '1.3.6.1.2.1.1.1.0'
SYS_NAME = '1.3.6.1.2.1.1.5.0'
def m... | mudzi42/pynet_class | class2/my_snmp.py | Python | apache-2.0 | 747 |
#!/usr/bin/env python3
# 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
# "... | ptrendx/mxnet | dev_menu.py | Python | apache-2.0 | 9,244 |
# -*- 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):
# Changing field 'Test.content'
db.alter_column(u'itest_test', 'content'... | xuender/test | testAdmin/itest/migrations/0007_auto__chg_field_test_content.py | Python | apache-2.0 | 1,756 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "ur_description"
PROJECT_SPACE_DIR = "... | robotic-ultrasound-image-system/ur5 | build/ur5-master/universal_robot-kinetic-devel/ur_description/catkin_generated/pkg.installspace.context.pc.py | Python | apache-2.0 | 380 |
domain_names = ['0clickemail.com', 'noclickemail.com', '10minutemail.com', 'bofthew.com', 'drdrb.com', 'drdrb.net',
'jnxjn.com', 'klzlk.com', 'nepwk.com', 'nwldx.com', 'owlpic.com', 'pjjkp.com', 'prtnx.com', 'rmqkr.net',
'rppkn.com', 'rtrtr.com', 'trbvm.com', 'tyldd.com', 'uggsrock.com... | sinnwerkstatt/django-indisposable-email-field | indisposable_email_field/data.py | Python | apache-2.0 | 9,940 |
"""
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 use this ... | keedio/keedio-stacks | KEEDIO/1.3/services/KAFKA/package/scripts/rebalance.py | Python | apache-2.0 | 1,303 |
import asyncio
from unittest import TestCase
from tukio.task import register, TaskHolder, tukio_factory
from tukio.utils import FutureState
from tukio.workflow import Workflow, WorkflowTemplate
@register('basic', 'execute')
class BasicTask(TaskHolder):
async def execute(self, event):
pass
@register('cr... | optiflows/tukio | tests/test_workflow.py | Python | apache-2.0 | 7,788 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | kubernetes-client/python | kubernetes/client/models/v1beta1_limited_priority_level_configuration.py | Python | apache-2.0 | 6,329 |
#!/usr/bin/python
# Copyright 2009 Jay Reding
# 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 ... | Ryuno-Ki/BloGTK3 | share/blogtk2/lib/blogtk2/main.py | Python | apache-2.0 | 26,085 |
"""JVPN netstats libraries
"""
__author__ = 'e@dscp.org (Ebben Aries)'
import socket
import struct
def GetNetstats(device):
device = device + ':'
for line in open('/proc/net/dev', 'r'):
data = filter(None, line.split(' '))
if data[0] == device:
return (data[1], data[2], data[9], data[10])
def Get... | earies/jvpn | jvpn/netstats.py | Python | apache-2.0 | 1,247 |
"""calculate bootstrap bounds on a sample game"""
import argparse
import json
import sys
import numpy as np
from gameanalysis import bootstrap
from gameanalysis import gameio
from gameanalysis import regret
from gameanalysis import scriptutils
CHOICES = {
'regret': (bootstrap.mixture_regret, regret.mixture_regr... | yackj/GameAnalysis | gameanalysis/script/sgboot.py | Python | apache-2.0 | 3,682 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | kickstandproject/wildcard | wildcard/views.py | Python | apache-2.0 | 1,561 |