code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#-*-coding:utf-8-*-
from . import about_blueprint
from flask import render_template
@about_blueprint.route("/")
def about_index():
return render_template("about.html") | PythonScientists/Shape | main/module/about/views.py | Python | apache-2.0 | 173 |
#!/bin/python
from zeroos.core0.client import Client
import sys
import time
"""
This script expect you know the IP of the core0 and you can access it from the machine running this script.
an easy way to do it is to build the initramfs with a customr zerotier network id (https://github.com/g8os/initramfs/tree/0.10.0#c... | g8os/core0 | docs/_archive/examples/mongodb.py | Python | apache-2.0 | 3,162 |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana 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.o... | DougFirErickson/neon | neon/backends/tests/test_tensor.py | Python | apache-2.0 | 4,727 |
#!/usr/bin/env python
# flake8: noqa
from setuptools import find_packages, setup
setup(
name = "acos-client",
version = "1.4.6",
packages = find_packages(),
author = "A10 Networks",
author_email = "mdurrant@a10networks.com",
description = "A10 Networks ACOS API Client",
license = "Apache"... | mdurrant-b3/acos-client | setup.py | Python | apache-2.0 | 1,390 |
import urllib2
import zipfile
import re
url = "http://www.pythonchallenge.com/pc/def/channel.zip"
data = urllib2.urlopen(url).read()
file1='ttt.zip'
with open(file1,'wb+') as fzip:
fzip.write(data)
#dd=re.compile(r'[from|is] (\d+$)')
dd = re.compile(r'(?<=[from|is] )(\d+)')
zf = zipfile.ZipFile(file1,'r')
text=... | gregorianzhang/pythonchallenge | 6.py | Python | apache-2.0 | 761 |
'''
Check Yahoo finance currency data helper.
Update log: (date / version / author : comments)
2017-12-10 / 1.0.0 / Du Jiang : Creation
2017-12-13 / 2.0.0 / Du Jiang : Use new API
'''
from com.djs.learn.financeapi import CheckFinanceDataRequests
__data_type = 1
__inventory_info_file_path = "../../../../etc/Currency... | djsilenceboy/LearnTest | Python_Test/PyFinanceApiSample/com/djs/learn/test/TestCheckYahooFinanceCurrencyData.py | Python | apache-2.0 | 709 |
# 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... | openstack/smaug | karbor/services/operationengine/engine/triggers/timetrigger/__init__.py | Python | apache-2.0 | 1,625 |
"""
Provided code for Application portion of Module 1
Imports physics citation graph
"""
###################################
# Code for loading citation graph
CITATION_URL = "phys-cite_graph.txt"
def load_graph(graph_url):
"""
Function that loads a graph given the URL
for a text representation of the gr... | tsh/coursera-algorithmic-thinking | Week 1/graph_loader.py | Python | apache-2.0 | 908 |
import os
import sys
import logging
import threading
from flask import Flask
app = Flask(__name__)
app.config.from_envvar("PEGASUS_METRICS_CONFIG")
# This is required for sessions and message flashing
app.secret_key = os.urandom(24)
import pegasus.metrics.views
import pegasus.metrics.filters
| pegasus-isi/pegasus-metrics | pegasus/metrics/__init__.py | Python | apache-2.0 | 298 |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.cogdominium.DistributedCogdoElevatorInt
from toontown.building.DistributedElevatorInt import DistributedElevatorInt
class DistributedCogdoElevatorInt(DistributedElevatorInt):
def _getDoorsClosedInfo(self):
return ('cogdoInterior', '... | DedMemez/ODS-August-2017 | cogdominium/DistributedCogdoElevatorInt.py | Python | apache-2.0 | 335 |
#!/usr/bin/python
from subprocess import call
import sys
import os
from socket import *
cs = socket(AF_INET, SOCK_DGRAM)
cs.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
cs.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
###Broadcast according to client group
#Show ports associated with a particular group
file = "group_port.txt" ... | Colviz/Vince | groups/group_server.py | Python | apache-2.0 | 2,451 |
"""Per-repository configuration options."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_repooptions
#
# Public Classes:
# Data
#
# Public Functions:
# merge_override_into_data
# me... | valhallasw/phabricator-tools | py/abd/abdt_repooptions.py | Python | apache-2.0 | 6,892 |
"""Support for MyQ gateways."""
from pymyq.const import (
DEVICE_STATE as MYQ_DEVICE_STATE,
DEVICE_STATE_ONLINE as MYQ_DEVICE_STATE_ONLINE,
KNOWN_MODELS,
MANUFACTURER,
)
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
BinarySensorEntity,
)
from homeassistant.help... | kennedyshead/home-assistant | homeassistant/components/myq/binary_sensor.py | Python | apache-2.0 | 2,370 |
# _*_ coding:utf-8 _*_
import random
from parser_xml import doxml
__author__ = 'Administrator'
import pygame
def item_to_int(array=[]):
arr = []
for a in array:
arr.append(int(a))
return arr
pygame.init()
keys = [False, False, False, False]
screen = pygame.display.set_mode((450, 650), 0, 32)
... | myangeline/pygame | flightgame/game.py | Python | apache-2.0 | 5,800 |
from common.methods import set_progress
from utilities.models import ConnectionInfo
from servicecatalog.models import ServiceBlueprint
from infrastructure.models import CustomField
import json
from ast import literal_eval
import requests
API_CLIENT_CI = "Citrix API"
def create_custom_fields_as_needed():
CustomF... | CloudBoltSoftware/cloudbolt-forge | blueprints/citrix/citrix_itm_predictive_dns_record/management/edit_record.py | Python | apache-2.0 | 4,201 |
import csv
import datetime
import logging
import os
from celery.task import task
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.timezone import now
from libya_elections.constants import REMINDER_CHECKIN, REMINDER_REPORT, \
REMINDER_LAST_REPORT, REMINDER_CLOSE
fr... | SmartElect/SmartElect | bulk_sms/tasks.py | Python | apache-2.0 | 7,112 |
#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... | InsightSoftwareConsortium/ITKExamples | src/IO/ImageBase/GenerateSlicesFromVolume/Code.py | Python | apache-2.0 | 1,976 |
# -*- coding: utf-8 -*-
import unittest
from datetime import datetime
from unittest.mock import call
from uuid import uuid4, UUID
from mock import patch, MagicMock
from alamo_worker.alerter.backend.cassandra import (
CassandraDriver, SELECT_QUERY, INSERT_QUERY, INSERT_SERVICE_QUERY,
AsyncCassandraDriver
)
fro... | RulersOfAsgard/ALAMO-worker | alamo_worker/alerter/tests/test_cassandra_backend.py | Python | apache-2.0 | 4,182 |
import numpy as np
import tvm
import topi
import topi.testing
from topi.util import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
def generate_quantized_np(shape, bits, out_dtype):
min_val = 0
max_val = 1 << bits
return np.random.randint(min_val, max_val, size=shape).astype(out_dtype)
def... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/topi/tests/python/test_topi_bitserial_conv2d.py | Python | apache-2.0 | 4,850 |
from flask import Flask, redirect, abort, url_for
app = Flask(__name__)
app.debug = True
@app.route('/')
def index():
return redirect(url_for('login'))
@app.route('/login')
def login():
abort(401)
this_is_never_executed()
if __name__ == '__main__':
app.run()
| schanezon/webapp | test.py | Python | apache-2.0 | 278 |
#!/usr/bin/env python3
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: op-test-framework/testcases/OpTestPCI.py $
#
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License,... | open-power/op-test-framework | testcases/OpTestPCI.py | Python | apache-2.0 | 36,744 |
from decimal import Decimal
from voluptuous import MultipleInvalid
from minfraud.validation import validate_transaction, validate_report
import unittest
class ValidationBase:
def setup_transaction(self, transaction):
if "device" not in transaction:
transaction["device"] = {}
if "ip_... | maxmind/minfraud-api-python | tests/test_validation.py | Python | apache-2.0 | 15,656 |
"""Support for Subaru sensors."""
import subarulink.const as sc
from homeassistant.components.sensor import DEVICE_CLASSES
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_VOLTAGE,
LENGTH_KILOMETERS,
LENGTH_MILES,
PERCENTAGE,
PRESSURE_HPA,
T... | partofthething/home-assistant | homeassistant/components/subaru/sensor.py | Python | apache-2.0 | 7,898 |
# -*- 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-bigquery-storage | samples/generated_samples/bigquerystorage_v1beta2_generated_big_query_write_append_rows_sync.py | Python | apache-2.0 | 1,884 |
from os import makedirs
from os.path import join, dirname, exists
from string import Template
from galaxy.util.bunch import Bunch
from galaxy.objectstore import build_object_store_from_config
from .test_utils import TempDirectoryTestCase
from .test_objectstore import MockDataset
class PulsarObjectStoreTest(TempDirec... | ssorgatem/pulsar | test/pulsar_objectstore_test.py | Python | apache-2.0 | 5,154 |
from tornado.process import cpu_count, _reseed_random
from tornado import ioloop
import logging
import os
import signal
import sys
from tornado.util import errno_from_exception
import errno
logger = logging.getLogger(__name__)
_task_id = None
exiting = False
def fork_processes(num_processes, max_restar... | kevenli/scrapydd | scrapydd/process.py | Python | apache-2.0 | 3,812 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | RyanSkraba/beam | sdks/python/apache_beam/io/tfrecordio_test.py | Python | apache-2.0 | 18,843 |
# Copyright (c) 2014 Rackspace Hosting
# 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 req... | richm/designate | designate/objects/tsigkey.py | Python | apache-2.0 | 756 |
# 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... | alsrgv/tensorflow | tensorflow/python/distribute/saved_model_save_load_test.py | Python | apache-2.0 | 3,531 |
# Copyright (C) 2014 Universidad Politecnica de Madrid
# 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... | ging/python-keystoneclient | keystoneclient/v3/contrib/activation.py | Python | apache-2.0 | 1,528 |
import tornado.ioloop
import tornado.web
import tornado.websocket
import os
UPLOAD_FILE_PATH = "./tempfiles/"
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.render("./templates/main.html", title = "Main Page");
class EchoWebSocket(tornado.websocket.WebSocketHandler):
all_client = ... | shj00007/DODO | test.py | Python | apache-2.0 | 1,569 |
import glob
import os
import synapseclient
import uuid
from synapseclient import Project, File, Folder, Evaluation
from challenge import *
import challenge
from collections import OrderedDict
syn = synapseclient.Synapse()
syn.login()
CLEANUP = True
## module scope variable to hold project
project = None
evaluation =... | Sage-Bionetworks/DREAM_Alzheimers_Challenge_Scoring | test.py | Python | apache-2.0 | 6,996 |
# key point is to find the half node
class Node:
def __init__(self, val):
self.val = val
self.next = None
class LinkList:
def __init__(self):
self.head = None
def push(self, val):
node = Node(val)
if self.head:
node.next = self.head
self.he... | sonymoon/algorithm | src/main/python/geeksforgeeks/list/mmerge-sort-for-linked-list.py | Python | apache-2.0 | 1,384 |
#!/usr/bin/python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Sarsate/compute-image-packages | google_compute_engine/instance_setup/tests/instance_setup_test.py | Python | apache-2.0 | 14,219 |
from setuptools import setup
setup(
name = "smbios_validation_tool",
author = "Xu Han",
author_email = "",
license = "Apache",
url = "https://github.com/google/smbios-validation-tool",
packages=['smbios_validation_tool', 'dmiparse'],
scripts=['smbios_validation'],
)
| google/smbios-validation-tool | setup.py | Python | apache-2.0 | 296 |
# Copyright (c) 2013 Rackspace Hosting
# 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 req... | magic0704/oslo.db | oslo_db/tests/test_api.py | Python | apache-2.0 | 8,075 |
import pytest
from etcdb import OperationalError
from etcdb.lock import WriteLock
def test_insert(cursor):
cursor.execute('CREATE TABLE t1(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255))')
cursor.execute("INSERT INTO t1(id, name) VALUES (1, 'aaa')")
cursor.execute("INSERT INTO t1(id, name)... | box/etcdb | tests/functional/dml/test_insert.py | Python | apache-2.0 | 1,931 |
# Copyright 2018 - Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | openstack/vitrage | vitrage/tests/unit/datasources/prometheus/test_prometheus_transformer.py | Python | apache-2.0 | 6,042 |
import unittest
import sys
import inspect
from robot.running.handlers import _PythonHandler, _JavaHandler, DynamicHandler
from robot import utils
from robot.utils.asserts import *
from robot.running.testlibraries import TestLibrary
from robot.running.dynamicmethods import (
GetKeywordArguments, GetKeywordDocumenta... | synsun/robotframework | utest/running/test_handlers.py | Python | apache-2.0 | 13,048 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/pikov | python/pikov/properties.py | Python | apache-2.0 | 2,766 |
import os
from ruamel import yaml
import great_expectations as ge
from great_expectations.core.batch import BatchRequest, RuntimeBatchRequest
redshift_username = os.environ.get("REDSHIFT_USERNAME")
redshift_password = os.environ.get("REDSHIFT_PASSWORD")
redshift_host = os.environ.get("REDSHIFT_HOST")
redshift_port =... | great-expectations/great_expectations | tests/integration/docusaurus/connecting_to_your_data/database/redshift_yaml_example.py | Python | apache-2.0 | 3,566 |
# Copyright 2021 DeepMind Technologies 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 agree... | deepmind/detcon | utils/augmentations.py | Python | apache-2.0 | 10,529 |
"""
gene.py realize the methods that are related to system recommendation.
@author: Bowen
"""
from system.models import gene, reaction, compound, reaction_compound, compound_gene, pathway, pathway_compound, organism
from system.fasta_reader import parse_fasta_str
from elasticsearch import Elasticsearch
import traceba... | igemsoftware/HFUT-China_2015 | system/gene.py | Python | apache-2.0 | 15,855 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-compute | google/cloud/compute_v1/services/service_attachments/client.py | Python | apache-2.0 | 59,785 |
from json import dumps
import requests
d = {'yolar': 535, 'galaxy': 536, 'solar': 551, 'swordkeeper': 552, 'civilization': 553, 'CurvatureDrive': 554,
'singer': 555, 'hdfragments': 556, 'evans': 557, 'dagon': 558, 'di-foil': 559, 'dimension': 560, 'farmer': 562,
'hibernation': 564, 'huformation': 565, 'ment... | ljm516/big-challenge | chanllenge/util/wayknew.py | Python | apache-2.0 | 1,625 |
from models.contact import Contacts
from data.data_for_contacts import constant as testdata
import pytest
def test_NewContact(app, db, json_contacts):
contact = json_contacts
old_contacts = db.get_contact_list()
app.contacts.create_contact(contact)
new_contacts = db.get_contact_list()
old_contact... | ksemish/KseniyaRepository | tests/NewContact.py | Python | apache-2.0 | 457 |
# pylint: disable=redefined-outer-name, missing-docstring
import sys
import pytest
sys.path.append('..')
from batchflow import Config
@pytest.fixture
def config():
_config = dict(key1='val1', key2=dict())
_config['key2']['subkey1'] = 'val21'
return Config(_config)
class TestConfig:
def test_getitem... | analysiscenter/dataset | batchflow/tests/config_test.py | Python | apache-2.0 | 2,864 |
import json
import time
import pytest
from anchore_engine.auth.common import (
get_creds_by_registry,
get_docker_registry_userpw,
registry_record_matches,
)
_test_username = "tonystark"
_test_password = "potts"
_test_registry_meta = {
"authorizationToken": "{}:{}".format(_test_username, _test_passwor... | anchore/anchore-engine | tests/unit/anchore_engine/auth/test_common.py | Python | apache-2.0 | 3,612 |
# 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-research/federated | generalization/utils/trainer_utils_test.py | Python | apache-2.0 | 6,847 |
# Copyright (c) 2015 SONATA-NFV, Thales Communications & Security
# 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
#
#... | cgeoffroy/son-analyze | son-scikit/src/son_scikit/hl_prometheus.py | Python | apache-2.0 | 2,969 |
# Copyright 2015 Don Drake don@drakeconsulting.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 or a... | dondrake/smartframes | tests/test_SmartFrames.py | Python | apache-2.0 | 5,541 |
#
# Copyright 2013 Nicolas Lamirault <nicolas.lamirault@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 ... | nlamirault/python-freeboxclient | freeboxclient/client.py | Python | apache-2.0 | 3,447 |
#!/usr/bin/env python
# @author: Martin Siggel <martin.siggel@dlr.de>
#
# This script fixes the cmake exports file by
# removing explicit linking to system libraries
import sys, re
def remove_absolute_paths(line):
"""
Removes libraries from the line that are found under /usr
"""
if sys.platform == '... | DLR-SC/tigl | ci/conda/oce-static/remove-system-libs.py | Python | apache-2.0 | 1,087 |
#! /usr/bin/env python
"""
Parse PER vs. SINR data from trace files.
Revision Info
=============
* $LastChangedBy: mandke $
* $LastChangedDate: 2011-10-19 17:04:02 -0500 (Wed, 19 Oct 2011) $
* $LastChangedRevision: 5220 $
:author: Ketan Mandke <kmandke@mail.utexas.edu>
:copyright:
Copyright 2009-2011 The Unive... | reidlindsay/wins | sandbox/experiments/aloha/infocom/parse-per.py | Python | apache-2.0 | 6,546 |
import ctypes
class JLinkException(Exception): pass
class JLink(object):
"Jlink api"
revser = 0
def __init__(self, dllpath):
self.jlink = ctypes.cdll.LoadLibrary(dllpath)
self.tif_select(1)
self.set_speed(1000)
self.reset()
def check_err(fn):
def che... | xqt2010a/Python_Study | python/07_JLink_RTT/JLink.py | Python | apache-2.0 | 2,491 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the XLSX output module."""
import os
import unittest
import zipfile
from xml.etree import ElementTree
from plaso.containers import events
from plaso.formatters import interface as formatters_interface
from plaso.formatters import manager as formatters_manager
fr... | dc3-plaso/plaso | tests/output/xlsx.py | Python | apache-2.0 | 5,608 |
# -*- coding: utf-8 -*-
import curses
import npyscreen
from vent.helpers.paths import PathDirs
from vent.menu import VentApp
from vent.menus.main import MainForm
npyscreen.TEST_SETTINGS['CONTINUE_AFTER_TEST_INPUT'] = False
def run_menu(test_input):
""" Actually run the menu and process any input """
# init... | Jeff-Wang93/vent | tests/menu/test_menu.py | Python | apache-2.0 | 12,615 |
#!/usr/bin/env python
# This script will tweet the text that is passed as an argument
# Requires Twython, API credentials set as env vars
# Usage: python status-tweet.py "Hello Everyone, this is my Raspberry Pi tweeting you more nonsense"
import sys
import os
from twython import Twython
import twitter_api_creds
# Se... | swoodford/twitter | status-tweet.py | Python | apache-2.0 | 663 |
from direct.actor.Actor import Actor
from direct.task.Task import Task
from panda3d.core import *
from panda3d.direct import *
from otp.otpbase.OTPBase import OTPBase
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.parties.DistributedPartyActivity import Distributed... | silly-wacky-3-town-toon/SOURCE-COD | toontown/parties/DistributedPartyJukeboxActivityBase.py | Python | apache-2.0 | 9,133 |
import pickle
import redis
from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB
__all__ = [
'get_client',
'cache_object',
'get_object'
]
def get_client():
client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB)
return client
def cache_object(client, key, obj, ttl=60):
... | racker/pod-manager | pod_manager/db.py | Python | apache-2.0 | 603 |
# 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... | rahul003/mxnet | python/mxnet/module/base_module.py | Python | apache-2.0 | 47,156 |
# Copyright 2017, Fabien Boucher
# Copyright 2017, Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | morucci/repoxplorer | repoxplorer/controllers/projects.py | Python | apache-2.0 | 2,146 |
# 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... | tensorflow/tensorboard | tensorboard/backend/event_processing/plugin_asset_util.py | Python | apache-2.0 | 3,555 |
# Copyright 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 applicable law or agreed to in writing... | stratis-storage/stratis-cli | tests/whitebox/monkey_patching/test_keyboard_interrupt.py | Python | apache-2.0 | 1,934 |
#!/usr/bin/python
##########################################################################
#
# MTraceCheck
# Copyright 2017 The Regents of the University of Michigan
# Doowon Lee and Valeria Bertacco
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... | leedoowon/MTraceCheck | src_main/codegen_common.py | Python | apache-2.0 | 10,228 |
from django.core import urlresolvers
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import timesince, floatformat
from horizon import tables
from horizon.templatetags.sizeformat import mbformat
class CSVSummary(tables.LinkAction):
name = "csv_summary"
verbose_name... | MKTCloud/MKTCloud | openstack_dashboard/usage/tables.py | Python | apache-2.0 | 2,531 |
# 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 b... | vganapath/rally | tests/unit/plugins/common/hook/test_sys_call.py | Python | apache-2.0 | 4,165 |
# 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
from pants.contrib.python.checks.tasks.checkstyle.plugin_subsystem_base import PluginSubs... | foursquare/pants | contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/indentation_subsystem.py | Python | apache-2.0 | 559 |
##
# Copyright (c) 2006-2013 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... | skarra/CalDAVClientLibrary | caldavclientlibrary/protocol/http/tests/test_util.py | Python | apache-2.0 | 4,886 |
from transitfeed import TYPE_ERROR, TYPE_WARNING, TYPE_NOTICE
from oba_rvtd_monitor.feedvalidator import LimitPerTypeProblemAccumulator
class MonitoringProblemAccumulator(LimitPerTypeProblemAccumulator):
pass
| trilliumtransit/oba_rvtd_monitor | oba_rvtd_monitor/problems.py | Python | apache-2.0 | 216 |
"""
This component provides basic support for Amcrest IP cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.amcrest/
"""
import logging
from homeassistant.components.amcrest import (
DATA_AMCREST, STREAM_SOURCE_LIST, TIMEOUT)
from homeas... | PetePriority/home-assistant | homeassistant/components/amcrest/camera.py | Python | apache-2.0 | 3,307 |
#
# Copyright 2016-2019 Crown Copyright
#
# 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... | gchq/gaffer-tools | python-shell/src/example.py | Python | apache-2.0 | 26,676 |
#
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#!/usr/bin/env python
usage = '''
Write buildbot spec to outfile based on the bot name:
$ python buildbot_spec.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug
Or run self-tests:... | qrealka/skia-hc | tools/buildbot_spec.py | Python | apache-2.0 | 13,404 |
import base64
import errno
import random
import ssl
import threading
import time
import copy
import websocket
import xmltodict
import config
import debug
from utils import exitutils
import hubs.isy.isycodes as isycodes
import logsupport
from controlevents import CEvent, PostEvent, ConsoleEvent, PostIfInterested
from ... | kevinkahn/softconsole | hubs/isy/isyeventmonitor.py | Python | apache-2.0 | 21,759 |
from .array_ import array # noqa: F401
from .base import ( # noqa: F401
ExtensionArray,
ExtensionOpsMixin,
ExtensionScalarOpsMixin,
)
from .categorical import Categorical # noqa: F401
from .datetimes import DatetimeArray # noqa: F401
from .integer import IntegerArray, integer_array # noqa: F401
from .i... | kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/core/arrays/__init__.py | Python | apache-2.0 | 581 |
# 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 | poem/core/pipeline_utils.py | Python | apache-2.0 | 18,823 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | hellais/luigi | test/central_planner_test.py | Python | apache-2.0 | 28,970 |
# Copyright 2017 Bracket Computing, 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.
# A copy of the License is located at
#
# https://github.com/brkt/brkt-cli/blob/master/LICENSE
#
# or in the "license" file... | brkt/brkt-cli | brkt_cli/test_version.py | Python | apache-2.0 | 2,893 |
"""Single and multi-threaded executors."""
import datetime
import functools
import logging
import math
import os
import threading
from abc import ABCMeta, abstractmethod
from threading import Lock
from typing import (
Dict,
Iterable,
List,
MutableSequence,
Optional,
Set,
Tuple,
Union,
... | common-workflow-language/cwltool | cwltool/executors.py | Python | apache-2.0 | 18,408 |
# Copyright 2014 - Mirantis, Inc.
# Copyright 2015 - StackStorm, 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
#
# Unl... | openstack/mistral | mistral/lang/v2/actions.py | Python | apache-2.0 | 2,707 |
from model.group_address import Address_data
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/contacts.json... | esemin83/python_training | generator/contact.py | Python | apache-2.0 | 2,227 |
# Copyright 2017 Google Inc. and Skytruth 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 agr... | GlobalFishingWatch/vessel-classification | classification/metadata.py | Python | apache-2.0 | 16,174 |
# Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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... | ging/horizon | openstack_dashboard/dashboards/idm/home/views.py | Python | apache-2.0 | 3,184 |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2021 BigML
#
# 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 ... | jaor/python | bigml/tests/test_09_ensemble_prediction.py | Python | apache-2.0 | 4,365 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | kayhayen/Nuitka | tests/syntax/GlobalForParameter.py | Python | apache-2.0 | 793 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import codecs
import... | dbentley/pants | src/python/pants/backend/docgen/tasks/markdown_to_html.py | Python | apache-2.0 | 8,705 |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | HybridF5/jacket | jacket/tests/compute/unit/virt/disk/mount/test_api.py | Python | apache-2.0 | 7,718 |
#!/usr/bin/env python
#
# 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 requir... | googleads/googleads-python-lib | examples/ad_manager/v202108/creative_set_service/update_creative_set.py | Python | apache-2.0 | 2,796 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | zestrada/nova-cs498cc | nova/db/api.py | Python | apache-2.0 | 56,325 |
import sys, os
sys.path.append(os.path.abspath("../utils/"))
from utils_io_list import *
from test_utils_io_folder import *
def test_generate_pairs_for_each_folder():
images_folder_path= "folder/path/example"
num_of_frames = 2
pairs = generate_pairs_for_each_folder(images_folder_path, num_of_frames)
... | Guanghan/ROLO | update/unit_test/test_utils_io_list.py | Python | apache-2.0 | 2,578 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
import caching.base
class Migration(migrations.Migration):
dependencies = [
('opendebates', '0018_flag_note'),
]
operations = [
migrations.CreateModel(
na... | ejucovy/django-opendebates | opendebates/migrations/0019_sitemode.py | Python | apache-2.0 | 1,059 |
# Copyright (c) 2013 Red Hat, Inc.
# Author: William Benton (willb@redhat.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 r... | willb/wallaroo | clients/python-wallaroo/wallaroo/client/node.py | Python | apache-2.0 | 5,705 |
# coding=utf-8
# Copyright 2022 The TensorFlow GAN 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 applicabl... | tensorflow/gan | tensorflow_gan/examples/progressive_gan/layers.py | Python | apache-2.0 | 9,208 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | tonybaloney/st2 | contrib/runners/mistral_v2/tests/unit/test_mistral_v2_policy.py | Python | apache-2.0 | 11,045 |
class Solution(object):
def count_bits(self, n):
c = (n - ((n >> 1) & 0o33333333333) - ((n >> 2) & 0o11111111111))
return ((c + (c >> 3)) & 0o30707070707) % 63
def countBits(self, num):
"""
:type num: int
:rtype: List[int]
"""
return map(self.count_bits, x... | ckclark/leetcode | py/counting-bits.py | Python | apache-2.0 | 336 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | kayhayen/Nuitka | nuitka/nodes/TryNodes.py | Python | apache-2.0 | 17,486 |
# Copyright (C) 2015 zulily, 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, ... | zulily/node_status | node_status/version.py | Python | apache-2.0 | 623 |
#!/usr/bin/env python
#==============================================================================
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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 ma... | dldinternet/aws-cfn-resource-bridge | setup.py | Python | apache-2.0 | 3,161 |
__version__ = "1.3.15"
| F5Networks/f5-icontrol-rest-python | icontrol/__init__.py | Python | apache-2.0 | 23 |
from __future__ import absolute_import, print_function
import logging
from datetime import datetime
from changes.config import db
from changes.models import Repository, RepositoryStatus
from changes.queue.task import tracked_task
logger = logging.getLogger('repo.sync')
@tracked_task(max_retries=None)
def import_r... | alex/changes | changes/jobs/import_repo.py | Python | apache-2.0 | 1,505 |