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 python3
"""
Command-line script to merge a branch.
"""
from __future__ import absolute_import
import io
from os import path
import sys
import logging
import yaml
import click
import click_log
# Add top-level module path to sys.path before importing tubular code.
sys.path.append(path.dirname(path.dirn... | eltoncarr/tubular | tubular/scripts/merge_branch.py | Python | agpl-3.0 | 3,106 |
from .slurm import SlurmJobQueue,OldSlurmJobQueue
class PlafrimJobQueue(SlurmJobQueue):
def __init__(self, username=None,hostname='plafrim-ext', basedir=None, local_basedir='', base_work_dir=None, max_jobs=100, key_file='plafrim', password=None, install_as_job=False, modules = [], **kwargs):
if username is None:
... | wschuell/experiment_manager | experiment_manager/job_queue/plafrim.py | Python | agpl-3.0 | 1,067 |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import res_config_settings
from . import account_move_change_rate
... | ingadhoc/odoo-argentina | l10n_ar_ux/wizards/__init__.py | Python | agpl-3.0 | 400 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-27 21:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Greeting... | goyal-sidd/BLT | website/migrations/0001_initial.py | Python | agpl-3.0 | 588 |
"""
Configure URL endpoints for the djangoapp
"""
from django.urls import re_path
from django.conf import settings
from .views import CombinedDiscussionsConfigurationView, DiscussionsConfigurationSettingsView, DiscussionsProvidersView
urlpatterns = [
re_path(
fr'^v0/{settings.COURSE_KEY_PATTERN}$',
... | eduNEXT/edx-platform | openedx/core/djangoapps/discussions/urls.py | Python | agpl-3.0 | 752 |
from pytest_factoryboy import register
from meinberlin.test.factories import kiezkasse
register(kiezkasse.ProposalFactory)
| liqd/a4-meinberlin | tests/kiezkasse/conftest.py | Python | agpl-3.0 | 125 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Johnzero/erp | openerp/addons/fetchmail/fetchmail.py | Python | agpl-3.0 | 12,859 |
"""add a spam field
Revision ID: 41804fbf1862
Revises: 4d7d5b95ddef
Create Date: 2014-12-17 19:04:09.190962
"""
# revision identifiers, used by Alembic.
revision = '41804fbf1862'
down_revision = '4d7d5b95ddef'
from alembic import op
import sqlalchemy as sa
from os.path import join, dirname, abspath, realpath
impo... | geekosphere/wootpaste | alembic/versions/41804fbf1862_add_a_spam_field.py | Python | agpl-3.0 | 757 |
# The Hazard Library
# Copyright (C) 2012-2017 GEM Foundation
#
# This program 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 option) any later version.
#... | gem/oq-hazardlib | openquake/hazardlib/tests/__init__.py | Python | agpl-3.0 | 1,329 |
#!/usr/bin/env python3
## \file init.py
# \brief Initializes necessary dependencies for SU2 either using git or it
# fetches zip files.
# \author T. Albring
# \version 7.0.3 "Blackbird"
#
# SU2 Project Website: https://su2code.github.io
#
# The SU2 Project is maintained by the SU2 Foundation
# (http://su2... | EduardoMolina/SU2 | meson_scripts/init.py | Python | lgpl-2.1 | 7,414 |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | youfoh/webkit-efl | Tools/Scripts/webkitpy/layout_tests/port/qt.py | Python | lgpl-2.1 | 8,302 |
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holding valid commercial ... | qtproject/pyside-pyside | tests/QtGui/qcolor_test.py | Python | lgpl-2.1 | 3,949 |
#!/usr/bin/python
charList = [ '\xd9', '\x83', '\xd8', '\xa7', '\xd9', '\x81', '\x20', '\xd8',
'\xa7', '\xd9', '\x84', '\xd8', '\xac', '\xd8', '\xa7', '\xd8',
'\xb9', '\x00' ]
location = ''
location = ''.join(charList)
print location
| trep/opentrep | test/i18n/utf8/pyutf8.py | Python | lgpl-2.1 | 263 |
'''
Shows how to load SVG files in gtkimageview. It is really easy.
'''
import gtk
from gtk import gdk
import gtkimageview
import sys
try:
import rsvg
except ImportError:
print 'Sorry! rsvg is needed to run this demo.'
sys.exit(1)
try:
handle = rsvg.Handle(sys.argv[1])
except IndexError:
print 'Us... | GNOME/pygtkimageview | tests/demo03.py | Python | lgpl-2.1 | 645 |
##############################################################################
# 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... | lgarren/spack | var/spack/repos/builtin/packages/lua-luafilesystem/package.py | Python | lgpl-2.1 | 2,512 |
# -*- Python -*-
#
# test.py
#
# Copyright (C) 2005-2013 EDF-EADS-Phimeca
#
# 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 Software Foundation, either versi... | dbarbier/privot | python/src/test.py | Python | lgpl-3.0 | 913 |
# -*- coding: utf-8 -*-
# © 2012 spirit <hiddenspirit@gmail.com>
# © 2013-2014 Steven Myint
#
# 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, either version 3 of the License,
# or (at yo... | viraja1/grammar-check | grammar_check/__init__.py | Python | lgpl-3.0 | 19,319 |
import sys
import Pyro5
import logging
sys.path.extend(['..', '../..'])
import mupif as mp
log = logging.getLogger()
@Pyro5.api.expose
class Application2(mp.Model):
"""
Simple application that computes an arithmetical average of mapped property
"""
def __init__(self, metadata={}):
MD = {
... | mupif/mupif | examples/Example02-distrib/application2.py | Python | lgpl-3.0 | 3,766 |
from pycp2k.inputsection import InputSection
from ._localize4 import _localize4
from ._current3 import _current3
from ._nmr1 import _nmr1
from ._spinspin1 import _spinspin1
from ._epr1 import _epr1
from ._polar1 import _polar1
from ._print61 import _print61
class _linres1(InputSection):
def __init__(self):
... | SINGROUP/pycp2k | pycp2k/classes/_linres1.py | Python | lgpl-3.0 | 1,578 |
#!/bin/env python
r"""Solartron Orbit network reader GUI."""
# python modules
import sys
from time import sleep
# external modules
from serial.serialutil import SerialException
from PyQt4 import QtCore, QtGui
# app modules
from solartron import Driver
from sderrors import *
from pedal import DummyPedal as Pedal
from... | Jellofishi/solartron | qtsolartron.py | Python | lgpl-3.0 | 12,301 |
"""
Implementation of Burger's equation with nonlinear solve in each
timestep
"""
from __future__ import print_function
import sys
import numpy
import random
from dolfin import *
from dolfin_adjoint import *
import libadjoint.exceptions
dolfin.parameters["adjoint"]["record_all"] = True
dolfin.parameters["adjoint"]["... | live-clones/dolfin-adjoint | tests_dolfin/svd_burgers/svd_burgers.py | Python | lgpl-3.0 | 2,284 |
from django.conf import settings
from . import constants as c
# Where the data, primarily the weights, are stored.
settings.ASKLET_BACKEND = getattr(
settings,
'ASKLET_BACKEND',
c.SQL)
# What mechanism we use to calculate ranks.
# Dependent on backend.
settings.ASKLET_RANKER = getattr(
settings,
... | chrisspen/asklet | asklet/settings.py | Python | lgpl-3.0 | 348 |
import pyblish.api
import pyblish.lib
from pyblish_lite import control
# Vendor libraries
from nose.tools import (
with_setup,
assert_equals
)
def clean():
pyblish.api.deregister_all_plugins()
@with_setup(clean)
def test_something():
"""Anything runs"""
count = {"#": 0}
class MyCollector(p... | pyblish/pyblish-lite | tests/test_control.py | Python | lgpl-3.0 | 8,342 |
import numpy as np
from procgraph import Block
from contracts import contract
class DepthBuffer(Block):
Block.alias('depth_buffer')
Block.input('rgba')
Block.output('rgba')
Block.output('line')
Block.output('depth')
def init(self):
self.depth = None
def update(s... | spillai/procgraph | src/procgraph_mplayer/depth_buffer.py | Python | lgpl-3.0 | 1,391 |
#! /bin/python
# jessehogandeliamariahogan
#vim: set ts=4 sw=4 et
import copy
import os
import curses
import time
import sys
false=False
true=True
class char:
def __init__(self, x, y, char):
self.x = x
self.y = y
self.letter = char
def str(self):
return "%s,%s %s" % (self.x, sel... | jhogan/boog | boog.py | Python | unlicense | 23,069 |
from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import re
import socket
import sys
import time
import xml.etree.ElementTree
from ..compat import (
compat_cookiejar,
compat_http_client,
compat_urllib_error,
compat_urllib_parse_urlp... | fluks/youtube-dl | youtube_dl/extractor/common.py | Python | unlicense | 38,144 |
import unittest
import assignment1 as a1
from sklearn.neighbors import KNeighborsClassifier
class Test_a1_test(unittest.TestCase):
def test_answer1(self):
cancer = a1.answer_one()
self.assertEqual(cancer.index._start, 0)
self.assertEqual(cancer.index._stop, 569)
colnames = ['me... | polde-live/pyml | pyml/test/a1_test.py | Python | unlicense | 2,112 |
#!/usr/bin/python
import sys, time
for ts in sys.argv[1:]:
print ts, time.ctime(float(ts))
sys.exit(0)
| vandys/nowplaying | reports/disptime.py | Python | unlicense | 107 |
#!/usr/bin/python3
import os
# import logging
import logger as logger_
WS_SERVER = 'ws://127.0.0.1:4055/ws'
WS_TIMEOUT = 10
APP_DIR = os.path.dirname(__file__)
# SQL_DIR = os.path.join(APP_DIR, 'sql')
logger = logger_.rotating_log(os.path.join(
APP_DIR, 'kts_snmp.log'), 'kts_snmp_log')
SNMP_IP = '192.168.222.17... | andrewisakov/taximaster_x | snmp/settings.py | Python | unlicense | 379 |
import math
# According to Law of cosines, p^2 + p*r + r^2 = c^2.
# Let c = r+k, => r = (p^2-k^2)/(2*k-p) and p > k > p/2 (k is even).
# Suppose p <= q <= r.
max_sum = 120000
d = {} # p => set(r)
for p in range(1, max_sum/2+1):
if p%10000 == 0:
print p
d[p] = set()
mink = int(p/2)+1
maxk = int... | renxiaoyi/project_euler | problem_143.py | Python | unlicense | 739 |
# 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: Mcl_Cmd_NetBios_DataHandler.py
def DataHandlerMain(namespace, InputFilename, OutputFilename):
import mcl.imports
import mcl.data.Input
... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/DataHandlers/Mcl_Cmd_NetBios_DataHandler.py | Python | unlicense | 13,809 |
from __future__ import print_function
import numpy as np
""" This will be the interior of the sigmoid cross entropy function,
this is what also will be conputed at each layer. We can vectorize this
simply by using numpy matrix ops. The forward operation is simply a dot(W, x)
and the backward pass will accumulate gra... | neale/CS-program | 519-DeepLearning/assignment1/NN/Layers.py | Python | unlicense | 3,014 |
class ActionType:
END_TURN = 0
MOVE = 1
SHOOT = 2
RAISE_STANCE = 3
LOWER_STANCE = 4
THROW_GRENADE = 5
USE_MEDIKIT = 6
EAT_FIELD_RATION = 7
HEAL = 8
REQUEST_ENEMY_DISPOSITION = 9 | tigeral/polygon | python/code_troopers/model/ActionType.py | Python | unlicense | 217 |
# Copyright 2013 Douglas Linder
# 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... | shadowmint/nwidget | samples/snake/views/game_view.py | Python | apache-2.0 | 5,269 |
"""
Title: Image similarity estimation using a Siamese Network with a contrastive loss
Author: Mehdi
Date created: 2021/05/06
Last modified: 2021/05/06
Description: Similarity learning using a siamese network trained with a contrastive loss.
"""
"""
## Introduction
[Siamese Networks](https://en.wikipedia.org/wiki/Sia... | keras-team/keras-io | examples/vision/siamese_contrastive.py | Python | apache-2.0 | 11,646 |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... | wavefrontHQ/python-client | test/test_alert_source.py | Python | apache-2.0 | 1,258 |
# python3
# pylint: disable=g-bad-file-header
# Copyright 2021 DeepMind Technologies Limited. 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... | deepmind/enn | enn/experiments/neurips_2021/base.py | Python | apache-2.0 | 2,522 |
# Copyright 2017 The Abseil 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 ... | abseil/abseil-py | absl/testing/tests/absltest_filtering_test.py | Python | apache-2.0 | 7,461 |
# -*- 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-dialogflow | samples/generated_samples/dialogflow_generated_dialogflow_v2beta1_intents_update_intent_sync.py | Python | apache-2.0 | 1,566 |
# -*- 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-dialogflow-cx | samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_sync.py | Python | apache-2.0 | 1,449 |
# 211. Add and Search Word - Data structure design
#
# Design a data structure that supports the following two operations:
#
# void addWord(word)
# bool search(word)
#
# search(word) can search a literal word or a regular expression string containing
# only letters a-z or .. A . means it can represent any one letter.
#... | gengwg/leetcode | 211_add_and_search_word.py | Python | apache-2.0 | 2,673 |
# Copyright 2012 Pedro Navarro Perez
# Copyright 2013 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... | openstack/compute-hyperv | compute_hyperv/nova/volumeops.py | Python | apache-2.0 | 33,067 |
# -*- coding: utf-8 -*-
import argparse
import tensorflow as tf
from nlp.text_representation.glove.train import train
def main(args):
if args.process == tf.estimator.ModeKeys.TRAIN:
train(args)
else:
raise Exception("cannot support this process:" + args.process)
if __name__ == '__main__':
... | koala-ai/tensorflow_nlp | nlp/text_representation/glove/run.py | Python | apache-2.0 | 1,371 |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import codecs
import os
import re
from setuptools import find_packages, setup
def get_version(filename):
with codecs.open(filename, 'r', 'utf-8') as fp:
contents = fp.read()
return re.search(r"__version__ = ['\"](... | roverdotcom/gargoyle | setup.py | Python | apache-2.0 | 2,408 |
# Copyright 2016 Isotoma 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 writing... | yaybu/touchdown | touchdown/tests/test_core_main.py | Python | apache-2.0 | 764 |
# 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-google/cirq_google/transformers/analytical_decompositions/two_qubit_to_sycamore.py | Python | apache-2.0 | 18,563 |
# -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... | mfelsche/dwd_weather_data | weather/data/solar.py | Python | apache-2.0 | 1,704 |
# Copyright (c) 2015 Canonical Ltd
#
# 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 ... | javacruft/pylxd | pylxd/operation.py | Python | apache-2.0 | 3,139 |
# -*- coding: utf-8 -*-
import unittest
import sodaclient
SODA_URL = "http://localhost:8080"
LEXICON_NAME = "test_countries-3"
MATCHINGS = ["exact", "lower", "stop", "stem1", "stem2", "stem3"]
LOOKUP_ID = "http://test-countries-3.com/ABW"
TEXT = "Institute of Clean Coal Technology, East China University of Science an... | elsevierlabs-os/soda | src/main/python/sodaclient_test.py | Python | apache-2.0 | 2,973 |
# Copyright 2012, Intel, 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 agree... | bswartz/cinder | cinder/volume/rpcapi.py | Python | apache-2.0 | 15,156 |
import numpy as np
# Example taken from : http://cs231n.github.io/python-numpy-tutorial/#numpy
x = np.array([[1,2],[3,4]])
print np.sum(x) # Compute sum of all elements; prints "10"
print np.sum(x, axis=0) # Compute sum of each column; prints "[4 6]"
print np.sum(x, axis=1) # Compute sum of each row; prints "[3 7... | kmova/bootstrap | docker/py2docker/numpy-sum.py | Python | apache-2.0 | 323 |
# -*- 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... | googleads/google-ads-python | google/ads/googleads/v8/enums/types/campaign_experiment_traffic_split_type.py | Python | apache-2.0 | 1,292 |
# -*- 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... | googleads/google-ads-python | google/ads/googleads/v8/services/services/ad_service/client.py | Python | apache-2.0 | 21,991 |
import os
import os.path
import cherrypy
from cherrypy.lib import static
from cherrypy.lib.static import serve_file
import shutil
import tempfile
import glob
from clarityviz import claritybase
localDir = os.path.dirname(__file__)
absDir = os.path.join(os.getcwd(), localDir)
# print absDir
def imag... | NeuroDataDesign/seelviz | Jupyter/cherrypy/clviz_web_token_albert.py | Python | apache-2.0 | 15,295 |
from api.core.utility import redirectOutputToLogger
redirectOutputToLogger()
__author__ = 'Michael Pryor'
if __name__ == '__main__':
import ConfigParser
import argparse
import datetime
import os
import logging
import sys
from logging import config
import bottle
parser = argparse.A... | vivek8943/GeoTweetSearch | main.py | Python | apache-2.0 | 14,290 |
"""Dependency tracking for trackable objects."""
# 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/li... | aldian/tensorflow | tensorflow/python/training/tracking/tracking.py | Python | apache-2.0 | 12,398 |
# -*- 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-aiplatform | google/cloud/aiplatform_v1/services/migration_service/async_client.py | Python | apache-2.0 | 21,005 |
# Copyright (c) 2016 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 ... | eayunstack/neutron | neutron/tests/unit/agent/l3/test_dvr_snat_ns.py | Python | apache-2.0 | 2,142 |
#!/bin/env dls-python
import unittest
from dls_ade import dls_checkout_module
from mock import patch, MagicMock
class MakeParserTest(unittest.TestCase):
def setUp(self):
self.parser = dls_checkout_module.make_parser()
@patch('dls_ade.dls_changes_since_release.ArgParser.add_branch_flag')
def tes... | dls-controls/dls_ade | dls_ade/dls_checkout_module_test.py | Python | apache-2.0 | 2,092 |
# -*- coding: utf-8 -*-
import sys
sys.path.append("/Libs/jython-standalone-2.7.0.jar")
sys.path.append("/Libs/mysql-connector-java-5.1.22-bin.jar")
import codecs
import os
# import pathlib
from GitSearch.DBManager_IJA import DBManager
# source_path = '/Users/Falcon/Desktop/IJA/Original_data/'
# dest_path = '/Users/... | facoy/facoy | IndexerByFuncs/Method_Extractor.py | Python | apache-2.0 | 4,944 |
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, ListView, TemplateView
from pretix.base.models import Event, EventPe... | akuks/pretix | src/pretix/control/views/main.py | Python | apache-2.0 | 2,498 |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | metacloud/python-troveclient | troveclient/tests/test_client.py | Python | apache-2.0 | 1,531 |
"""Tools to simplify PyTorch reporting and integrate with TensorBoard."""
import collections
import six
import sys
import time
try:
from tensorflow import summary as tb_summary
except ImportError:
tb_summary = None
class TensorBoardWriter(object):
"""Write events in TensorBoard format."""
def __ini... | nearai/program_synthesis | program_synthesis/common/tools/reporter.py | Python | apache-2.0 | 3,368 |
import stdutils, math
from stdutils import inputAsDict, cTheta, niceRoot, cApprox
vals = inputAsDict(('size',cTheta))
real = math.cos(vals[cTheta])
comp = math.sin(vals[cTheta])
#str1 = '{} ({} + i {})'.format(niceRoot(vals['size']).getString(),niceRoot(real).getString(),niceRoot(comp).getString())
str2 = '<{}, {}>'.... | meta1203/Trigonometry-Programlets | vector_dimensions.py | Python | apache-2.0 | 525 |
#
# 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 us... | chuckchen/spark | python/pyspark/pandas/tests/test_groupby.py | Python | apache-2.0 | 118,904 |
"""
Helper for views.py
"""
from base_handler import base_handler
import traceback
import app.model
from flask import g, render_template
class single_access_handler(base_handler):
def __init__(self):
"""
Manages all the operations that are involved with a single port association with EPGs
... | sfloresk/NCA-Container-Builder | NCABase/app/sijax_handlers/single_access_handler.py | Python | apache-2.0 | 13,867 |
# -*- coding: utf-8 -*-
import pytest
from rest_framework.exceptions import PermissionDenied, ParseError
from awx.api.filters import FieldLookupBackend, OrderByBackend, get_field_from_path
from awx.main.models import (AdHocCommand, ActivityStream,
CustomInventoryScript, Credential, Job,
... | wwitzel3/awx | awx/main/tests/unit/api/test_filters.py | Python | apache-2.0 | 4,535 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('cenet', '0006_auto_20160801_1939'),
]
operations = [
migrations.AddField(
model_name='cenetwork'... | Si-elegans/Web-based_GUI_Tools | cenet/migrations/0007_auto_20160806_1502.py | Python | apache-2.0 | 710 |
# -*- coding: utf-8 -*-
import scrapy
from src.items import SrcItem
class XroxySpider(scrapy.Spider):
name = "xroxy"
allowed_domains = ["xrory.com"]
start_urls = (
'http://www.xroxy.com/proxylist.htm',
)
def parse(self, response):
table = response.xpath('/html/body/div[1]/div[2]/t... | LeoCBS/scrapy-proxy | src/spiders/xroxy.py | Python | apache-2.0 | 476 |
# -*- coding: utf-8 -*-
import httplib as http
import logging
from flask import request
from framework.exceptions import HTTPError
from framework.auth.utils import privacy_info_handle
from framework.auth.decorators import must_be_logged_in
from framework.flask import redirect
from addons.wiki.utils import to_mongo_... | chennan47/osf.io | addons/wiki/views.py | Python | apache-2.0 | 19,789 |
from django.conf.urls import url
from agendas import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^agendas/alert$', views.alert, name='alert')
]
| codefortulsa/punctuil | agendas/urls.py | Python | apache-2.0 | 178 |
from functools import partial
from typing import Any, Callable, Dict, Generator, List, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerve... | rht/zulip | zerver/webhooks/clubhouse/view.py | Python | apache-2.0 | 27,498 |
# Copyright 2015, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.com>
#
# 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... | tomfotherby/tower-cli | tests/test_commands_config.py | Python | apache-2.0 | 12,164 |
# 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 | social_rl/gym_multigrid/manual_control_multiagent.py | Python | apache-2.0 | 3,290 |
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.api.urlfetch import DownloadError
from library import login
from boto.ec2.connection import *
class InstanzAnlegenNimbus(webapp.RequestHandler):
def post(self)... | nagyistoce/koalacloud | ec2/InstanzAnlegenNimbus.py | Python | apache-2.0 | 1,526 |
import mxnet as mx
import numpy as np
from mxnet.executor_manager import _split_input_slice
from rcnn.config import config
from rcnn.io.image import tensor_vstack
from rcnn.io.rpn import get_rpn_testbatch, get_rpn_batch, assign_anchor
from rcnn.io.rcnn import get_rcnn_testbatch, get_rcnn_batch
class TestLoader(mx.io... | likelyzhao/mxnet | example/rcnn/rcnn/core/loader.py | Python | apache-2.0 | 22,692 |
#!/usr/bin/env python
# Copyright 2018 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-speech | samples/snippets/transcribe_enhanced_model.py | Python | apache-2.0 | 2,170 |
from __future__ import absolute_import, division
from sys import stdout
from os import remove
from os.path import join, abspath, isdir
import os.path
from time import time, sleep
from multiprocessing import RawValue, Lock, Process, cpu_count
from string import Template
import numpy as np
from numpy.fft import irfftn ... | haddocking/powerfit | powerfit/powerfitter.py | Python | apache-2.0 | 22,830 |
# Copyright 2013 IBM Corp.
#
# 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 t... | ntymtsiv/tempest | tempest/api/compute/v3/admin/test_servers.py | Python | apache-2.0 | 7,222 |
# 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... | dhuang/incubator-airflow | chart/tests/test_create_user_job.py | Python | apache-2.0 | 3,564 |
from __future__ import print_function, absolute_import, division
import sys
import click
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
import ec2hosts
def main():
try:
cli(obj={})
except Exception as e:
import traceback
click.echo(traceback.format_exc(), err=True)
... | danielfrg/ec2hosts | ec2hosts/cli.py | Python | apache-2.0 | 1,208 |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=8, path_list=[
[TestAction.create_vm, 'vm1', ],
[TestAction.create_volume, 'volume1', 'flag=scsi'],
[TestAction.attach_volume, 'vm1', 'volume1'],
... | zstackio/zstack-woodpecker | integrationtest/vm/multihosts/vm_snapshots/paths/xsky_path20.py | Python | apache-2.0 | 1,808 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM
# 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/LI... | maoy/zknova | nova/api/openstack/compute/contrib/floating_ips_bulk.py | Python | apache-2.0 | 6,057 |
import codecs
from setuptools import setup, find_packages
import os
import re
import sys
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_opti... | athoune/aiohttp_security | setup.py | Python | apache-2.0 | 2,105 |
# 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 ... | unodba/cloudstack-docs-install | source/conf.py | Python | apache-2.0 | 14,051 |
# coding=utf-8
# COPYRIGHT 2014 Rackspace
#
# Author: Tim Simmons <tim.simmons@rackspace.com>
#
# 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... | melodous/designate | designate/tests/test_api/test_v2/extensions/test_quotas.py | Python | apache-2.0 | 5,778 |
"""
Copyright 2013 Shine Wang
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
distrib... | shinexwang/Classy | Testing/TestMain/testProgram.py | Python | apache-2.0 | 1,514 |
#!/usr/bin/env python
#
# Copyright (c) 2013 In-Q-Tel, Inc/Lab41, 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
#
# Unles... | kfoss/try41 | dockerfiles/redwood/visual.py | Python | apache-2.0 | 2,481 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import call_seq
setup(
name = 'call_seq',
version = '0.0.2',
description = 'call sequence visualization',
author = 'ya790206',
url = 'https://github.com/ya790206/call_seq',
license = 'Apache License Ve... | ya790206/call_seq | setup.py | Python | apache-2.0 | 446 |
from __future__ import absolute_import, unicode_literals, division, print_function
__author__ = 'reyrodrigues'
import os
import httplib2
from apiclient import discovery
import oauth2client
from oauth2client import client
from django.core.management.base import BaseCommand
from content import models
import requests
... | theirc/refugeeinfo.eu | content/management/commands/syncdocs.py | Python | apache-2.0 | 4,605 |
# Copyright 2015 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... | AnishShah/tensorflow | tensorflow/tools/api/tests/api_compatibility_test.py | Python | apache-2.0 | 12,593 |
import os
import yaml
from network import Network
from storage import Storage
from cloudtools import conn, make_network_name
from config import TEMPLATE_PATH
with open(os.path.join(TEMPLATE_PATH, "network.yaml")) as f:
netconf = yaml.load(f)
with open(os.path.join(TEMPLATE_PATH, "vm.yaml")) as f:
vmconf = yam... | sshnaidm/openstack-sqe | tools/cloud/domain.py | Python | apache-2.0 | 3,609 |
# Copyright 2018 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... | ros2/system_tests | test_cli_remapping/test/test_cli_remapping.py | Python | apache-2.0 | 6,164 |
"""Support to interface with the Plex API."""
from datetime import timedelta
import json
import logging
import requests
import voluptuous as vol
from homeassistant import util
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const i... | molobrakos/home-assistant | homeassistant/components/plex/media_player.py | Python | apache-2.0 | 33,328 |
#!/usr/bin/env python3
"""A command line tool for generating component specification files."""
# 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
#
#... | kubeflow/pipelines | components/aws/sagemaker/common/generate_components.py | Python | apache-2.0 | 4,875 |
# Copyright (c) 2014 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | ChameleonCloud/blazar | blazar/db/exceptions.py | Python | apache-2.0 | 1,705 |
# -*- coding: utf-8 -*-
from copy import deepcopy
from datetime import datetime, timedelta
from types import ModuleType
from unittest import TestCase
from unittest.mock import patch
from alamo_worker.conf import settings
from alamo_worker.alerter.notifications.http import HttpNotificationClient
from alamo_worker.alert... | RulersOfAsgard/ALAMO-worker | alamo_worker/alerter/tests/test_notification_http.py | Python | apache-2.0 | 4,938 |
# -*- coding: utf-8 -*-
#
# rotterdam documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 1 11:54:37 2014.
#
# 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.
#
#... | lvh/rotterdam | docs/conf.py | Python | apache-2.0 | 8,780 |
#
# Heavily inspired from https://github.com/IINemo/docker-syntaxnet_rus://github.com/IINemo/docker-syntaxnet_rus
# itself inspired from https://github.com/tensorflow/models/blob/master/syntaxnet/syntaxnet/parser_eval.py
# just modified to be able to call wrapper several time for the same process
#
"""A program to ann... | short-edition/syntaxnet-wrapper | syntaxnet_wrapper/src/parser_eval.py | Python | apache-2.0 | 8,901 |
# migrate.py [up|seed|down] [local|docker]
# e.g. migrate.py up docker
import sys
import os
import re
from subprocess import call, check_output
from operator import itemgetter, attrgetter, methodcaller
CASSANDRA_PATH_LOCAL = '/Users/jacekdalkowski/Dev/_cassandra/apache-cassandra-3.0.0/bin/'
ARTIFACTS_PATH_LOCAL = '/... | jacekdalkowski/bike-timer | web-database/db_migrations/migrate.py | Python | apache-2.0 | 2,224 |