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 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... | alsrgv/tensorflow | tensorflow/python/keras/layers/recurrent_test.py | Python | apache-2.0 | 54,154 |
# Copyright 2017 Ravi Sojitra. 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... | RaviSoji/probabilistic_LDA | tests/test_optimizer/test_optimizer_inference.py | Python | apache-2.0 | 4,213 |
from django.shortcuts import render
from django.conf import settings
from common.views import AbsSegmentSelection
#from common.views import AbsTargetSelection
from common.views import AbsTargetSelectionTable
# from common.alignment_SITE_NAME import Alignment
from protwis.context_processors import site_title
Alignment... | protwis/protwis | similaritymatrix/views.py | Python | apache-2.0 | 3,838 |
#!/usr/bin/env python
"""
Created by: Lee Bergstrand (2018)
Description: A simple unittest for testing the genome_property_tree module.
"""
import json
import unittest
from copy import deepcopy
from pygenprop.database_file_parser import parse_genome_property
from pygenprop.database_file_parser import parse_genome_p... | LeeBergstrand/pygenprop | pygenprop/testing/test_tree.py | Python | apache-2.0 | 12,594 |
from .testlib import TestCase
import argparse
import logging
import os.path
import re
import unittest
from resync.client_utils import init_logging, count_true_args, parse_links, parse_link, parse_capabilities, parse_capability_lists, add_shared_misc_options, process_shared_misc_options
from resync.client import Client... | resync/resync | tests/test_client_utils.py | Python | apache-2.0 | 6,834 |
"""
# setup module
"""
import os
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, 'README.md')) as f:
README = f.read()
# with open(os.path.join(HERE, 'CHANGES.txt')) as f:
# CHANGES = f.read()
CHANGES = "Changes"
PREQ = [
'pyrami... | dockerian/pyapi | demo/setup.py | Python | apache-2.0 | 1,256 |
# Copyright (c) 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... | paninetworks/neutron | neutron/db/ipam_non_pluggable_backend.py | Python | apache-2.0 | 22,516 |
#!/usr/bin/env python
"""
Extract pronunciations from the ELP items.
Outputs a CSV with the orthographic and phonological form on each
line. The phonological form is stripped of syllabification and stress
markers.
"""
# Copyright 2013 Constantine Lignos
#
# Licensed under the Apache License, Version 2.0 (the "Licens... | lingtools/lingtools | extract_elp_prons.py | Python | apache-2.0 | 4,566 |
# Copyright (c) 2017 Fujitsu 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/licenses/LICENSE-2.0
#
# Unless requi... | noironetworks/neutron | neutron/tests/unit/services/logapi/common/test_db_api.py | Python | apache-2.0 | 14,273 |
import sys
from flexmock import flexmock
import inject
from mcloud.events import EventBus
from mcloud.txdocker import IDockerClient, DockerTwistedClient
from mcloud.util import txtimeout
import pytest
from mcloud.remote import Server, Client, ApiError, Task, ApiRpcServer
from twisted.internet import reactor, defer
fr... | modera/mcloud | tests/test_remote.py | Python | apache-2.0 | 6,741 |
# Copyright 2013 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... | alanquillin/quark | quark/segment_allocations.py | Python | apache-2.0 | 11,496 |
# Copyright 2015 PerfKitBenchmarker 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 appli... | meteorfox/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Python | apache-2.0 | 8,628 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-24 05:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',... | sdu14SoftwareEngineering/GameOfLife_WEB | game/migrations/0001_initial.py | Python | apache-2.0 | 615 |
# Copyright The OpenTelemetry 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 ... | open-telemetry/opentelemetry-python | exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/__init__.py | Python | apache-2.0 | 2,513 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 VMware, 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.or... | rickerc/cinder_audit | cinder/tests/test_vmware_vmdk.py | Python | apache-2.0 | 78,544 |
import flask
from pypi_vm.infrastructure.view_modifiers import response
from pypi_vm.viewmodels.home.home_index_viewmodel import HomeIndexViewModel
blueprint = flask.Blueprint('home', __name__, template_folder='templates')
@blueprint.route('/')
@response(template_file='home/index.html')
def index():
vm = HomeIn... | Wintellect/WintellectWebinars | 2019-06-06-ten-tips-python-web-devs-kennedy/code/top_10_web_explore/ex07_viewmodels/pypi_vm/views/home_view.py | Python | apache-2.0 | 359 |
# -----------------------------------------------------------------------------
#
# -*- coding: utf-8 -*-
#
# phlox-libdc1394/dc1394/frame.py
#
# Copyright (C) 2016, by Matthias Yang Chen <matthias_cy@outlook.com>
# All rights reserved.
#
# phlox-libdc1394 is free software: you can redistribute it and/or modify it
# un... | PhloxAR/phloxar | PhloxAR/dc1394/frame.py | Python | apache-2.0 | 6,774 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Ian Good
# Copyright 2014 Ryan Lane
#
# 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/LICEN... | ryan-lane/keystone-redis | keystoneredis/token.py | Python | apache-2.0 | 3,492 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright 2013 Joe Harris
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
... | meeb/txcloudflare | examples/ip_ban.py | Python | apache-2.0 | 2,255 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import networkx as nx
import copy
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER, DEAD_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3... | Zouyiran/ryu | ryu/app/chapter_2/pre_install_app.py | Python | apache-2.0 | 12,687 |
# 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/text/yelp_polarity_test.py | Python | apache-2.0 | 961 |
#!/usr/bin/env python
import sys
sys.path.append("../build/")
import phisSchema
import pyxb
import warnings
# Strategy:
# Perhaps cleanest would be to build a separate interface for data that may vary from VFB.
# This also allows separation of Jython code
# OTOH - this gives another layer of mappings to maintain.
... | PhenoImageShare/PhenoImageShare | VFB_import/src/VFB2PhisXML.py | Python | apache-2.0 | 15,991 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | ashvina/heron | heron/tools/common/src/python/access/query.py | Python | apache-2.0 | 1,797 |
import re
import urllib.request
import logging
import math
from bs4 import BeautifulSoup
from Vacation import VacationPackage, Departures, Destinations, Duration
ALL_PAGES = True
DEPARTURE_MAPPING = {
Departures.OTTAWA: "YOW"
}
DEPARTURE_CITY_MAPPING = {
Departures.OTTAWA: "Ottawa"
}
DESTINATION_MAPPING = ... | astone282/vactrack | vactrack/Expedia.py | Python | apache-2.0 | 6,312 |
import numpy as np
file = "/home/rishabh/IdeaProjects/jitd/java/benchmark_20151213_224704_freqWrites/benchmark_scatter_1024m.txt"
# data = np.genfromtxt(file, dtype=(int, float, None), delimiter=',', names=['x', 'y', 'z'],)
data = np.genfromtxt(file, dtype=None, delimiter=',', names=['x', 'y', 'z'], )
write = 0
read ... | rmp91/jitd | java/stats.py | Python | apache-2.0 | 893 |
# 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 (t... | apache/incubator-allura | ForgeUserStats/forgeuserstats/tests/test_model.py | Python | apache-2.0 | 22,990 |
# Copyright 2015 Intel
# 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... | stackforge/compute-hyperv | compute_hyperv/tests/unit/test_coordination.py | Python | apache-2.0 | 3,659 |
#
# =================================================================
# =================================================================
# def _enum(**enums):
# return type('Enum', (), enums)
import eventlet
from eventlet import greenthread
import paxes_cinder.k2aclient.k2asample as k2asample
from paxes_cinder.... | windskyer/k_cinder | paxes_cinder/k2aclient/k2asample/tool_ssp_simulation.py | Python | apache-2.0 | 36,321 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2013 Spotify AB
#
# 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... | pombredanne/sparkey-python | test/binary_test.py | Python | apache-2.0 | 2,128 |
import inspect
import example
print(inspect.getsource(example.A.get_name))
| jasonwee/asus-rt-n14uhp-mrtg | src/lesson_language_tools/inspect_getsource_method.py | Python | apache-2.0 | 76 |
"""
Exon IDs of the TP53 gene and one of its transcripts (TP53-026) were copied
from the Ensembl website, make sure same IDs are found by pyensembl.
"""
from __future__ import absolute_import
from pyensembl import cached_release
ensembl = cached_release(77)
# all exons associated with TP53 gene in Ensembl release 77... | hammerlab/pyensembl | test/test_exon_id.py | Python | apache-2.0 | 3,958 |
"""Weather component that handles meteorological data for your location."""
from __future__ import annotations
from abc import abstractmethod
from collections.abc import Mapping
from datetime import datetime
from typing import Any, cast
from pyclimacell.const import (
CURRENT,
DAILY,
FORECASTS,
HOURLY... | mezz64/home-assistant | homeassistant/components/climacell/weather.py | Python | apache-2.0 | 17,080 |
from unittest import mock
from test import support
from test.test_httpservers import NoLogRequestHandler
from unittest import TestCase
from wsgiref.util import setup_testing_defaults
from wsgiref.headers import Headers
from wsgiref.handlers import BaseHandler, BaseCGIHandler, SimpleHandler
from wsgiref import util
from... | batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/test/test_wsgiref.py | Python | apache-2.0 | 27,734 |
"""
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import pytest
import salt.modules.modjk as modjk
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
return {modjk: {}}
def test_version():
"""
Test for return the modjk version
"""
with patch.object... | saltstack/salt | tests/pytests/unit/modules/test_modjk.py | Python | apache-2.0 | 5,541 |
import tornado
import tornado.gen
from req import Service
from req import ApiRequestHandler
class Index(ApiRequestHandler):
@tornado.gen.coroutine
def get(self):
self.render()
| Tocknicsu/nctuoj_contest | backend/handler/index.py | Python | apache-2.0 | 195 |
# 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... | iagcl/data_pipeline | ui/app/scheduler_bg.py | Python | apache-2.0 | 2,334 |
# Copyright 2010-2021 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/or-tools | ortools/linear_solver/linear_solver_natural_api.py | Python | apache-2.0 | 8,096 |
import functools
import re
import pytest
from autoray import do, lazy, to_numpy, infer_backend, get_dtype_name, astype
from numpy.testing import assert_allclose
from .test_autoray import BACKENDS, gen_rand
def test_manual_construct():
def foo(a, b, c):
a1, a2 = a
b1 = b['1']
c1, c2 = c... | jcmgray/autoray | tests/test_lazy.py | Python | apache-2.0 | 11,880 |
"""
Demo of the histogram (hist) function used to plot a cumulative distribution.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import mlab
def plot_loss_over_time(file_name):
with open(file_name, 'r') as f:
lines = f.readlines()
events = order_events(lines)
packets_sent ... | andres-erbsen/rrtcp | results/scripts/plotting.py | Python | apache-2.0 | 1,242 |
#!/usr/bin/env python
# coding: utf-8
import email.utils
import logging
import os
import smtplib
import threading
from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart
logger = logging.getLogger("maillog")
class MailBase(threading.Thread):
mailServerPort = 25
def __init__(self,... | gannicus-yu/pyutils | myutils/mailbase.py | Python | apache-2.0 | 4,008 |
import re
import os
import logging
from collections import defaultdict
from insights.config.static import get_config
from insights.config import AnalysisTarget, META_FILE_LIST, CommandSpec
logger = logging.getLogger(__name__)
logger.setLevel(logging.FATAL)
class SpecMapper(object):
"""
This class wraps a tar... | PaulWay/insights-core | insights/core/specs.py | Python | apache-2.0 | 5,582 |
from django.urls import path, re_path
from django.conf import settings
from django.contrib.auth import views as auth_views
urlpatterns = [
re_path(
'login/',
auth_views.LoginView.as_view(template_name='dj_auth/login.html'),
name='login'),
re_path(
'logout/',
auth_views.... | mava-ar/sgk | src/dj_auth/urls.py | Python | apache-2.0 | 1,618 |
import os
import shutil
import csv
class Restorer:
def __init__(self, backupDir):
self.backupDir = backupDir
if not self.backupDir.endswith('/'):
self.backupDir += '/'
def Run(self, filenamesListFname, doDelete=False):
if not os.path.exists(self.backupDir + filenamesListFna... | mozafari/vprofiler | src/Restorer/Restorer.py | Python | apache-2.0 | 744 |
from io import StringIO
import csv
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.files.base import ContentFile
from django.test import TestCase
from django.urls import reverse
from django.utils.timezone import now
from register.forms impo... | SmartElect/SmartElect | register/tests/test_views.py | Python | apache-2.0 | 21,018 |
from .base import FileTransport, HttpFileTransport, BlitzortungDataPath, BlitzortungDataPathGenerator
from .raw_signal import RawSignalsBlitzortungDataProvider
from .station import StationsBlitzortungDataProvider
from .strike import StrikesBlitzortungDataProvider
def strikes():
from .. import INJECTOR
return... | wuan/bo-python | blitzortung/dataimport/__init__.py | Python | apache-2.0 | 571 |
# Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft 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 b... | Azure/WALinuxAgent | azurelinuxagent/pa/deprovision/default.py | Python | apache-2.0 | 10,146 |
#!/usr/bin/env python
import re
from ciscoconfparse import CiscoConfParse
def main():
'''
using the ciscoconfparse to find the crypto maps that are not using AES
'''
cisco_file = 'cisco_ipsec.txt'
cisco_cfg = CiscoConfParse(cisco_file)
crypto_maps = cisco_cfg.find_objects_wo_child(parentspec... | hbenaouich/Learning-Python | class-1/ex10_confParse.py | Python | apache-2.0 | 760 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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... | itskewpie/tempest | tempest/api/compute/admin/test_quotas.py | Python | apache-2.0 | 10,071 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | mcgonagle/ansible_f5 | library/bigip_device_dns.py | Python | apache-2.0 | 11,184 |
# 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 Li... | inbloom/legacy-projects | lri-middleware/path_builder/form.py | Python | apache-2.0 | 1,107 |
# Copyright The OpenTelemetry 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 ... | open-telemetry/opentelemetry-python | tests/opentelemetry-test-utils/src/opentelemetry/test/globals_test.py | Python | apache-2.0 | 2,110 |
#Interphase - Copyright (C) 2009 James Garnon <http://gatc.ca/>
#Released under the MIT License <http://opensource.org/licenses/MIT>
from __future__ import division
import os
from env import engine
__docformat__ = 'restructuredtext'
class Text(object):
"""
Receives text to display on surface.
Arguments ... | nordicpower/GameListPatch | interphase/util.py | Python | apache-2.0 | 17,408 |
from math import sqrt
from datetime import datetime
from dexter.models import db, Document, Person
from sqlalchemy.sql import func
from sqlalchemy.orm import joinedload
class BaseAnalyser(object):
"""
Base for analyser objects that handles a collection of
documents to analyse, based on either document i... | Code4SA/mma-dexter | dexter/analysis/base.py | Python | apache-2.0 | 3,167 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | 111pontes/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_infra_objmgr_oper.py | Python | apache-2.0 | 57,513 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('mainsite', '0005_auto_20150909_0246'),
... | srenner/photerva | mainsite/migrations/0006_auto_20150916_0219.py | Python | apache-2.0 | 2,722 |
# Copyright 2015-2017 Cisco Systems, 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 req... | smartbgp/libbgp | libbgp/bmp/termination.py | Python | apache-2.0 | 1,910 |
"""Class to reload platforms."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
import logging
from typing import Any
from homeassistant import config as conf_util
from homeassistant.const import SERVICE_RELOAD
from homeassistant.core import Event, HomeAssistant, callback
from ... | mezz64/home-assistant | homeassistant/helpers/reload.py | Python | apache-2.0 | 5,950 |
class Solution:
def minDistance(self, word1, word2):
"""
:type word1: str
:type word2: str
:rtype: int
"""
l1 = len(word1)
l2 = len(word2)
if l1 == 0 and l2 != 0:
return l2
if l1 != 0 and l2 == 0:
return l1
... | MingfeiPan/leetcode | dp/72.py | Python | apache-2.0 | 859 |
# Copyright 2020 DeepMind Technologies 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 ag... | deepmind/dm_robotics | cpp/setup.py | Python | apache-2.0 | 4,478 |
import unittest
from gremlin_rest import GremlinClient
class TestClient(unittest.TestCase):
def setUp(self):
self.client = GremlinClient('http://172.17.0.248:8182')
def tearDown(self):
for v in self.client.V().run():
self.client.delete_vertex(vertex_id = v.vertex_id)
def test... | windj007/python-gremlin-rest | gremlin_rest/tests/all_tests.py | Python | apache-2.0 | 1,682 |
import os
import pynja
import repo
@pynja.project
class java1(repo.JavaProject):
def emit(self):
sources = [
"com/java1/Counter.java",
]
with self.java_compile_ex(sources) as task:
task.workingDir = os.path.join(self.projectDir, "source")
self.jar_create("j... | fifoforlifo/pynja | test2/code/java1/java1.py | Python | apache-2.0 | 331 |
from datetime import datetime
from app import app
from app.authentication import with_login
from flask import Blueprint, jsonify, request, Response
from app.generate_csv import generate_csv_clean
from app.msol_util import get_next_update_estimation_message_aws
from app.es.awsmetric import AWSMetric
from app.es.awsstat ... | giubil/trackit | api/files/api/app/views/aws/cost/stats.py | Python | apache-2.0 | 43,920 |
# Copyright 2015 6WIND S.A.
# 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... | openstack/networking-6wind | networking_6wind/common/constants.py | Python | apache-2.0 | 1,169 |
# -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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
#
# U... | ChristopheVuillot/qiskit-sdk-py | qiskit/qasm/_node/_customunitary.py | Python | apache-2.0 | 1,893 |
# start the service
oculusrift = Runtime.start("oculusrift","OculusRift") | MyRobotLab/pyrobotlab | service/OculusRift.py | Python | apache-2.0 | 73 |
"""Tests for the DFS module"""
import unittest
from dfs import dfsTraverse
class test_dfsTraverse(unittest.TestCase):
"""Test the correct order in traversing a graph"""
def setUp(self):
"""Create a graph and a tuple with the correct traverse"""
self.correctResTup = ('a', 'b', 'e', 'g', 'f', '... | radome/algorithms_and_data_structures | Python/test/test_dfs.py | Python | apache-2.0 | 911 |
# coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... | vericred/vericred-python | test/test_county_bulk.py | Python | apache-2.0 | 9,989 |
"""
Defines a legend for displaying components.
:copyright: 2015 Agile Geoscience
:license: Apache 2.0
"""
# from builtins import object
from io import StringIO
import csv
import warnings
import random
import re
import itertools
try:
from functools import partialmethod
except: # Python 2
from utils import pa... | agile-geoscience/striplog | striplog/legend.py | Python | apache-2.0 | 30,661 |
#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | joelsmith/openshift-tools | ansible/roles/lib_openshift_3.2/library/oc_pvc.py | Python | apache-2.0 | 39,870 |
# Copyright 2020 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/launch | launch_xml/test/launch_xml/test_timer.py | Python | apache-2.0 | 1,975 |
#coding=utf-8
import os
# Basic settings
# requests settings
TIMEOUT = 5
VERIFY = False
# directories might be used
LOCATIONS = {
'log': 'log',
'data': 'data',
}
# stderr is redirected to this file
ERR_LOG_FILE = os.path.join(LOCATIONS['log'], 'err.log')
# log in this file
LOGGING_FILE = os.path.join(LOCAT... | Moonshile/fast12306 | src/core/settings.py | Python | apache-2.0 | 2,707 |
#-*- coding: utf-8 -*-
def factorial(n):
"""Return the factorial of n"""
if n < 2:
return 1
return n * factorial(n - 1)
def fibonacci(n):
"""Return the nth fibonacci number"""
if n < 2:
return n
return fibonacci(n - 1) + fibonacci(n - 2)
def fib_fac(x=30, y=900):
fib = ... | ealogar/curso-python | advanced/fib_fac.py | Python | apache-2.0 | 1,159 |
'''
Tree from:
http://www.quesucede.com/page/show/id/python-3-tree-implementation
'''
from urllib.parse import urlparse
import os
(_ROOT, _DEPTH, _BREADTH) = range(3)
class Node:
def __init__(self, identifier):
self.__identifier = identifier
self.__children = []
@property
def identifier... | glaudsonml/kurgan-ai | libs/Tree.py | Python | apache-2.0 | 2,507 |
from moto.dynamodb2.comparisons import get_comparison_func
from moto.dynamodb2.exceptions import IncorrectDataType
from moto.dynamodb2.models.utilities import bytesize
class DDBType(object):
"""
Official documentation at https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html
... | spulec/moto | moto/dynamodb2/models/dynamo_type.py | Python | apache-2.0 | 8,167 |
import sys
def solve(B):
ans = [0]*B
guess = 1
for _ in range(10):
print(guess)
sys.stdout.flush()
n = int(input().strip())
ans[guess-1] = n
guess += 1
print("".join(map(str, ans)))
sys.stdout.flush()
result = input()
if result == "N":
sys.ex... | zuun77/givemegoogletshirts | codejam/2020/qual/q4.py | Python | apache-2.0 | 411 |
# 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 Li... | pypa/warehouse | warehouse/packaging/search.py | Python | apache-2.0 | 2,723 |
# Copyright (c) OpenMMLab. All rights reserved.
# flake8: noqa
import warnings
from .formatting import *
warnings.warn('DeprecationWarning: mmdet.datasets.pipelines.formating will be '
'deprecated, please replace it with '
'mmdet.datasets.pipelines.formatting.')
| open-mmlab/mmdetection | mmdet/datasets/pipelines/formating.py | Python | apache-2.0 | 293 |
# -*- 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-dataplex | samples/generated_samples/dataplex_v1_generated_dataplex_service_update_lake_async.py | Python | apache-2.0 | 1,513 |
import logging
import sys
from typing import Any, Callable
from django.conf import settings
from django.core.management.base import BaseCommand, \
CommandError, CommandParser
from tornado import ioloop
from tornado.log import app_log
# We must call zerver.tornado.ioloop_logging.instrument_tornado_ioloop
# before... | rishig/zulip | zerver/management/commands/runtornado.py | Python | apache-2.0 | 5,167 |
# 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... | Juniper/tempest | tempest/scenario/test_volume_boot_pattern.py | Python | apache-2.0 | 10,161 |
# Copyright 2019 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... | alsrgv/tensorflow | tensorflow/lite/testing/generate_examples_lib.py | Python | apache-2.0 | 176,619 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import binascii
import io
import logging
import os
import traceback
from builtins import ... | twitter/pants | src/python/pants/scm/git.py | Python | apache-2.0 | 22,734 |
"""
Copyright 2014 Quentin Kaiser
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
dis... | QKaiser/pynessus | pynessus/models/scanner.py | Python | apache-2.0 | 2,984 |
# Class definition:
# RunJob
# This is the main RunJob class; RunJobEvent etc will inherit from this class
# Note: at the moment, this class is essentially the old runJob module turned object oriented.
# The class will later become RunJobNormal, ie responible for running normal PanDA jobs.
# At th... | RRCKI/pilot | RunJob.py | Python | apache-2.0 | 69,493 |
from mongoengine import *
from models.zips import Zips
from geopy import distance
from geopy import Point
connect('scratch', host='mongodb://142.133.150.180/scratch')
# zipins = Zips(zipcode=999999, city="testlocation", loc=[1.0,1.0],pop=12345, state="ZZ").save()
locationList = []
location = {}
distanceList = []
fo... | rainmakeross/python-dataanalysis | app.py | Python | apache-2.0 | 871 |
#!/usr/bin/env python
"""
Standaone Rule
==============
This is a customer spec, parser and rule and can be run
against the local host using the following command::
$ insights-run -p examples.rules.stand_alone
or from the examples/rules directory::
$ ./stand_alone.py
"""
from __future__ import print_functio... | RedHatInsights/insights-core | examples/rules/stand_alone.py | Python | apache-2.0 | 2,746 |
# Copyright (c) 2002-2016, California Institute of Technology.
# All rights reserved. Based on Government Sponsored Research under contracts NAS7-1407 and/or NAS7-03001.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# ... | nasa-gibs/onearth | src/test/oe_test_utils.py | Python | apache-2.0 | 44,219 |
VERSION = '0.3.4'
| jarpy/lambkin | lambkin/version.py | Python | apache-2.0 | 18 |
"""Module containing bug report helper(s)."""
from __future__ import print_function
import json
import platform
import sys
import ssl
import idna
import urllib3
from . import __version__ as requests_version
try:
import charset_normalizer
except ImportError:
charset_normalizer = None
chardet = None
try:
... | cloudera/hue | desktop/core/ext-py3/requests-2.27.1/requests/help.py | Python | apache-2.0 | 3,920 |
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from dgp.core.controllers.project_controllers import AirborneProjectController
from .base import WorkspaceTab
class ProjectTab(WorkspaceTab):
def __init__(self, project: AirborneProjectController, parent=None):
super().__init__(parent=parent, flags=Qt.W... | DynamicGravitySystems/DGP | dgp/gui/workspaces/project.py | Python | apache-2.0 | 517 |
#!/home/firlism/tools/css_platform/sleepyenv/bin/python
# EASY-INSTALL-SCRIPT: 'Pillow==2.8.2','pilfont.py'
__requires__ = 'Pillow==2.8.2'
__import__('pkg_resources').run_script('Pillow==2.8.2', 'pilfont.py')
| hexlism/css_platform | sleepyenv/bin/pilfont.py | Python | apache-2.0 | 209 |
from __future__ import unicode_literals
from moto.acm import acm_backends
from moto.apigateway import apigateway_backends
from moto.autoscaling import autoscaling_backends
from moto.awslambda import lambda_backends
from moto.cloudformation import cloudformation_backends
from moto.cloudwatch import cloudwatch_backends
... | whummer/moto | moto/backends.py | Python | apache-2.0 | 4,058 |
def cavity(l,n):
for i in xrange(1,n-1):
for j in xrange(1,n-1):
if l[i-1][j]!='X' and l[i][j-1]!='X' and l[i+1][j]!='X' and l[i][j+1]!='X' and l[i][j]>l[i-1][j] and l[i][j]>l[i+1][j] and l[i][j]>l[i][j-1] and l[i][j]>l[i][j+1]:
l[i][j]='X'
if __name__ == '__main__':
n = inp... | arriqaaq/hackerrank | Algo- Warmup/cavity-rank.py | Python | apache-2.0 | 508 |
import json
import pyaml
import yaml
from lib.util import Util
from lib.parser import Parser
import logging
import traceback
import glob
import os
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('ToscanfvParser')
class ToscanfvParser(Parser):
"""Parser methods for toscanfv project type
"""
... | superfluidity/RDCL3D | code/lib/toscanfv/toscanfv_parser.py | Python | apache-2.0 | 2,078 |
OPEN = "mate-open"
FILE_MANAGER = "caja"
| hanya/BookmarksMenu | pythonpath/bookmarks/env/mate.py | Python | apache-2.0 | 42 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from page_objects import *
from selenium import webdriver
import datetime
import time
import Queue
import threading
import traceback
tenders = Queue.Queue()
tenders_ids = []
tenders_threads = 2
bids = Queue.Queue()
bids_failed = {}
runs = Queue.Queue()
class CreateT... | lesiavl/selenium_perfomance_tests | pzo_load/load_test_file.py | Python | apache-2.0 | 5,242 |
# Copyright (c) 2012 Citrix Systems, 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 ... | OpenAcademy-OpenStack/nova-scheduler | nova/tests/api/openstack/compute/contrib/test_aggregates.py | Python | apache-2.0 | 18,751 |
# syft absolute
import syft as sy
from syft.lib.python.string import String
from syft.proto.lib.python.string_pb2 import String as String_PB
def test_string_serde() -> None:
syft_string = String("Hello OpenMined")
serialized = syft_string._object2proto()
assert isinstance(serialized, String_PB)
des... | OpenMined/PySyft | packages/syft/tests/syft/lib/python/string/string_serde_test.py | Python | apache-2.0 | 780 |
#
# Copyright 2013 Radware 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 agr... | nash-x/hws | neutron/services/loadbalancer/plugin.py | Python | apache-2.0 | 15,871 |
# -*- 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-datacatalog | samples/generated_samples/datacatalog_v1beta1_generated_data_catalog_test_iam_permissions_async.py | Python | apache-2.0 | 1,610 |