code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/python
#
# Copyright 2008 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 app... | kdlucas/pyrering | lib/pyreringconfig.py | Python | apache-2.0 | 10,508 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/lldp/lldpparam.py | Python | apache-2.0 | 5,812 |
__author__ = 'BeyondSky'
from collections import defaultdict
class Solution(object):
def getHint(self, secret, guess):
"""
:type secret: str
:type guess: str
:rtype: str
"""
bulls = cows = 0
digits = defaultdict(int)
# first pass: count bulls and non... | BeyondSkyCoder/BeyondCoder | leetcode/python/bulls_and_cows.py | Python | apache-2.0 | 1,021 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | google-research/language | language/mentionmemory/utils/test_utils.py | Python | apache-2.0 | 4,490 |
'''
More information at: http://www.pymolwiki.org/index.php/elbow_angle
Calculate the elbow angle of an antibody Fab complex and optionally draw a
graphical representation of the vectors used to determine the angle.
NOTE: There is no automatic checking of the validity of limit_l and limit_h
values or of the assignm... | demharters/git_scripts | my_elbow_angle_tcr_imgt.py | Python | apache-2.0 | 7,744 |
# ====================================================================
# 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 re... | romanchyla/pylucene-trunk | test/test_RegexQuery.py | Python | apache-2.0 | 2,757 |
# 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 ... | illfelder/libcloud | libcloud/compute/drivers/ec2.py | Python | apache-2.0 | 256,785 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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
#
# ... | stdlib-js/stdlib | lib/node_modules/@stdlib/stats/base/dists/arcsine/ctor/benchmark/python/benchmark.scipy.py | Python | apache-2.0 | 5,040 |
# Copyright 2020 The FedLearner 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... | bytedance/fedlearner | fedlearner/data_join/raw_data_iter_impl/tf_record_iter.py | Python | apache-2.0 | 7,400 |
import os,re,fnmatch
from ehive.runnable.IGFBaseJobFactory import IGFBaseJobFactory
class FastqFileFactory(IGFBaseJobFactory):
'''
A job factory class for creating fan jobs for demultilexed fastq files
'''
def param_defaults(self):
params_dict=super(FastqFileFactory,self).param_defaults()
params_dict.u... | imperial-genomics-facility/data-management-python | ehive/runnable/jobfactory/FastqFileFactory.py | Python | apache-2.0 | 2,589 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = 'CwT'
from .global_state import State
Global = State()
| CvvT/crawler_sqlmap | crawler/util/__init__.py | Python | apache-2.0 | 120 |
# 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 | direction_net/dataset.py | Python | apache-2.0 | 15,616 |
# coding=utf-8
# Copyright 2016 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 requ... | google-research/tf-slim | tf_slim/data/parallel_reader.py | Python | apache-2.0 | 11,775 |
from osgeo import gdal, osr, ogr
import numpy as np
import scipy.misc
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("banner-generator")
def create_raster_from_band( red, green, blue, output_file):
logger.debug("Create big raster in output_file : %s"%output_file)
red_ds = gd... | yoms/sentinel-banner-generator | banner_generator.py | Python | apache-2.0 | 6,246 |
#encoding=utf-8
#一大类特征
from scipy import sparse
import re
class VectorEncoder(object):
def __init__(self):
self.n_size = 0
self.idmap = {}
def fit(self, X):
for row in X:
units = re.split("\\s+", row)
for unit in units:
if unit == '-1': unit = 'nul... | eryueniaobp/contest | encoder/VectorEncoder.py | Python | apache-2.0 | 1,662 |
"""Test study generator."""
from typing import Collection
from vizier.pyvizier import pythia as vz
def flat_space_with_all_types() -> vz.SearchSpace:
"""Search space with all parameter types."""
space = vz.SearchSpace()
root = space.select_root()
root.add_float_param('lineardouble', -1., 2.)
root.add_floa... | google/vizier | vizier/testing/test_studies.py | Python | apache-2.0 | 2,373 |
from bs4 import BeautifulSoup
class RunParameter_xml:
'''
A class for reading runparameters xml file from Illumina sequencing runs
:param xml_file: A runparameters xml file
'''
def __init__(self, xml_file):
self.xml_file = xml_file
self._read_xml()
def _read_xml(self):
'''
Internal funct... | imperial-genomics-facility/data-management-python | igf_data/illumina/runparameters_xml.py | Python | apache-2.0 | 3,007 |
# Copyright 2022 moco_beta
#
# 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... | mocobeta/janome | janome/system_dic.py | Python | apache-2.0 | 2,058 |
#!/bin/python3.5
from collections import Iterable
d = {'a':1, 'b':2, 'c':3}
for key in d:
print(key)
for value in d.values():
print(value)
for ch in 'ABC':
print(ch)
print(isinstance('abc', Iterable) )
print(isinstance(123,Iterable))
for i, value in enumerate(['a', 'b', 'c']):
print(i, value)
for x,y in [(1,1... | dronly/python | lxfpython/advance/do_iter.py | Python | apache-2.0 | 382 |
# 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 | gfsa/training/train_util.py | Python | apache-2.0 | 14,842 |
# Webhooks for external integrations.
from __future__ import absolute_import
from typing import Any, Dict, List, Optional, Text, Tuple
from django.utils.translation import ugettext as _
from django.db.models import Q
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from zerver.models... | j831/zulip | zerver/webhooks/jira/view.py | Python | apache-2.0 | 10,755 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | google/budou | budou/mecabsegmenter.py | Python | apache-2.0 | 3,631 |
# Django settings for ibistu_serverV2_webserver project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('admin', 'c0710204@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME':... | c0710204/Ibistu-serverV2 | webserver/ibistu_serverV2_webserver/ibistu_serverV2_webserver/settings.py | Python | apache-2.0 | 5,483 |
from ..PulsePrimitives import *
from ..Compiler import compile_to_hardware
from ..PulseSequencePlotter import plot_pulse_files
from .helpers import create_cal_seqs
from itertools import product
import operator
from ..ControlFlow import *
from ..TdmInstructions import *
from functools import reduce
from typing import It... | BBN-Q/QGL | QGL/BasicSequences/Feedback.py | Python | apache-2.0 | 12,237 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#---
#--- Python
import sys
import StringIO
import argparse
#---
#--- 3rd party
from redmine import Redmine
from redmine import exceptions as redmine_exceptions
#---
class ProjectTree(object) :
def __init__(self, allProjects ) :
self._projects = list(allProje... | uni-halle/python-redmine-tools | topic_index.py | Python | apache-2.0 | 11,227 |
import unittest
import logging
from domaincrawl.link_aggregator import LinkAggregator
from domaincrawl.link_filters import DomainFilter, is_acceptable_url_scheme
from domaincrawl.site_graph import SiteGraph
from domaincrawl.util import URLNormalizer, extract_domain_port
class LinkAggregatorTest(unittest.Tes... | planBrk/domaincrawler | test/test_link_aggregator.py | Python | apache-2.0 | 3,054 |
# 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 | non_semantic_speech_benchmark/distillation/compression_lib/compression_op.py | Python | apache-2.0 | 17,758 |
#!/usr/bin/env python
# standard library imports
# third party related imports
import factory
# local library imports
from mobile_push.db import Session, Topic
class TopicFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta(object):
model = Topic
sqlalchemy_session = Session
name =... | theKono/mobile-push | tests/factories/topic.py | Python | apache-2.0 | 422 |
from setuptools import setup
setup(
name='soundcurl',
version='0.1.0',
description='A command line utility for downloading songs from SoundCloud.',
author='Jeremy McKibben-Sanders',
author_email='jmckib2+soundcurl@gmail.com',
url='https://github.com/jmckib/soundcurl',
package_dir={'': 'src'... | jmckib/soundcurl | setup.py | Python | apache-2.0 | 490 |
from sqlalchemy import Column, ForeignKey, Integer, String, Text, DateTime, Float
from models import Base, Account
from sqlalchemy.orm import relationship
from datetime import datetime
# STOCK EXCHANGE
class Company(Base):
__tablename__ = 'companies'
code = Column(String(4), primary_key=True)
name = Colum... | skyman/YamScripts | YamTeller/yamsdaq_models.py | Python | apache-2.0 | 1,788 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2008 - 2012 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/... | rich-pixley/zoo-animals | statlog-rollup.py | Python | apache-2.0 | 3,874 |
'''
Create 2 VMs with same image. Then commit 2 new images from 2 VMs.
@author: Youyk
'''
import time
import os
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker... | zstackio/zstack-woodpecker | integrationtest/vm/virt_plus/image_store/test_crt_2_vms_imgs_from_same_img.py | Python | apache-2.0 | 2,414 |
# Copyright 2020 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from absl import app
from iree.tf.support import tf_test_utils
import numpy as np
import tensorflow.co... | google/iree | integrations/tensorflow/test/python/iree_tf_tests/uncategorized/linspace_test.py | Python | apache-2.0 | 1,322 |
# 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... | Huyuwei/tvm | python/tvm/relay/op/image/image.py | Python | apache-2.0 | 2,130 |
# -*- 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 | samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_async.py | Python | apache-2.0 | 1,721 |
from asynctnt_queue import Queue, Tube
from tests import BaseTarantoolTestCase
class QueueTestCase(BaseTarantoolTestCase):
async def test__queue_create(self):
q = Queue(self.conn)
self.assertEqual(q.conn, self.conn, 'conn valid')
def test__queue_get_tube(self):
q = Queue(self.conn)
... | igorcoding/asynctnt-queue | tests/test_queue.py | Python | apache-2.0 | 925 |
# -*- coding: utf-8 -*-
import django
import sys
from itertools import chain
from django import forms
from django.conf import settings
from django.db.models.query import QuerySet
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.html import conditional_es... | Venturi/oldcms | env/lib/python2.7/site-packages/sortedm2m/forms.py | Python | apache-2.0 | 4,668 |
# Fetch BoM gridded files from the Bureau server.
import sys
from datetime import datetime
import calendar
import subprocess
import os.path
R = 'http://www.bom.gov.au/web03/ncc/www/awap'
WGET = '/usr/bin/wget'
# Append yyyymmddyyyymmdd.grid.Z to these URLs to get the file
vars = {
'rain/day' : R+'/rainfall/totals/... | KimberleyOpie/common-tools | raw_data_tools/get_bom_grid.py | Python | apache-2.0 | 4,025 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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... | HewlettPackard/python-proliant-sdk | examples/Redfish/ex31_set_license_key.py | Python | apache-2.0 | 2,431 |
#
# (c) Copyright 2014 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
#
# Unle... | ChameleonCloud/horizon | openstack_dashboard/dashboards/admin/metadata_defs/forms.py | Python | apache-2.0 | 6,611 |
"""
URL routing for blogs, entries and feeds
"""
from django.conf.urls.defaults import patterns, url
from django.conf import settings
from feeds import LatestEntriesByBlog, LatestEntries #, EntryComments
from models import Blog
from views import generic_blog_entry_view, blog_detail
from viewpoint.settings import USE_C... | callowayproject/django-viewpoint | viewpoint/urls_defaultblog.py | Python | apache-2.0 | 2,705 |
"""A module to deal with processes."""
import datetime
def uptime(asstr = False):
"""Get system uptime>"""
raw = ''
with open('/proc/uptime','r') as ut:
raw = ut.read()[:-1]
uts = list(map(lambda x: int(float(x)), raw.split(' ')))
if asstr:
uts = str(datetime.timedelta(seconds = uts[0]))
return uts
| JoelBondurant/RandomCodeSamples | python/proc.py | Python | apache-2.0 | 312 |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from textwrap import dedent
from pants.backend.python import target_types_rules
from pants.backend.python.goals.lockfile import GeneratePythonLockfile
... | pantsbuild/pants | src/python/pants/backend/python/subsystems/ipython_test.py | Python | apache-2.0 | 3,096 |
# Copyright 2019 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | deepmind/dm_memorytasks | dm_memorytasks/_version.py | Python | apache-2.0 | 867 |
# Copyright (C) 2012 - 2014 EMC 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
#
# Unle... | Akrog/cinder | cinder/api/contrib/consistencygroups.py | Python | apache-2.0 | 14,556 |
#!/usr/bin/python
#
# Copyright 2007 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... | google/python_portpicker | src/tests/portpicker_test.py | Python | apache-2.0 | 16,155 |
#!/usr/bin/env python
"""
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")... | radicalbit/ambari | ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/package/scripts/upgrade.py | Python | apache-2.0 | 3,109 |
#
# Author: Endre Karlson <endre.karlson@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | billingstack/python-fakturo | fakturo/core/cli/base.py | Python | apache-2.0 | 3,279 |
# Copyright 2015 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 requir... | Tehsmash/networking-cisco | networking_cisco/plugins/cisco/l3/drivers/asr1k/asr1k_routertype_driver.py | Python | apache-2.0 | 33,133 |
# 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... | ismail-s/warehouse | tests/unit/packaging/test_services.py | Python | apache-2.0 | 9,105 |
import allure
from allure_commons_test.report import has_test_case
from allure_commons_test.result import with_status, with_message_contains, has_status_details
from hamcrest import assert_that
@allure.issue("376")
@allure.feature("Integration")
def test_pytest_check(allured_testdir):
"""
>>> import pytest_c... | allure-framework/allure-python | allure-pytest/test/integration/pytest_check/pytest_check_test.py | Python | apache-2.0 | 961 |
# Copyright 2013 Rackspace
#
# 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... | racker/python-raxcli | raxcli/concurrency/__init__.py | Python | apache-2.0 | 1,568 |
from django import forms
from utils.fields import SlugField
from utils.forms import (
BootstrapMixin,
JSONField,
SmallTextarea,
StaticSelect,
add_blank_choice,
)
from .enums import PasswordAlgorithm
from .models import Platform
class PlatformForm(BootstrapMixin, forms.ModelForm):
slug = Slug... | respawner/peering-manager | devices/forms.py | Python | apache-2.0 | 1,030 |
#! /usr/bin/env python
import sys, os, getopt, struct, unittest
from distutils.spawn import spawn
build = True
verbosity = 2
here = os.path.dirname(os.path.abspath(__file__))
os.chdir(here)
def bits():
"""determine if running on a 32 bit or 64 bit platform
"""
return struct.calcsize("P") * 8
# -- parse... | ioram7/keystone-federado-pgid2013 | build/greenlet/run-tests.py | Python | apache-2.0 | 1,321 |
"""Unit test for cgroup_service - Treadmill cgroup service.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import tempfile
import unittest
import select
import shutil
import mock
import treadmill
from... | captiosus/treadmill | tests/services/cgroup_service_test.py | Python | apache-2.0 | 6,163 |
import os
import stat
import time
from inaugurator import sh
class TargetDevice:
_found = None
@classmethod
def device(cls, candidates):
if cls._found is None:
cls._found = cls._find(candidates)
return cls._found
pass
@classmethod
def _find(cls, candidates):
... | eliran-stratoscale/inaugurator | inaugurator/targetdevice.py | Python | apache-2.0 | 1,263 |
import collections
import random
# Set the random seed so we see the same output each time
# the script is run.
random.seed(1)
d1 = collections.deque(maxlen=3)
d2 = collections.deque(maxlen=3)
for i in range(5):
n = random.randint(0, 100)
print('n =', n)
d1.append(n)
d2.appendleft(n)
print('D1... | jasonwee/asus-rt-n14uhp-mrtg | src/lesson_data_structures/collections_deque_maxlen.py | Python | apache-2.0 | 349 |
# Copyright 2016 Mirantis 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... | openstack/horizon | openstack_dashboard/contrib/developer/profiler/api.py | Python | apache-2.0 | 3,772 |
#!/usr/bin/python
#
# 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 b... | dietrichc/streamline-ppc-reports | examples/adwords/v201406/basic_operations/add_ad_groups.py | Python | apache-2.0 | 2,698 |
import pytest
import pytest
from cwltool.utils import onWindows
from .util import get_data, get_main_output, needs_docker
try:
from galaxy.tools import deps
except ImportError:
deps = None
@needs_docker
@pytest.mark.skipif(not deps, reason="galaxy-lib is not installed")
def test_biocontainers():
wflow... | dleehr/cwltool | tests/test_dependencies.py | Python | apache-2.0 | 1,496 |
# coding=utf-8
# Copyright 2019 The Google UDA Team 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/uda | image/randaugment/augmentation_transforms.py | Python | apache-2.0 | 14,832 |
# 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... | noironetworks/python-group-based-policy-client | gbpclient/tests/unit/test_cli20_natpool.py | Python | apache-2.0 | 4,756 |
import json
import os
from functools import wraps
from docker.utils.ports import split_port
from jsonschema import Draft4Validator
from jsonschema import FormatChecker
from jsonschema import ValidationError
from .errors import ConfigurationError
DOCKER_CONFIG_HINTS = {
'cpu_share': 'cpu_shares',
'add_host':... | Dakno/compose | compose/config/validation.py | Python | apache-2.0 | 8,262 |
# Copyright 2016 Capital One Services, 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... | RyanWolfe/cloud-custodian | tests/test_vpc.py | Python | apache-2.0 | 16,157 |
# 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... | chemelnucfin/tensorflow | tensorflow/python/feature_column/feature_column_v2.py | Python | apache-2.0 | 183,637 |
# Copyright 2013 - Red Hat, 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 writi... | jamesyli/solum | solum/common/exception.py | Python | apache-2.0 | 6,153 |
import subprocess
subprocess.call("""
adb -d shell am start -n com.android.gallery/com.android.camera.GalleryPicker
""")
| carabri/carabri | test_script/open_gallery.py | Python | apache-2.0 | 123 |
"""
Tools for sending email.
"""
import mimetypes
import os
import smtplib
import socket
import time
import random
from email import Charset, Encoders
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils i... | jamslevy/gsoc | app/django/core/mail.py | Python | apache-2.0 | 14,299 |
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax1 = fig.add_subplot(1, 2, 1, projection="3d")
x = np.linspace(-6 * np.pi, 6 * np.pi, 1000)
y = np.sin(x)
z = np.cos(x)
ax1.plot(x, y, z)
ax2 = fig.add_subplot(1, 2, 2, projection="3d")
X = np.arange(-2... | tongxindao/shiyanlou | shiyanlou_cs892/sub.py | Python | apache-2.0 | 469 |
# Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | quantumlib/Cirq | cirq-core/cirq/contrib/acquaintance/shift_swap_network_test.py | Python | apache-2.0 | 11,590 |
from elftools.dwarf.ranges import RangeEntry, BaseAddressEntry
from elftools.dwarf import constants
def get_die_offset_by_reference(referer_die, attrname, use_abstract_origin=True):
'''Return the offset of the DIE referred by the given attribute in the referrer DIE.'''
ref = referer_die.attributes.get(attrname... | Samsung/ADBI | idk/cachebuilder/dwarftools.py | Python | apache-2.0 | 6,162 |
# coding=utf-8
# Copyright 2022 The Deeplab2 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 ... | google-research/deeplab2 | model/builder_test.py | Python | apache-2.0 | 3,005 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 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 copy of ... | sutartmelson/girder | girder/utility/webroot.py | Python | apache-2.0 | 3,397 |
import json
import objects
from mifkit.util.mif_encoder import MifEncoder
from mifkit.util.case import keys_to_snake_case
from mifkit.util.case import to_capitalized_camel_case
def dump(mif_object, fp, **kwargs):
"""
Convert this object into a JSON-encoded string and save it in a file.
:param mif_object:... | CitrineInformatics/mifkit | mifkit/mif.py | Python | apache-2.0 | 3,890 |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.core.urlresolvers import reverse
from django.template import RequestContext, loader
from django.views.decorators.csrf import csrf_exempt
def index(request):
template = loader.get_template('index.html')
re... | osgee/django-web-demo | webdemo/views.py | Python | apache-2.0 | 1,352 |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.parties.PartyCogActivity
from panda3d.core import CollideMask, CollisionHandler, CollisionHandlerEvent, CollisionNode, CollisionSphere, NodePath, Point3, TextNode, Texture
from direct.interval.MetaInterval import Sequence, Parallel, Track
from direc... | DedMemez/ODS-August-2017 | parties/PartyCogActivity.py | Python | apache-2.0 | 29,414 |
# Copyright 2016 Euclidean Technologies Management LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | euclidjda/dnn-quant | scripts/deep_mlp_model.py | Python | apache-2.0 | 7,953 |
import torch.nn as nn
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.registry import register_model
from .helpers import build_model_with_cfg
def _cfg(url='', **kwargs):
return {
'url': url,
'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': None,
... | rwightman/pytorch-image-models | timm/models/convmixer.py | Python | apache-2.0 | 3,631 |
#!/usr/bin/env python
# Libraries
import imapclient
# Local imports
import account_settings
import utils
def get_all_folders(username, password):
server = utils.login_to_server(username, password)
all_folders = server.list_folders()
all_folders = [triple[2] for triple in all_folders]
return all_folders, s... | dhermes/gmail-imap-migrate | step1_make_new_labels.py | Python | apache-2.0 | 895 |
#
# 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
# ... | noironetworks/heat | heat/engine/resources/openstack/heat/random_string.py | Python | apache-2.0 | 9,442 |
# 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 agreed to in writing, ... | googleapis/python-talent | samples/snippets/job_search_commute_search_test.py | Python | apache-2.0 | 828 |
# -*- coding: utf-8 -*-
#
# Read the Docs Template documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 26 14:19:49 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | DigitalSkills-fr/Docs | docs/conf.py | Python | apache-2.0 | 8,474 |
wsgi_app = "weasyl.wsgi:make_wsgi_app()"
proc_name = "weasyl"
preload_app = False
secure_scheme_headers = {
'X-FORWARDED-PROTO': 'https',
}
forwarded_allow_ips = '*'
| Weasyl/weasyl | gunicorn.conf.py | Python | apache-2.0 | 173 |
# Copyright 2010 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... | CloudServer/cinder | cinder/tests/unit/api/test_common.py | Python | apache-2.0 | 24,477 |
# Copyright 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-coral/demo-manufacturing | models/retraining/train_classifier.py | Python | apache-2.0 | 9,469 |
#!/usr/bin/env python
"""AFF4 interface implementation.
This contains an AFF4 data model implementation.
"""
import __builtin__
import abc
import StringIO
import time
import zlib
import logging
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import lexe... | MiniSEC/GRR_clone | lib/aff4.py | Python | apache-2.0 | 74,406 |
import pymongo
import json
cache = {}
client = pymongo.MongoClient()
try:
dbConf = json.load(open("./model/db.json","r"))
except:
try:
dbConf = json.load(open("./db.json","r"))
except:
dbConf = {"dbname": "voteview"}
db = client[dbConf["dbname"]]
def metaLookup(api = ""):
if not api:
... | JeffreyBLewis/WebVoteView | model/searchMeta.py | Python | apache-2.0 | 568 |
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, 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 ... | nhamplify/aminator | aminator/plugins/blockdevice/base.py | Python | apache-2.0 | 1,648 |
#!/usr/bin/env python3
delineator = "//"
hashtag = "#"
# generate poems from a file
# out: list of poem lines
def generate_poems(filename):
g = []
# get to the first poem in the file
with open(filename, 'r') as f:
for line in f:
line = line.rstrip()
if line.startswith( deli... | benjspriggs/tumb-borg | tumb_borg/process.py | Python | apache-2.0 | 1,044 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | cvandeplas/plaso | plaso/parsers/winreg_plugins/userassist_test.py | Python | apache-2.0 | 3,967 |
from __future__ import unicode_literals
import time
import pytest
@pytest.mark.selenium
def test_ui(selenium):
selenium.browser.get(selenium.url('/download'))
time.sleep(3)
| clld/tsezacp | tests/test_selenium.py | Python | apache-2.0 | 183 |
# Copyright 2016 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | ep1cman/workload-automation | wlauto/utils/fps.py | Python | apache-2.0 | 4,301 |
# Copyright 2013 Answers for AWS 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 w... | Answers4AWS/backup-monkey | backup_monkey/cli.py | Python | apache-2.0 | 5,890 |
'''
Classes for using multipart form data from Python, which does not (at the
time of writing) support this directly.
To use this, make an instance of Multipart and add parts to it via the factory
methods field and file. When you are done, get the content via the get method.
@author: Stacy Prowell (http://stacyprowe... | mpetyx/pychatbot | AIML/AliceTwitter/GAEAlice/multipart.py | Python | apache-2.0 | 5,097 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/global_/lsp_bit/overload_bit/__init__.py | Python | apache-2.0 | 25,678 |
from django.utils import unittest
from spacescout_web.test.not_found import NotFound404Test
from spacescout_web.test.url_filtering import URLFiltering
| uw-it-aca/spacescout_web | spacescout_web/tests.py | Python | apache-2.0 | 152 |
#!/usr/bin/env python
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Aloomaio/googleads-python-lib | examples/adwords/v201809/basic_operations/update_expanded_text_ad.py | Python | apache-2.0 | 2,330 |
# Copyright 2005-2010 Wesabe, 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 ... | wesabe/fixofx | lib/ofxtools/csv_converter.py | Python | apache-2.0 | 14,873 |
from abc import ABCMeta, abstractmethod, abstractproperty
from contextlib import contextmanager
from functools import wraps
import gzip
from inspect import getargspec
from itertools import (
combinations,
count,
product,
)
import operator
import os
from os.path import abspath, dirname, join, realpath
import... | enigmampc/catalyst | catalyst/testing/core.py | Python | apache-2.0 | 47,204 |
"""
WSGI config for websqlrunner 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.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | snava10/sqlRunner | websqlrunner/websqlrunner/wsgi.py | Python | apache-2.0 | 402 |