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
""" Support for IP Webcam, an Android app that acts as a full-featured webcam. For more details about this component, please refer to the documentation at https://home-assistant.io/components/android_ip_webcam/ """ import asyncio import logging from datetime import timedelta import voluptuous as vol from homeassista...
morphis/home-assistant
homeassistant/components/android_ip_webcam.py
Python
apache-2.0
10,232
# -*- 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-scheduler
google/cloud/scheduler_v1beta1/services/cloud_scheduler/transports/base.py
Python
apache-2.0
10,415
# # Copyright (c) SAS Institute 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 w...
sassoftware/conary
conary/local/sqldb.py
Python
apache-2.0
94,996
#! /usr/bin/python # -*- coding: utf-8 -*- import ast import pickle import numpy as np import os import socket import sys import importlib from datetime import datetime import theano as th import theanet.neuralnet as nn ################################ HELPER FUNCTIONS ############################ def share(data, d...
rakeshvar/theanet
train.py
Python
apache-2.0
7,597
# Copyright (c) 2015 Cisco 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 or agreed to in writ...
openstack/barbican
functionaltests/api/v1/functional/test_acls_rbac.py
Python
apache-2.0
13,953
# python # This file is generated by a program (mib2py). Any edits will be lost. from pycopia.aid import Enum import pycopia.SMI.Basetypes Range = pycopia.SMI.Basetypes.Range Ranges = pycopia.SMI.Basetypes.Ranges from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, N...
kdart/pycopia
mibs/pycopia/mibs/SNMP_PROXY_MIB.py
Python
apache-2.0
4,800
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleads/google-ads-python
google/ads/googleads/v8/services/services/product_bidding_category_constant_service/client.py
Python
apache-2.0
18,954
# from exceptions import ApiException from client import Client import json class Lexicon(Client): """Lexicon class""" def __init__(self, language='hr'): super(Lexicon, self).__init__() self.language = language def queryEntries(self, surface=None, lemma=None, msd=None, rhymes_with=None, n...
clarinsi/reldi-lib
reldi/lexicon.py
Python
apache-2.0
1,528
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os import re from builtins import open INCLUDE_PARSER = re.compile(r'^\s*include...
twitter/pants
contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_util.py
Python
apache-2.0
2,327
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os from pants.backend.python.subsystems.ipython import IPython from pants.backend.python.util_rules.local_dists import LocalDistsPex, LocalDistsPexRequest from pants.backend.python....
patricklaw/pants
src/python/pants/backend/python/goals/repl.py
Python
apache-2.0
5,683
__author__ = 'Joe Linn' from pylastica.query.abstract import AbstractQuery class SimpleQueryString(AbstractQuery): """ @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html """ OPERATOR_AND = "and" OPERATOR_OR = "or" def __init__(...
jlinn/pylastica
pylastica/query/simplequerystring.py
Python
apache-2.0
1,809
# -*- coding: utf-8 -*- # # MothBall documentation build configuration file, created by # sphinx-quickstart on Thu Jun 30 20:11:36 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
MarionTheBull/watchmaker
docs/conf.py
Python
apache-2.0
9,706
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import tensorflow as tf from niftynet.layer.downsample import DownSampleLayer from tests.niftynet_testcase import NiftyNetTestCase class DownSampleTest(NiftyNetTestCase): def get_3d_input(self): input_shape = (2, 16, 16, 16, 8...
NifTK/NiftyNet
tests/downsample_test.py
Python
apache-2.0
3,371
import unittest import random from ..frame import Frame, decode_frame from ..message import MessageType from ..utilslib.strings import random_bytes class FrameTestCase(unittest.TestCase): MSG_TYPE = MessageType.HELLO PAYLOAD = "Hello World!" def frame_setup(self, msg_type, payload): self.msg_type...
abranches/backmonitor
backmonitor/tests/frame_tests.py
Python
apache-2.0
1,806
# # Copyright 2014 eNovance # # 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, ...
openstack/ceilometer
ceilometer/tests/unit/publisher/test_gnocchi.py
Python
apache-2.0
33,790
# Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
liverbirdkte/searchlight
searchlight/api/v1/router.py
Python
apache-2.0
3,261
# Copyright 2009 Google 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, ...
pools/JaikuEngine
common/test/api.py
Python
apache-2.0
65,695
from .models import * def fix_airport_country(country_str, iso_code2): try: aps = Airport.objects.filter(country_str__contains=country_str) except: print("No listings were found.") try: c = Country.objects.get(iso_code2=iso_code2) except: print("That country was not fou...
MarconiMediaGroup/TravelHub
web/ofd/helpers.py
Python
apache-2.0
466
"""Serializers for authentication views. """ from django.contrib.auth import authenticate from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers class TokenSerializer(serializers.Serializer): """ Serializer for obtaining an auth token. The actual generation of th...
knowmetools/km-api
km_api/km_auth/serializers.py
Python
apache-2.0
1,348
from TestBase import BaseClass class ContractBase(BaseClass): def add_contract(self): wd = self.wd wd.find_element_by_link_text("add new").click() wd.find_element_by_name("email").click() wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys() ...
werbk/task-2.1
tests_contract/contract_lib.py
Python
apache-2.0
5,896
# -*- coding: utf-8 -*- from urlparse import urlparse from nose.tools import * # flake8: noqa from dateutil.parser import parse as parse_date from tests.base import DbTestCase, ApiTestCase, assert_datetime_equal from tests.utils import make_drf_request from tests.factories import UserFactory, NodeFactory, Registrati...
ZobairAlijan/osf.io
api_tests/nodes/serializers/test_serializers.py
Python
apache-2.0
4,035
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 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 applicab...
redhat-cip/dci-control-server
dci/decorators.py
Python
apache-2.0
2,908
#!/usr/bin/python # -*- coding: utf_8 -*- # Autopsy Forensic Browser # # Copyright 2013 Basis Technology Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/l...
eugene7646/autopsy
test/script/regression.py
Python
apache-2.0
93,572
import pytest from sovrin_common.types import ClientPoolUpgradeOperation from collections import OrderedDict from plenum.common.messages.fields import ConstantField, ChooseField, VersionField, MapField, Sha256HexField, \ NonNegativeNumberField, LimitedLengthStringField, BooleanField EXPECTED_ORDERED_FIELDS = Orde...
keenondrums/sovrin-node
sovrin_common/test/types/test_pool_upg_schema.py
Python
apache-2.0
1,055
#!/usr/bin/env python import os try: __IPYTHON__ import sys del sys.argv[1:] except: pass import srwl_bl import srwlib import srwlpy import srwl_uti_smp def set_optics(v=None): el = [] pp = [] names = ['S1', 'S1_HCM', 'HCM', 'HCM_DCM_C1', 'DCM_C1', 'DCM_C2', 'DCM_C2_HFM', 'HFM', 'After_H...
mrakitin/sirepo
tests/template/srw_generate_data/nsls-ii-hxn-beamline-ssa-closer.py
Python
apache-2.0
36,110
# Copyright 2021 Google LLC. # Copyright (c) Microsoft Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
GoogleChromeLabs/chromium-bidi
tests/_helpers.py
Python
apache-2.0
4,890
#!/usr/bin/python # # 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 ag...
GoogleCloudPlatform/datacatalog-connectors-hive
google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/sync/metadata_synchronizer.py
Python
apache-2.0
6,243
import sys import os import json from optparse import OptionParser from tornado.template import Template from build_template import * from build_config import * def get_allow_empty_fields(fields_config, unhandled_fields): allow_empty_fields = unhandled_fields for field in fields_config: if field["fiel...
healerkx/AdminBuildr
scripts/build_model.py
Python
apache-2.0
2,961
from unittest import TestCase from dogpile.cache import util class UtilsTest(TestCase): """ Test the relevant utils functionality. """ def test_coerce_string_conf(self): settings = {'expiration_time': '-1'} coerced = util.coerce_string_conf(settings) self.assertEqual(coerced['ex...
YosaiProject/yosai_dpcache
tests/cache/test_utils.py
Python
apache-2.0
905
import numpy as np import cv2 import h5py min_img_size = 12 label_path = './label.txt' landmark_path = './landmark.txt' regression_box_path = './regression_box.txt' crop_image_path = './crop_image.txt' train_file_path = './train_12.hd5' label = np.loadtxt(label_path, int) landmark = np.loadtxt(landmark_path, float) r...
dedoogong/asrada
FaceLandmark_Detector_DAN/generate_hd5.py
Python
apache-2.0
1,140
import json import logging import re from contextlib import contextmanager @contextmanager def disable_warnings(logger_name): """ Suppresses expected warning messages to keep the test output clean. """ logger = logging.getLogger(logger_name) current_level = logger.level logger.setLevel(logging...
respawner/peering-manager
utils/testing/functions.py
Python
apache-2.0
1,327
#!/usr/bin/env python # # Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is d...
scavarda/mysql-dbcompare
mysql-utilities-1.6.0/scripts/mysqlrplsync.py
Python
apache-2.0
11,414
#!/usr/bin/python import importlib import logging import os import json from datetime import datetime from pprint import pprint from st2actions.runners.pythonrunner import Action class GetUnapproved(Action): def run(self, allns): output = [] for ns in allns['items']: if 'metadata'...
pearsontechnology/st2contrib
packs/bitesize/actions/find_unapproved_ns.py
Python
apache-2.0
862
# maximum number of letters(ignoring spaces and duplicates) if tie choose alphabetical order. # import sys # text = "".join(sys.stdin.readlines()) # name_list = text.split("\n") inputList = ["kylan charles", "raymond strickland", "julissa shepard", "andrea meza", "destiny alvarado"] inputList2 = ["maria garcia", "smit...
saisankargochhayat/algo_quest
Company-Based/SAP/social_sabatical_name.py
Python
apache-2.0
938
# -*- coding: utf-8 -*- ############################################################################## # # Online Discounts and Coupons # Authors: Dominador B. Ramos Jr. <mongramosjr@gmail.com> # Company: 3D2N World (http://www.3d2nworld.com) # # Copyright 2016 Dominador B. Ramos Jr. # # Licensed under the Ap...
mongramosjr/best-deals
website_best_deal/__openerp__.py
Python
apache-2.0
1,784
""" Allows custom jinja filters. """ ### Built-in filters ### def select(value, key): """ Select a key from a dictionary. If ``value`` is not a dictionary or ``key`` does not exist in it, the ``value`` is returned as is. """ return value.get(key, value) if isinstance(value, dict) else value...
locationlabs/confab
confab/jinja_filters.py
Python
apache-2.0
2,518
# Copyright 2015 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 a...
google/citest
citest/base/base_test_case.py
Python
apache-2.0
8,010
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup, NavigableString from phyllo.phyllo_logger import logger import nltk from itertools import cycle nltk.download('punkt') from nltk import sent_tokenize def parseRes2(soup, title, url, cur, author, date, collectiont...
oudalab/phyllo
phyllo/extractors/bebelDB.py
Python
apache-2.0
3,089
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleads/google-ads-python
google/ads/googleads/v10/services/services/remarketing_action_service/transports/base.py
Python
apache-2.0
6,058
# Copyright 2012 IBM Corp. # 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 r...
sacharya/nova
nova/tests/conductor/test_conductor.py
Python
apache-2.0
83,151
# coding=utf-8 # Copyright 2013 Hewlett-Packard Development Company, L.P. # Copyright 2013 International Business Machines 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 # ...
ionutbalutoiu/ironic
ironic/conductor/manager.py
Python
apache-2.0
116,241
# Copyright 2016 F5 Networks 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...
F5Networks/f5-common-python
f5/bigip/tm/cm/test/functional/test_failover_status.py
Python
apache-2.0
1,104
# Copyright (c) 2015-2020 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 required b...
cloudify-cosmo/tosca-vcloud-plugin
system_tests/vcloud_handler.py
Python
apache-2.0
5,843
# Copyright 2020 Google 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 required by applicable law o...
GoogleCloudPlatform/declarative-resource-client-library
python/services/sql/user.py
Python
apache-2.0
6,762
# python3 # pylint: disable=g-bad-file-header # Copyright 2021 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org...
deepmind/neural_testbed
neural_testbed/likelihood/utils_test.py
Python
apache-2.0
1,794
# -*- coding: utf-8 -*- import rogerthat_tests import logging import os import sys from rogerthat.bizz.service.mfd.mfd_javascript import _render_flow_definitions, _get_js_mfr_code root = logging.getLogger() root.setLevel(logging.DEBUG) WIDGETS_FLOW_XML = u"""<?xml version="1.0" encoding="utf-8"?> <messageFlowDefini...
rogerthat-platform/rogerthat-backend
js-test/generate_flow_definitions.py
Python
apache-2.0
18,061
from selenium import webdriver from time import sleep driver = webdriver.Firefox() driver.get('http://www.google.com') sleep(2) loginTextBox = driver.find_element_by_css_selector('.gLFyf.gsfi') searchButton = driver.find_element_by_xpath('//input[@name="btnK"]') loginTextBox.clear() loginTextBox.send_keys("python")...
twiindan/selenium_lessons
04_Selenium/03_elements_interaction/send_keys.py
Python
apache-2.0
365
# # Copyright (c) SAS Institute 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 w...
fedora-conary/conary
conary/repository/netrepos/netauth.py
Python
apache-2.0
50,922
#!/usr/bin/env python import subprocess import re import math from optparse import OptionParser length_regexp = 'Duration: (\d{2}):(\d{2}):(\d{2})\.\d+,' re_length = re.compile(length_regexp) def main(): (filename, split_length) = parse_options() if split_length <= 0: print "Split length can't be 0...
ArneBab/video-splitter
ffmpeg-split.py
Python
apache-2.0
2,871
from django.shortcuts import render, resolve_url from django.contrib.auth.decorators import login_required from gui.decorators import profile_required from gui.utils import collect_view_data from gui.signals import view_faq from api.decorators import setting_required @login_required @profile_required def api(request...
erigones/esdc-ce
gui/docs/views.py
Python
apache-2.0
1,344
EC2_INSTANCE_TYPES = [ 't2.micro', 't2.small', 't2.medium', 't2.large', 'r4.large' ] RDS_INSTANCE_TYPES = [ 'db.t2.micro', 'db.t2.small', 'db.t2.medium', 'db.t2.large' ] ELASTICACHE_INSTANCE_TYPES = [ 'cache.m1.small' ] ALLOW_ALL_CIDR = '0.0.0.0/0' VPC_CIDR = '10.0.0.0/16' GR...
kdeloach/model-my-watershed
deployment/cfn/utils/constants.py
Python
apache-2.0
568
#!/usr/bin/env python from __future__ import print_function import argparse import numpy as N import os import sys def parse_args(args): p = argparse.ArgumentParser() p.add_argument('-i', '--input-files', default=[sys.stdin], nargs="+", type=argparse.FileType('rt'), help='input f...
melrief/Hadoop-Log-Tools
hadoop/util/stats.py
Python
apache-2.0
1,993
prev=1 cnt=2 next=1 while(len(str(next))<1000): prev,next=next,next+prev cnt+=1 print(cnt)
rekbun/project-euler
src/python/problem25.py
Python
apache-2.0
98
# python3 # 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 ...
google/TaglessCRM
src/plugins/pipeline_plugins/hooks/ads_uac_hook.py
Python
apache-2.0
9,520
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tombstone/models
research/object_detection/utils/spatial_transform_ops.py
Python
apache-2.0
22,019
# -*- coding: utf-8 -*- """ Created on Wed Jan 03 09:36:48 2018 @author: tih """ import os import sys from DataAccess import DownloadData def main(Dir, Startdate='', Enddate='', latlim=[-60, 70], lonlim=[-180, 180], Waitbar = 1): """ This function downloads monthly ETmonitor data Keyword arguments: ...
wateraccounting/wa
Collect/ETmonitor/Es_monthly.py
Python
apache-2.0
817
import random from datetime import date, timedelta, datetime from django.core.urlresolvers import reverse from ._utils import generate_random_event, TestCase, hours_ago, hours_ahead from ..models import Event class EventManagerTestCase(TestCase): def test_upcoming_future(self): event_future = generate_ra...
armstrong/armstrong.apps.events
armstrong/apps/events/tests/managers.py
Python
apache-2.0
2,622
# 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...
gunan/tensorflow
tensorflow/python/data/kernel_tests/shuffle_test.py
Python
apache-2.0
13,444
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
rahulunair/nova
nova/tests/functional/api_sample_tests/test_shelve.py
Python
apache-2.0
2,812
from ryu.base.app_manager import RyuApp from ryu.controller.ofp_event import EventOFPSwitchFeatures from ryu.controller.ofp_event import EventOFPQueueStatsReply from ryu.controller.handler import set_ev_cls from ryu.controller.handler import CONFIG_DISPATCHER from ryu.controller.handler import MAIN_DISPATCHER from ryu....
lagopus/lagopus
test/ryu/vsw-602_mp_queue_stats.py
Python
apache-2.0
1,976
# Copyright 2015 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 ...
ram8647/gcb-mobilecsp
modules/help_urls/topics.py
Python
apache-2.0
6,586
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db.models import Q from django.shortcuts import get_object_or_404 from guardian.shortcuts import get_objects_for_user from rest_framework import generics from rest_framework import permissions from rest_framework.exceptions import PermissionDe...
chrisseto/osf.io
reviews/views.py
Python
apache-2.0
9,559
""" 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 this ...
zouzhberk/ambaridemo
demo-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
Python
apache-2.0
7,844
from __future__ import with_statement from logging.config import fileConfig from alembic import context from sqlalchemy import engine_from_config, pool # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Pyth...
biosustain/marsi
marsi/alembic/env.py
Python
apache-2.0
1,993
#!/cygdrive/c/Python27 # 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 # "L...
mufaddalq/cloudstack-datera-driver
tools/apidoc/gen_toc.py
Python
apache-2.0
8,453
EC2_INSTANCE_TYPES = [ 't2.micro', 't2.small', 't2.medium' ] RDS_INSTANCE_TYPES = [ 'db.t2.micro' ] ELASTICACHE_INSTANCE_TYPES = [ 'cache.t2.micro' ] ALLOW_ALL_CIDR = '0.0.0.0/0' VPC_CIDR = '10.0.0.0/16' GRAPHITE = 2003 GRAPHITE_WEB = 8080 HTTP = 80 HTTPS = 443 KIBANA = 5601 POSTGRESQL = 5432 RE...
mmcfarland/model-my-watershed
deployment/cfn/utils/constants.py
Python
apache-2.0
369
#!/usr/bin/env python import boto3 import sys import json import logging from botocore.exceptions import ClientError from CoinCollection import ValueRecord logger = logging.getLogger("tango") logger.setLevel(logging.DEBUG) class Cache(): def stash(self, key, record): logger.debug("Stash request for: " + ...
robcz/tangosnake
TangoServices.py
Python
apache-2.0
2,895
from __future__ import absolute_import import urllib from django import forms DEFAULT_DATE_FORMATS = ["%d/%m/%Y"] DEFAULT_TIME_FORMATS = ["%H:%M"] class RevisionsFilteringForm(forms.Form): from_date = forms.SplitDateTimeField(label="From", required=False, ...
ox-it/talks.ox
talks/audit_trail/forms.py
Python
apache-2.0
812
# -*- 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
google/GiftStick
tests/directory_tests.py
Python
apache-2.0
2,385
#!/usr/bin/env python # Python 3 required # THIS TAKES WAAAAY TO LONG. ONLY SOLVED IT BY LETTING IT RUN # OVERNIGHT ACCIDENTALLY :/ import locale import sys import math import timeit locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59...
jarretraim/euler_py
1-10/03.py
Python
apache-2.0
1,446
#!/usr/bin/env python import os import sys import time from ServerConfig import General from ServerConfig import Hadoop from ServerConfig import Hive xmlProp = lambda key, value: "<property><name>" + key +"</name><value>" + value + "</value></property>\n" concatStr = lambda servers, sep: sep.join(servers) def copy...
tellproject/helper_scripts
hive.py
Python
apache-2.0
3,067
# Copyright 2008 Online Agility (www.onlineagility.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 b...
dherbst/python-icontact
icontact/client.py
Python
apache-2.0
23,268
# -*- 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/components/component/transceiver/physical_channels/channel/state/__init__.py
Python
apache-2.0
34,214
# -*- coding: utf-8 -*- """ werkzeug.wrappers ~~~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains al...
yongshengwang/hue
build/env/lib/python2.7/site-packages/Werkzeug-0.6-py2.7.egg/werkzeug/wrappers.py
Python
apache-2.0
63,444
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2015] Michał Szczygieł, M4GiK Software # # 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...
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/core/utils/log.py
Python
apache-2.0
3,315
""" /*************************************************************************** Name : HTP Geoprocessor Description : Tools for processing HTP geospatial data Date : 29/Mar/12 copyright : (C) 2012 by Dr. Kelly Thorp, USDA-ARS email : kelly.thorp@...
npcasler/phenomics
HTPGeoprocessor.py
Python
apache-2.0
4,471
# -*- coding: utf-8 -*- ''' Manage VPCs ================= .. versionadded:: 2015.8.0 Create and destroy VPCs. Be aware that this interacts with Amazon's services, and so may incur charges. This module uses ``boto``, which can be installed via package, or pip. This module accepts explicit vpc credentials but can als...
smallyear/linuxLearn
salt/salt/states/boto_vpc.py
Python
apache-2.0
30,718
# # Copyright 2018 Analytics Zoo 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...
intel-analytics/analytics-zoo
pyzoo/test/zoo/orca/automl/autoestimator/test_autoestimator_keras.py
Python
apache-2.0
5,054
MARV 2 21 7710 36 0 70 MARV 5 01 x 0 0 0 MARV 5 02 7710 66 420 40 MARV 5 14 5710 33 315 70 MARV 5 67 7710 66 500 70 MARV 6 09 + 0 5 x 20 MARV 6 16 + 310 0 0 0 MARV 6 46 + 0 66 660 70 MARV 6 49 + x 66 0 70 MARV 6 82a 7710 66 x x MARV 6 82b 0 0 x 70 MARV 7 27 x x 600 0 MARV 7 63 x 7 70 x MARV 9 01 x x 0 MARV 9 06 x 0 0 ...
PaulEG/Various-Projects
Sudu.py
Python
artistic-2.0
347
#!/usr/bin/env python import logging import boto.ec2 import config class EC2Client: def __init__(self): self.conn = boto.ec2.connect_to_region(config.ec2_region) def stop(self): if self.get_status() in ['running', 'pending']: logging.info('Stopping server...') self....
felixbade/minecraft-proxy
app/server_manager/ec2.py
Python
artistic-2.0
902
#!/usr/bin/env python import os print "Cleaning directory %s"%(os.path.realpath('.')) rubbish_filetypes = ('h5','hdf','.dat','.pyc', '.png', '.pdf', '.tar.gz') rubbish_startnames = ('job','logdata','Amplitude','Real','spool','pool') choosing = raw_input("Continue [yes/anykey_for_NO] ?") if choosing == 'yes': print "C...
mrosenstihl/PulsePrograms
make_clean.py
Python
bsd-2-clause
679
#!/usr/bin/env python """ As wave2D_func1.py, but the wave2D_func1_loop_0 module is used for the purpose of measuring overhead in array copying. """ from __future__ import division # disable integer division from scitools.numpyutils import * def solver(I, f, c, bc, Lx, Ly, nx, ny, dt, tstop, user_act...
sniemi/SamPy
sandbox/src1/TCSE3-3rd-examples/src/py/examples/pde/wave2D_func1_0.py
Python
bsd-2-clause
18,617
from opensfm.actions import create_submodels from . import command import argparse from opensfm.dataset import DataSet class Command(command.CommandBase): name = "create_submodels" help = "Split the dataset into smaller submodels" def run_impl(self, dataset: DataSet, args: argparse.Namespace) -> None: ...
mapillary/OpenSfM
opensfm/commands/create_submodels.py
Python
bsd-2-clause
454
#!/usr/bin/python -Wall # ================================================================ # Copyright (c) John Kerl 2007 # kerl.john.r@gmail.com # ================================================================ from __future__ import division # 1/2 = 0.5, not 0. from math import * from sackmat_m import * import cop...
johnkerl/scripts-math
pythonlib/bin/jac.py
Python
bsd-2-clause
5,698
# (C) 2012-2015 by Daniel Nyga # # 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 limitation the rights to use, copy, modify, merge, publish, # distrib...
danielnyga/pracmln
python2/pracmln/__init__.py
Python
bsd-2-clause
1,458
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 Madis Veskimeister <madis@pingviinitiivul.ee> # from app.config import SQLALCHEMY_DATABASE_URI from app import db import os.path db.create_all()
avalikarvamus/pinguinvoice
db_create.py
Python
bsd-2-clause
211
from django.conf.urls import include, url from powerdns.utils import patterns urlpatterns = patterns( '', url(r'', include('dnsaas.api.v1.urls', namespace='default')), url(r'^v2/', include('dnsaas.api.v2.urls', namespace='v2')), )
dominikkowalski/django-powerdns-dnssec
dnsaas/api/urls.py
Python
bsd-2-clause
246
#!/usr/bin/env python # -*- coding: utf-8 -*- from saml2 import BINDING_SOAP, BINDING_URI from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HTTP_POST from saml2 import BINDING_HTTP_ARTIFACT from saml2.saml import NAMEID_FORMAT_PERSISTENT from saml2.saml import NAME_FORMAT_URI from pathutils import full...
tpazderka/pysaml2
tests/idp_conf_mdb.py
Python
bsd-2-clause
3,959
#!/usr/bin/env python2.7 #(c) 2015-2016 by Authors #This file is a part of Nano-Align program. #Released under the BSD license (see LICENSE file) """ Flips blockades signals according to the protein's AA order """ from __future__ import print_function import sys import os nanoalign_root = os.path.dirname(os.path.di...
fenderglass/Nano-Align
scripts/flip-blockades.py
Python
bsd-2-clause
2,322
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Use genetic map to break chimeric scaffolds, order and orient scaffolds onto chromosomes. """ import os.path as op import sys import logging import numpy as np from collections import Counter from functools import lru_cache from itertools import combinations, groupby ...
tanghaibao/jcvi
jcvi/assembly/geneticmap.py
Python
bsd-2-clause
20,122
#!/usr/bin/env python '''em_dict_basic.py - Basic benchmark for external memory dictionary.''' __author__ = 'huku <huku@grhack.net>' import sys import shutil import random import time import util import pyrsistence def main(argv): # Initialize new external memory dictionary. util.msg('Populating external...
huku-/pyrsistence
tests/em_dict_basic.py
Python
bsd-2-clause
766
# -*- coding: utf-8 -*- import pytest from os.path import dirname, join from iscclib.image import ImageID TEST_IMG = join(dirname(__file__), '4.2.04.jpg') TEST_CODE = u'CAUD7P6NU73ID' TEST_IDENT = 13733935459959803788 def test_image_id_min_max(): max_value = 2 ** 64 - 1 iid = ImageID(ident=max_value) ass...
coblo/pyiscclib
tests/test_iscclib_image.py
Python
bsd-2-clause
600
from setuptools import setup, find_packages import imp version = imp.load_source('crema.version', 'crema/version.py') setup( name='crema', version=version.version, description="Convolutional-recurrent estimators for music analysis", author='Brian McFee', url='http://github.com/bmcfee/crema', ...
bmcfee/crema
setup.py
Python
bsd-2-clause
1,596
#!/usr/bin/env python2 # coding:utf-8 import sys import os import threading current_path = os.path.dirname(os.path.abspath(__file__)) root_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, os.pardir)) data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data')) module_data...
zlsun/XX-Net
code/default/x_tunnel/local/heroku_front/check_ip.py
Python
bsd-2-clause
4,521
# -*- coding: utf-8 -*- # # django-timegraph - monitoring graphs for django # Copyright (c) 2011-2012, Wifirst # Copyright (c) 2013, Jeremy Lainé # All rights reserved. # # See AUTHORS file for a full list of contributors. # # Redistribution and use in source and binary forms, with or without modification, # are permit...
jlaine/django-timegraph
timegraph/admin.py
Python
bsd-2-clause
2,072
import os import glob from pathlib import Path import flask import yaml class VersionManager(object): def __init__(self, versions=None): self._versions = versions @property def versions(self): if self._versions is None: version_paths = Path('versions').glob('**/*.yaml') ...
kylef/swiftenv-api
versions.py
Python
bsd-2-clause
4,108
# -*- coding:utf-8 -*- import socket # 判断是否是ip:port def is_ip_port(ip_port): ip_port_arr = ip_port.split(':') if len(ip_port_arr) != 2 or isinstance(ip_port_arr[1], int): return False return is_internal_ip(ip_port_arr[0]) # 判断是否是内网ip def is_internal_ip(ip): if not check_ip(ip): retu...
siye1982/kafkey
app/main/__init__.py
Python
bsd-2-clause
848
from django.conf.urls.defaults import patterns, url, include from django.contrib import admin from django.conf import settings from django.views.generic.simple import direct_to_template admin.autodiscover() urlpatterns = patterns( '', url(r'^', include('reciblog.blog.urls')), url(r'^about$', direct_to_tem...
wraithan/reciblog
urls.py
Python
bsd-2-clause
617
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') CONTROLLER = DOMAIN + '/phylesystem/studies' SUBMIT_URI = CONTROLLER + '/properties' r = test_http_json_method(SUBMIT_URI, 'GET', expected...
OpenTreeOfLife/phylesystem-api
ws-tests/test_v2_studies_properties.py
Python
bsd-2-clause
498
branding = { "toolsName" : "Citrix XenServer Tools", "installerProductName" : "Citrix XenServer Tools Installer", "manufacturer" : "Citrix", "installerKeyWords" : "Citrix XenServer Windows Installer", "shortTools" : "XenTools", "installerServiceName" : "Citrix Xen...
benchalmers/win-installer
src/branding/branding.py
Python
bsd-2-clause
3,401