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 |
|---|---|---|---|---|---|
# -*- 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/model_service.py | Python | apache-2.0 | 17,689 |
'''
Created on Jul 18, 2017
@author: I310003
'''
| BlessedAndy/Programming-Foundations-with-Python | Programming Foundations with Python/src/cn/careerwinner/sap/report_scheduler.py | Python | apache-2.0 | 55 |
import os
import shutil
BASE_FOLDER = os.path.dirname(os.path.abspath(__file__).replace('.pyc', '.py'))
def install(dst_folder):
target_folder = os.path.join(dst_folder, 'Base')
sup_folder = os.path.abspath(os.path.join(BASE_FOLDER, 'assets', 'src', 'IMC', 'Base'))
# Running from source tree.
prin... | oceanscan/imctrans | imctrans/cpp/base.py | Python | apache-2.0 | 560 |
# -*- coding: utf-8 -*-
from couchdb.design import ViewDefinition
from couchdb.http import HTTPError
from time import sleep
from random import randint
import os
def add_index_options(doc):
doc['options'] = {'local_seq': True}
start_date_chronograph = ViewDefinition(
'chronograph',
'start_date',
open... | openprocurement/openprocurement.auction | openprocurement/auction/design.py | Python | apache-2.0 | 2,643 |
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | metacloud/python-cinderclient | cinderclient/v2/contrib/list_extensions.py | Python | apache-2.0 | 1,439 |
from numpy import *
from numpy.random import lognormal
from random import *
import time
Sigma1 = 0.27043285
RiskMap = { 'none' : 0.001, 'low' : Sigma1, 'medium' : 2*Sigma1, 'high' : 3*Sigma1, 'very high' : 4*Sigma1 }
BaseFactors = { 50 : 1, 60 : 1.07091495269662, 70 : 1.15236358602526, 80 : 1.2555855388372... | macterra/galton | montecarlo.py | Python | apache-2.0 | 2,516 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | sridevikoushik31/nova | nova/virt/xenapi/vmops.py | Python | apache-2.0 | 88,390 |
####################################
## batch code for WF simulation
####################################
import sys, array, os, getpass
from subprocess import call
import subprocess as subp
import time
import math as math
from subprocess import Popen, PIPE
if len(sys.argv)<2:
print("========= Syntax ========")
... | XENON1T/processing | montecarlo/fax_waveform/MidwayBatch.py | Python | apache-2.0 | 4,098 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('studio', 'mdbl@live.com'),
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/Users/studio... | mdblv2/joatu-django | application/joatu/local_settings.py | Python | apache-2.0 | 2,019 |
import jumon
def main():
jumon.entry(__name__)
| TakesxiSximada/syaml | src/syaml/commands/__init__.py | Python | apache-2.0 | 53 |
import commands
import time
import MySQLdb
from locust import Locust, events, task, TaskSet
def show_tables(self):
print "Running show_tables..."
print self.client.query("SHOW TABLES IN mysql", name="SHOW TABLES")
def mysql_user(self):
print "Running show users..."
pr... | pcrews/rannsaka | mysql/mysql_demo.py | Python | apache-2.0 | 3,820 |
# 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 | cache_replacement/policy_learning/cache/traces/train_test_split.py | Python | apache-2.0 | 4,756 |
# Enter your code here. Read input from STDIN. Print output to STDOUT
t = int(input())
for _ in range(t):
n_A = int(input())
set_A = set(map(int, input().split()))
n_B = int(input())
set_B = set(map(int, input().split()))
print(set_A.issubset(set_B))
| MithileshCParab/HackerRank-10DaysOfStatistics | Python/Sets/check_subset.py | Python | apache-2.0 | 287 |
# Copyright 2014, 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 ... | magic0704/oslo.messaging | oslo_messaging/_drivers/protocols/amqp/opts.py | Python | apache-2.0 | 3,495 |
#!/usr/bin/env python
#
# Copyright 2015 Ravello 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 applica... | benoit-canet/ravellobmc | test.py | Python | apache-2.0 | 3,544 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | kubernetes-client/python | kubernetes/client/models/v1beta1_flow_schema_spec.py | Python | apache-2.0 | 8,042 |
class Alarm(object):
id = ''
uid = 0
note_id = ''
date = 0
update_date = 0
is_deleted = 0
#note = None()
| ThinkmanWang/NotesServer | models/Alarm.py | Python | apache-2.0 | 151 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | polyaxon/polyaxon | core/polyaxon/polypod/compiler/lineage/artifacts_collector.py | Python | apache-2.0 | 1,081 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-04 22:15
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
def create_ids(apps, schema_editor):
Launch = apps.get_model('api', 'Launch')
for m in Launch.objects.all():
m.new_id = uuid.uuid4()
... | ItsCalebJones/SpaceLaunchNow-Server | api/migrations/0020_launch_new_id.py | Python | apache-2.0 | 860 |
def bfs(node, target, comparator=lambda x, y: x == y):
queue = [node]
visited_nodes = []
while len(queue) != 0:
current_node = queue.pop(0)
if current_node not in visited_nodes:
if comparator(current_node.value, target):
return current_node
queue.exte... | ocozalp/Algorithms | search/uninformed_search.py | Python | apache-2.0 | 1,797 |
# -*- coding: utf-8 -*-
"""
Sphinx plugins for Django documentation.
"""
import os
import re
from docutils import nodes, transforms
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
try:
from django.utils import simplejson as json
ex... | RaD/django-south | docs/djbook/_ext/djbookdocs.py | Python | apache-2.0 | 7,983 |
##########################################################################
#
# Processor specific code
# CPU = "Z80"
# Description = "Zilog 8-bit microprocessor."
# DataWidth = 8 # 8-bit data
# AddressWidth = 16 # 16-bit addresses
# Maximum length of an instruction (for formatting purposes)
maxLength = 4
# Leadin ... | jefftranter/udis | z80.py | Python | apache-2.0 | 32,759 |
from rasa.engine.caching import TrainingCache
from rasa.engine.graph import ExecutionContext, GraphNode, GraphSchema, SchemaNode
from rasa.engine.storage.storage import ModelStorage
from rasa.engine.training import fingerprinting
from rasa.engine.training.components import PrecomputedValueProvider
from rasa.engine.trai... | RasaHQ/rasa_nlu | tests/engine/training/test_hooks.py | Python | apache-2.0 | 3,903 |
#!/usr/bin/env python3
# In this example we will see how data in reference tables can be manipulated
# using the REST API.
# Our company has a multilevel security authorization architecture. Users
# are assigned an authorization server that they must use to log in to the
# network. Once inside the general network, som... | ibm-security-intelligence/api-samples | reference_data/04_Tables.py | Python | apache-2.0 | 12,660 |
from django.contrib import admin
'''from tester.models import Club,Member,Signup,Event
class admin_club(admin.ModelAdmin):
list_display=["club_name"]
class admin_event(admin.ModelAdmin):
list_display=["event_name"]
class admin_student(admin.ModelAdmin):
list_display=["usn","name"]
class admin_membe... | anirudhagar13/PES-Portal | pes_portal/club/admin.py | Python | apache-2.0 | 548 |
from datetime import datetime, timedelta
from manager_rest.test.base_test import BaseServerTestCase
from cloudify_rest_client.exceptions import CloudifyClientError
class ExecutionSchedulesTestCase(BaseServerTestCase):
DEPLOYMENT_ID = 'deployment'
fmt = '%Y-%m-%dT%H:%M:%S.%fZ'
an_hour_from_now = \
... | cloudify-cosmo/cloudify-manager | rest-service/manager_rest/test/endpoints/test_execution_schedules.py | Python | apache-2.0 | 8,636 |
##
# Copyright (c) 2010-2014 Apple 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 l... | trevor/calendarserver | txdav/carddav/datastore/test/test_sql.py | Python | apache-2.0 | 32,730 |
# 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 required by applicab... | wangyang59/tf_models | video_prediction/prediction_model_flo_edge.py | Python | apache-2.0 | 9,575 |
import random
from base64 import b64encode, b64decode
import mock
from six.moves.urllib.parse import parse_qs, urlparse
from pyramid.httpexceptions import HTTPBadRequest
from kinto.core.utils import json
from . import BaseTest
class PaginationTest(BaseTest):
def setUp(self):
super(PaginationTest, self)... | monikagrabowska/osf.io | kinto/tests/core/resource/test_pagination.py | Python | apache-2.0 | 10,656 |
# Copyright 2013 Metacloud, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | darren-wang/ks3 | keystone/resource/routers.py | Python | apache-2.0 | 1,239 |
# general
import time
# peachbox imports
from peachbox.task import Task
from peachbox.connector import sink, source
from peachbox.pipeline import Chain, Validator
# tutorial
from pipelines.importer import UserReviewEdge, ProductReviewEdge, ReviewProperties
import model.master
class ImportMovieReviews(ScheduledTask):
... | PeachstoneIO/peachbox | tutorials/tutorial_movie_reviews/tasks/importer.py | Python | apache-2.0 | 1,848 |
# Copyright (c) 2015 Huawei Technologies Co., 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
#
# ... | Paul-Ezell/cinder-1 | cinder/volume/drivers/huawei/huawei_driver.py | Python | apache-2.0 | 49,899 |
# version code 988
# Please fill out this stencil and submit using the provided submission script.
from GF2 import one
from matutil import *
from vecutil import zero_vec
## Problem 1
# Write each matrix as a list of row lists
echelon_form_1 = [[1,2,0,2,0],
[0,1,0,3,4],
[0,0,2,3,4... | tri2sing/LinearAlgebraPython | hw6.py | Python | apache-2.0 | 4,332 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.setpoint_managers import SetpointManagerMultiZoneCoolingAverage
log = logging.getLogger(__name__)
class TestSetpointManagerMultiZoneCoolingAverage(unittest.TestCase):
def s... | rbuffat/pyidf | tests/test_setpointmanagermultizonecoolingaverage.py | Python | apache-2.0 | 2,146 |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: vraj@reciprocitylabs.com
# Maintained By: vraj@reciprocitylabs.com
"""Defines a Revision model for storing snapshots."""
from ggrc import db
from ... | prasannav7/ggrc-core | src/ggrc/models/revision.py | Python | apache-2.0 | 4,093 |
import calendar
import datetime
import os
import time
from ajenti.api import *
from ajenti.ui import p, UIElement, on
@p('value', default='', bindtypes=[str, unicode, int, long])
@p('readonly', type=bool, default=False)
@p('type', default='text')
@plugin
class TextBox (UIElement):
typeid = 'textbox'
@p('value'... | lupyuen/RaspberryPiImage | usr/share/pyshared/ajenti/plugins/main/controls_inputs.py | Python | apache-2.0 | 3,085 |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | williamFalcon/pytorch-lightning | legacy/simple_classif_training.py | Python | apache-2.0 | 5,832 |
# coding: utf-8
"""
Copyright 2016 SmartBear 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
Unless required by applicable l... | wavefront-mike/python-client | wavefront_client/api_client.py | Python | apache-2.0 | 20,266 |
import os
import re
import json
def createSpeciesJson(source_data_path):
# create the species.json file using data from the specified path
# traverse directories looking for dirs named "1km". If it's
# path matches this pattern:
# .../<taxon-name>/models/<species-name>/1km
# then record that as ... | jcu-eresearch/climas-ng | webapp/climasng/data/datafinder.py | Python | apache-2.0 | 2,719 |
# -*- coding: utf-8 -*-
# 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
#
# Un... | google/mirandum | alerts/fanfunding/migrations/0003_auto_20160416_2023.py | Python | apache-2.0 | 2,470 |
# 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 required by applicable law or a... | e4p/dsub | dsub/providers/google.py | Python | apache-2.0 | 46,657 |
# Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | dimtruck/magnum | magnum/tests/unit/common/x509/test_sign.py | Python | apache-2.0 | 7,885 |
"""RFC 6962 client API."""
from ct.client import log_client
from ct.client.db import database
import gflags
import logging
import random
from twisted.internet import defer
from twisted.internet import error
from twisted.internet import protocol
from twisted.internet import reactor as ireactor
from twisted.internet im... | lexibrent/certificate-transparency | python/ct/client/async_log_client.py | Python | apache-2.0 | 18,435 |
import just
from scrapy.spiders import Spider
class MySpider(Spider):
name = "github_spider"
allowed_domains = ["github.com"]
with open("../repos.txt") as f:
start_urls = [url.strip() for url in f.readlines()]
def parse(self, response):
base = "https://raw.githubusercontent.com"
... | warenlg/shell-complete | shcomplete/repospider.py | Python | apache-2.0 | 428 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import urllib
import zlib
import zipfile
import math
import sys
import json
import time
import bz2
import gzip
import binascii
import requests
import random
from subprocess import *
import subprocess
import threading
import MySQLdb # See http:/... | jpoullet2000/cgs-benchmarks | hbase-benchmarks/hbase_import_process.py | Python | apache-2.0 | 21,976 |
#
# Licensed to Intel Corporation under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# Intel Corporation licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this fi... | zhichao-li/BigDL | dl/src/main/python/util/common.py | Python | apache-2.0 | 7,567 |
"""Support for Ecovacs Ecovacs Vaccums."""
from __future__ import annotations
import logging
import sucks
from homeassistant.components.vacuum import (
SUPPORT_BATTERY,
SUPPORT_CLEAN_SPOT,
SUPPORT_FAN_SPEED,
SUPPORT_LOCATE,
SUPPORT_RETURN_HOME,
SUPPORT_SEND_COMMAND,
SUPPORT_STATUS,
SU... | mezz64/home-assistant | homeassistant/components/ecovacs/vacuum.py | Python | apache-2.0 | 6,203 |
# -*- coding: utf-8 -*-
# Main kivy import
import kivy
# Additional kivy imports
from kivy.app import App
from kivy.config import Config
# Screens
from screens import screenmanager
from screens.mainscreen import MainScreen
from screens.ingamescreen import IngameScreen
# Cause program to end if the required kivy ver... | ohaz/Colours | main.py | Python | apache-2.0 | 1,269 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import unittest
from earo.event import Event, Field
from earo.handler import Handler, Emittion, NoEmittion
from earo.mediator import Mediator
from earo.context import Context
from earo.processor import Processor, ProcessFlow
from earo.diagram import Diagram
class TestDiagram(... | Everley1993/Laky-Earo | test/test_diagram.py | Python | apache-2.0 | 4,567 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | pypa/warehouse | warehouse/admin/__init__.py | Python | apache-2.0 | 2,024 |
from gui_items import *
from objects.xml.xml_step import Step
class ActionPanel:
def __init__(self, display):
self.steps = []
self.display = display
# new ACTION panel (textbox met draaien, knop voor het uitvoeren van de draaien)
self.panel = self.display.gui_items.add_panel(450,... | Willempie/Artificial_Intelligence_Cube | logic/handling/panel_action.py | Python | apache-2.0 | 5,455 |
#!/usr/bin/env 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | google/google-ctf | 2021/quals/kctf/challenge-templates/pwn/healthcheck/healthcheck.py | Python | apache-2.0 | 1,160 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: zhlinhng@gmail.com
Version: 0.0.1
Created Time: 2016-03-03
Last_modify: 2016-03-03
******************************************
'''
'''
Reverse a linked list from position m to n... | zhlinh/leetcode | 0092.Reverse Linked List II/solution.py | Python | apache-2.0 | 1,199 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | skuda/client-python | kubernetes/test/test_logs_api.py | Python | apache-2.0 | 964 |
#
# 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... | Fokko/incubator-airflow | tests/executors/test_local_executor.py | Python | apache-2.0 | 3,328 |
from selenium.webdriver.common.by import By
from SeleniumPythonFramework.src.main.Pages.CommonPage import CommonPage
# Production locations
TRY_TEXT = {"by": By.ID, "locator": "url-input"}
TRY_BUTTON = {"by": By.ID, "locator": "get-data"}
PATH = ""
class HomePage(CommonPage):
def __init__(self, **kwargs):
... | GinoGalotti/python-selenium-utils | SeleniumPythonFramework/src/main/Pages/HomePage.py | Python | apache-2.0 | 710 |
# -*- coding: utf-8 -*-
# Copyright (c) 2004-2014 Alterra, Wageningen-UR
# Allard de Wit (allard.dewit@wur.nl), April 2014
from collections import namedtuple
from math import exp
from ..traitlets import Float, Int, Instance, AfgenTrait
from ..decorators import prepare_rates, prepare_states
from ..base_classes import P... | jajberni/pcse_web | main/pcse/crop/partitioning.py | Python | apache-2.0 | 12,949 |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
##
## Run selected tests from test_pep380 from StdLib
##
import unittest
import sys
from iptest import run_tes... | IronLanguages/ironpython3 | Tests/test_pep380_stdlib.py | Python | apache-2.0 | 4,035 |
#!/usr/bin/env python
# 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, softwar... | savinash47/openstack-doc-tools | os_doc_tools/handle_pot.py | Python | apache-2.0 | 8,610 |
import modules.options_helper as opt_helper
from modules.file.file_helper import File
import sys
def main(options):
# available config keys
options_registry = ["path","find","replace_with"]
# verify config option provided match registry
opt_helper.check_options(options, options_re... | dkoudlo/py-manage-server | modules/file/replace.py | Python | apache-2.0 | 1,593 |
from blinky.appveyor import *
from blinky.circle import *
from blinky.github import *
from blinky.jenkins import *
from blinky.travis import *
http_port = 8080
model.title = "Test CI"
# Components
proton_c = Component(model, "Proton C")
# Environments
multiple = Environment(model, "Multiple OSes")
# Agents
gith... | ssorj/blinky | misc/config.py | Python | apache-2.0 | 754 |
__author__ = "Rajiv Mayani"
import logging
import uuid
from decimal import Decimal
from enum import Enum
from flask.json import JSONEncoder
from sqlalchemy import inspect
from Pegasus.service.base import ErrorResponse, OrderedDict, PagedResponse
log = logging.getLogger(__name__)
class PegasusJsonEncoder(JSONEncod... | pegasus-isi/pegasus | packages/pegasus-python/src/Pegasus/service/_encoder.py | Python | apache-2.0 | 1,941 |
"""a collection of Annotation-related models"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from flask_appbuilder import Model
from sqlalchemy import (
Column, DateTime, ForeignKey, Index, Integer, String, Text... | alanmcruickshank/superset-dev | superset/models/annotations.py | Python | apache-2.0 | 1,544 |
class Sample(object):
"""
A data point of the Metric
:param metricId: Metric FQN
:type metricId: string
:param timestamp: Timestamp for the sample
:type timestamp: int
:param value: Value of the sample
:type value: float
:param min: Minimum of the sa... | Netuitive/netuitive-client-python | netuitive/sample.py | Python | apache-2.0 | 1,267 |
#! /usr/bin/python
"""Src-depend is a simple tool for sketching source code dependency graphs
from source code itself. It iterates through all source code files in given
directory, finds import statements and turns them into edges of a dependency
graph.
Uses graphviz for sketching graphs."""
import argparse
import gra... | Sventimir/src-depend | depend.py | Python | apache-2.0 | 4,469 |
from setuptools import setup, find_packages
setup(
name = 'jper-oaipmh',
version = '1.0.0',
packages = find_packages(),
install_requires = [
"octopus==1.0.0",
"esprit",
"Flask"
],
url = 'http://cottagelabs.com/',
author = 'Cottage Labs',
author_email = 'us@cottag... | JiscPER/jper-oaipmh | setup.py | Python | apache-2.0 | 610 |
# 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 ... | wjsl/jaredcumulo | test/system/auto/simple/mapreduce.py | Python | apache-2.0 | 6,108 |
# Copyright (c) 2017 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/db/migration/alembic_migrations/versions/baccabeffa81_remove_fks.py | Python | apache-2.0 | 4,936 |
"""List diff preferences associated with one's account"""
# pylint: disable=invalid-name
import argparse
import logging
from libpycr.exceptions import PyCRError
from libpycr.gerrit.client import Gerrit
from libpycr.meta import GerritAccountBuiltin
from libpycr.pager import Pager
from libpycr.utils.commandline import... | JcDelay/pycr | libpycr/builtin/accounts/ls-diff-prefs.py | Python | apache-2.0 | 3,136 |
# Copyright 2015 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... | freedomtan/tensorflow | tensorflow/python/framework/sparse_tensor.py | Python | apache-2.0 | 17,827 |
__author__ = 'Tony Beltramelli www.tonybeltramelli.com - 06/09/2015'
import numpy as np
class Label:
def __init__(self, path):
file_path = "{}labels.csv".format(path)
try:
data = np.genfromtxt(file_path, delimiter=',', skip_header=1,
names=['timestamp'... | tonybeltramelli/Deep-Spying | server/analytics/modules/label/Label.py | Python | apache-2.0 | 725 |
def parse_event(raw_event,preserve_backslash=False,preserve_dot=False):
in_string = False
words = []
d = {}
key = None
curr = []
for c in raw_event:
if c == '\\' and not preserve_backslash:
continue
elif c == '"':
in_string = not in_string
elif c == ' ':
if in_string:
c... | melrief/Hadoop-Log-Tools | hadoop/log/convert/libjobevent.py | Python | apache-2.0 | 1,665 |
# Copyright (c) 2013 Yogesh Panchal, yspanchal@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 ... | yspanchal/bitbucketcli | bitbucket/wiki.py | Python | apache-2.0 | 4,056 |
import argparse
import requests
import logging
import pip._internal
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Get the nth version of a given package')
parser.add_argument('--package', type=str, required=True, help='The PyPI you want to inspect')
parser.add_argument('--nth_l... | zsdonghao/tensorlayer | docker/pypi_list.py | Python | apache-2.0 | 1,987 |
from django.shortcuts import render, render_to_response, RequestContext
from .forms import SignUpForm
# Create your views here.
def home(request):
form = SignUpForm(request.POST or None)
if form.is_valid():
save_it = form.save(commit=False)
save_it.save()
return render_to_response... | sonnykr/blog | SignUps/views.py | Python | apache-2.0 | 389 |
# 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... | google/UIforETW | bin/ETWPackSymbols.py | Python | apache-2.0 | 7,629 |
from app.gcloud.utils import refresh_credentials, get_gapi_authorized_http
from datetime import datetime, timedelta
import oauth2client
import apiclient
INSTANCE_METRICS = [
'compute.googleapis.com/instance/cpu/utilization'
]
INSTANCE_DISK_METRICS = [
'compute.googleapis.com/instance/disk/read_bytes_count',
... | giubil/trackit | api/files/api/app/gcloud/compute_metrics.py | Python | apache-2.0 | 5,327 |
from keras.models import Sequential
from keras.layers.core import Flatten, Dense, Dropout
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.optimizers import SGD
import numpy as np
def VGG_16(weights_path=None):
model = Sequential()
model.add(ZeroPadding2D((1,1),input... | qxcv/joint-regressor | keras/vggnet/vgg16_keras.py | Python | apache-2.0 | 2,604 |
import os
import numpy as np
import nibabel as nb
import nighresjava
from ..io import load_volume, save_volume
from ..utils import _output_dir_4saving, _fname_4saving
def levelset_curvature(levelset_image, distance=1.0,
save_data=False, overwrite=False, output_dir=None,
... | nighres/nighres | nighres/surface/levelset_curvature.py | Python | apache-2.0 | 4,723 |
# This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from xdrlib import Packer, Unpacker
from ..type_checked import type_checked
from .base import Integer
__all__ = ["Int32"]
@type_checked
class Int32:
"""
XDR Source Code::
typedef int int32;
... | StellarCN/py-stellar-base | stellar_sdk/xdr/int32.py | Python | apache-2.0 | 1,398 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
# no... | 1ukash/horizon | horizon/dashboards/project/volumes/tests.py | Python | apache-2.0 | 14,507 |
from __future__ import absolute_import
import zope.interface.interface
from zope.interface.adapter import AdapterLookup as _AdapterLookup
from zope.interface.adapter import AdapterRegistry as _AdapterRegistry
from zope.interface.registry import Components, ComponentLookupError
__all__ = ('Registry',)
NO_CONTRACTS =... | fafhrd91/mdl | mdl/registry.py | Python | apache-2.0 | 3,760 |
def tracer(func): # State via enclosing scope and func attr
def wrapper(*args, **kwargs): # calls is per-function, not global
wrapper.calls += 1
print('call %s to %s' % (wrapper.calls, func.__name__))
return func(*args, **kwargs)
wrapper.calls = 0
return... | dreadrel/UWF_2014_spring_COP3990C-2507 | notebooks/scripts/book_code/code/decorator5.py | Python | apache-2.0 | 750 |
# -*- 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... | tseaver/gcloud-python | bigtable/google/cloud/bigtable_admin_v2/gapic/transports/bigtable_instance_admin_grpc_transport.py | Python | apache-2.0 | 12,786 |
import ast
import logging
import time
import unittest
from malcolm.profiler import Profiler
# https://github.com/bdarnell/plop/blob/master/plop/test/collector_test.py
class ProfilerTest(unittest.TestCase):
def filter_stacks(self, results):
# Kind of hacky, but this is the simplest way to keep the tests
... | dls-controls/pymalcolm | tests/test_profiler.py | Python | apache-2.0 | 2,778 |
# 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... | dhuang/incubator-airflow | tests/providers/microsoft/azure/hooks/test_azure_data_factory.py | Python | apache-2.0 | 15,858 |
# Copyright (c) 2016 Intel 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 applicable la... | cloudbase/neutron | neutron/objects/floatingip.py | Python | apache-2.0 | 1,361 |
from ajax_select import make_ajax_form
from ajax_select.admin import AjaxSelectAdmin
from bitfield import BitField
from bitfield.admin import BitFieldListFilter
from bitfield.forms import BitFieldCheckboxSelectMultiple
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.shortcuts i... | b12io/orchestra | orchestra/admin.py | Python | apache-2.0 | 13,202 |
from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
class TextTabStopTextAfterTab_ExpectCorrectResult(_VimTest):
snippets = ('test', '$1 Hinten\n$1')
keys = 'test' + EX + 'hallo'
wanted = 'hallo Hinten\nhallo'
class TextTabStopTextBeforeTab_ExpectCorrectResult(_VimTest):
... | yslin/tools-zodlin | ubuntu/vim/.vim/lang/all/ultisnips/test/test_Mirror.py | Python | apache-2.0 | 8,787 |
#
# 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
# ... | openstack/heat | heat/engine/resources/template_resource.py | Python | apache-2.0 | 14,723 |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | tensorflow/datasets | tensorflow_datasets/audio/gtzan/gtzan.py | Python | apache-2.0 | 3,225 |
##################################################
#
# IMpot
#
#################################################
import subprocess
import shlex
import packet
##################################################
#
# Constants
#
#################################################
# Genrals imports
HEADER = "tshark -r"
PR... | fabthefabulousfab/script_plantuml | extract_tshark.py | Python | apache-2.0 | 1,810 |
"""Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be u... | mikewesner-wf/glasshouse | appengine/lib/invoke/vendor/pexpect/__init__.py | Python | apache-2.0 | 78,307 |
#### DB SETUP ####
from pocket_change.database import SQLAlchemyWrapperProxy
sqlalchemy_db = SQLAlchemyWrapperProxy()
from sneeze.database.models import add_models as sneeze_models
from pocket.database import add_models as pocket_models
model_adders = [sneeze_models, pocket_models]
#### APP CONFIG ####
from flask ... | psusloparov/sneeze | pocket_change/pocket_change/__init__.py | Python | apache-2.0 | 2,161 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# 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... | ruijie/quantum | quantum/tests/unit/ryu/test_ryu_db.py | Python | apache-2.0 | 2,027 |
# 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 th... | stackforge/kolla | kolla/tests/test_methods.py | Python | apache-2.0 | 5,853 |
#!/usr/bin/env python
from flup.server.fcgi import WSGIServer
from frontend import app
WSGIServer(app, bindAddress=app.config['FCGI_SOCKET']).run()
| jkossen/imposter | examples/frontend_fcgi.py | Python | bsd-2-clause | 149 |
import os
from flask import Flask, redirect, render_template_string, request, url_for
from flask_babel import Babel
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
from flask_user import confirm_email_required, current_user, login_required, \
UserManager, UserMixin, SQLAlchem... | jamescarignan/Flask-User | example_apps/invite_app.py | Python | bsd-2-clause | 6,755 |
# -*- coding: utf-8 -*-
import logging
from django.db import models
from system.official_account.models import OfficialAccount
from system.rule.models import Rule
logger_rule_match = logging.getLogger(__name__)
class RuleMatchManager(models.Manager):
"""
微信规则回复表 Manager
"""
def add(self, rule, plu... | doraemonext/wechat-platform | wechat_platform/system/rule_match/models.py | Python | bsd-2-clause | 2,385 |
# Copyright 2008-2009 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import os
import re
import sys
import gtk
from... | jbaayen/reinteract | lib/reinteract/base_notebook_window.py | Python | bsd-2-clause | 10,711 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.