code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# Copyright (C) 2016 Nippon Telegraph and Telephone 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 appli... | osrg/bgperf | quagga.py | Python | apache-2.0 | 5,099 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Aloomaio/googleads-python-lib | examples/ad_manager/v201805/network_service/get_all_networks.py | Python | apache-2.0 | 1,350 |
# Copyright 2021 The Waymo Open Dataset 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... | waymo-research/waymo-open-dataset | waymo_open_dataset/metrics/ops/motion_metrics_ops_test.py | Python | apache-2.0 | 13,287 |
from __future__ import unicode_literals
import os
from mopidy import config, exceptions, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.di... | jeh/mopidy-gmusic | mopidy_gmusic/__init__.py | Python | apache-2.0 | 976 |
import types
import unittest
from collections import namedtuple
import mock
from plugins.systems.config_container_crawler import ConfigContainerCrawler
from plugins.systems.config_host_crawler import ConfigHostCrawler
from plugins.systems.connection_container_crawler import ConnectionContainerCrawler
from plugins.syst... | sastryduri/agentless-system-crawler | tests/unit/test_plugins.py | Python | apache-2.0 | 69,027 |
#########
# Copyright (c) 2019 Cloudify Platform Ltd. 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... | cloudify-cosmo/cloudify-manager | rest-service/manager_rest/test/security_utils.py | Python | apache-2.0 | 3,245 |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | DataONEorg/d1_python | client_onedrive/src/d1_onedrive/impl/resolver/__init__.py | Python | apache-2.0 | 814 |
from __future__ import absolute_import
import logging
import struct
import six
from six.moves import xrange
import kafka.common
import kafka.protocol.commit
import kafka.protocol.fetch
import kafka.protocol.message
import kafka.protocol.metadata
import kafka.protocol.offset
import kafka.protocol.produce
from kafka... | gamechanger/kafka-python | kafka/protocol/legacy.py | Python | apache-2.0 | 14,397 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | openstack/horizon | openstack_dashboard/dashboards/admin/overview/tests.py | Python | apache-2.0 | 8,099 |
# 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... | apache/incubator-airflow | tests/always/test_project_structure.py | Python | apache-2.0 | 17,394 |
#!/bin/python3
def aVeryBigSum(n, ar):
return sum(ar)
n = int(input().strip())
ar = list(map(int, input().strip().split(' ')))
result = aVeryBigSum(n, ar)
print(result)
| sazzadBuet08/programming-contest | hackar_rank/infolytx_mock_hackar_rank/ABigSum.py | Python | apache-2.0 | 176 |
#!/usr/bin/python2
#
# Copyright 2012 Abid Hasan Mujtaba
#
# 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... | abid-mujtaba/fetchheaders | fetchheaders.py | Python | apache-2.0 | 20,367 |
#!/usr/bin/env python
"""Tests for constructing supercell models."""
import itertools
import numpy as np
from numpy.testing import assert_allclose
import pytest
from parameters import KPT, T_VALUES
import tbmodels
def get_equivalent_k(k, supercell_size):
return itertools.product(
*[
(np.li... | Z2PackDev/TBmodels | tests/test_supercell.py | Python | apache-2.0 | 4,214 |
# -*- coding:utf-8 -*-
from .inception import InceptionDao
from .models import DataMaskingRules, DataMaskingColumns
from simplejson import JSONDecodeError
import simplejson as json
import re
inceptionDao = InceptionDao()
class Masking(object):
# 脱敏数据
def data_masking(self, cluster_name, db_name, sql, sql_res... | jly8866/archer | sql/data_masking.py | Python | apache-2.0 | 16,236 |
import Tkinter as tk
def foo(*args):
print "foo!", args
import sys; sys.stdout.flush()
def __extend__(app):
extension = KeywordExtension(app)
app.bind_class("all", "<F5>", extension.make_keyword)
# this needs to add something to the tools menu...
class KeywordExtension(object):
def __init__(se... | boakley/robotframework-workbench | rwb/editor/extensions/keywords.py | Python | apache-2.0 | 1,061 |
"""This example demonstrates the usage of SigOpt with Ray Tune.
It also checks that it is usable with a separate scheduler.
"""
import sys
import time
from ray import tune
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.sigopt import SigOptSearch
def evaluate(step, width, height):
... | ray-project/ray | python/ray/tune/examples/sigopt_example.py | Python | apache-2.0 | 2,215 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dannysite_web.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| manyunkai/dannysite4 | src/manage.py | Python | apache-2.0 | 256 |
from hazelcast.protocol.builtin import FixSizedTypesCodec, CodecUtil
from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import END_FRAME_BUF, END_FINAL_FRAME_BUF, SIZE_OF_FRAME_LENGTH_AND_FLAGS, create_initial_buffer_custom
from hazelcast.sql import SqlColumnMetadata
from hazelcast.protoc... | hazelcast/hazelcast-python-client | hazelcast/protocol/codec/custom/sql_column_metadata_codec.py | Python | apache-2.0 | 1,925 |
# -*- 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/metadata_service/async_client.py | Python | apache-2.0 | 145,760 |
#!/usr/bin/env python
# Copyright 2019 The PySCF Developers. 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... | sunqm/pyscf | pyscf/tools/test/test_cubegen.py | Python | apache-2.0 | 2,994 |
# Copyright 2014 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | ShaperTools/openhtf | openhtf/core/test_descriptor.py | Python | apache-2.0 | 18,718 |
"""Component for interacting with a Lutron Caseta system."""
from __future__ import annotations
import asyncio
import contextlib
import logging
import ssl
import async_timeout
from pylutron_caseta import BUTTON_STATUS_PRESSED
from pylutron_caseta.smartbridge import Smartbridge
import voluptuous as vol
from homeassis... | mezz64/home-assistant | homeassistant/components/lutron_caseta/__init__.py | Python | apache-2.0 | 10,684 |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Generate SystemVerilog designs from IpBlock object"""
import logging as log
import os
from typing import Dict, Optional, Tuple
from mako import exceptions # type: igno... | lowRISC/opentitan | util/reggen/gen_rtl.py | Python | apache-2.0 | 5,763 |
import json
from typing import Tuple
from great_expectations.core.id_dict import IDDict
class MetricConfiguration:
def __init__(
self,
metric_name: str,
metric_domain_kwargs: dict,
metric_value_kwargs: dict = None,
metric_dependencies: dict = None,
):
self._met... | great-expectations/great_expectations | great_expectations/validator/metric_configuration.py | Python | apache-2.0 | 2,379 |
class TimestampAntiStealingLinkConfig(dict):
def __init__(self, json):
if json is not None:
if 'enabled' in json.keys():
self.enabled = json['enabled']
else:
self.enabled = None
if 'primaryKey' in json.keys():
self.primary_key = json['primaryKey']
else:
self... | XiaoMi/galaxy-fds-sdk-python | fds/model/timestamp_anti_stealing_link_config.py | Python | apache-2.0 | 1,037 |
#!/usr/bin/python
## Download files from Amazon S3 (e.g. raw photos for 3D models)
## Andy Bevan 15-Jun-2014, updated 21-Nov-2014
## Daniel Pett updated 05-Jan-2016
__author__ = 'ahb108'
## Currently for Python 2.7.5 (tested on MacOSX 10.9.2) launched in a virtual environment:
from PIL import Image # Pillow with libj... | MicroPasts/MicroPasts-Scripts | photoMasking/photoMasking.py | Python | apache-2.0 | 4,679 |
#!/usr/bin/env python
# coding: utf-8
#copyRight by heibanke
import csv
import re
csvfile = open('beijing_jt.csv','r')
reader = csv.reader(csvfile)
# reader.next() only can use in py2
next(reader)
jt_info = next(reader)
print(jt_info[1].decode('utf-8'))
csvfile.close()
# convert stati... | heibanke/python_do_something | Code/Chapter2/homework2-4_csv_ex.py | Python | apache-2.0 | 647 |
# 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 | ptopk_patch_selection/lib/data.py | Python | apache-2.0 | 11,369 |
#
# 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... | vinodkc/spark | python/pyspark/rdd.py | Python | apache-2.0 | 126,212 |
# Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... | HybridF5/jacket | jacket/tests/compute/unit/virt/libvirt/volume/test_volume.py | Python | apache-2.0 | 11,446 |
# Copyright 2017 The Forseti Security 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 ap... | forseti-security/forseti-security | tests/scanner/scanners/forwarding_rule_rules_scanner_test.py | Python | apache-2.0 | 7,464 |
# coding=utf-8
# Copyright 2020 Microsoft and the HuggingFace Inc. 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... | huggingface/transformers | src/transformers/models/deberta/tokenization_deberta.py | Python | apache-2.0 | 10,189 |
"""Support for LaMetric notifications."""
import logging
from requests.exceptions import ConnectionError as RequestsConnectionError
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService)
from homeassistant.const import CONF_ICON
imp... | jamespcole/home-assistant | homeassistant/components/lametric/notify.py | Python | apache-2.0 | 4,402 |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import json
import os
import sys
from argparse import ArgumentTypeError
from datetime import datetime, timedelta
from c7n import cli, version, commands
from c7n.resolver import ValuesFrom
from c7n.resources import aws
from c7n.schema impor... | alfredgamulo/cloud-custodian | tests/test_cli.py | Python | apache-2.0 | 21,634 |
#!/usr/bin/env python
#
# Copyright 2016 Hannes Juutilainen
#
# 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... | hjuutilainen/autopkg-virustotalanalyzer | VirusTotalAnalyzer/VirusTotalAnalyzer.py | Python | apache-2.0 | 12,577 |
import os
import subprocess
import errno
from JumpScale import j
PIPE = subprocess.PIPE
if subprocess.mswindows:
from win32file import ReadFile, WriteFile
from win32pipe import PeekNamedPipe
import msvcrt
else:
import select
import fcntl
if j.core.platformtype.myplatform.isLinux():
try:
... | Jumpscale/jumpscale_core8 | lib/JumpScale/tools/expect/Expect.py | Python | apache-2.0 | 25,028 |
#
# Copyright 2013 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... | jimgoo/zipline-fork | zipline/errors.py | Python | apache-2.0 | 12,167 |
# Copyright 2011 Chris Davis
#
# 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, so... | graphite-project/ceres | ceres.py | Python | apache-2.0 | 31,634 |
# -*- 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-domains | samples/generated_samples/domains_v1_generated_domains_delete_registration_sync.py | Python | apache-2.0 | 1,539 |
from Bio import SeqIO
import sys, string
fasta_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.fa" # Input fasta file
result_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.filtered.fa" # Output f... | nsalomonis/AltAnalyze | import_scripts/filterFASTA.py | Python | apache-2.0 | 619 |
def getitem(v,d):
"Returns the value of entry d in v"
assert d in v.D
return v.f[d] if d in v.f else 0
def setitem(v,d,val):
"Set the element of v with label d to be val"
assert d in v.D
v.f[d] = val
def equal(u,v):
"Returns true iff u is equal to v"
assert u.D == v.D
union = set(u... | tri2sing/LinearAlgebraPython | vec.py | Python | apache-2.0 | 3,573 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | wallnerryan/quantum_migrate | quantum/agent/linux/external_process.py | Python | apache-2.0 | 3,644 |
# -*- 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-compute | google/cloud/compute_v1/services/global_public_delegated_prefixes/pagers.py | Python | apache-2.0 | 3,216 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Microsoft Office MRUs Windows Registry plugin."""
import unittest
from plaso.formatters import officemru # pylint: disable=unused-import
from plaso.formatters import winreg # pylint: disable=unused-import
from plaso.lib import eventdata
from plaso.lib impor... | dc3-plaso/plaso | tests/parsers/winreg_plugins/officemru.py | Python | apache-2.0 | 3,793 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Mirantis 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
#
#... | r-icarus/openstack_microserver | openstack_dashboard/dashboards/project/vpn/tests.py | Python | apache-2.0 | 12,792 |
# Copyright 2014 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 ... | raybuhr/python-docs-samples | appengine/ndb/modeling/tests/test_relation_model_models.py | Python | apache-2.0 | 2,319 |
import os.path
from uuid import uuid4
import shutil
import logging
logger = logging.getLogger(__name__)
_MARKER = object()
class FileUploadTempStore(object):
session_storage_slug = 'websauna.tempstore'
def __init__(self, request):
self.tempdir = request.registry.settings['websauna.uploads_tempdir'... | enkidulan/enkiblog | src/enkiblog/core/deform/tempstorage.py | Python | apache-2.0 | 2,365 |
# -*- coding: utf-8 -*-
# There are tests here with unicode string literals and
# identifiers. There's a code in ast.c that was added because of a
# failure with a non-ascii-only expression. So, I have tests for
# that. There are workarounds that would let me run tests for that
# code without unicode identifiers and ... | batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/test_fstring.py | Python | apache-2.0 | 47,266 |
import tensorflow as tf
import os
import sys
from copy import copy
from model.pipeline import Pipeline
from tensorflow.python import debug as tf_debug
if __name__ == "__main__":
num_keypoints = 30
patch_feature_dim = 8
decoding_levels = 5
kp_transform_loss = 1e4
base_recon_weight = 0.1
reco... | YutingZhang/lmdis-rep | exp-ae-celeba-mafl-30.py | Python | apache-2.0 | 2,477 |
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | openstack/tempest | tempest/api/compute/floating_ips/test_list_floating_ips_negative.py | Python | apache-2.0 | 1,663 |
"""Controlles a bunch of remotes."""
import asyncio
import functools
import logging
import os
import pathlib
import signal
import sys
import traceback
from implant import commands, connect, core, testing
log = logging.getLogger(__name__)
PLUGINS_ENTRY_POINT_GROUP = 'implant.plugins'
def parse_command(line):
"""... | diefans/debellator | src/implant/master.py | Python | apache-2.0 | 5,656 |
#!/usr/bin/env python3
from argparse import ArgumentParser
from os import environ
from sys import argv
from requests import put
def read_file(file_path): # pragma: no cover
with open(file_path, 'rb') as f:
return f.read()
def upload(file_path, repository, repository_path, url, username, password):
... | bjuvensjo/scripts | vang/nexus3/upload.py | Python | apache-2.0 | 1,766 |
from ghizmo.commands import lib
def tags(config, args):
"""
List all tags.
"""
return config.repo.tags()
def show_tags(config, args):
"""
Show info for tags supplied on stdin.
"""
for item in lib.input_json_lines():
yield config.repo.tag(item)
def _delete_ref(repo, ref_name, force, dry_run):
... | jlevy/ghizmo | ghizmo/commands/repo.py | Python | apache-2.0 | 3,040 |
import doctest
from maiden import config
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(config))
return tests
| oozappa/maiden | tests/__init__.py | Python | apache-2.0 | 148 |
"""
This module holds models related to benefits features and configurations
"""
from django import forms
from django.db import models
from django.db.models import UniqueConstraint
from django.urls import reverse
from polymorphic.models import PolymorphicModel
from sponsors.models.assets import ImgAsset, TextAsset, Fi... | manhhomienbienthuy/pythondotorg | sponsors/models/benefits.py | Python | apache-2.0 | 20,095 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# quicksorts.py (C) myke, 2015
# 2015-11-08 1.1
# various versions of quicksort alogo
import random
TIMES = 10
SIZE = 10
RANGE = 10
# -----------------------------------------------
def qs1 (al):
""" Algo quicksort for a list
"""
if not al:
return ... | mykespb/pythoner | quicksorts.py | Python | apache-2.0 | 1,354 |
# Copyright 2014 Baidu, 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, softwa... | baidubce/bce-sdk-python | baidubce/services/tsdb/tsdb_handler.py | Python | apache-2.0 | 1,744 |
import cPickle
point_table = {}
point_table[( 4, 4)] = 400.
point_table[( 3, 4)] = 270.
point_table[( 2, 4)] = 170.
point_table[( 1, 4)] = 100.
point_table[( 0, 4)] = 0.
point_table[(-1, 4)] = 0.
point_table[(-2, 4)] = 0.
point_table[(-3, 4)] = 0.
point_table[(-4, 4)] = 0.
point_table[( 4, 3)] = 240.
point_table[( 3,... | lshuo/WC2014_bet | src/set_zhihu_point_table.py | Python | apache-2.0 | 2,291 |
import sys
import os
import subprocess
import filter_remapped_reads
import util
#
# filter_remapped_reads.py
# INPUT FILES:
# to_remap_bam - input BAM file containing original set of reads
# that need to be remapped after having their alleles flipped
#
# remap_bam - input BAM file containing rem... | smozaffari/WASP | mapping/test_filter_remapped_reads.py | Python | apache-2.0 | 18,537 |
"""Contains function for calculating BERT embeddings"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import re
import torch
from torch.utils.data import TensorDataset, DataLoader, SequentialSampler
from torch.utils.data.dis... | googleinterns/contextual-adjectives | categorize_adjectives/libraries/bert_embeddings.py | Python | apache-2.0 | 5,343 |
# Copyright 2020 Makani Technologies 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... | google/makani | analysis/control/flap_limits.py | Python | apache-2.0 | 6,670 |
#!/usr/bin/env python3
# Copyright 2021 Anapaya Systems
#
# 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... | netsec-ethz/scion | acceptance/cert_renewal/test.py | Python | apache-2.0 | 9,210 |
# Generated by Django 2.2.4 on 2019-08-07 19:56
import awx.main.utils.polymorphic
import awx.main.fields
from django.db import migrations, models
import django.db.models.deletion
from awx.main.migrations._rbac import (
rebuild_role_parentage, rebuild_role_hierarchy,
migrate_ujt_organization, migrate_ujt_organ... | GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awx/main/migrations/0109_v370_job_template_organization_field.py | Python | apache-2.0 | 3,857 |
#!/home/jojoriveraa/Dropbox/Capacitación/Platzi/Python-Django/NFCow/venv/bin/python3
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| jojoriveraa/titulacion-NFCOW | venv/bin/django-admin.py | Python | apache-2.0 | 192 |
# -*- 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 | google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc.py | Python | apache-2.0 | 18,035 |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import Iterable, Optional, Tuple
from pants.backend.python.target_types i... | benjyw/pants | src/python/pants/backend/python/typecheck/mypy/rules.py | Python | apache-2.0 | 13,525 |
import os
import posixpath
import random
import string
import logging
import tempfile
import time
from .extract_images import ExtractImages
logger = logging.getLogger(__name__)
class ExtractImagesToS3(ExtractImages):
'''
This KnowledgePostProcessor subclass extracts images from posts to S3. It
is desig... | airbnb/knowledge-repo | knowledge_repo/postprocessors/extract_images_to_s3.py | Python | apache-2.0 | 2,903 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | DirectXMan12/nova-hacking | nova/scheduler/chance.py | Python | apache-2.0 | 4,443 |
# Copyright 2013 Gert Kremer
#
# 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... | schubergphilis/twitterwall | tweety/basic_auth.py | Python | apache-2.0 | 4,682 |
# =============================================================================
# Copyright (c) 2016, Cisco Systems, 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 ... | kstaniek/csm | csmserver/platform_matcher.py | Python | apache-2.0 | 8,457 |
# Copyright 2012 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 ... | ksh/gpirecertification | controllers/assessments.py | Python | apache-2.0 | 11,743 |
# Copyright 2013 Dell 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 app... | citrix-openstack-build/neutron-fwaas | neutron_fwaas/tests.skip/unit/services/firewall/drivers/linux/test_iptables_fwaas.py | Python | apache-2.0 | 11,580 |
# Copyright 2020 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... | tensorflow/examples | tensorflow_examples/lite/model_maker/core/data_util/object_detector_dataloader.py | Python | apache-2.0 | 15,144 |
from . import families
from .glm import glm, linear_component, plot_posterior_predictive
| wanderer2/pymc3 | pymc3/glm/__init__.py | Python | apache-2.0 | 89 |
# -*- 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_participants_list_suggestions_async.py | Python | apache-2.0 | 1,546 |
from __future__ import unicode_literals
import logging
import os
from mopidy import config, ext
__version__ = '0.3.0'
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = 'Mopidy-Webhooks'
ext_name = 'webhooks'
version = __version__
def get_default_config(self):
... | pombredanne/mopidy-webhooks | mopidy_webhooks/__init__.py | Python | apache-2.0 | 877 |
# Copyright 2014 Rackspace
#
# 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... | brandonlogan/octavia | octavia/db/migration/alembic_migrations/versions/4c094013699a_update_load_balancer_amphora.py | Python | apache-2.0 | 2,518 |
"""Unit test for directory watcher (inotify).
"""
import errno
import os
import shutil
import tempfile
import select
import unittest
# Disable W0611: Unused import
import tests.treadmill_test_deps # pylint: disable=W0611
import mock
from treadmill import idirwatch
class DirWatcherTest(unittest.TestCase):
"""... | toenuff/treadmill | tests/idirwatcher_test.py | Python | apache-2.0 | 2,182 |
from webfs import WebFSStat
import stat
def Test_Basic():
fields = ('st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid', 'st_gid',
'st_size', 'st_atime', 'st_mtime', 'st_ctime')
st = WebFSStat()
print st.__dict__.keys()
for field in fields:
assert field in st.__dict__.keys(), 'fi... | harun-emektar/webfs | tests/Test_WebFSStat.py | Python | apache-2.0 | 655 |
import os
import shutil
import logging
from getpass import getuser
from dls_ade import vcs_git, Server
from dls_ade.exceptions import (RemoteRepoError, VerificationError,
ArgumentError)
class ModuleCreator(object):
"""Abstract base class for the management of the creation of new m... | dls-controls/dls_ade | dls_ade/module_creator.py | Python | apache-2.0 | 17,511 |
from awxkit.api.resources import resources
from . import base
from . import page
class Setting(base.Base):
pass
page.register_page([resources.setting,
resources.settings_all,
resources.settings_authentication,
resources.settings_changed,
... | GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awxkit/awxkit/api/pages/settings.py | Python | apache-2.0 | 1,336 |
import json
import apiai
CLIENT_ACCESS_TOKEN = 'api key'
def nlu(mytext):
ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)
request = ai.text_request()
request.lang = 'en' # optional, default value equal 'en'
# request.session_id = "<SESSION ID, UBIQUE FOR EACH USER>"
request.query = myte... | mzmmoazam/DrawBot | nlu.py | Python | apache-2.0 | 2,221 |
import argparse
import logging
import os
import sys
from mpi4py import MPI
from pandayoda.yodacore import Yoda
from pandayoda.yodaexe import Droid
import logging
logging.basicConfig(level=logging.DEBUG)
def main(globalWorkDir, localWorkDir):
comm = MPI.COMM_WORLD
mpirank = comm.Get_rank()
# Create sep... | RRCKI/pilot | HPC/HPCJob.py | Python | apache-2.0 | 1,933 |
# 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, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import itertools
imp... | kslundberg/pants | src/python/pants/backend/codegen/tasks/protobuf_gen.py | Python | apache-2.0 | 13,284 |
# -*- coding: utf-8 -*-
"""
Copyright 2010 cloudControl UG (haftungsbeschraenkt)
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
... | cloudControl/cctrl | cctrl/user.py | Python | apache-2.0 | 8,933 |
# Copyright 2015 Metaswitch Networks
#
# 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... | alexhersh/libcalico | calico_containers/pycalico/ipam.py | Python | apache-2.0 | 36,358 |
# Copyright (c) 2016 Cisco Systems
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | noironetworks/aci-integration-module | aim/tools/cli/commands/config.py | Python | apache-2.0 | 1,450 |
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... | gogoair/foremast | src/foremast/awslambda/api_gateway_event/__init__.py | Python | apache-2.0 | 661 |
import unittest
from os import path
from API.directoryscanner import find_runs_in_directory
path_to_module = path.abspath(path.dirname(__file__))
class TestDirectoryScanner(unittest.TestCase):
def test_sample_names_spaces(self):
runs = find_runs_in_directory(path.join(path_to_module, "sample-names-with-s... | phac-nml/irida-miseq-uploader | Tests/unitTests/test_directoryscanner.py | Python | apache-2.0 | 1,282 |
#!/usr/bin/env python
"""Messages are written to stdout instead of the normal stderr.
"""
import logging
from themelog import init_log
logger = logging.getLogger()
init_log(stdout=True)
logger.debug('This is a debug message')
logger.info('This is a info message')
logger.warning('This is a warning message')
logger.erro... | mjem/themelog | tests/test_stdout.py | Python | apache-2.0 | 395 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | ClusterHQ/libcloud | libcloud/dns/drivers/zerigo.py | Python | apache-2.0 | 18,252 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | fangxingli/hue | desktop/libs/liboozie/src/liboozie/submittion2_tests.py | Python | apache-2.0 | 12,471 |
from sys import argv
script, filename = argv
print "We're going to erase %r." % filename
print "If you don't want that, hit CTRL-C (^C)."
print "If you do want that, hit RETURN."
raw_input("?")
print "Opening the file..."
target = open(filename,'w')
print "Truncating the file. Goodbye!"
target.truncate()
print "N... | CodeSheng/LPLHW | ex16-3.py | Python | apache-2.0 | 619 |
# -*- 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/types/featurestore_service.py | Python | apache-2.0 | 56,061 |
# -*- coding: utf-8 -*-
__author__ = 'Ostico <ostico@gmail.com>'
import unittest
import os
os.environ['DEBUG'] = "1"
os.environ['DEBUG_VERBOSE'] = "0"
import pyorient
class CommandTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(CommandTestCase, self).__init__(*args, **kwargs)
... | orientechnologies/pyorient | tests/test_record_contents.py | Python | apache-2.0 | 12,906 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
# -*- coding: utf-8 -*-
import os
from django_nyt import VERSION
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, be... | spookylukey/django-nyt | setup.py | Python | apache-2.0 | 2,187 |
# May you do good and not evil
# May you find forgiveness for yourself and forgive others
# May you share freely, never taking more than you give. -- SQLite source code
#
# As we enjoy great advantages from the inventions of others, we should be glad
# of an opportunity to serve others by an invention of ours, and thi... | ownport/storages | storages/packages/peewee.py | Python | apache-2.0 | 136,615 |
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, 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 applicabl... | markmcclain/astara | akanda/rug/api/configuration.py | Python | apache-2.0 | 6,984 |
import os
from setuptools import find_packages
from setuptools import setup
version = '1.0'
install_requires = [
]
tests_require = install_requires + ['Sphinx', 'docutils',
'virtualenv', 'nose', 'coverage']
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open... | Packetslave/strava | setup.py | Python | apache-2.0 | 1,182 |
"""Classification training"""
import os, sys
sys.path.append('../')
sys.path.append('../models/')
sys.path.append('../util/')
import time
import json
import importlib
import argparse
import tensorflow as tf
import numpy as np
from input_data import Data
def optimization(learning_rate, loss):
"""Defines the opt... | Lazea/TensorFlow | classification/classification_train.py | Python | apache-2.0 | 3,781 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.