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 |
|---|---|---|---|---|---|
#-------------------------------------------------------------------------------
# Copyright (c) 2011 Anton Golubkov.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU Lesser Public License v2.1
# which accompanies this distribution, and is available at
#... | anton-golubkov/Garland | src/ipf/ipftype/ipfsmoothingtype.py | Python | lgpl-2.1 | 1,155 |
# -*- Mode: Python; py-indent-offset: 4 -*-
# pyclutter - Python bindings for Clutter
# Copyright (C) 2006 Emmanuele Bassi
#
# clutter/keysyms.py: list of keysyms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by ... | pmarti/pyclutter | clutter/keysyms.py | Python | lgpl-2.1 | 30,005 |
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (a... | mirrorcoder/paramiko | tests/test_util.py | Python | lgpl-2.1 | 19,156 |
# devicetree.py
# Device management for anaconda's storage configuration module.
#
# Copyright (C) 2009-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at you... | dwlehman/blivet | blivet/devicetree.py | Python | lgpl-2.1 | 42,702 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | lib/spack/spack/cmd/__init__.py | Python | lgpl-2.1 | 9,998 |
import pprint
import difflib
_MAX_LENGTH = 80
def pretty_diff(d1, d2):
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
return res... | Tojaj/yum-metadata-diff | yum_metadata_diff/diff_objects.py | Python | lgpl-2.1 | 10,928 |
#! /usr/bin/env python3
"""
Setup script to build a standalone cardmonitor.exe executable on windows
using py2exe. Run: python.exe setup.py py2exe, to build executable file.
__author__ = "http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This file i... | LudovicRousseau/pyscard | smartcard/Examples/wx/cardmonitor/setup.py | Python | lgpl-2.1 | 1,372 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2009 Adriano Monteiro Marques.
#
# Author: Bartosz SKOWRON <getxsick at gmail dot com>
#
# This library 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 S... | umitproject/umpa | umit/umpa/utils/net.py | Python | lgpl-2.1 | 2,096 |
# $Id: rundemo.py 577 2008-01-03 11:39:10Z artem $
#
# This file is part of Mapnik (c++ mapping toolkit)
# Copyright (C) 2005 Jean-Francois Doyon
#
# Mapnik 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; eith... | h4ck3rm1k3/MapNickAutotools | demo/test/textspacing.py | Python | lgpl-2.1 | 2,565 |
import datetime as dt
import numpy as np
import simulate_portfolio_allocation as smlt
import all_permutes as permutes
import get_data
def allocation_op(symbols, exchange, allow_short, days = None, filter_symbols = 5, data_allocate = None, dt_start = None, dt_end = None):
''' Function ALLOCATION / SHARPE RATION OP... | melrcm/Optimizepy | allocation_sharpe_optimizer.py | Python | lgpl-2.1 | 7,000 |
# Bare border volumes
# create mesh
from SMESH_mechanic import *
mesh.Tetrahedron()
mesh.Compute()
# remove some volumes to have volumes with bare borders
mesh.RemoveElements( mesh.GetElementsByType(VOLUME)[0:5] )
# get all volumes with bare borders
filter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_BareBorderVolume)
ids... | FedoraScientific/salome-smesh | doc/salome/examples/filters_ex24.py | Python | lgpl-2.1 | 393 |
#!/usr/bin/env python
# This file is autogenerated by Autocmake
# Copyright (c) 2015 by Radovan Bast and Jonas Juselius
# See https://github.com/scisoft/autocmake/
import os
import sys
sys.path.append('cmake/lib')
from config import configure
import docopt
options = """
Usage:
./setup.py [options] [<builddir>]
... | robertodr/kleisli | setup.py | Python | lgpl-2.1 | 2,121 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | lib/spack/spack/test/cmd/url.py | Python | lgpl-2.1 | 5,856 |
#!/usr/bin/env python
#
# Python-bindings support functions test script
#
# Copyright (C) 2010-2022, Joachim Metz <joachim.metz@gmail.com>
#
# Refer to AUTHORS for acknowledgements.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as ... | libyal/libfsntfs | tests/pyfsntfs_test_support.py | Python | lgpl-3.0 | 1,560 |
'''
Created on Jun 26, 2016
@author: consultit
'''
from panda3d.core import TextNode, ClockObject, AnimControlCollection, \
auto_bind, LPoint3f, LVecBase3f, TextureStage, TexGenAttrib
from p3opensteer import OSSteerManager, ValueList_string, ValueList_LPoint3f, \
ValueList_float, OSSteerPlugIn
#
from ... | consultit/p3opensteer | samples/python/map_drive.py | Python | lgpl-3.0 | 11,669 |
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
import time
from constraint_to_dae import *
from hpp.corbaserver.rbprm.rbprmstate import State,StateHelper
from display_tools import *
import plateform_hrp2_path as tp
import ti... | pFernbach/hpp-rbprm-corba | script/scenarios/sandbox/dynamic/plateform_hrp2_interp_testTransition.py | Python | lgpl-3.0 | 7,681 |
from pyoos.utils.etree import etree
from owslib.namespaces import Namespaces
ns = Namespaces()
SML_NS = ns.get_versioned_namespace('sml', '1.0.1')
SWE_NS = [ns.get_versioned_namespace('swe', '1.0.1')]
class IoosDescribeSensor(object):
def __new__(cls, element):
if isinstance(element, str):
ro... | emiliom/pyoos | pyoos/parsers/ioos/describe_sensor.py | Python | lgpl-3.0 | 1,657 |
# -*- coding: utf-8 -*-
# © 2012-2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{'name': 'Switzerland - Payment Slip (BVR/ESR)',
'summary': 'Print ESR/BVR payment slip with your invoices',
'version': '10.0.2.1.1',
'author': "Camptocamp,Odoo Community Association (OCA)",
'category... | lem8r/cofair-addons | l10n_ch_payment_slip/__manifest__.py | Python | lgpl-3.0 | 847 |
from pycp2k.inputsection import InputSection
from ._print55 import _print55
from ._interpolator10 import _interpolator10
class _nmr1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Interpolate_shift = None
self.Nics = None
... | SINGROUP/pycp2k | pycp2k/classes/_nmr1.py | Python | lgpl-3.0 | 844 |
#!/usr/bin/env python
def get_config():
config = {
'collection_interval': 15, # Seconds, how often to collect metric data
'report_capacity_every_x_times': 20 # Avoid reporting capacity info too frequently, 0 disables capacity reporting
}
return config
| wangy1931/tcollector | collectors/etc/zfsiostats_conf.py | Python | lgpl-3.0 | 298 |
__author__ = 'Matthias'
from tkinter import *
from Terminal.Items.ItemStock import ItemStock
from Terminal.Items.Item import Item
class ActiveTileHandler:
def __init__(self):
self.active_tile = ItemStock(Item("", 0), 1).create_item_tile(None)
def set_tile(self, tile: Frame):
tile.winfo_tople... | MMeent/MANTHIS-terminal | Terminal/ActiveTileHandler.py | Python | lgpl-3.0 | 641 |
from pycp2k.inputsection import InputSection
class _mixing1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Method = None
self.Alpha = None
self.Beta = None
self.Pulay_alpha = None
self.Pulay_beta = None
... | SINGROUP/pycp2k | pycp2k/classes/_mixing1.py | Python | lgpl-3.0 | 2,435 |
# -*- coding: utf-8 -*-
"""
Map tile acquisition
--------------------
Demonstrates cartopy's ability to draw map tiles which are downloaded on
demand from the Stamen tile server. Internally these tiles are then combined
into a single image and displayed in the cartopy GeoAxes.
"""
__tags__ = ["Scalar data"]
import ma... | zak-k/cartopy | lib/cartopy/examples/eyja_volcano.py | Python | lgpl-3.0 | 1,775 |
import pytest
def test_node_exists():
try:
from pyknow.matchers.rete.abstract import Node
from pyknow.matchers.rete.abstract import OneInputNode
from pyknow.matchers.rete.abstract import TwoInputNode
except ImportError as exc:
assert False, exc
def test_node_interface():
... | buguroo/pyknow | tests/unit/matchers/rete/test_rete_abstract.py | Python | lgpl-3.0 | 783 |
"""
Copyright (c) 2015-2019 Nitrokey UG
This file is part of libnitrokey.
libnitrokey 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
any later version.
libnitrokey is... | Nitrokey/libnitrokey | unittest/test_storage.py | Python | lgpl-3.0 | 27,100 |
from django import forms
from open-ehr.report_manager.models import *
class NewReportTypeForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
self.report_belongs_to_lab = kwargs.pop('report_belongs_to_lab', None)
super(NewReportTypeForm, self).__init__(*args, **kwargs)
def save(self, com... | saketkc/open-ehr-django | open-ehr-django-src/report_manager/forms.py | Python | lgpl-3.0 | 1,714 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pySFML - Python bindings for SFML
# Copyright 2012-2013, Jonathan De Wachter <dewachter.jonathan@gmail.com>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If ... | Gaulois94/python-sfml | examples/spacial_music/spacial_music.py | Python | lgpl-3.0 | 3,151 |
#!/usr/bin/env python
##\author Dominik Kirchner
##\brief Publishes diagnostic messages for diagnostic aggregator unit test
from debian.changelog import keyvalue
PKG = 'rosha_repair_executor'
import roslib; roslib.load_manifest(PKG)
import rospy
from time import sleep
#from diagnostic_msgs.msg import DiagnosticA... | cott81/rosha | rosha/rosha_repair_executor/test/repair_action_RedundantLoc.py | Python | lgpl-3.0 | 905 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# workspace.py
#
# Copyright (c) 2014
# Author: Claudio Driussi <claudio.driussi@gmail.com>
#
from sqlalchemy.ext.declarative import declarative_base
from .db import *
class WorkSpace(object):
"""Encapsulate an whole SQLAlchemy orm from an DynaQ db definitio... | claudiodriussi/DynaQ | dynaq/workspace.py | Python | lgpl-3.0 | 5,345 |
#!/usr/bin/env python3
import os
import sys
import getopt
import xml.dom.minidom
class CppCreator(object):
def __init__(self, file_name, xml_root, output_path):
if not os.path.exists(output_path):
print ("CppCreator create error")
exit(1)
self.xml_root = xml_r... | face2wind/Elegance | tools/serialize_creator/cpp_creator.py | Python | lgpl-3.0 | 8,346 |
#! /usr/bin/env python3
#
# Copyright (c) 2014 Joseph Keshet, Morgan Sonderegger, Thea Knowles
#
# This file is part of Autovot, a package for automatic extraction of
# voice onset time (VOT) from audio files.
#
# Autovot is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser Gen... | mlml/autovot | autovot/bin/auto_vot_append_files.py | Python | lgpl-3.0 | 4,617 |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (C) 2013-2019 British Crown (Met Office) & Contributors.
#
# 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 ... | matthewrmshin/isodatetime | metomi/isodatetime/tests/test_datetimeoper.py | Python | lgpl-3.0 | 15,759 |
import bs
import random
import bsUtils
#import PlayerSpaz
def bsGetAPIVersion():
# see bombsquadgame.com/apichanges
return 4
def bsGetGames():
return [BackToYou]
class Icon(bs.Actor):
def __init__(self,player,position,scale,showLives=True,showDeath=True,
nameScale=1.0,nameM... | Mrmaxmeier/BombSquad-Community-Mod-Manager | mods/BackToYou.py | Python | unlicense | 25,208 |
# coding: utf-8
import sys
import os
prgname = 'minrc2reg'
colornames ={
"Black": "ColorTable08",
"BoldBlack": "ColorTable00",
"Red": "ColorTable12",
"BoldRed": "ColorTable04",
"Green": "ColorTable10",
"BoldGreen": "ColorTable02",
"Yellow": "ColorTable15",
"BoldYellow": "ColorTable06",
"Blue": "ColorTable09",
"Bo... | detlefm/cmd_colors_convert | converters/minrc2reg.py | Python | unlicense | 2,961 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_unquote,
)
from ..utils import (
ExtractorError,
int_or_none,
JSON_LD_RE,
NO_DEFAULT,
parse_age_limit,
parse_duration,
try_get,... | hakatashi/youtube-dl | youtube_dl/extractor/nrk.py | Python | unlicense | 24,502 |
# -*- coding: utf-8 -*-
from views.api import api, restful, error
from flask import request, render_template
from utils.consts import *
from models.news import News
from models.category import Category
@restful('/category/')
def get_categorys():
data = {}
categorys = Category.get_all()
data['categories'] ... | DlutCS/nserver_py | views/api/news.py | Python | unlicense | 2,540 |
#!/bin/env python
import os
import re
import sys
import time
import pickle
import random
import socket
import os.path
import traceback
import subprocess
from optparse import OptionParser
VERSION='1.1.0.7'
COLOR = {
'success' : '\33[2;32m', # Green
'fail' : '\033[2;31m', # Red
'bad' : '\033[31... | DarthMaulware/EquationGroupLeaks | Leak #4 - Don't Forget Your Base/EQGRP-Auction-File/Linux/etc/autoutils.py | Python | unlicense | 22,459 |
"""Production settings and globals."""
from os import environ
from common import *
SERVER_EMAIL = EMAIL_HOST_USER
SECRET_KEY = environ.get('SECRET_KEY', SECRET_KEY)
ALLOWED_HOSTS = ['.herokuapp.com']
SEND_SMS = True
| muranga/ataps | ataps/settings/prod.py | Python | unlicense | 219 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-07 14:42
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('qui... | denys-zarubin/sweetheart_test | quiz/migrations/0012_auto_20170407_1442.py | Python | unlicense | 547 |
from typing import Optional, TYPE_CHECKING, List
from cloudfoundry_client.v3.entities import Entity, EntityManager, ToOneRelationship
if TYPE_CHECKING:
from cloudfoundry_client.client import CloudFoundryClient
class ServiceInstanceManager(EntityManager):
def __init__(self, target_endpoint: str, client: "Clo... | antechrestos/cf-python-client | main/cloudfoundry_client/v3/service_instances.py | Python | apache-2.0 | 1,550 |
""" tokenizer for tweets! might be appropriate for other social media dialects too.
general philosophy is to throw as little out as possible.
development philosophy: every time you change a rule, do a diff of this
program's output on ~100k tweets. if you iterate through many possible rules
and only accept the ones t... | ewan-klein/nltk_twitter | twokenise.py | Python | apache-2.0 | 6,480 |
"""Base UptimeRobot entity."""
from __future__ import annotations
from pyuptimerobot import UptimeRobotMonitor
from homeassistant.helpers.entity import DeviceInfo, EntityDescription
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
)
from .const import ATTR_TARG... | aronsky/home-assistant | homeassistant/components/uptimerobot/entity.py | Python | apache-2.0 | 1,942 |
# -*- coding: utf-8 -*-
import unittest
from openprocurement.api.tests.base import snitch
from openprocurement.tender.belowthreshold.tests.base import (
TenderContentWebTest,
test_lots,
test_bids,
test_organization
)
from openprocurement.tender.belowthreshold.tests.chronograph_blanks import (
# Te... | openprocurement/openprocurement.tender.belowthreshold | openprocurement/tender/belowthreshold/tests/chronograph.py | Python | apache-2.0 | 5,547 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: pymcxray.examples.simulation_test_maps
:synopsis: Script to simulate mcxray maps for MM2017 with Nadi.
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Script to simulate mcxray maps for MM2017 with Nadi.
"""
################... | drix00/pymcxray | pymcxray/examples/simulation_test_map.py | Python | apache-2.0 | 10,408 |
from astropy.io import fits
from astropy.wcs import WCS
import numpy as np
class RADecMap(object):
def __init__(self,extent,nra,ndec):
"""
Container for equatorial maps.
extent: extent of map [ra0,ra1,dec0,dec1]
nra: sampling in ra
ndec: sampling in dec
"""
... | ewanbarr/UtmostFanbeamMapper | map_maker.py | Python | apache-2.0 | 4,128 |
import logging
import shlex
import subprocess
import json
from airflow.hooks.aws_emr import EMRHook
from airflow.hooks.S3_hook import S3Hook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from airflow.exceptions import AirflowException
from slackclient import SlackClient
fr... | brandsoulmates/incubator-airflow | airflow/operators/aws_emr_operator.py | Python | apache-2.0 | 5,997 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
This is a tool for file iterate
@Author : Jasonwbw@yahoo.com
'''
import numpy
from itertools import izip
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def to_unicode(text, encoding='utf8', errors='strict'):
"""Convert a string (bytestr... | jasonwbw/jason_putils | putils/io/file_iter.py | Python | apache-2.0 | 1,029 |
# -*- coding: utf-8 -*-
# Copyright 2022 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-security-private-ca | samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_authority_async.py | Python | apache-2.0 | 2,081 |
from cloudmesh.shell.Shell import Shell
from flask import Blueprint
from flask import render_template, redirect, flash
from datetime import datetime
from flask.ext.wtf import Form
from wtforms import TextField, SelectField, TextAreaField
from cloudmesh.old_inventory.inventory import Inventory
from hostlist import expan... | rajpushkar83/cloudmesh | todo/modules/workflow.py | Python | apache-2.0 | 5,445 |
from pandajedi.jedicore.MsgWrapper import MsgWrapper
from DDMClientBase import DDMClientBase
# logger
from pandacommon.pandalogger.PandaLogger import PandaLogger
logger = PandaLogger().getLogger(__name__.split('.')[-1])
# class to access to general DDM
class GenDDMClient(DDMClientBase):
# constructor
def __... | RRCKI/panda-jedi | pandajedi/jediddm/GenDDMClient.py | Python | apache-2.0 | 411 |
import pygame
import sys
pygame.init()
class Input:
def __init__(self):
self.shift = False
self.white = (255,255,255)
self.red = (255,10,10)
self.black = (0,0,0)
def get_key(self):
while True:
event = pygame.event.poll()
if event.type == pygame.QUIT:
p... | fapable/pygameproject2 | Input.py | Python | apache-2.0 | 2,779 |
# -*- coding:utf-8 -*-
# Copyright (c) 2010-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 ... | tipabu/swift | test/unit/common/test_memcached.py | Python | apache-2.0 | 37,888 |
import unittest
import artifactcli.artifactcli
class TestArtifactCli(unittest.TestCase):
def test_usage(self):
self.assertEqual(artifactcli.artifactcli.main(), 1)
| mogproject/artifact-cli | tests/artifactcli/test_artifactcli.py | Python | apache-2.0 | 177 |
# Lint as: python3
"""A torque based stance controller framework."""
from __future__ import absolute_import
from __future__ import division
#from __future__ import google_type_annotations
from __future__ import print_function
import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.get... | google-research/tiny-differentiable-simulator | python/examples/whole_body_control/torque_stance_leg_controller.py | Python | apache-2.0 | 10,138 |
#!/usr/bin/env python
"""
Simple example for an OpenID consumer.
Once you understand this example you'll know the basics of OpenID
and using the Python OpenID library. You can then move on to more
robust examples, and integrating OpenID into your application.
"""
__copyright__ = 'Copyright 2005-2008, Janrain, Inc.'
f... | necaris/python3-openid | examples/consumer.py | Python | apache-2.0 | 19,199 |
from unittest.case import TestCase
from dateutil.parser import parse
from responsebot.models import User, Tweet
class UserModelTestCase(TestCase):
def test_create_from_raw_data(self):
created_at = 'Mon Apr 25 08:25:58 +0000 2016'
raw = {
'some_key': 'some value',
'created... | invinst/ResponseBot | tests/unit_tests/models/test_user_model.py | Python | apache-2.0 | 824 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleads/google-ads-python | google/ads/googleads/oauth2.py | Python | apache-2.0 | 4,658 |
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Some multiclient flows aka hunts."""
import re
import stat
import logging
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import cron
from grr.lib import data_store
from grr.lib import flow
from grr.lib import rdfv... | MiniSEC/GRR_clone | lib/hunts/standard.py | Python | apache-2.0 | 36,298 |
import sys
import os.path
import logging
import ply.yacc
from rightarrow.annotations import *
from rightarrow.lexer import Lexer
logger = logging.getLogger(__name__)
class Parser(object):
tokens = Lexer.tokens
def __init__(self, debug=False, lexer_class=None):
self.debug = debug
self.lexer_... | kennknowles/python-rightarrow | rightarrow/parser.py | Python | apache-2.0 | 6,194 |
# coding: utf-8
"""
An API to insert and retrieve metadata on cloud artifacts.
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1alpha1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
... | grafeas/client-python | grafeas/models/discovery_discovered_details.py | Python | apache-2.0 | 3,542 |
import os
import ast
from codeink.parchment import peephole
def test_parse():
parent_dir = os.path.dirname(os.path.dirname(__file__))
pig1_path = os.path.join(parent_dir, 'guinea-pig', 'cage1', 'pig1.py')
tree = peephole.parse(pig1_path)
assert ast.Module == type(tree)
assert 'pig1 module' == pee... | carocad/CodeInk | tests/test_parchment/test_peephole.py | Python | apache-2.0 | 980 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Support for Python.
See https://www.pantsbuild.org/docs/python-backend.
"""
from pants.backend.python import target_types_rules
from pants.backend.python.dependency_inference import r... | patricklaw/pants | src/python/pants/backend/python/register.py | Python | apache-2.0 | 2,773 |
# 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... | amyxchen/openhtf | test/phase_info_test.py | Python | apache-2.0 | 2,220 |
#!/usr/bin/env python
# encoding: utf-8
## Python impl of JFRED, developed by Robby Garner and Paco Nathan
## See: http://www.robitron.com/JFRED.php
##
## 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... | liber118/pyFRED | src/fred_rules.py | Python | apache-2.0 | 11,958 |
'''TextFinder - a widget for searching through a text widget
'''
import Tkinter as tk
import ttk
class TextFinder(ttk.Frame):
def __init__(self, parent, text_widget):
self.text = text_widget
ttk.Frame.__init__(self, parent)
validatecommand = (self.register(self._on_validate), "%P")
... | boakley/robotframework-workbench | rwb/widgets/textfinder.py | Python | apache-2.0 | 8,510 |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/stat/ns/nspbr_stats.py | Python | apache-2.0 | 5,513 |
from tests import PMGLiveServerTestCase
from pmg.models import db
from tests.fixtures import dbfixture, UserData, RoleData
class TestAdminView(PMGLiveServerTestCase):
def setUp(self):
super(TestAdminView, self).setUp()
self.fx = dbfixture.data(RoleData, UserData,)
self.fx.setup()
def... | Code4SA/pmg-cms-2 | tests/views/test_admin_view.py | Python | apache-2.0 | 894 |
import lib.record_rate
import lib.commonclient
import lib.getconfig
import lib.puylogger
import lib.pushdata
import lib.basecheck
import json
baseurl = lib.getconfig.getparam('Docker', 'stats')
detailed_mon = lib.getconfig.getparam('Docker', 'detailed')
prettynames = lib.getconfig.getparam('Docker', 'prettynames')
mem... | oddeyeco/oe-agent2 | checks_available/check_docker_stats.py | Python | apache-2.0 | 6,294 |
# Copyright 2014: Rackspace UK
# 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... | yeming233/rally | rally/plugins/openstack/context/nova/keypairs.py | Python | apache-2.0 | 2,640 |
#!/usr/local/bin/python3 -u
"""
Author: Oliver Ratzesberger <https://github.com/fxstein>
Copyright: Copyright (C) 2016 Oliver Ratzesberger
License: Apache License, Version 2.0
"""
# Make sure we have access to SentientHome commons
import os
import sys
try:
sys.path.append(os.path.dirname(os.pat... | fxstein/SentientHome | rules/plugin.rules.py | Python | apache-2.0 | 3,196 |
"""
PantsMUD core exception classes.
"""
class BrainMissingInputHandlers(Exception):
pass
class ZoneNotFound(Exception):
pass
class NodeNotFound(Exception):
pass
class LinkNotFound(Exception):
pass
class LinkAlreadyExists(Exception):
pass
class CommandError(Exception):
pass
class C... | ecdavis/pantsmud | pantsmud/util/error.py | Python | apache-2.0 | 608 |
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
defines few algorithms, that deals with different properties of C++ types
Do you aware of boost::type_traits library? pygc... | eile/ITK | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/type_traits.py | Python | apache-2.0 | 44,926 |
# coding: utf8
import sys, os
import subprocess
class AdbException(Exception):
def __init__(self, code, msg):
Exception.__init__(self, code, msg)
def __repr__(self):
code, msg = self.args
return 'AdbException: code:%s %s'%(code, msg)
class Adb:
SERIAL_NO = None
def adb(f):
... | ganadist/adb_downloader | lib/adb.py | Python | apache-2.0 | 2,027 |
import logging
from great_expectations.execution_engine.sqlalchemy_execution_engine import (
SqlAlchemyExecutionEngine,
)
from great_expectations.expectations.metrics.import_manager import sa
from great_expectations.expectations.metrics.map_metric_provider import (
ColumnMapMetricProvider,
column_condition... | great-expectations/great_expectations | great_expectations/expectations/metrics/column_map_metrics/column_values_not_match_like_pattern_list.py | Python | apache-2.0 | 1,597 |
# Copyright 2015 ARM Limited
#
# 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 writin... | ep1cman/workload-automation | wlauto/instrumentation/energy_model/__init__.py | Python | apache-2.0 | 42,085 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core import mail
from django.http import HttpResponse
from django.test import override_settings
from django_auth_ldap.backend import LDAPBackend, _LDAPUser
from django.test.client import RequestFactory
from django.utils.timezone import now as timezone... | tommyip/zulip | zerver/tests/test_auth_backends.py | Python | apache-2.0 | 153,893 |
# 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
# distributed under the... | stackforge/blazar | blazar/opts.py | Python | apache-2.0 | 1,861 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | cloudbau/nova | nova/tests/api/openstack/compute/plugins/v3/test_simple_tenant_usage.py | Python | apache-2.0 | 20,267 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
SDMXPlugin
A QGIS plugin
Plugin to query SDMX data cubes as WFS feature types
-------------------
begin : 2017-06-14
cop... | lmoran/SDMXPlugin | __init__.py | Python | apache-2.0 | 1,543 |
import os
import json
from ss_rule_scheme import update_outbound_rules, init_inbound_rules, init_outbound_rules, msg_clear_all_outbound, ss_process_policy_change
base_path = os.path.abspath(os.path.join(os.path.realpath(__file__),
".."))
test_file = os.path.join(base_path, "blackholin... | h2020-endeavour/iSDX | pctrl/policy_loader.py | Python | apache-2.0 | 1,264 |
from __future__ import absolute_import
from .redshift_etl import migrate_from_s3_by_day
| Parsely/parsely_raw_data | dbt/redshift/__init__.py | Python | apache-2.0 | 89 |
# File: CeParser.py ; This file is part of Twister.
# version: 3.017
# Copyright (C) 2012-2014 , Luxoft
# Authors:
# Andreea Proca <aproca@luxoft.com>
# Andrei Costachi <acostachi@luxoft.com>
# Cristi Constantin <crconstantin@luxoft.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# ... | ctgriffiths/twister | server/CeParser.py | Python | apache-2.0 | 23,751 |
# Copyright 2016 Open Source Robotics Foundation, 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... | catkin/catkin_tools | catkin_tools/execution/events.py | Python | apache-2.0 | 2,304 |
import pika
import sys
credentials = pika.PlainCredentials('qunews', 'qunews')
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost', 5672, 'qunews_host', credentials))
channel = connection.channel()
channel.exchange_declare(exchange='qunews_data',
type='topic')
result =... | carvalhodj/qunews | rabbitmq/receive.py | Python | apache-2.0 | 1,031 |
version = '1.6.8'
revision = ' development'
milestone = 'Yoitsu'
release_number = '95'
projectURL = 'https://syncplay.pl/'
| alby128/syncplay | syncplay/__init__.py | Python | apache-2.0 | 123 |
# 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 | kws_streaming/layers/random_stretch_squeeze_test.py | Python | apache-2.0 | 1,962 |
import os
import sys
import shutil
import glob
import time
import multiprocessing as mp
if len(sys.argv)!=5:
print("Usage: ")
print("python extract_features_for_merlin.py <path_to_merlin_dir> <path_to_wav_dir> <path_to_feat_dir> <sampling rate>")
sys.exit(1)
# top merlin directory
merlin_dir = sys.argv[1]... | bajibabu/merlin | misc/scripts/vocoder/world/extract_features_for_merlin.py | Python | apache-2.0 | 5,044 |
from typing import Callable, List
from decorator import decorator
from fabric.api import execute, parallel, settings
@decorator
def all_servers(task, *args, **kwargs):
"""Execute the decorated function on all remote server nodes."""
helper = args[0]
hosts = helper.cluster_spec.servers
return execut... | couchbase/perfrunner | perfrunner/remote/context.py | Python | apache-2.0 | 1,512 |
# -*- coding: utf-8 -*-
import logging
from core.core import Core
import core.core
from core.parameters_parser import ParametersParserStr
from core.product_collection import ProductCollection
from core.dependency_manager import DependencyManager
from core.parameters_manager import ParametersManager
from core.parameters... | helicontech/zoo | Zoocmd/cmdline/commands/uninstall.py | Python | apache-2.0 | 3,047 |
from flask import render_template, request, abort, redirect, url_for
from datetime import datetime
from nayami.common.app import app
from nayami.common.auth import user_auth
from nayami.model.post import Post
@app.route('/', methods=['GET'])
def index_page():
return render_template('index.html')
@app.route('/p... | Coderhypo/namiya | nayami/route/post.py | Python | apache-2.0 | 3,039 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import binascii
import os
import pytest
from cryptography.ha... | hipnusleo/laserjet | resource/pypi/cryptography-1.7.1/tests/hazmat/primitives/test_idea.py | Python | apache-2.0 | 2,825 |
# Copyright 2019 The ROBEL 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 applicable law or agreed to in wr... | google-research/robel | robel/components/tracking/virtual_reality/client.py | Python | apache-2.0 | 3,972 |
# Copyright 2015 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 a... | sbc100/yapf | yapf/yapflib/style.py | Python | apache-2.0 | 23,126 |
# Copyright 2022 Google 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 by applicable law or a... | tensorflow/tfx | tfx/utils/name_utils.py | Python | apache-2.0 | 2,836 |
# Copyright 2022 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | quantumlib/Cirq | cirq-core/cirq/transformers/target_gatesets/sqrt_iswap_gateset_test.py | Python | apache-2.0 | 13,585 |
import os
import sys
sys.path.insert(0, "../../util/python")
import Cons
import Conf
def Load():
_LoadLogs()
sys.exit(0)
_WritePlotData()
_cass = None
_mutants = None
class LogEntry(object):
# simulation_time_dur_ms simulated_time OpW_per_sec running_behind_cnt read_latency_ms read_cnt
# ... | hobinyoon/apache-cassandra-2.2.3-src | mtdb/process-log/calc-latency-multiple-runs/Latency.py | Python | apache-2.0 | 6,312 |
#!/usr/bin/python
import pyupm_i2clcd as lcd
import psutil
import pywapi
import signal
import os
import sys
import time
import paho.mqtt.client as paho
import string
import plotly.plotly as py
import dweepy
import pyupm_grove as grove
from plotly.graph_objs import Scatter, Layout, Figure
from threading import Thread
f... | hvelazquezs/TheIoTLearningInitiative | InternetOfThings101/MainAll01.py | Python | apache-2.0 | 5,180 |
import base64
from subprocess import call
template = '{"kind":"node","version":"v2","metadata":{"name":"%s","labels":{"group":"gravitational/devc"}},"spec":{"addr":"%s","hostname":"%s","cmd_labels":{"kernel":{"period":"5m0s","command":["/bin/uname","-r"],"result":"4.15.0-32-generic"}},"rotation":{"current_id":"","star... | yacloud-io/teleport | examples/etcd/gen.py | Python | apache-2.0 | 778 |
import numpy as np
import time
import sys
from __init__ import *
from init import init_all
from printer import print_header, print_config, print_line
from builder import create_lib,build_lensblur
from exec_pipe import lensblur
#from app_tuner import auto_tune
app = "lens_blur"
def main():
print_header()
ap... | bollu/polymage | sandbox/apps/python/img_proc/lens_blur/main.py | Python | apache-2.0 | 632 |
# -*- coding: utf-8 -*-
# Author: Petr Dlouhý <petr.dlouhy@auto-mat.cz>
#
# Copyright (C) 2015 o.s. Auto*Mat
#
# 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, o... | PetrDlouhy/django-fluent-comments | example/article/tests.py | Python | apache-2.0 | 2,825 |