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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ... | anthonysandrin/kafka-utils | tests/kafka_cluster_manager/partition_count_balancer_test.py | Python | apache-2.0 | 26,033 |
import sys
from repoze.lru import lru_cache
from logging.config import fileConfig
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
from reports.helpers import create_db_url
BIDS_PAYMENTS_KEYS = frozenset(('bids', 'invoices'))
TENDERS_PAYMENTS_KEYS = frozenset(('tenders', 'refunds'))
class Confi... | openprocurement/reports | reports/config.py | Python | apache-2.0 | 2,186 |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 ... | elzaggo/pydoop | examples/avro/py/check_results.py | Python | apache-2.0 | 1,677 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2016 Futur Solo
#
# 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
#
# ... | futursolo/FutureFinity | futurefinity/utils.py | Python | apache-2.0 | 5,938 |
from imap_tools import MailBox
with MailBox('imap.mail.com').login('test@mail.com', 'pwd', 'INBOX') as mailbox:
criteria = 'ALL'
found_nums = mailbox.numbers(criteria)
page_len = 3
pages = int(len(found_nums) // page_len) + 1 if len(found_nums) % page_len else int(len(found_nums) // page_len)
for p... | ikvk/imap_tools | examples/fetch_by_pages.py | Python | apache-2.0 | 605 |
#!/usr/bin/env python2.7
# Copyright 2016 Autodesk 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 la... | accwebs/DockerMake | dockermake/imagedefs.py | Python | apache-2.0 | 7,810 |
# 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/api_project_repo_id.py | Python | apache-2.0 | 4,162 |
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox()
elif browser == "ch... | Lenchik13/Testing | fixture/application.py | Python | apache-2.0 | 1,000 |
#!/usr/bin/env python3
"""Tests for the trait mapping pipeline. Test resources are compressed XML files which contain one or a few records
manually extracted from the main ClinVar XML to check specific cases."""
import os
import tempfile
from eva_cttv_pipeline.trait_mapping.main import main
def get_test_resource(re... | EBIvariation/eva-cttv-pipeline | tests/eva_cttv_pipeline/trait_mapping/test_main.py | Python | apache-2.0 | 2,363 |
# Django settings for cbmonitor project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'cbmonitor.db'
}
}
# Local time zone for this installation.
TIME_ZONE = 'America/Los_Angeles'
# Language code for this installatio... | couchbaselabs/litmus | webapp/settings.py | Python | apache-2.0 | 2,790 |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
# BoatServer created on 15/8/21 下午3:15
# Copyright 2014 offbye@gmail.com
"""
"""
__author__ = ['"Xitao":<offbye@gmail.com>']
from socket import *
host = '172.19.3.18'
port = 9999
bufsize = 1024
addr = (host, port)
client = socket()
client.connect(addr)
while True:
d... | offbye/PiBoat | pyboat/socket_client.py | Python | apache-2.0 | 525 |
__author__ = 'Ahmed G. Ali'
ANNOTARE_DB = {
'name': 'annotare2',
'host': 'mysql-annotare-prod.ebi.ac.uk',
'port': 4444,
'username': '',
'password': ''
}
AE_AUTO_SUB_DB = {
'name': 'ae_autosubs',
'host': 'mysql-ae-autosubs-prod.ebi.ac.uk',
'port': 4091,
'username': '',
'password'... | arrayexpress/ae_auto | settings/settings_no_password.py | Python | apache-2.0 | 2,129 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | jcmgray/autoray | autoray/_version.py | Python | apache-2.0 | 18,445 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-04 11:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0025_remove_pool_poolsize'),
]
operations = [
migrations.AddField(... | y73isc00l/WishGift | myproject/polls/migrations/0026_auto_20170204_1715.py | Python | apache-2.0 | 624 |
# Copyright 2019 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 ... | CloudVLab/professional-services | tools/ml-auto-eda/ml_eda/reporting/recommendation.py | Python | apache-2.0 | 4,289 |
from validate_app import validateApp
import os
from distutils import spawn
import sys
from parse_files import parseOutHTseq, bringTogether
from bashSub import bashSub
def checkPreprocessApplications():
applications = ["spades.py"]
source = ["http://bioinf.spbau.ru/spades"]
i = 0;
for app in applicatio... | msettles/expHTS | expHTS/spadesCMD.py | Python | apache-2.0 | 3,121 |
#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Results.Phirhoz
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
MCXRay phirhoz result file.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copy... | drix00/pymcxray | pymcxray/FileFormat/Results/Phirhoz.py | Python | apache-2.0 | 2,697 |
# Copyright (c) 2014 Simon Kennedy <sffjunkie+code@gmail.com>.
class RPCError(Exception):
pass
class RPCResponseError(RPCError):
pass
| sffjunkie/hiss | src/hiss/handler/kodi/jsonrpc/__init__.py | Python | apache-2.0 | 145 |
'''
@author: Pengtao.Zhang
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.vpc_operations as vpc_ops
import os
from itertools import izip
import zstackwoodpecker.operations.resource_oper... | zstackio/zstack-woodpecker | integrationtest/vm/vpc_ha/test_vpc_netflow_v9.py | Python | apache-2.0 | 4,086 |
# Copyright 2021 The TensorFlow 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 ... | tensorflow/similarity | tensorflow_similarity/api/__init__.py | Python | apache-2.0 | 4,454 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# -----------------------------------------------
# ----> Computer Aided Optical Analysis <----
# -----------------------------------------------
# (c) 2015 by Swissatest Testmaterialien AG
# http://www.swissatest.ch
# -----------------------------------------------
# Devel... | rrmelcer/swissatest-analysis | gui/qt4/credits.py | Python | apache-2.0 | 19,884 |
from abc import ABC, abstractmethod
from demo_python_at.commons.message import Message
class Printer(ABC):
"""Base class for all printers."""
@abstractmethod
def print(self, message: Message):
"""Abstract method for printing."""
pass
class StdoutPrinter(Printer):
"""Class that prin... | tatools/demo-python | demo_python_at/commons/printer.py | Python | apache-2.0 | 527 |
from zipline.api import sid, symbol, order, record, get_datetime
import logbook
import pandas as pd
log = logbook.Logger("ZiplineLog")
def initialize(context):
context.set_benchmark(symbol('TOPIX'))
context.assets = [
symbol(sym_str)
for sym_str in [
'2121',
'4689',
... | magne-max/zipline-ja | zipline/examples/buy_test.py | Python | apache-2.0 | 888 |
import pymongo
con = pymongo.Connection()
db = con.students
grades = db.grades
amount = grades.count()
print "Amount of elements in grades: %s " % amount
exam_el = grades.find({ "type" : "exam" }).count()
print "Amount of exam types in grades: %s " % exam_el
quiz_el = grades.find({ "type" : "quiz" }).coun... | petervdb/eLearning | mongodb/dev_course/analyse_grades.py | Python | apache-2.0 | 1,351 |
import re
from modularodm import Q
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import PermissionDenied, ValidationError, NotFound, MethodNotAllowed, NotAuthenticated
from rest_framework.status import HTTP_204_NO_CONTENT
from rest_framework.response import Response
... | rdhyee/osf.io | api/nodes/views.py | Python | apache-2.0 | 141,472 |
###############################################################################
# Insert
###############################################################################
# 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 ... | inbloom/legacy-projects | lri-middleware/ccss/insert.py | Python | apache-2.0 | 56,321 |
import ast
import json
import urllib
import urlparse
from isodate.isodatetime import parse_datetime
from django.conf import settings
from ..exceptions import ParamError
agent_ifps_can_only_be_one = ['mbox', 'mbox_sha1sum', 'openid', 'account']
def get_agent_ifp(data):
ifp_sent = [
a for a in agent_ifps_... | creighton/ADL_LRS | lrs/utils/__init__.py | Python | apache-2.0 | 3,345 |
# Copyright 2013 NEC Corporation
# 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 ... | CiscoSystems/tempest | tempest/scenario/test_minimum_basic.py | Python | apache-2.0 | 5,548 |
#!/usr/bin/env python
import subprocess32 as subprocess
import threading
import os
import time
import dynamo_utils as dutils
import config_manager as cm
import shlex
############################################################################
# Default params
##########################################################... | yadudoc/cloud_kotta | command.py | Python | apache-2.0 | 6,801 |
#!/usr/bin/env python2.7
# Copyright 2017 gRPC 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 la... | sreecha/grpc | tools/interop_matrix/client_matrix.py | Python | apache-2.0 | 14,790 |
# Copyright The PyTorch Lightning team.
#
# 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 i... | williamFalcon/pytorch-lightning | tests/loggers/test_wandb.py | Python | apache-2.0 | 9,157 |
#
# Copyright 2014 NEC Corporation. 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... | openstack/ceilometer | ceilometer/tests/unit/network/statistics/test_port.py | Python | apache-2.0 | 3,879 |
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com'
""" This example demonstrates how optimise power flow with Pyreto. """
import sys
import logging
import numpy
import scipy.io
import pylab
import pylon
import pyreto
from pyreto.util import plotGenCost
from pybrain.rl.agents import LearningAgent
from pybrain.rl.... | rwl/pylon | examples/pyreto/rlopf.py | Python | apache-2.0 | 5,046 |
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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
# ... | crwilcox/azure-storage-python | tests/storage_testcase.py | Python | apache-2.0 | 2,705 |
from functools import lru_cache
from .tokenizer_base import BaseTokenizer
from .tokenizer_re import TokenizerRegexp
class Tokenizer13a(BaseTokenizer):
def signature(self):
return '13a'
def __init__(self):
self._post_tokenizer = TokenizerRegexp()
@lru_cache(maxsize=2**16)
def __call_... | mjpost/sacreBLEU | sacrebleu/tokenizers/tokenizer_13a.py | Python | apache-2.0 | 985 |
#!/usr/bin/env python
"""Flows to collect file contents and metadata."""
from typing import Any, Mapping, Optional
from grr_response_core import config
from grr_response_core.lib.rdfvalues import client_fs as rdf_client_fs
from grr_response_core.lib.rdfvalues import crypto as rdf_crypto
from grr_response_core.lib.rdf... | google/grr | grr/server/grr_response_server/flows/file.py | Python | apache-2.0 | 16,923 |
import time
import pytest
@pytest.mark.moto
@pytest.mark.asyncio
async def test_list_queues(sqs_client, sqs_queue_url):
response = await sqs_client.list_queues()
pytest.aio.assert_status_code(response, 200)
assert sqs_queue_url in response['QueueUrls']
@pytest.mark.moto
@pytest.mark.asyncio
async def t... | aio-libs/aiobotocore | tests/test_sqs.py | Python | apache-2.0 | 2,198 |
import logging
#Config
MYSQL_HOST = '127.0.0.1'
MYSQL_PORT = 3306
MYSQL_USER = 'root'
MYSQL_PASS = 'oppzk'
MYSQL_DB = 'SSMM'
MANAGE_PASS = 'passwd'
#if you want manage in other server you should set this value to global ip
MANAGE_BIND_IP = '127.0.0.1'
#make sure this port is idle
MANAGE_PORT = 10001
PANEL_VERSION = ... | niubileme/shadowsocks-manyuser | shadowsocks/config.py | Python | apache-2.0 | 805 |
# Copyright 2018 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... | Bismarrck/tensorflow | tensorflow/python/ops/while_v2.py | Python | apache-2.0 | 38,134 |
# Lint as: python2, python3
# Copyright 2021 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
#
... | tensorflow/tpu | models/official/detection/projects/vild/preprocessing/dataset_util.py | Python | apache-2.0 | 1,426 |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | tensorflow/agents | tf_agents/policies/random_py_policy_test.py | Python | apache-2.0 | 5,609 |
click("Sarnvzsm.png")
sleep(1.5)
hover("iarpvambqmai.png")
sleep(1.5)
exit(0) | silverbulleters/vanessa-behavoir | tools/Sikuli/FeatureLoadMany.sikuli/FeatureLoadMany.py | Python | apache-2.0 | 77 |
'''
A Python Implementation of the Baffling Recursive Algorithm for Isotopic cluster distributioN
'''
import os
from .brainpy import (isotopic_variants, IsotopicDistribution, periodic_table,
max_variants, calculate_mass, neutral_mass, mass_charge_ratio,
PROTON, _has_c, Peak)... | mobiusklein/brainpy | brainpy/__init__.py | Python | apache-2.0 | 1,839 |
from typing import List, Set, Tuple, Dict
import numpy
from allennlp.common.checks import ConfigurationError
def decode_mst(
energy: numpy.ndarray, length: int, has_labels: bool = True
) -> Tuple[numpy.ndarray, numpy.ndarray]:
"""
Note: Counter to typical intuition, this function decodes the _maximum_
... | allenai/allennlp | allennlp/nn/chu_liu_edmonds.py | Python | apache-2.0 | 10,283 |
__author__ = 'Nick Apperley'
# -*- coding: utf-8 -*-
#
# Establishes an OpenVPN connection using an OVPN file. Based on a Hacking Lab Python script
# (http://media.hacking-lab.com/largefiles/livecd/z_openvpn_config/backtrack/vpn-with-python.py). Requires Python 3
# and the pexpect library (module).
import pexpect
fro... | napperley/OpenVPN_Tunneler | openvpn.py | Python | apache-2.0 | 1,290 |
from django.db import models
from django_countries.fields import CountryField
from django.utils.text import slugify
from django.core.urlresolvers import reverse
from phonenumber_field.modelfields import PhoneNumberField
import os,datetime
from uuid import uuid4
from imagekit.models import ImageSpecField
from imagekit.... | mykonosbiennale/mykonosbiennale.github.io | filmfestival/models.py | Python | apache-2.0 | 13,267 |
'''
mrtparse - MRT format data parser
Copyright (C) 2022 Tetsumune KISO
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 applicabl... | t2mune/mrtparse | mrtparse/base.py | Python | apache-2.0 | 9,331 |
"""
Unique user emails.
Revision ID: 00c617174e54
Revises: dea413e13a8a
Create Date: 2021-04-19 12:45:55.439916
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "00c617174e54"
down_revision = "dea413e13a8a"
branch_labels = None
depends_on = None
def upgrade():
op.create_unique_con... | Ouranosinc/Magpie | magpie/alembic/versions/2021-04-19_00c617174e54_unique_user_emails.py | Python | apache-2.0 | 450 |
_base_ = './sparse_rcnn_r50_fpn_1x_coco.py'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
min_values = (480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
... | open-mmlab/mmdetection | configs/sparse_rcnn/sparse_rcnn_r50_fpn_mstrain_480-800_3x_coco.py | Python | apache-2.0 | 853 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.economics import ComponentCostReference
log = logging.getLogger(__name__)
class TestComponentCostReference(unittest.TestCase):
def setUp(self):
self.fd, self.path =... | rbuffat/pyidf | tests/test_componentcostreference.py | Python | apache-2.0 | 3,417 |
#!/usr/bin/python
import sys, os, re
import json
import argparse
import pprint
arg_parser = argparse.ArgumentParser(description='Define tests')
arg_parser.add_argument('-p', '--pretty-print', action="store_true", help="select human friendly output, default is CSV")
arg_parser.add_argument('-i', '--info', action="stor... | bigfootproject/OSMEF | data_processing/aggregate_old.py | Python | apache-2.0 | 4,348 |
from gym.spaces import Box
from functools import partial
import logging
import numpy as np
import gym
from typing import Dict, Tuple, List
import ray
import ray.experimental.tf_utils
from ray.rllib.agents.ddpg.ddpg_tf_model import DDPGTFModel
from ray.rllib.agents.ddpg.ddpg_torch_model import DDPGTorchModel
from ray.r... | ray-project/ray | rllib/agents/ddpg/ddpg_tf_policy.py | Python | apache-2.0 | 18,764 |
# Copyright 2013-2018 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 w... | credp/lisa | external/devlib/devlib/utils/android.py | Python | apache-2.0 | 35,289 |
# -*- coding: utf-8 -*-
import logging
import thread
from optparse import OptionParser
import sleekxmpp
class DeviceClient(sleekxmpp.ClientXMPP) :
def __init__(self, jid, password):
print "User : %s"%jid
super(DeviceClient, self).__init__(jid, password)
logging.info("XMPP client launched... | JulienPobot/LeCubeMedia | src/clients/cldevice.py | Python | apache-2.0 | 1,869 |
# 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 agreed to in writing, ... | GoogleCloudPlatform/bigquery-record-manager | constants.py | Python | apache-2.0 | 598 |
# Copyright 2014 Cirruspath, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | cirruspath/python-oauth2-middleware | pom/server/pomserver.py | Python | apache-2.0 | 7,922 |
# vim: set ts=2 expandtab:
'''
Module: read.py
Desc: unpack data from binary files
Author: John O'Neil
Email: oneil.john@gmail.com
DATE: Thursday, March 13th 2014
'''
import struct
DEBUG = False
class EOFError(Exception):
""" Custom exception raised when we read to EOF
"""
pass
def split_buffer(length, buf):
... | johnoneil/arib | arib/read.py | Python | apache-2.0 | 2,368 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django import forms
from .models import Editorials
class EditorialsModelForm(forms.ModelForm):
class Meta:
model = Editorials
fields = '__all__'
widgets = {
'content': forms.Te... | radheygupta/editorialsnow | editorials/admin.py | Python | apache-2.0 | 703 |
#!/usr/bin/env python
copyright = '''
/*
* Copyright 2009 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without li... | execunix/vinos | xsrc/external/mit/MesaLib/dist/src/gallium/auxiliary/indices/u_indices_gen.py | Python | apache-2.0 | 10,366 |
# 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... | rdo-management/tuskar | tuskar/tests/templates/test_namespace.py | Python | apache-2.0 | 1,765 |
#!/usr/bin/env python
import sys
import os
import re
import traceback
import tarfile, io
import anchore.anchore_utils
def get_retrieved_file(imgid, srcfile, dstdir):
ret = list()
extractall = False
if srcfile == 'all':
extractall = True
thedstdir = os.path.join(dstdir, imgid)
tarfiles ... | anchore/anchore | anchore/anchore-modules/queries/get-retrieved-files.py | Python | apache-2.0 | 3,253 |
"""
WSGI config for mrestweb project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | brunogabriel/mobile-rest-web | mrestweb/mrestweb/wsgi.py | Python | apache-2.0 | 393 |
# -*- 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-artifact-registry | google/cloud/artifactregistry_v1beta2/services/artifact_registry/pagers.py | Python | apache-2.0 | 25,894 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/clusterfuzz | src/clusterfuzz/_internal/chrome/build_info.py | Python | apache-2.0 | 6,483 |
from __future__ import unicode_literals
from .models import lambda_backends
from ..core.models import base_decorator, deprecated_base_decorator
lambda_backend = lambda_backends["us-east-1"]
mock_lambda = base_decorator(lambda_backends)
mock_lambda_deprecated = deprecated_base_decorator(lambda_backends)
| william-richard/moto | moto/awslambda/__init__.py | Python | apache-2.0 | 305 |
#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
import psutil
import time
from sandesh.nodeinfo.cpuinfo.ttypes import ProcessCpuInfo
class WindowsProcessMemCpuUsageData(object):
def __init__(self, pid, last_cpu, last_time):
self.last_cpu = last_cpu
self.last_time = last_time
... | rombie/contrail-controller | src/nodemgr/common/windows_process_mem_cpu.py | Python | apache-2.0 | 1,375 |
# Copyright 2016 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | BaluDontu/docker-volume-vsphere | esx_service/utils/auth.py | Python | apache-2.0 | 13,215 |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | jaloren/robotframework | src/robot/libraries/BuiltIn.py | Python | apache-2.0 | 146,969 |
#!/usr/bin/env python
'''
5. Write a program that prompts a user for an IP address, then checks if the IP address is valid, and then converts the IP address to binary (dotted decimal format). Re-use the functions created in exercises 3 and 4 ('import' the functions into your new program).
'''
# Import functiosn - ip ... | laetrid/learning | First_course/ex6_5.py | Python | apache-2.0 | 736 |
from mergebot_frontend import app
from flask import abort, render_template, send_from_directory
from mergebot_frontend.models import Poller, QueuedItem, WorkItemStatus
@app.route("/")
def index():
"""Root handler for website; serves list of pollers.
Returns:
Index template with the list of active... | jasonkuster/merge-bot | mergebot_frontend/views.py | Python | apache-2.0 | 3,308 |
#!/usr/bin/env python
# -*- encoding: utf8 -*-
'''Program
'''
import sys
import math
__author__ = 'noahsark'
t = int(sys.stdin.readline().strip())
output = ''
for i in xrange(t):
n = int(sys.stdin.readline().strip())
answer = 0
for j in xrange(1, int(math.sqrt(n)) + 1):
if n % j == 0:
... | jimmylai/spoj | DIVSUM/DIVSUM.py | Python | apache-2.0 | 544 |
"""
Contains Mailman DAO implementations.
"""
from django.conf import settings
from restclients.dao_implementation import get_timeout
from restclients.dao_implementation.live import get_con_pool, get_live_url
from restclients.dao_implementation.mock import get_mockdata_url
class File(object):
"""
The File DA... | uw-it-aca/uw-restclients | restclients/dao_implementation/mailman.py | Python | apache-2.0 | 1,495 |
from __future__ import absolute_import
from docker import errors as d_errors
def key_from_image_name(image_name):
"""
>>> key_from_image_name('shipwright/blah:1234')
'1234'
"""
return image_name.split(':', 1)[1]
def key_from_image_info(image_info_dict):
"""
>>> key_from_image_info({
... | graingert/dockhand | shipwright/docker.py | Python | apache-2.0 | 1,348 |
rope = {'theta': [{'school': 'Choate', 'rope': (2, 4)}], 'mu': [{'rope': (-2, 2)}]}
axes = az.plot_forest(non_centered_data,
rope=rope,
var_names='~tau',
combined=True,
figsize=(9, 7))
axes[0].set_title('Estimate... | mcmcplotlib/mcmcplotlib | api/generated/arviz-plot_forest-2.py | Python | apache-2.0 | 350 |
#
# Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | enigmampc/catalyst | catalyst/finance/performance/position.py | Python | apache-2.0 | 7,850 |
# -*- coding: utf-8 -*-
import collections
import httplib as http
import pytz
from flask import request
from modularodm import Q
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_logged_in
from framework.auth.utils import privacy_info_handle
from framework.forms.utils import san... | lamdnhan/osf.io | website/project/views/comment.py | Python | apache-2.0 | 8,811 |
class LinkedListNode:
def __init__(self, value):
self.value = value
self.next = None
def reverseLinkedList(head):
originalPointer = head
newHead = None
secondNew = None
while originalPointer != None:
newHead = originalPointer
originalPointer = originalPointer.nex... | katchengli/tech-interview-prep | interview_cake/ic24.py | Python | apache-2.0 | 777 |
"""
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | airbnb/streamalert | streamalert_cli/test/handler.py | Python | apache-2.0 | 22,898 |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
# This file deals with the ifmap id handling for both vnc-user-visible entities
# and bgp-visible entities
import uuid
import re
import StringIO
from lxml import etree
from ifmap.client import client, namespaces
from ifmap.request import NewSessionRe... | sysbot/contrail-controller | src/config/common/imid.py | Python | apache-2.0 | 8,002 |
# -*- 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),
('core', '0015_auto_20150928_0850'),
]
... | hultberg/ppinnlevering | core/migrations/0016_auto_20151001_0714.py | Python | apache-2.0 | 843 |
import os
import sys
import shutil
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import init_ops
from tensorflow.contrib.layers.python.layers import regularizers
module_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")
if module_path not in sys.path:
sys.path.append(mod... | kabrapratik28/DeepVideos | model/model_GAN_8.py | Python | apache-2.0 | 38,127 |
# coding: utf-8
#
# Copyright 2017 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | prasanna08/oppia-ml | core/classifiers/TextClassifier/text_classifier_test.py | Python | apache-2.0 | 2,185 |
# Copyright (c) 2016 Stratoscale, 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 ... | ge0rgi/cinder | cinder/tests/unit/api/v3/test_volume_manage.py | Python | apache-2.0 | 8,439 |
# -*- coding: utf-8 -*-
from troubleshooting.framework.output.output import OutPut
from troubleshooting.framework.libraries.library import singleton
from troubleshooting.framework.modules.configuration import ConfigManagerInstance
@singleton
class welcome(object):
def __init__(self):
super(self.__class__... | gaoxiaofeng/troubleShooting | src/troubleshooting/framework/output/welcome.py | Python | apache-2.0 | 2,569 |
# Copyright 2018, The TensorFlow Federated 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 o... | tensorflow/federated | tensorflow_federated/python/learning/model.py | Python | apache-2.0 | 12,401 |
# 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... | AlexOugh/horizon | openstack_dashboard/nikola_auth/backend.py | Python | apache-2.0 | 9,701 |
import asyncio
import asyncio.streams
from .client_exceptions import (ClientOSError, ClientPayloadError,
ClientResponseError, ServerDisconnectedError)
from .http import HttpResponseParser, StreamWriter
from .streams import EMPTY_PAYLOAD, DataQueue
class ResponseHandler(DataQueue, asyn... | alex-eri/aiohttp-1 | aiohttp/client_proto.py | Python | apache-2.0 | 6,070 |
#
# corpusbuilder.py
# Builds and extends a news corpus stored in SQLite
# Gareth Dwyer, 2016
# # # # # # # # # # # # # #
# standard imports
# third party imports
import newspaper
# local imports
import config
from article import Article
from common import log
from dbhelper import DBHelper
from publisher import Pu... | sixhobbits/CorpusBuilder | corpusbuilder.py | Python | apache-2.0 | 1,608 |
# Copyright 2016 Tesora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | Tesora-Release/tesora-trove-dashboard | trove_dashboard/content/databases/logs/urls.py | Python | apache-2.0 | 1,148 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | dmlc/tvm | tests/python/relay/aot/aot_test_utils.py | Python | apache-2.0 | 30,132 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 o... | openstack/trove | trove/tests/unittests/backup/test_backup_models.py | Python | apache-2.0 | 26,428 |
#
# Copyright 2014 Cisco 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 law or agreed to in writ... | openstack/ceilometer | ceilometer/network/services/lbaas.py | Python | apache-2.0 | 15,220 |
# Lint as: python3
# pylint: disable=g-bad-file-header
# Copyright 2020 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.a... | deepmind/deepmind-research | option_keyboard/gpe_gpi_experiments/run_regressed_w_fig4b.py | Python | apache-2.0 | 3,094 |
import logging
from pathlib import Path
from pymerra2 import download
# Here we process multiple variables at a time to avoid downloading
# original data twice (all these variables are in the same files).
# These variables names are user choices, their merra-2 equivalent are
# specified below or in the default pymerra... | bstdenis/pymerra2 | scripts/merra2_subdaily_download.py | Python | apache-2.0 | 1,774 |
import sys
import os
import shutil as sh
import logging as log
import multiprocessing as mp
import ex.util as eu
from OMOP import OMOP
import base
eu.InitLog(log.INFO)
dat_dest="D:/Documents/DataSet/omop/simulation/"
# dat_dest="~/h/data/omop/simulation/"
def DoTask(configs):
modifier=configs[0]
folder=bas... | excelly/xpy-ml | omop/simu_flow.py | Python | apache-2.0 | 2,109 |
# Copyright 2013 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 ... | rememberlenny/google-course-builder | tools/etl/etl.py | Python | apache-2.0 | 30,584 |
#!/usr/bin/env python
import sys
import os
import re
from lib2to3.pgen2.driver import Driver
from lib2to3 import pygram, pytree
from lib2to3.pytree import Node, Leaf, type_repr
from lib2to3.pygram import python_symbols
def sym_type(name):
return getattr(python_symbols, name)
def new_node(name):
return Node(... | anandology/pyjamas | pyjs/src/pyjs/translator_dict.py | Python | apache-2.0 | 117,085 |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from scheduler.views.rest_dispatch import RESTDispatch
from uw_r25.spaces import get_spaces, get_space_by_id
import logging
logger = logging.getLogger(__name__)
class Space(RESTDispatch):
def __init__(self):
self._sp... | uw-it-aca/django-panopto-scheduler | scheduler/views/api/space.py | Python | apache-2.0 | 1,252 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | jcfr/girder | girder/api/api_main.py | Python | apache-2.0 | 1,856 |
from django.db import models
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length = 255)
def __str__(self):
return self.name | jojoriveraa/titulacion-NFCOW | NFCow/categories/models.py | Python | apache-2.0 | 170 |