hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1722141343d2b3287453720a3843cca41017331b | 780 | py | Python | fluentcms_socialfeed/content_plugins.py | bashu/fluentcms-socialfeed | 095e203f60be0faf7fa68540bf0db97c2a882718 | [
"Apache-2.0"
] | null | null | null | fluentcms_socialfeed/content_plugins.py | bashu/fluentcms-socialfeed | 095e203f60be0faf7fa68540bf0db97c2a882718 | [
"Apache-2.0"
] | null | null | null | fluentcms_socialfeed/content_plugins.py | bashu/fluentcms-socialfeed | 095e203f60be0faf7fa68540bf0db97c2a882718 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from socialaggregator.models import Ressource
from .models import SocialFeedItem
@plugin_pool.register
class SocialFeedPlugin(ContentPlugin):
model = SocialFeedItem... | 30 | 88 | 0.703846 |
27aa1fc908a2b01a2978671bc6f4c9d28ce5737a | 5,708 | py | Python | ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
'''
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"); y... | 42.281481 | 144 | 0.641731 |
416f4659963d9c0d40ea39c188248cc8790e5ee0 | 6,476 | py | Python | helpers.py | brucexin/Udacity_P3_Implement_SLAM | 3405b1031bd514eb546b71dbea9adc1ec92cd4ae | [
"MIT"
] | null | null | null | helpers.py | brucexin/Udacity_P3_Implement_SLAM | 3405b1031bd514eb546b71dbea9adc1ec92cd4ae | [
"MIT"
] | 4 | 2021-06-08T22:33:18.000Z | 2022-03-12T00:24:41.000Z | helpers.py | brucexin/Udacity_P3_Implement_SLAM | 3405b1031bd514eb546b71dbea9adc1ec92cd4ae | [
"MIT"
] | null | null | null | from robot_class import robot
from math import *
import random
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# --------
# this helper function displays the world that a robot is in
# it assumes the world is a square grid of some given size
# and that landmarks is a list of landmark position... | 35.582418 | 107 | 0.623996 |
57616b8c6849647257e05dcc87101be42b410166 | 548 | py | Python | data.py | Noesns/BangNasdaq | 80d6a78d3d8a5f428919c412a1c125350a9bb28e | [
"MIT"
] | null | null | null | data.py | Noesns/BangNasdaq | 80d6a78d3d8a5f428919c412a1c125350a9bb28e | [
"MIT"
] | null | null | null | data.py | Noesns/BangNasdaq | 80d6a78d3d8a5f428919c412a1c125350a9bb28e | [
"MIT"
] | null | null | null |
import pandas as pd
import yfinance as yf
import datetime
now = datetime.datetime.now()
tickers = pd.read_csv('CNDX_holdings.csv', skiprows=2).dropna()
tickers = tickers['Ticker']
precios = {}
for i in tickers:
pr = yf.download(i, start='2018-01-01', end=now, interval='1d')
pr = pr.drop(['Adj Clo... | 26.095238 | 74 | 0.644161 |
b93e27105304fc89839ce00f9d3dd3f6de47db04 | 325 | py | Python | test/response_test.py | hennr/buildnotify | 581fbd17e2fac4ef841ef97f8f4d15bbb9a6854d | [
"MIT"
] | 27 | 2017-11-13T09:31:22.000Z | 2022-03-09T11:00:15.000Z | test/response_test.py | hennr/buildnotify | 581fbd17e2fac4ef841ef97f8f4d15bbb9a6854d | [
"MIT"
] | 159 | 2017-09-14T16:22:51.000Z | 2022-03-21T06:01:39.000Z | test/response_test.py | hennr/buildnotify | 581fbd17e2fac4ef841ef97f8f4d15bbb9a6854d | [
"MIT"
] | 10 | 2018-06-12T02:13:18.000Z | 2021-03-12T11:04:51.000Z | import unittest
from buildnotifylib.core.response import Response
from requests.exceptions import SSLError
class ResponseTest(unittest.TestCase):
def test_should_return_ssl_error(self):
response = Response({}, SSLError())
self.assertTrue(response.failed())
self.assertTrue(response.ssl_erro... | 29.545455 | 49 | 0.753846 |
28e105800c84921003321ae46041bb3169189ef6 | 1,288 | py | Python | parse/python/mk.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 13 | 2018-12-17T23:30:54.000Z | 2021-12-29T14:31:43.000Z | parse/python/mk.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 36 | 2018-06-07T21:34:13.000Z | 2022-03-13T21:01:43.000Z | parse/python/mk.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 2 | 2021-01-03T11:47:20.000Z | 2021-12-29T14:31:49.000Z | import time
import json
import requests
from bs4 import BeautifulSoup
URL = 'https://www.mk.ru/{}/{}/'
categories = ('politics', 'economics', 'incident', 'social', 'sport', 'culture', 'science')
for category in categories:
print('-'*100)
print(category)
print('-'*100)
with open('data/mk/{}.json'.format(categor... | 17.888889 | 91 | 0.590062 |
411e02fdccfc6b3effd37b4a52ddf1f61c6ded12 | 18,304 | py | Python | src/flake8/plugins/manager.py | brianv0/flake8 | 93ad9617b0a192836cbc9a591b5abe74e2c85ba7 | [
"MIT"
] | null | null | null | src/flake8/plugins/manager.py | brianv0/flake8 | 93ad9617b0a192836cbc9a591b5abe74e2c85ba7 | [
"MIT"
] | null | null | null | src/flake8/plugins/manager.py | brianv0/flake8 | 93ad9617b0a192836cbc9a591b5abe74e2c85ba7 | [
"MIT"
] | null | null | null | """Plugin loading and management logic and classes."""
import logging
import sys
import entrypoints
from flake8 import exceptions
from flake8 import utils
from flake8.plugins import notifier
if sys.version_info >= (3, 3):
import collections.abc as collections_abc
else:
import collections as collections_abc
... | 32.98018 | 78 | 0.608938 |
6c20e65ac08ba74a4bcb6fb9ebd5bf51fd40ab8b | 705 | py | Python | setup.py | rmon-vfer/renfe-time | 7abfc04d1383cb86188a95d255b9b2d461c5c18b | [
"MIT"
] | null | null | null | setup.py | rmon-vfer/renfe-time | 7abfc04d1383cb86188a95d255b9b2d461c5c18b | [
"MIT"
] | null | null | null | setup.py | rmon-vfer/renfe-time | 7abfc04d1383cb86188a95d255b9b2d461c5c18b | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name = "RenfeTime",
version = "0.1.0",
author = "Ramón Vila Ferreres",
author_email = "ramon.vila@the-cocktail.com",
description = "Simple package to obtain and parse train schedules from RENFE"... | 32.045455 | 82 | 0.660993 |
889cc8a9c5dd559731c3a87a72c48d8b9392c7b2 | 5,837 | py | Python | tests/describe/spec/test_finders.py | jeffh/describe | 6a33ffecc3340b57e60bc8a7095521882ff9a156 | [
"MIT"
] | 3 | 2015-06-25T07:10:04.000Z | 2015-11-13T08:59:49.000Z | tests/describe/spec/test_finders.py | jeffh/describe | 6a33ffecc3340b57e60bc8a7095521882ff9a156 | [
"MIT"
] | 1 | 2018-05-29T04:31:51.000Z | 2018-05-29T04:31:51.000Z | tests/describe/spec/test_finders.py | jeffh/describe | 6a33ffecc3340b57e60bc8a7095521882ff9a156 | [
"MIT"
] | 1 | 2018-05-25T03:59:57.000Z | 2018-05-25T03:59:57.000Z | import sys
from unittest import TestCase, TestSuite
from cStringIO import StringIO
from itertools import izip_longest
from collections import defaultdict
from mock import Mock, MagicMock, patch
from describe.spec.finders import SpecFileFinder, StandardSpecFinder
from describe.spec.containers import ExampleGroup, Exam... | 38.401316 | 111 | 0.670207 |
6c01b4f326f47cedbb7a1b25404f168337bdc003 | 14,160 | py | Python | python/ccxt/__init__.py | cw-shubhamMuniyal/ccxt | c6fb927de0f15c67d7c38a9aebf5bfe67cba7073 | [
"MIT"
] | 1 | 2018-08-20T09:38:13.000Z | 2018-08-20T09:38:13.000Z | python/ccxt/__init__.py | shubham12345678901/ccxt | c6fb927de0f15c67d7c38a9aebf5bfe67cba7073 | [
"MIT"
] | null | null | null | python/ccxt/__init__.py | shubham12345678901/ccxt | c6fb927de0f15c67d7c38a9aebf5bfe67cba7073 | [
"MIT"
] | 1 | 2019-01-02T01:32:45.000Z | 2019-01-02T01:32:45.000Z | # -*- coding: utf-8 -*-
"""CCXT: CryptoCurrency eXchange Trading Library"""
# MIT License
# Copyright (c) 2017 Igor Kroitor
# 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 restricti... | 46.27451 | 80 | 0.535523 |
96841bab4ef26a043ec6b337f69e2fed8b97d979 | 2,172 | py | Python | resources/hotel.py | rsousadev/Rest-API-Flask | a04a55cf841af118b504536c43a9087894417ef3 | [
"MIT"
] | null | null | null | resources/hotel.py | rsousadev/Rest-API-Flask | a04a55cf841af118b504536c43a9087894417ef3 | [
"MIT"
] | null | null | null | resources/hotel.py | rsousadev/Rest-API-Flask | a04a55cf841af118b504536c43a9087894417ef3 | [
"MIT"
] | null | null | null | from flask_restful import Resource, reqparse
from models.hotel import HotelModel
from flask_jwt_extended import jwt_required
class Hoteis(Resource):
def get(self):
return {'hoteis': [hotel.json() for hotel in HotelModel.query.all()]}
class Hotel(Resource):
atributos = reqparse.RequestParser()
at... | 35.032258 | 112 | 0.629834 |
5806d2a4d5b92b57c93a1b70d6c65caf2ebf6949 | 12,812 | py | Python | packages/python/plotly/plotly/validators/violin/marker/__init__.py | thatneat/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | 1 | 2020-02-29T09:46:51.000Z | 2020-02-29T09:46:51.000Z | packages/python/plotly/plotly/validators/violin/marker/__init__.py | hermitspirit/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/violin/marker/__init__.py | hermitspirit/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="symbol", parent_name="violin.marker", **kwargs):
super(SymbolValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 31.712871 | 85 | 0.344677 |
f6ed14547744a4836093155e6c33777961b56ceb | 1,598 | py | Python | src/sentry/models/grouptagvalue.py | Munyola/sentry | ab8923b2801d7d72d6903e0d9180584817bb1b9a | [
"BSD-3-Clause"
] | 1 | 2017-10-18T19:40:14.000Z | 2017-10-18T19:40:14.000Z | src/sentry/models/grouptagvalue.py | Munyola/sentry | ab8923b2801d7d72d6903e0d9180584817bb1b9a | [
"BSD-3-Clause"
] | null | null | null | src/sentry/models/grouptagvalue.py | Munyola/sentry | ab8923b2801d7d72d6903e0d9180584817bb1b9a | [
"BSD-3-Clause"
] | null | null | null | """
sentry.models.grouptagvalue
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.db import models
from django.utils import timezone
from sentry.constants import M... | 32.612245 | 75 | 0.697121 |
4679c38e2f720c37f303f8e837126e5157de23a1 | 378 | py | Python | backend/app/tests/api.py | sweeneyngo/furspect | 2753fd9c7a3436fe1e058707b4d9037e34561c26 | [
"MIT"
] | null | null | null | backend/app/tests/api.py | sweeneyngo/furspect | 2753fd9c7a3436fe1e058707b4d9037e34561c26 | [
"MIT"
] | 7 | 2021-08-10T06:31:07.000Z | 2021-08-22T02:39:38.000Z | backend/app/tests/api.py | sweeneyngo/furspect | 2753fd9c7a3436fe1e058707b4d9037e34561c26 | [
"MIT"
] | null | null | null | from flask.ext.testing import TestCase
from app.shared.models import db
class MyTest(TestCase):
SQLALCHEMY_DATABASE_URI = "sqlite://"
TESTING = True
def create_app(self):
# pass in test configuration
return create_app(self)
def setUp(self):
db.create_all()
def tearDown... | 18 | 41 | 0.642857 |
3a0b1cb70dbdb4585f2cf905b0d07ff3176abbbc | 7,245 | py | Python | toontown/suit/DistributedLawbotBossSuitAI.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 1 | 2019-11-23T21:54:23.000Z | 2019-11-23T21:54:23.000Z | toontown/suit/DistributedLawbotBossSuitAI.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | null | null | null | toontown/suit/DistributedLawbotBossSuitAI.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | null | null | null | from otp.ai.AIBaseGlobal import *
from direct.distributed.ClockDelta import *
from direct.directnotify import DirectNotifyGlobal
from toontown.battle import SuitBattleGlobals
from toontown.toonbase import ToontownGlobals
import DistributedSuitBaseAI, random
from direct.fsm import ClassicFSM, State
from direct.fsm impor... | 37.53886 | 130 | 0.63216 |
e78702f26b7cbbf784819100a4942777510f22ab | 2,013 | py | Python | movie_analysis/plot_functions.py | EricMGomez/movie-gender-sentiment-analysis | 3737bec3793a9e403dc9a63f190137d7b6dbf4f5 | [
"MIT"
] | 1 | 2021-11-23T08:49:44.000Z | 2021-11-23T08:49:44.000Z | movie_analysis/plot_functions.py | EricMGomez/movie-gender-sentiment-analysis | 3737bec3793a9e403dc9a63f190137d7b6dbf4f5 | [
"MIT"
] | 2 | 2018-11-20T23:19:45.000Z | 2018-12-12T00:41:35.000Z | movie_analysis/plot_functions.py | EricMGomez/movie-gender-sentiment-analysis | 3737bec3793a9e403dc9a63f190137d7b6dbf4f5 | [
"MIT"
] | 3 | 2018-12-10T11:37:39.000Z | 2018-12-11T07:52:38.000Z | " Package for plotting and fitting data "
# Import Packages:
import numpy as np
import matplotlib
matplotlib.use('PS')
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import scipy as sp
# Scatter plot of all movies:
def scatter_scores(gender_diversity_score, sentiment_score, figure_name):
" S... | 38.711538 | 83 | 0.739195 |
2eab25638ee2846179f380f771dcd1a9d92eef88 | 14,850 | py | Python | qa/rpc-tests/addressindex.py | Tommouse91/VerusCoin | 8a5f86b850770df552e27d391f4bcc6482224900 | [
"Unlicense"
] | 80 | 2018-05-21T15:30:04.000Z | 2022-03-25T00:36:46.000Z | qa/rpc-tests/addressindex.py | Tommouse91/VerusCoin | 8a5f86b850770df552e27d391f4bcc6482224900 | [
"Unlicense"
] | 25 | 2018-05-20T23:30:16.000Z | 2022-03-25T22:07:09.000Z | qa/rpc-tests/addressindex.py | Tommouse91/VerusCoin | 8a5f86b850770df552e27d391f4bcc6482224900 | [
"Unlicense"
] | 67 | 2018-05-06T03:38:22.000Z | 2022-03-18T20:54:16.000Z | #!/usr/bin/env python
# Copyright (c) 2019 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# TODO: change addres formats to include in Verus tests
#
# Test addressindex generation and fetching for insightexpl... | 40.684932 | 113 | 0.629024 |
42014466c0585d3003f78b7e55996f493ce9a18c | 1,995 | py | Python | exercises/sum_of_three.py | edoriggio/algorithms-and-data-structures | d6f3ac520bb3021400bf47770de692ab0c305b75 | [
"Apache-2.0"
] | null | null | null | exercises/sum_of_three.py | edoriggio/algorithms-and-data-structures | d6f3ac520bb3021400bf47770de692ab0c305b75 | [
"Apache-2.0"
] | null | null | null | exercises/sum_of_three.py | edoriggio/algorithms-and-data-structures | d6f3ac520bb3021400bf47770de692ab0c305b75 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Edoardo Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 24.9375 | 74 | 0.546867 |
fdb066df455a1c1b010e97d267396643ab755d7c | 114 | py | Python | confidential.py | zippycup/hashicorp_vault_config | 964d2206c2e97c20b6b753af0828c0bd4b177dfb | [
"Apache-2.0"
] | 3 | 2018-04-23T09:32:02.000Z | 2019-02-11T17:45:24.000Z | confidential.py | zippycup/hashicorp_vault_config | 964d2206c2e97c20b6b753af0828c0bd4b177dfb | [
"Apache-2.0"
] | 1 | 2018-06-19T11:56:35.000Z | 2018-06-19T11:56:35.000Z | confidential.py | zippycup/hashicorp_vault_config | 964d2206c2e97c20b6b753af0828c0bd4b177dfb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
ldap_pass = "[changeme]"
vault_addr = 'https://[changeme]:8200'
vault_token = '[changeme ]'
| 19 | 39 | 0.657895 |
1d32d1a87ef4eb3dd49686e428798c37ae5402cb | 946 | py | Python | core/controller.py | dnqxj/test-cli | 094cc798e92cd98cedd66115f2bf770b29d45385 | [
"Apache-2.0"
] | 1 | 2022-02-21T09:16:42.000Z | 2022-02-21T09:16:42.000Z | core/controller.py | dnqxj/orange-test | 094cc798e92cd98cedd66115f2bf770b29d45385 | [
"Apache-2.0"
] | null | null | null | core/controller.py | dnqxj/orange-test | 094cc798e92cd98cedd66115f2bf770b29d45385 | [
"Apache-2.0"
] | null | null | null | from core.data_handler import app_data_handler
from core.console import console
class Controller(object):
"""
控制器注册与调度运行类
用于将用户带装饰器的控制器存入列表,在主程序时调用控制器的run方法
"""
_CONTROLLER = {}
def run(self, driver, controller=()):
if controller is ():
for controller_name in self._CONTROL... | 31.533333 | 79 | 0.645877 |
d48fa209bfce064fef2bfb6761f46ab928aafd51 | 1,495 | py | Python | rpi/2-kolo/nag-flaskapp/app.py | DoctorDehi/nag2020-tym42 | 6f2f9afe8bb2d24d7b198239945df9ebf5bdbf6b | [
"MIT"
] | null | null | null | rpi/2-kolo/nag-flaskapp/app.py | DoctorDehi/nag2020-tym42 | 6f2f9afe8bb2d24d7b198239945df9ebf5bdbf6b | [
"MIT"
] | null | null | null | rpi/2-kolo/nag-flaskapp/app.py | DoctorDehi/nag2020-tym42 | 6f2f9afe8bb2d24d7b198239945df9ebf5bdbf6b | [
"MIT"
] | null | null | null | import sys
sys.path.append("/home/pi/.local/lib/python3.7/site-packages")
sys.path.append("/home/pi/.local/lib/python3.7/dist-packages")
from flask import Flask
from flask import render_template, request, jsonify
import redis
import json
app = Flask(__name__)
r = redis.Redis(host='localhost', port=6379, db=0)
if "c... | 27.181818 | 68 | 0.607358 |
8794e413f8ee2a403d13590e83ae724be949bbcd | 18,090 | py | Python | test/functional/rpc_rawtransaction.py | Lightcoindev/Lightcoin | a8555320bebbf95545bc8c2841f1fadc38f5bd53 | [
"MIT"
] | null | null | null | test/functional/rpc_rawtransaction.py | Lightcoindev/Lightcoin | a8555320bebbf95545bc8c2841f1fadc38f5bd53 | [
"MIT"
] | 1 | 2021-11-24T12:51:05.000Z | 2021-11-24T12:51:05.000Z | test/functional/rpc_rawtransaction.py | Lightcoindev/Lightcoin | a8555320bebbf95545bc8c2841f1fadc38f5bd53 | [
"MIT"
] | 1 | 2021-06-14T16:43:31.000Z | 2021-06-14T16:43:31.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- createrawtransaction
- signrawtransacti... | 51.392045 | 174 | 0.653068 |
b939bb6e5b038c3d70b482fd57a03f27434aa665 | 21,952 | py | Python | src/pretix/plugins/banktransfer/views.py | tcatm/pretix | a76f74b161e140f4445568b97cb26fc57247e0d2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/banktransfer/views.py | tcatm/pretix | a76f74b161e140f4445568b97cb26fc57247e0d2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/banktransfer/views.py | tcatm/pretix | a76f74b161e140f4445568b97cb26fc57247e0d2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import csv
import json
import logging
from datetime import timedelta
from decimal import Decimal
from django.contrib import messages
from django.db.models import Count, Q
from django.db.models.functions import Concat
from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
... | 40.205128 | 122 | 0.599626 |
1300eb1975d3e4242110580ae478c6ea8adb8758 | 9,185 | py | Python | week2/utilities/ltr_utils.py | danielsoussan/search_with_machine_learning_course | 8a8468f65e8e112f7a384283678443281267c68a | [
"Apache-2.0"
] | null | null | null | week2/utilities/ltr_utils.py | danielsoussan/search_with_machine_learning_course | 8a8468f65e8e112f7a384283678443281267c68a | [
"Apache-2.0"
] | null | null | null | week2/utilities/ltr_utils.py | danielsoussan/search_with_machine_learning_course | 8a8468f65e8e112f7a384283678443281267c68a | [
"Apache-2.0"
] | null | null | null | import json
import requests
def create_rescore_ltr_query(user_query, query_obj, click_prior_query, ltr_model_name, ltr_store_name,
active_features=None, rescore_size=500, main_query_weight=1, rescore_query_weight=2):
query_obj["rescore"] = {
"window_size": rescore_size,
... | 43.738095 | 129 | 0.583016 |
80dece54f6985df52f39cf89bbcf523456f31883 | 4,686 | py | Python | rbtools/api/tests/test_http_request.py | ngie-eign/rbtools | b8b484edd75065080a837acd977cac3daeb58972 | [
"MIT"
] | null | null | null | rbtools/api/tests/test_http_request.py | ngie-eign/rbtools | b8b484edd75065080a837acd977cac3daeb58972 | [
"MIT"
] | null | null | null | rbtools/api/tests/test_http_request.py | ngie-eign/rbtools | b8b484edd75065080a837acd977cac3daeb58972 | [
"MIT"
] | null | null | null | """Unit tests for rbtools.api.request.HttpRequest."""
from __future__ import unicode_literals
import six
from kgb import SpyAgency
from rbtools.api.request import HttpRequest
from rbtools.testing import TestCase
class HttpRequestTests(SpyAgency, TestCase):
"""Unit tests for rbtools.api.request.HttpRequest."""... | 33.471429 | 75 | 0.55271 |
179e9ac92ba36a510bb3dd3433d0f363620aee4e | 2,205 | py | Python | src/alembic_utils/statement.py | namhdp/alembic_utils | 18011f370d75f69456671e710047af6015265e53 | [
"MIT"
] | null | null | null | src/alembic_utils/statement.py | namhdp/alembic_utils | 18011f370d75f69456671e710047af6015265e53 | [
"MIT"
] | null | null | null | src/alembic_utils/statement.py | namhdp/alembic_utils | 18011f370d75f69456671e710047af6015265e53 | [
"MIT"
] | null | null | null | from uuid import uuid4
def normalize_whitespace(text, base_whitespace: str = " ") -> str:
""" Convert all whitespace to *base_whitespace* """
return base_whitespace.join(text.split()).strip()
def strip_terminating_semicolon(sql: str) -> str:
"""Removes terminating semicolon on a SQL statement if it exis... | 31.056338 | 71 | 0.614512 |
54cdfd9e15dbf85aeb67c7143300dd4e33d57db5 | 3,419 | py | Python | tools/c7n_azure/c7n_azure/provisioning/function_app.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 2,415 | 2018-12-04T00:37:58.000Z | 2022-03-31T12:28:56.000Z | tools/c7n_azure/c7n_azure/provisioning/function_app.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 3,272 | 2018-12-03T23:58:17.000Z | 2022-03-31T21:15:32.000Z | tools/c7n_azure/c7n_azure/provisioning/function_app.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 773 | 2018-12-06T09:43:23.000Z | 2022-03-30T20:44:43.000Z | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from azure.mgmt.web.models import (
Site,
SiteConfig,
ManagedServiceIdentity)
from c7n_azure.constants import (AUTH_TYPE_EMBED, FUNCTION_DOCKER_VERSION, FUNCTION_EXT_VERSION)
from c7n_azure.provisioning.deployment_unit import D... | 39.755814 | 100 | 0.650483 |
43026b128d79a69a928dc2be56221d7369457a22 | 35,591 | py | Python | sdk/digitaltwins/azure-digitaltwins-core/tests/test_relationships_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/digitaltwins/azure-digitaltwins-core/tests/test_relationships_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/digitaltwins/azure-digitaltwins-core/tests/test_relationships_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# -------------------------------------------------------------------------
import pyte... | 39.810962 | 118 | 0.611615 |
79ceaef61a06188142850ea9421ba791b95ee8b6 | 26,083 | py | Python | synapse/cmds/cron.py | ackroute/synapse | 51197f89ab372d2e357bcd054358352ecca66840 | [
"Apache-2.0"
] | 216 | 2017-01-17T18:52:50.000Z | 2022-03-31T18:44:49.000Z | synapse/cmds/cron.py | ackroute/synapse | 51197f89ab372d2e357bcd054358352ecca66840 | [
"Apache-2.0"
] | 2,189 | 2017-01-17T22:31:48.000Z | 2022-03-31T20:41:45.000Z | synapse/cmds/cron.py | ackroute/synapse | 51197f89ab372d2e357bcd054358352ecca66840 | [
"Apache-2.0"
] | 44 | 2017-01-17T16:50:57.000Z | 2022-03-16T18:35:52.000Z | import time
import types
import calendar
import datetime
import functools
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cli as s_cli
import synapse.lib.cmd as s_cmd
import synapse.lib.time as s_time
import synapse.lib.parser as s_parser
StatHelp = '''
Gives detailed information abo... | 35.010738 | 118 | 0.56347 |
f433f6835a09dd777f178e0633a97aa9b4880971 | 3,939 | py | Python | xlsxwriter/test/worksheet/test_sparkline04.py | shareablee/XlsxWriter | 3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_sparkline04.py | shareablee/XlsxWriter | 3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_sparkline04.py | shareablee/XlsxWriter | 3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAss... | 41.03125 | 337 | 0.454176 |
b1ad904209d8659860156d5106cf8663d54f6a19 | 7,808 | py | Python | Samples/LinuxExecutionFilters/ResolveUserNameAndDoMount.py | materrac/hpcpack-template-2016 | f1b5c6ce48c964c2309bbe1e6142512988cff4b1 | [
"MIT"
] | 7 | 2019-03-30T18:08:15.000Z | 2021-08-17T12:01:27.000Z | Samples/LinuxExecutionFilters/ResolveUserNameAndDoMount.py | materrac/hpcpack-template-2016 | f1b5c6ce48c964c2309bbe1e6142512988cff4b1 | [
"MIT"
] | 3 | 2019-04-19T03:10:44.000Z | 2020-01-13T14:57:37.000Z | Samples/LinuxExecutionFilters/ResolveUserNameAndDoMount.py | materrac/hpcpack-template-2016 | f1b5c6ce48c964c2309bbe1e6142512988cff4b1 | [
"MIT"
] | 9 | 2019-03-07T01:55:35.000Z | 2020-12-30T10:29:21.000Z | #!/usr/bin/env python
# Hpc Execution Filter Sample - Compose Customized Active Directory User Name and Do Mount For Non-Admin Users
# This script reuse ResolveUserName.py to compose right Active Directory user name,
# and do mount for Non-Admin users.
#
# The sample fulfils the following scenario:
# Administrators us... | 40.666667 | 229 | 0.654585 |
e5b8065e88a07086c47ba30d9f78d8da33c22d08 | 28,885 | py | Python | plugins/modules/oci_network_load_balancer_actions.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_load_balancer_actions.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_load_balancer_actions.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 47.274959 | 160 | 0.525636 |
61c01eb21aca82f7a9b2730cdc0526c09eba5029 | 9,952 | py | Python | docs/conf.py | lukasmu/calplot | c0c29197ba4477b6c66775f8ff062c38eec9785d | [
"MIT"
] | 57 | 2020-06-17T16:54:42.000Z | 2022-03-29T11:21:56.000Z | docs/conf.py | lukasmu/calplot | c0c29197ba4477b6c66775f8ff062c38eec9785d | [
"MIT"
] | 18 | 2020-09-17T09:54:16.000Z | 2022-02-09T13:16:32.000Z | docs/conf.py | lukasmu/calplot | c0c29197ba4477b6c66775f8ff062c38eec9785d | [
"MIT"
] | 9 | 2020-09-17T10:06:36.000Z | 2021-10-10T14:38:02.000Z | # -*- coding: utf-8 -*-
#
# Calplot documentation build configuration file
#
# 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.
#
# All configuration values have a default; values that are comme... | 32 | 79 | 0.718348 |
91f71b79e445f0684c0cc9e468935756328eaca1 | 1,512 | py | Python | rave_python/rave_mpesa.py | MaestroJolly/rave-python | 6923a117b122efbad5921f566ecd3abfd69be147 | [
"MIT"
] | null | null | null | rave_python/rave_mpesa.py | MaestroJolly/rave-python | 6923a117b122efbad5921f566ecd3abfd69be147 | [
"MIT"
] | null | null | null | rave_python/rave_mpesa.py | MaestroJolly/rave-python | 6923a117b122efbad5921f566ecd3abfd69be147 | [
"MIT"
] | null | null | null | from rave_python.rave_payment import Payment
from rave_python.rave_misc import generateTransactionReference
import json
class Mpesa(Payment):
def __init__(self, publicKey, secretKey, usingEnv):
super(Mpesa, self).__init__(publicKey, secretKey, usingEnv)
# Charge mobile money function
def char... | 47.25 | 118 | 0.677249 |
664973f8085789960934f903b075eea22f21d4db | 988 | py | Python | core/management/commands/rename.py | ryankibayhan/ryb-ecommerce | 15fa3bcb624be528926458b466ad7fe7fef5158e | [
"MIT"
] | null | null | null | core/management/commands/rename.py | ryankibayhan/ryb-ecommerce | 15fa3bcb624be528926458b466ad7fe7fef5158e | [
"MIT"
] | 12 | 2019-12-04T23:48:45.000Z | 2022-03-11T23:53:30.000Z | core/management/commands/rename.py | ryankibayhan/ryb-ecommerce | 15fa3bcb624be528926458b466ad7fe7fef5158e | [
"MIT"
] | null | null | null | import os
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Renames a Django project'
def add_arguments(self, parser):
parser.add_argument('new_project_name', type=str,
help='The new Django project name')
def handle(self, *args, *... | 29.058824 | 65 | 0.59413 |
0de29b2f9499179038707e46b2347bf79c81c36d | 1,224 | py | Python | tools/train.py | bossauh/pyvrs | 049dc1833a92cbcfacf0dfa7819f26298de8c0a5 | [
"MIT"
] | null | null | null | tools/train.py | bossauh/pyvrs | 049dc1833a92cbcfacf0dfa7819f26298de8c0a5 | [
"MIT"
] | 1 | 2022-02-26T19:42:53.000Z | 2022-02-26T19:42:53.000Z | tools/train.py | bossauh/pyvrs | 049dc1833a92cbcfacf0dfa7819f26298de8c0a5 | [
"MIT"
] | null | null | null | import os
import random
import sys
import numpy as np
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
from constants import *
training = []
labels = [x[:-4] for x in os.listdir(DATA_PATH) if x.endswith(FORMAT)]
if len(labels) < 2:
print("There is less than 2 training dat... | 27.2 | 85 | 0.683007 |
7e5d6f1171a790ad6ee2ffec5ecea8e5a1d9d15c | 4,835 | py | Python | code/main.py | IlyaLos/AttnGAN | 5934b24fd5b810a382cc12d74a8463f8d1948487 | [
"MIT"
] | null | null | null | code/main.py | IlyaLos/AttnGAN | 5934b24fd5b810a382cc12d74a8463f8d1948487 | [
"MIT"
] | null | null | null | code/main.py | IlyaLos/AttnGAN | 5934b24fd5b810a382cc12d74a8463f8d1948487 | [
"MIT"
] | null | null | null | from __future__ import print_function
from miscc.config import cfg, cfg_from_file
from datasets import TextDataset
from trainer import condGANTrainer as trainer
import os
import sys
import time
import random
import pprint
import datetime
import dateutil.tz
import argparse
import numpy as np
import torch
import torch... | 33.576389 | 114 | 0.627094 |
d9c9ab2d2dede387372553328b914a0e9fe0b1c8 | 2,145 | py | Python | python/239.sliding-window-maximum.py | Zhenye-Na/leetcode | 95196a45f5709ccf7b970ee5ac84a4bf8fe2301e | [
"MIT"
] | 10 | 2019-09-15T00:23:57.000Z | 2022-01-05T12:53:42.000Z | python/239.sliding-window-maximum.py | Zhenye-Na/leetcode | 95196a45f5709ccf7b970ee5ac84a4bf8fe2301e | [
"MIT"
] | 3 | 2021-06-30T00:39:26.000Z | 2021-08-01T07:13:59.000Z | python/239.sliding-window-maximum.py | Zhenye-Na/leetcode | 95196a45f5709ccf7b970ee5ac84a4bf8fe2301e | [
"MIT"
] | 6 | 2020-02-08T02:55:22.000Z | 2022-01-02T22:48:18.000Z | #
# @lc app=leetcode id=239 lang=python3
#
# [239] Sliding Window Maximum
#
# https://leetcode.com/problems/sliding-window-maximum/description/
#
# algorithms
# Hard (44.56%)
# Likes: 5308
# Dislikes: 219
# Total Accepted: 373.2K
# Total Submissions: 835.8K
# Testcase Example: '[1,3,-1,-3,5,3,6,7]\n3'
#
# You ar... | 20.046729 | 86 | 0.514219 |
6041267fe0a1bdf989b85786f79c21a5d0738e22 | 5,266 | py | Python | styletransfer/models/simple_model.py | jaeyeun97/MusicalStyleTransfer | 0aa9e8763597bf86ff0c13ae96dee75d165c4fc2 | [
"BSD-3-Clause"
] | 1 | 2020-04-14T14:11:14.000Z | 2020-04-14T14:11:14.000Z | styletransfer/models/simple_model.py | jaeyeun97/MusicalStyleTransfer | 0aa9e8763597bf86ff0c13ae96dee75d165c4fc2 | [
"BSD-3-Clause"
] | null | null | null | styletransfer/models/simple_model.py | jaeyeun97/MusicalStyleTransfer | 0aa9e8763597bf86ff0c13ae96dee75d165c4fc2 | [
"BSD-3-Clause"
] | null | null | null | """Model class template
This module provides a template for users to implement custom models.
You can specify '--model template' to use this model.
The class name should be consistent with both the filename and its model option.
The filename should be <model>_dataset.py
The class name should be <Model>Dataset.py
It im... | 51.627451 | 212 | 0.688378 |
8bfb51ccf059393a64621db3105ccb5cddc19027 | 24,124 | py | Python | lib/third_party/containerregistry/client/v2_2/docker_image_.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/third_party/containerregistry/client/v2_2/docker_image_.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/third_party/containerregistry/client/v2_2/docker_image_.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2017 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 ag... | 31.700394 | 80 | 0.668256 |
b13bce14c5729a4fa92406ee1a6255cef696ecdb | 2,631 | py | Python | coro/http/demo/websocket/chat/chat_server.py | amitdev/shrapnel | e9032fe6c906d8ebe55164c91a263c1ee7d7b045 | [
"BSD-2-Clause"
] | 98 | 2015-01-09T05:35:59.000Z | 2021-11-22T17:38:58.000Z | coro/http/demo/websocket/chat/chat_server.py | amitdev/shrapnel | e9032fe6c906d8ebe55164c91a263c1ee7d7b045 | [
"BSD-2-Clause"
] | 22 | 2015-02-10T23:57:53.000Z | 2020-01-31T01:14:55.000Z | coro/http/demo/websocket/chat/chat_server.py | amitdev/shrapnel | e9032fe6c906d8ebe55164c91a263c1ee7d7b045 | [
"BSD-2-Clause"
] | 22 | 2015-03-07T20:59:32.000Z | 2021-07-22T09:23:52.000Z | # -*- Mode: Python -*-
# http://martinsikora.com/nodejs-and-websocket-simple-chat-tutorial
import json
from coro.http.websocket import handler, websocket
import coro
W = coro.write_stderr
class server:
colors = ['red', 'green', 'blue', 'magenta', 'purple', 'plum', 'orange']
def __init__ (self):
se... | 29.561798 | 76 | 0.561003 |
bfdba79a30c9f3ecbeb97470c45aa0de17278f87 | 236 | py | Python | opnsense_cli/formats/json_filter_output.py | jan-win1993/opn-cli | 83c4792571dacbe6483722a95276954c7a2d0b3c | [
"BSD-2-Clause"
] | 13 | 2021-05-17T10:42:25.000Z | 2022-02-21T02:10:41.000Z | opnsense_cli/formats/json_filter_output.py | jan-win1993/opn-cli | 83c4792571dacbe6483722a95276954c7a2d0b3c | [
"BSD-2-Clause"
] | 14 | 2021-05-17T13:53:27.000Z | 2021-12-16T12:45:44.000Z | opnsense_cli/formats/json_filter_output.py | jan-win1993/opn-cli | 83c4792571dacbe6483722a95276954c7a2d0b3c | [
"BSD-2-Clause"
] | 2 | 2021-04-28T08:41:07.000Z | 2022-03-28T10:20:51.000Z | import click
import json
from opnsense_cli.formats.base import Format
class JsonFilterOutputFormat(Format):
def echo(self):
filtered_data = self.get_filtered_data_by_columns()
click.echo(json.dumps(filtered_data))
| 23.6 | 59 | 0.762712 |
176e0744e8112ff7fbb67f7d484d59ff63e82d69 | 3,668 | py | Python | pentest-automation/runall.py | jfbethlehem/Scripts | 043a1713d6666950f9cd2bf9b67aa3408865cdb5 | [
"BSD-3-Clause"
] | null | null | null | pentest-automation/runall.py | jfbethlehem/Scripts | 043a1713d6666950f9cd2bf9b67aa3408865cdb5 | [
"BSD-3-Clause"
] | null | null | null | pentest-automation/runall.py | jfbethlehem/Scripts | 043a1713d6666950f9cd2bf9b67aa3408865cdb5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import argparse
from netaddr import *
import os
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
# Nessus confiuration
parser.add_argument("--nusername", default='admin',
help="Nessus user name (admin)")
parser.add_argument("--npassword", def... | 36.316832 | 210 | 0.690022 |
75cabfd4f0361a7aed2ac3a8bc5b77cebb7bd00a | 241 | py | Python | alpyro_msgs/roscpp/logger.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | 1 | 2020-12-13T13:07:10.000Z | 2020-12-13T13:07:10.000Z | alpyro_msgs/roscpp/logger.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | alpyro_msgs/roscpp/logger.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | from alpyro_msgs import RosMessage, string
class Logger(RosMessage):
__msg_typ__ = "roscpp/Logger"
__msg_def__ = "c3RyaW5nIG5hbWUKc3RyaW5nIGxldmVsCgo="
__md5_sum__ = "a6069a2ff40db7bd32143dd66e1f408e"
name: string
level: string
| 21.909091 | 54 | 0.792531 |
2689a215559f6ae29a2799e35149eb5840bc890f | 1,808 | py | Python | tests/unit/modules/test_keyboard.py | velom/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | 1 | 2021-04-05T19:46:35.000Z | 2021-04-05T19:46:35.000Z | tests/unit/modules/test_keyboard.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_keyboard.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REA... | 25.828571 | 63 | 0.61615 |
1a2ed3bf39547120ff86d95576269db1453f8e77 | 1,517 | py | Python | src/multiplicity/migrations/0009_photo.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | src/multiplicity/migrations/0009_photo.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | src/multiplicity/migrations/0009_photo.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2018-11-23 05:47
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('multiplicity', '0008_dat... | 42.138889 | 125 | 0.613711 |
78956f94b33b94f3c1ad1a74a8dced47ef512d7b | 5,259 | py | Python | src/robot/result/keywordremover.py | N-Aero/robotframework | e15664f80e830f30209f118117bf361c74ebe7fb | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-06-05T21:55:16.000Z | 2021-06-05T21:55:16.000Z | src/robot/result/keywordremover.py | N-Aero/robotframework | e15664f80e830f30209f118117bf361c74ebe7fb | [
"ECL-2.0",
"Apache-2.0"
] | 63 | 2020-03-04T17:31:39.000Z | 2022-03-01T09:12:16.000Z | src/robot/result/keywordremover.py | fakegit/robotframework | c8daebe5b7c23cbcb2dd43e3b9aba6053f49ce58 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | 30.935294 | 80 | 0.664765 |
1339f13996bf2bb3eb9f3d11b44ea70f9640989b | 950 | py | Python | Random Forest Classification/MNIST/src/create_folds.py | mehulfollytobevice/MachineLearning | 452c4379f84dfb5ff68faa187b106d59f87a21f0 | [
"MIT"
] | 6 | 2020-02-26T08:15:08.000Z | 2021-05-20T01:15:04.000Z | Random Forest Classification/MNIST/src/create_folds.py | mehulfollytobevice/MachineLearning | 452c4379f84dfb5ff68faa187b106d59f87a21f0 | [
"MIT"
] | null | null | null | Random Forest Classification/MNIST/src/create_folds.py | mehulfollytobevice/MachineLearning | 452c4379f84dfb5ff68faa187b106d59f87a21f0 | [
"MIT"
] | 2 | 2021-04-10T15:31:36.000Z | 2021-05-22T03:06:26.000Z | #import libraries
from sklearn import datasets, manifold, model_selection
import config
def folds(df):
# creating a new column kfold and filling it with -1
df["kfold"]=-1
# shuffling the dataset
df=df.sample(frac=1).reset_index(drop=True)
# fetch targets
y= df.target.values
... | 25 | 59 | 0.643158 |
98ee752d392c8de6b8709d3eb8696bebcc526773 | 718 | py | Python | pkg/suggestion/v1beta1/internal/constant.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 17 | 2018-04-04T08:44:06.000Z | 2018-04-19T18:02:05.000Z | pkg/suggestion/v1beta1/internal/constant.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 58 | 2018-04-03T19:05:50.000Z | 2018-04-19T16:14:04.000Z | pkg/suggestion/v1beta1/internal/constant.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 10 | 2018-04-04T02:06:20.000Z | 2018-04-19T08:53:04.000Z | # Copyright 2022 The Kubeflow 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 in ... | 32.636364 | 74 | 0.756267 |
7b6fdc5e37a4abfebe0304b600c6d217efe8958e | 5,708 | py | Python | tests/unittests/bayesopt/gpmxnet/test_kernel.py | NunoEdgarGFlowHub/autogluon | 714894698495ef4352706d3c4250823ad4a43ead | [
"Apache-2.0"
] | 6 | 2020-06-16T19:17:36.000Z | 2021-07-07T14:50:31.000Z | tests/unittests/bayesopt/gpmxnet/test_kernel.py | NunoEdgarGFlowHub/autogluon | 714894698495ef4352706d3c4250823ad4a43ead | [
"Apache-2.0"
] | null | null | null | tests/unittests/bayesopt/gpmxnet/test_kernel.py | NunoEdgarGFlowHub/autogluon | 714894698495ef4352706d3c4250823ad4a43ead | [
"Apache-2.0"
] | null | null | null | import numpy as np
import mxnet as mx
import pytest
from autogluon.searcher.bayesopt.gpmxnet.kernel import Matern52, \
FabolasKernelFunction, ProductKernelFunction
from autogluon.searcher.bayesopt.gpmxnet.kernel.base import SquaredDistance
from autogluon.searcher.bayesopt.gpmxnet.constants import DATA_TYPE
from au... | 39.09589 | 127 | 0.678697 |
b7124a6e151764b28e13a74ae25dcfb90abd0bca | 7,168 | py | Python | src/model/stft_classifier.py | barisdemirdelen/generative_audio | 9479399986d02807027cf86a0e40bd6d5a8109f0 | [
"MIT"
] | 4 | 2017-09-18T08:19:07.000Z | 2021-07-20T12:24:21.000Z | src/model/stft_classifier.py | barisdemirdelen/generative_audio | 9479399986d02807027cf86a0e40bd6d5a8109f0 | [
"MIT"
] | null | null | null | src/model/stft_classifier.py | barisdemirdelen/generative_audio | 9479399986d02807027cf86a0e40bd6d5a8109f0 | [
"MIT"
] | 3 | 2017-12-16T09:43:38.000Z | 2021-03-22T09:26:25.000Z | import tensorflow as tf
from tensorflow.contrib.layers import l2_regularizer
from tensorflow.python.layers.normalization import batch_normalization
from model.ops import dilated_conv1d_layer, flatten1d, fully_connected
class StftClassifierModel(object):
def __init__(self, batch_size):
self.weight_regular... | 57.806452 | 127 | 0.554129 |
100d6fd8b1d1c6e1bf42d1d3fd0523cfbbb6e658 | 8,236 | py | Python | archive/motion_plan_rrt_v1.py | kuubi3d-udacity/motion_planning | 01a42e9ac888a2fdfd71f9f35100572a25632081 | [
"MIT"
] | null | null | null | archive/motion_plan_rrt_v1.py | kuubi3d-udacity/motion_planning | 01a42e9ac888a2fdfd71f9f35100572a25632081 | [
"MIT"
] | null | null | null | archive/motion_plan_rrt_v1.py | kuubi3d-udacity/motion_planning | 01a42e9ac888a2fdfd71f9f35100572a25632081 | [
"MIT"
] | null | null | null | import sys
import argparse
import time
import msgpack
from enum import Enum, auto
import numpy as np
import decimal
'''import sys
sys.path.insert(0, "/home/kuubi/ai/Udacity/FCND_Motion_Planning")'''
# This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code pac... | 33.616327 | 125 | 0.623725 |
d2fe23c51364899709f815d720e310416eed0d90 | 171 | py | Python | app/request_shoutout/tests/fakes/factories.py | michel-rodrigues/viggio_backend | f419f0b939209722e1eb1e272f33de172cd5c1f1 | [
"MIT"
] | null | null | null | app/request_shoutout/tests/fakes/factories.py | michel-rodrigues/viggio_backend | f419f0b939209722e1eb1e272f33de172cd5c1f1 | [
"MIT"
] | null | null | null | app/request_shoutout/tests/fakes/factories.py | michel-rodrigues/viggio_backend | f419f0b939209722e1eb1e272f33de172cd5c1f1 | [
"MIT"
] | null | null | null | def fake_talent_profit_factory(order, talent_profit):
return talent_profit
def fake_agency_profit_factory(order, agency_id, agency_profit):
return agency_profit
| 24.428571 | 64 | 0.824561 |
ae428c1db9fdb748be3b93da9a84103c510c7b17 | 562 | py | Python | ed/l/python/examples/whatever/typing.x.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | null | null | null | ed/l/python/examples/whatever/typing.x.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | null | null | null | ed/l/python/examples/whatever/typing.x.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | 1 | 2021-11-26T05:40:08.000Z | 2021-11-26T05:40:08.000Z | from typing import List, Set, Dict, Tuple, Optional
def t1():
return 'foo1', 'bar1'
def t2():
return ('foo2', 'bar2')
def t3() -> Tuple[str, str]:
return 'foo3', 'bar3'
def t():
f, b = t1()
print(f'f = {f}, b = {b}')
(f, b) = t2()
print(f'f = {f}, b = {b}')
f, b = t3()
print(f'f = {f}, b = {b}')
... | 15.611111 | 51 | 0.487544 |
af724af24c42190e59152989cd30bece952858ef | 6,210 | py | Python | grpc_predict.py | dhiraa/hyp-demo | d8a29551d9bc6b5cc677649de25878de9ea7e240 | [
"Apache-2.0"
] | null | null | null | grpc_predict.py | dhiraa/hyp-demo | d8a29551d9bc6b5cc677649de25878de9ea7e240 | [
"Apache-2.0"
] | 4 | 2020-01-28T22:18:33.000Z | 2021-08-25T14:50:47.000Z | grpc_predict.py | dhiraa/hyp-demo | d8a29551d9bc6b5cc677649de25878de9ea7e240 | [
"Apache-2.0"
] | 1 | 2019-10-15T11:57:22.000Z | 2019-10-15T11:57:22.000Z | import argparse
import os
import time
import cv2
import numpy as np
from grpc.beta import implementations
from prediction import resize_image, sort_poly, detect
from tensorflow.contrib.util import make_tensor_proto
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service... | 39.807692 | 123 | 0.565539 |
685034d1e5c52b47e2bebab8125643c776041f0a | 1,320 | py | Python | authors/apps/articles/tests/test_estimate_article_read_time.py | andela/ah-code-titans | 4f1fc77c2ecdf8ca15c24327d39fe661eac85785 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/articles/tests/test_estimate_article_read_time.py | andela/ah-code-titans | 4f1fc77c2ecdf8ca15c24327d39fe661eac85785 | [
"BSD-3-Clause"
] | 20 | 2018-11-26T16:22:46.000Z | 2018-12-21T10:08:25.000Z | authors/apps/articles/tests/test_estimate_article_read_time.py | andela/ah-code-titans | 4f1fc77c2ecdf8ca15c24327d39fe661eac85785 | [
"BSD-3-Clause"
] | 3 | 2019-01-24T15:39:42.000Z | 2019-09-25T17:57:08.000Z | from django.urls import reverse
from rest_framework import status
from authors.base_test_config import TestUsingLoggedInUser
class TestEstimatedArticleReadTime(TestUsingLoggedInUser):
def create_article(self, data):
response = self.client.post(
reverse("articles"),
data,
... | 28.695652 | 68 | 0.577273 |
467b69c114c25ddf78655dae22b48c0e1bfda3e3 | 7,213 | py | Python | .history/pwd_20210906061913.py | GraceOswal/Password-Locker | 57da03c46e4044bea681e59c56bcb9ed3a79db71 | [
"MIT"
] | null | null | null | .history/pwd_20210906061913.py | GraceOswal/Password-Locker | 57da03c46e4044bea681e59c56bcb9ed3a79db71 | [
"MIT"
] | null | null | null | .history/pwd_20210906061913.py | GraceOswal/Password-Locker | 57da03c46e4044bea681e59c56bcb9ed3a79db71 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
from passlock import User, Credentials
def create_new_user(username,password):
'''
Function to create a new user with a username and password
'''
new_user = User(username,password)
return new_user
def save_user(user):
'''
Function to save a new user
'''
u... | 38.572193 | 217 | 0.594344 |
5069ef29914464d9c36945a3a248222a9c8fa010 | 39,289 | py | Python | metabolomics_spectrum_resolver/dashinterface.py | mwang87/MetabolomicsSpectrumResolver | 3b63df3f919e6ab1ac2ca48027747985854d5c1d | [
"MIT"
] | 5 | 2019-10-10T16:55:48.000Z | 2021-05-27T16:06:31.000Z | metabolomics_spectrum_resolver/dashinterface.py | mwang87/MetabolomicsSpectrumResolver | 3b63df3f919e6ab1ac2ca48027747985854d5c1d | [
"MIT"
] | 125 | 2019-10-02T18:49:18.000Z | 2021-12-17T17:17:03.000Z | metabolomics_spectrum_resolver/dashinterface.py | mwang87/MetabolomicsSpectrumResolver | 3b63df3f919e6ab1ac2ca48027747985854d5c1d | [
"MIT"
] | 3 | 2020-05-11T15:20:29.000Z | 2020-07-26T23:38:49.000Z | import ast
from typing import Any, Dict, List, Tuple
from urllib.parse import urlencode, quote, parse_qs
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import dash_table
import requests
from dash.dependencies import Input, Output, State
from d... | 33.09941 | 94 | 0.402886 |
e5965b71a5863b36bec7a1e41e53f29c6a94a97a | 2,228 | py | Python | __init__.py | whitequark/dwarf_import | 3cee1af816c00c8dd268c149e65599209c3807a1 | [
"MIT"
] | null | null | null | __init__.py | whitequark/dwarf_import | 3cee1af816c00c8dd268c149e65599209c3807a1 | [
"MIT"
] | null | null | null | __init__.py | whitequark/dwarf_import | 3cee1af816c00c8dd268c149e65599209c3807a1 | [
"MIT"
] | null | null | null | # Copyright(c) 2020 Vector 35 Inc
#
# 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... | 34.8125 | 90 | 0.747756 |
e41b1565d80643d3fb920d36d7ceecf242ff8da3 | 263 | py | Python | domeans.py | Quartzinin/futhark-stencil-benchmarks | 63aaf5b89f26aac0e46051cb6332e0ad55177c94 | [
"MIT"
] | null | null | null | domeans.py | Quartzinin/futhark-stencil-benchmarks | 63aaf5b89f26aac0e46051cb6332e0ad55177c94 | [
"MIT"
] | null | null | null | domeans.py | Quartzinin/futhark-stencil-benchmarks | 63aaf5b89f26aac0e46051cb6332e0ad55177c94 | [
"MIT"
] | 1 | 2021-05-29T07:06:10.000Z | 2021-05-29T07:06:10.000Z | #!/usr/bin/python3
filenames = input()
(inpf,outf) = filenames.split()
with open(inpf,'r') as f:
with open(outf,'w') as w:
numbers=list(map(float,f))[-30:]
mean=int(sum(numbers)/len(numbers))
text=str(mean)+"\n"
w.write(text)
| 23.909091 | 43 | 0.577947 |
42e1166113adcaac091fc5f2676252cfb6179f21 | 5,414 | py | Python | landlab/ca/tests/cts_model.py | saraahsimon/landlab | 1cf809b685efbccaaa149b5899a600c3ccedf30f | [
"MIT"
] | null | null | null | landlab/ca/tests/cts_model.py | saraahsimon/landlab | 1cf809b685efbccaaa149b5899a600c3ccedf30f | [
"MIT"
] | null | null | null | landlab/ca/tests/cts_model.py | saraahsimon/landlab | 1cf809b685efbccaaa149b5899a600c3ccedf30f | [
"MIT"
] | null | null | null | #!/usr/env/python
import time
from matplotlib.pyplot import axis
from numpy import random
from landlab.ca.celllab_cts import CAPlotter, Transition
from landlab.io.native_landlab import save_grid
_DEBUG = False
class CTSModel(object):
"""
Implement a generic CellLab-CTS model.
This is the base class fr... | 29.747253 | 83 | 0.609716 |
828db8b98dd7815d7c4ab3de2adde3360f92d71f | 5,345 | py | Python | script/SymbionExample2.py | AnonymousSEMA/SEMA-ToolChain | 05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82 | [
"BSD-2-Clause"
] | null | null | null | script/SymbionExample2.py | AnonymousSEMA/SEMA-ToolChain | 05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82 | [
"BSD-2-Clause"
] | null | null | null | script/SymbionExample2.py | AnonymousSEMA/SEMA-ToolChain | 05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82 | [
"BSD-2-Clause"
] | null | null | null | import angr
import claripy
import nose
import os
import subprocess
import logging
try:
import avatar2
from angr_targets import AvatarGDBConcreteTarget
except ImportError:
raise nose.SkipTest()
binary_x64 = "/home/crochetch/Documents/SEMA-ToolChain/src/submodules/binaries/tests/x86_64/not_packed_elf64"
# ... | 37.118056 | 120 | 0.724415 |
13070f56f61f83a2b6fa9df930476ccedbdc6b8c | 3,201 | py | Python | tests/test_injector.py | jose-carmona/flask-assistant | ee2acd6677e6ef5d8c515c1790525e43163be7af | [
"Apache-2.0"
] | null | null | null | tests/test_injector.py | jose-carmona/flask-assistant | ee2acd6677e6ef5d8c515c1790525e43163be7af | [
"Apache-2.0"
] | null | null | null | tests/test_injector.py | jose-carmona/flask-assistant | ee2acd6677e6ef5d8c515c1790525e43163be7af | [
"Apache-2.0"
] | null | null | null | import pytest
from flask import Flask
from flask_assistant import Assistant, ask, context_manager as manager
from injector import Module, Injector, provider, singleton, inject
from tests.helpers import build_payload, get_query_response
class AppModule(Module):
@provider
@singleton
def provide_str(self) -> ... | 34.419355 | 137 | 0.709466 |
cd8317ea03c05fb8ff754f5c08a5ed656f3da1ac | 27,312 | py | Python | tools/c7n_gcp/tests/test_loadbalancer.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 2,415 | 2018-12-04T00:37:58.000Z | 2022-03-31T12:28:56.000Z | tools/c7n_gcp/tests/test_loadbalancer.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 3,272 | 2018-12-03T23:58:17.000Z | 2022-03-31T21:15:32.000Z | tools/c7n_gcp/tests/test_loadbalancer.py | lfranchini31/cloud-custodian | 1830fe4b9a59ff6afb675985c9ea531571616a76 | [
"Apache-2.0"
] | 773 | 2018-12-06T09:43:23.000Z | 2022-03-30T20:44:43.000Z | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from time import sleep
from gcp_common import BaseTest, event_data
class LoadBalancingAddressTest(BaseTest):
def test_loadbalancer_address_query(self):
factory = self.replay_flight_data('lb-addresses-query')
p = self.l... | 42.148148 | 91 | 0.607682 |
4e100f3297cb38f6790819a68128a05dd34bee27 | 2,987 | py | Python | experiments/starlette_openapi_core.py | KerstenBreuer/API-Protos | 5426f128f28d6b3f5d6e63be67fa695f6ba2db60 | [
"Apache-2.0"
] | null | null | null | experiments/starlette_openapi_core.py | KerstenBreuer/API-Protos | 5426f128f28d6b3f5d6e63be67fa695f6ba2db60 | [
"Apache-2.0"
] | null | null | null | experiments/starlette_openapi_core.py | KerstenBreuer/API-Protos | 5426f128f28d6b3f5d6e63be67fa695f6ba2db60 | [
"Apache-2.0"
] | null | null | null | from typing import Type
import yaml
import uvicorn
import werkzeug.datastructures
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.routing import Route
from starlette.responses import Response, JSONResponse
from openapi_core.validation.request.datatypes import OpenAP... | 29.87 | 87 | 0.754938 |
bc44ef3b31a64f3e34537e15f9154682d894711c | 16,891 | py | Python | torchtuples/tupletree.py | sarthakpati/torchtuples | 3cef86f3a4e9372b5e2332371d3a30480c120fe7 | [
"BSD-2-Clause"
] | 8 | 2020-07-31T00:46:32.000Z | 2021-12-07T08:16:00.000Z | torchtuples/tupletree.py | sarthakpati/torchtuples | 3cef86f3a4e9372b5e2332371d3a30480c120fe7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T15:30:44.000Z | 2021-01-22T17:52:02.000Z | torchtuples/tupletree.py | sarthakpati/torchtuples | 3cef86f3a4e9372b5e2332371d3a30480c120fe7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T12:37:23.000Z | 2021-01-21T12:37:23.000Z | import functools
import itertools
import numpy as np
import torch
import torchtuples
def apply_leaf(func):
"""Apply a function to data in TupleTree objects (leaf nodes).
E.g.: Two ways to get shapes of all elements in a tuple
data = tuplefy([(torch.randn(1, 2), torch.randn(2, 3)),
to... | 30.544304 | 106 | 0.614469 |
5700adb1b5c743d1f4c7f13583e03002ee9feee8 | 1,498 | py | Python | examples/ex_10_get_probe_from_library.py | samuelgarcia/probeinterface | 526c19131ba0dbbf267658bd9135edb08408e062 | [
"MIT"
] | 11 | 2020-11-24T10:07:58.000Z | 2022-03-19T13:03:03.000Z | examples/ex_10_get_probe_from_library.py | samuelgarcia/probeinterface | 526c19131ba0dbbf267658bd9135edb08408e062 | [
"MIT"
] | 49 | 2020-11-25T09:46:08.000Z | 2022-03-30T15:37:34.000Z | examples/ex_10_get_probe_from_library.py | samuelgarcia/probeinterface | 526c19131ba0dbbf267658bd9135edb08408e062 | [
"MIT"
] | 7 | 2020-11-24T09:02:22.000Z | 2022-03-30T10:42:05.000Z | """
Get probe from library
----------------------
`probeinterface` provides a library of probes from several manufacturers on the gin platform:
https://gin.g-node.org/spikeinterface/probeinterface_library
Users and manufacturers are welcome to contribute to it.
The Python module provide a function to download and ca... | 31.87234 | 93 | 0.576101 |
0523402ea0d93e47abdfb6c74220acde2c6ba4f6 | 7,266 | py | Python | eval_distribution.py | WeustiS/filter_similarity | b7e99b119be589d077b4e96f904aaa48ff3c7e54 | [
"MIT"
] | null | null | null | eval_distribution.py | WeustiS/filter_similarity | b7e99b119be589d077b4e96f904aaa48ff3c7e54 | [
"MIT"
] | null | null | null | eval_distribution.py | WeustiS/filter_similarity | b7e99b119be589d077b4e96f904aaa48ff3c7e54 | [
"MIT"
] | null | null | null | from filter_sim import *
def main():
for i in [0, 2, 5, 7, 10]:
dist_mat_2 = generate_dist_mat(
compare_encodings_cuda(
encode_filters(
get_filters('vgg', i),
get_frames(2, 'randomNumberPermutation')
... | 42 | 94 | 0.64905 |
b7bf342ec1db94a3e1546e396a8e7b2e63296600 | 2,205 | py | Python | src/oci/log_analytics/models/work_request_log_collection.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/log_analytics/models/work_request_log_collection.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/log_analytics/models/work_request_log_collection.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 31.056338 | 245 | 0.662132 |
f5a28b832f3b719e30f1337da7d961b9950124c9 | 109 | py | Python | python/npcomp/__init__.py | marbre/mlir-npcomp | 30adf9e6b0c1e94db38050a9e143f20a5a461d17 | [
"Apache-2.0"
] | 11 | 2020-03-30T23:31:03.000Z | 2021-06-16T01:17:58.000Z | python/npcomp/__init__.py | marbre/mlir-npcomp | 30adf9e6b0c1e94db38050a9e143f20a5a461d17 | [
"Apache-2.0"
] | 6 | 2020-10-21T18:18:10.000Z | 2021-04-02T20:38:28.000Z | python/npcomp/__init__.py | marbre/mlir-npcomp | 30adf9e6b0c1e94db38050a9e143f20a5a461d17 | [
"Apache-2.0"
] | null | null | null | # Top-level symbols.
from .exporter import *
from .types import *
from . import tracing
from . import utils
| 15.571429 | 23 | 0.733945 |
74c7acb754fe359f6b88616e37cd35c653367826 | 95 | py | Python | boot.py | masarliev/hass_nodemcu | 491aa58ea2b039cbfd2af6a8d342e862f94d612b | [
"MIT"
] | 6 | 2017-11-17T11:54:41.000Z | 2019-12-15T09:07:30.000Z | boot.py | masarliev/hass_nodemcu | 491aa58ea2b039cbfd2af6a8d342e862f94d612b | [
"MIT"
] | null | null | null | boot.py | masarliev/hass_nodemcu | 491aa58ea2b039cbfd2af6a8d342e862f94d612b | [
"MIT"
] | null | null | null | import esp
import gc
import webrepl
esp.osdebug(None)
gc.collect()
gc.enable()
webrepl.start()
| 11.875 | 17 | 0.768421 |
58f075acc9a5165c7884d3e1fc495ece0e5de925 | 3,863 | py | Python | nere/re_models/bilstm_att.py | WangShengguang/NERE | 4b8166aa348b9db207bb9a1e1da6eed5d567ae6f | [
"MIT"
] | null | null | null | nere/re_models/bilstm_att.py | WangShengguang/NERE | 4b8166aa348b9db207bb9a1e1da6eed5d567ae6f | [
"MIT"
] | null | null | null | nere/re_models/bilstm_att.py | WangShengguang/NERE | 4b8166aa348b9db207bb9a1e1da6eed5d567ae6f | [
"MIT"
] | 1 | 2021-08-21T09:21:21.000Z | 2021-08-21T09:21:21.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class BiLSTM_ATT(nn.Module):
def __init__(self, vocab_size, num_ent_tags, num_rel_tags, ent_emb_dim, batch_size):
super().__init__()
self.batch_size = batch_size
self.vocab_size = vocab_size
self.embedding_dim = ent... | 43.404494 | 113 | 0.66218 |
13a2187094ce71baab61efc3cf33f3aec0ebd3b4 | 1,250 | py | Python | var/spack/repos/builtin/packages/fast-global-file-status/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/fast-global-file-status/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | var/spack/repos/builtin/packages/fast-global-file-status/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class FastGlobalFileStatus(AutotoolsPackage):
"""provides a scalable mechanism to retrieve such ... | 35.714286 | 102 | 0.6928 |
34c336fa7b3b700c70e4902ce75543156a625c9d | 1,791 | py | Python | SortedIdElementSearch.py | fxie520/Coursera-Algo-Specialization | 4ae744ec2a578ac19465305077427eb0fa44a7e9 | [
"MIT"
] | null | null | null | SortedIdElementSearch.py | fxie520/Coursera-Algo-Specialization | 4ae744ec2a578ac19465305077427eb0fa44a7e9 | [
"MIT"
] | null | null | null | SortedIdElementSearch.py | fxie520/Coursera-Algo-Specialization | 4ae744ec2a578ac19465305077427eb0fa44a7e9 | [
"MIT"
] | null | null | null | from typing import List, Union
import random
# If multiple elements are equal to their indices, the following function only returns the index of one of them.
# Time complexity is O(log n)
def sorted_id_element_detection(sorted_arr: List[int], left_idx: int = 0) -> Union[int, None]:
arr_len = len(sorted_arr)
f... | 39.8 | 112 | 0.673367 |
5bc992187c85165a7acfb4d286622cd0eebdef04 | 1,963 | py | Python | 05-tramas/resorte.py | Agc96/matplotlib-examples | bc2db2d14c1822b05f99356ebf538ebcd14f262a | [
"MIT"
] | null | null | null | 05-tramas/resorte.py | Agc96/matplotlib-examples | bc2db2d14c1822b05f99356ebf538ebcd14f262a | [
"MIT"
] | null | null | null | 05-tramas/resorte.py | Agc96/matplotlib-examples | bc2db2d14c1822b05f99356ebf538ebcd14f262a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Determina el movimiento de un objeto unido a un resorte.
"""
import sys
import os
from IPython import get_ipython
# Limpiar la terminal
ipython = get_ipython()
ipython.magic('cls' if os.name == 'nt' else 'clear')
# Verificar si los datos existen con anterioridad
if 'amplitud' in globals(... | 24.234568 | 73 | 0.651554 |
be98453d065e1f9fa7b3174ec401dce0c31d1529 | 969 | py | Python | screenshot.py | jcs090218/ult_reverse_shell | 8aba39bde9c00bd738476ee9804f1cc931651f0b | [
"MIT"
] | 2 | 2021-03-02T08:50:56.000Z | 2022-02-23T00:37:13.000Z | screenshot.py | jcs090218/ult_reverse_shell | 8aba39bde9c00bd738476ee9804f1cc931651f0b | [
"MIT"
] | null | null | null | screenshot.py | jcs090218/ult_reverse_shell | 8aba39bde9c00bd738476ee9804f1cc931651f0b | [
"MIT"
] | 1 | 2021-03-02T08:50:53.000Z | 2021-03-02T08:50:53.000Z | # ========================================================================
# $File: screenshot.py $
# $Date: 2019-01-22 16:37:42 $
# $Revision: $
# $Creator: Jen-Chieh Shen $
# $Notice: See LICENSE.txt for modification and distribution information
# Copyright © 2019 by Shen, Jen-Chieh $
# ============... | 28.5 | 74 | 0.558308 |
90939570392f282a522dbd9ea9b1c39d6c73ed1b | 291 | py | Python | Mundo01/10_if_else/Desafios/ex035.py | Maycon13PB/Python3 | 8a1d55d6ae8ab67c80fffd11736422b98320a3d2 | [
"MIT"
] | null | null | null | Mundo01/10_if_else/Desafios/ex035.py | Maycon13PB/Python3 | 8a1d55d6ae8ab67c80fffd11736422b98320a3d2 | [
"MIT"
] | null | null | null | Mundo01/10_if_else/Desafios/ex035.py | Maycon13PB/Python3 | 8a1d55d6ae8ab67c80fffd11736422b98320a3d2 | [
"MIT"
] | null | null | null | a = float(input("Digite um termo"))
b = float(input("Digite um segundo termo "))
c = float(input("Digite um terceiro termo "))
if a < b + c and b < a + c and c < a + b:
print("Os segmentos acima PODEM FORMAR um triângulo")
else:
print("Os segmentos acima NÂO PODEM FORMAR triângulo") | 41.571429 | 58 | 0.670103 |
9b0bf3d7786b3bc42398fda5a1db3612b14891f3 | 951 | py | Python | heyyou/wigle.py | abzicht/heyyou | 437488299e47d0c0c2b5d7dc513424b4b314a7c9 | [
"MIT"
] | 7 | 2020-06-23T03:04:17.000Z | 2021-04-19T19:21:05.000Z | heyyou/wigle.py | abzicht/heyyou | 437488299e47d0c0c2b5d7dc513424b4b314a7c9 | [
"MIT"
] | null | null | null | heyyou/wigle.py | abzicht/heyyou | 437488299e47d0c0c2b5d7dc513424b4b314a7c9 | [
"MIT"
] | 2 | 2019-10-03T20:53:54.000Z | 2021-03-23T19:24:47.000Z | import sys
import requests
try:
from conf import Config
except ImportError:
from heyyou.conf import Config
class Wigle:
query = 'https://api.wigle.net/api/v2/network/search'
def __init__(self, ssid: str):
self.data = None
self.ssid = ssid
def get_data(self):
if not self... | 24.384615 | 93 | 0.56572 |
947b748fe13ec7cfe9ba9ce7fdeb4cf183e311de | 161 | py | Python | Examples/k_means_clustering_example.py | Player0109/ML-DL-implementation | 338a89229da541e4285a3ad22508bfef5effc5e5 | [
"BSD-3-Clause"
] | null | null | null | Examples/k_means_clustering_example.py | Player0109/ML-DL-implementation | 338a89229da541e4285a3ad22508bfef5effc5e5 | [
"BSD-3-Clause"
] | null | null | null | Examples/k_means_clustering_example.py | Player0109/ML-DL-implementation | 338a89229da541e4285a3ad22508bfef5effc5e5 | [
"BSD-3-Clause"
] | 2 | 2020-10-02T07:13:20.000Z | 2021-04-13T14:04:35.000Z | from MLlib.models import KMeansClustering
import numpy as np
X = np.genfromtxt('/datasets/k_means_clustering.txt')
KMC = KMeansClustering()
KMC.work(X, 3, 7)
| 17.888889 | 53 | 0.763975 |
e2c580eb3cc8901aebd0d4b3cf474172c18f91f4 | 11,154 | py | Python | electrum/plugins/tc/qt.py | dujinglun/SpaceChain_Client_ISS | cf086b7cb5e7b1bd7bf4bcc8ab90840fa68b3e80 | [
"MIT"
] | null | null | null | electrum/plugins/tc/qt.py | dujinglun/SpaceChain_Client_ISS | cf086b7cb5e7b1bd7bf4bcc8ab90840fa68b3e80 | [
"MIT"
] | 2 | 2021-06-02T00:53:23.000Z | 2021-11-15T17:50:16.000Z | electrum/plugins/tc/qt.py | dujinglun/SpaceChain_Client_ISS | cf086b7cb5e7b1bd7bf4bcc8ab90840fa68b3e80 | [
"MIT"
] | null | null | null | from .tc_plugins import TCPlugin
from .tools import TOS, HandlerTwoFactor
from .tc_requests import tc_requests
import os
import sys
import threading
from functools import partial
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QHBoxLayout, QRadioButton, QCheckBox, QLineEd... | 38.595156 | 232 | 0.611171 |
4b042123002a3ef8a7aff5beccf37658af679400 | 15,965 | py | Python | setup.py | mattrobenolt/sentry | 3468714db277391de6cbcfda20842e6b460eecb3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mattrobenolt/sentry | 3468714db277391de6cbcfda20842e6b460eecb3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mattrobenolt/sentry | 3468714db277391de6cbcfda20842e6b460eecb3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server
------------------
The Sentry ... | 33.469602 | 82 | 0.601315 |
093b2a679cce49cdc3bf796992ad55dc1ca637a2 | 183 | py | Python | checkdb.py | DharmendraGITHB/python-MySql | 755928240b1b7ac6dd072ea8432ba871ce1b6520 | [
"Apache-2.0"
] | null | null | null | checkdb.py | DharmendraGITHB/python-MySql | 755928240b1b7ac6dd072ea8432ba871ce1b6520 | [
"Apache-2.0"
] | null | null | null | checkdb.py | DharmendraGITHB/python-MySql | 755928240b1b7ac6dd072ea8432ba871ce1b6520 | [
"Apache-2.0"
] | null | null | null | import mysql.connector
mydb= mysql.connector.connect(host="localhost", user="root", password="123456")
cur= mydb.cursor()
cur.execute("SHOW DATABASES")
for x in cur:
print(x)
| 16.636364 | 79 | 0.715847 |
651375316856aff204fbf4308d51cf53453eb17d | 1,200 | py | Python | memberaudit/tests/testdata/load_locations.py | buahaha/aa-memberaudit | 3824fd5dec06631f7b54caa0248c2f6dcb08636a | [
"MIT"
] | null | null | null | memberaudit/tests/testdata/load_locations.py | buahaha/aa-memberaudit | 3824fd5dec06631f7b54caa0248c2f6dcb08636a | [
"MIT"
] | null | null | null | memberaudit/tests/testdata/load_locations.py | buahaha/aa-memberaudit | 3824fd5dec06631f7b54caa0248c2f6dcb08636a | [
"MIT"
] | null | null | null | import inspect
import json
import os
from eveuniverse.models import EveEntity
from ...constants import EVE_CATEGORY_ID_STATION
from ...models import Location
_currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
def _load_data():
with open(_currentdir + "/esi_testdata.json", "... | 27.906977 | 87 | 0.700833 |
a14e220d3c33ff16d611effeace6267e98795dd2 | 13,434 | py | Python | onnxruntime/python/tools/quantization/qdq_quantizer.py | GreyZzzzzzXh/onnxruntime | d012d9fb913230205620771c94cb6f5cb89a4203 | [
"MIT"
] | null | null | null | onnxruntime/python/tools/quantization/qdq_quantizer.py | GreyZzzzzzXh/onnxruntime | d012d9fb913230205620771c94cb6f5cb89a4203 | [
"MIT"
] | null | null | null | onnxruntime/python/tools/quantization/qdq_quantizer.py | GreyZzzzzzXh/onnxruntime | d012d9fb913230205620771c94cb6f5cb89a4203 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os
... | 56.683544 | 149 | 0.586199 |
41c1ec435ab1a5dd43902ed7a1a712efddaa7cd4 | 205 | py | Python | Ex29.py | jpsampaio/ExEcommIT | fabf3287aa86dafae00709341c776e446d4e2968 | [
"MIT"
] | null | null | null | Ex29.py | jpsampaio/ExEcommIT | fabf3287aa86dafae00709341c776e446d4e2968 | [
"MIT"
] | null | null | null | Ex29.py | jpsampaio/ExEcommIT | fabf3287aa86dafae00709341c776e446d4e2968 | [
"MIT"
] | null | null | null | vel = int(input("Digite a velocidade atual do carro: "))
multa = 7 * (vel - 80)
if vel > 80:
print(f"Você foi multado. Valor: R${multa:.2f}")
else:
print("Tenha um bom dia, dirija com segurança.") | 29.285714 | 56 | 0.639024 |
d44457cad4c1eeebb68fdcd9caeebd3c842c0840 | 1,943 | py | Python | uvu/test_retinanet.py | fabianfallasmoya/semi_supervised_v1 | 6e93c3a332a4a76cff6d0acdcdaae40a5123d1db | [
"Apache-2.0"
] | null | null | null | uvu/test_retinanet.py | fabianfallasmoya/semi_supervised_v1 | 6e93c3a332a4a76cff6d0acdcdaae40a5123d1db | [
"Apache-2.0"
] | null | null | null | uvu/test_retinanet.py | fabianfallasmoya/semi_supervised_v1 | 6e93c3a332a4a76cff6d0acdcdaae40a5123d1db | [
"Apache-2.0"
] | null | null | null | from typing import List
import argparse
from detectron2.evaluation import COCOEvaluator, inference_on_dataset
from detectron2.config import get_cfg
from detectron2 import model_zoo
from detectron2.data.datasets import register_coco_instances
from detectron2.data import build_detection_test_loader
from trainers import... | 36.660377 | 110 | 0.749357 |
9ecfc29f0104ace2404155a6587a5afd49858826 | 20,818 | py | Python | lib/galaxy/tools/data_fetch.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 1 | 2020-03-11T15:17:32.000Z | 2020-03-11T15:17:32.000Z | lib/galaxy/tools/data_fetch.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 72 | 2019-06-06T18:52:41.000Z | 2022-02-17T02:53:18.000Z | lib/galaxy/tools/data_fetch.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 1 | 2022-03-01T08:07:54.000Z | 2022-03-01T08:07:54.000Z | import argparse
import errno
import json
import os
import shutil
import sys
import tempfile
from io import StringIO
import bdbag.bdbag_api
from galaxy.datatypes import sniff
from galaxy.datatypes.registry import Registry
from galaxy.datatypes.upload_util import (
handle_upload,
UploadProblemException,
)
from ... | 40.111753 | 148 | 0.625853 |
ed19623b0d54ca12707cddf5d8aad99566786b67 | 10,853 | py | Python | modules/nzbget.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 422 | 2015-01-08T14:08:08.000Z | 2022-02-07T11:47:37.000Z | modules/nzbget.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 581 | 2015-01-01T08:07:16.000Z | 2022-02-23T11:44:37.000Z | modules/nzbget.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 115 | 2015-01-08T14:41:00.000Z | 2022-02-13T12:31:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cherrypy
import htpc
import requests
from requests.auth import HTTPBasicAuth
import logging
import base64
import re
from cherrypy.lib.auth2 import require, member_of
from jsonrpclib import jsonrpc
from htpc.helpers import fix_basepath, striphttp
class NZBGet(objec... | 38.760714 | 182 | 0.569151 |
f5e259d34f54d4f915bcff373df02999f98c53ec | 73 | py | Python | example_usage.py | Ran4/python-c-mvp | 4093650ec838584579f62c7e28750346fde2c24a | [
"MIT"
] | 1 | 2020-04-03T14:16:22.000Z | 2020-04-03T14:16:22.000Z | example_usage.py | Ran4/python-c-mvp | 4093650ec838584579f62c7e28750346fde2c24a | [
"MIT"
] | null | null | null | example_usage.py | Ran4/python-c-mvp | 4093650ec838584579f62c7e28750346fde2c24a | [
"MIT"
] | null | null | null | from funcs import square
print(help(square))
print()
print(square(4.3))
| 12.166667 | 24 | 0.739726 |
c02ca0d0bb9b73dbdd8e30fbd942d8570304cb1c | 1,076 | py | Python | BlinkingLED_VaryingFreq.py | mdemiray/MicroPython-BlinkingLEDwithVaryingFreq | f37577f5f6d4342c644445218fe03f4d732b5cdb | [
"Apache-2.0"
] | null | null | null | BlinkingLED_VaryingFreq.py | mdemiray/MicroPython-BlinkingLEDwithVaryingFreq | f37577f5f6d4342c644445218fe03f4d732b5cdb | [
"Apache-2.0"
] | null | null | null | BlinkingLED_VaryingFreq.py | mdemiray/MicroPython-BlinkingLEDwithVaryingFreq | f37577f5f6d4342c644445218fe03f4d732b5cdb | [
"Apache-2.0"
] | null | null | null | import machine
import time
pin_D0 = machine.Pin(14, machine.Pin.OUT)
pin_D1 = machine.Pin(16,machine.Pin.OUT)
pin_D2 = machine.Pin(5,machine.Pin.OUT)
pin_D3 = machine.Pin(4,machine.Pin.OUT)
pin_D4 = machine.Pin(0,machine.Pin.OUT)
pin_D5 = machine.Pin(2,machine.Pin.OUT)
pin_D0.off()
pin_D1.off()
pin_D2.off()
pin_D3.... | 18.877193 | 45 | 0.592937 |
da268ae5f45b72af7425e723217e7d2f6effd28c | 2,744 | py | Python | test.py | jacklyonlee/pcsde | 145cab9d5f115daa553a4919b62389e687fbff74 | [
"MIT"
] | null | null | null | test.py | jacklyonlee/pcsde | 145cab9d5f115daa553a4919b62389e687fbff74 | [
"MIT"
] | null | null | null | test.py | jacklyonlee/pcsde | 145cab9d5f115daa553a4919b62389e687fbff74 | [
"MIT"
] | 2 | 2022-01-16T18:30:36.000Z | 2022-01-23T11:11:21.000Z | import os
import pprint
import argparse
import torch
import numpy as np
from dataset import ShapeNet15k
from model.networks import SetVAE
from trainer import Trainer
def parse_args():
root_dir = os.path.abspath(os.path.dirname(__file__))
parser = argparse.ArgumentParser()
# Environment settings
par... | 22.866667 | 86 | 0.598761 |
1b52e912da97c9d8b06c6507802218cf44d65320 | 1,031 | py | Python | examples/generative/synthesize_cloud.py | fredyeah/streamer | 079b8cb5d6002df50f13aa184ece7a4a3b357da4 | [
"MIT"
] | 5 | 2021-05-20T00:59:41.000Z | 2021-12-05T18:25:57.000Z | examples/generative/synthesize_cloud.py | fredyeah/streamer | 079b8cb5d6002df50f13aa184ece7a4a3b357da4 | [
"MIT"
] | null | null | null | examples/generative/synthesize_cloud.py | fredyeah/streamer | 079b8cb5d6002df50f13aa184ece7a4a3b357da4 | [
"MIT"
] | 1 | 2021-05-30T12:43:02.000Z | 2021-05-30T12:43:02.000Z | import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
from py_modular.sound.granular import GranBase
from py_modular.sound.oscillators import Sine
from py_modular.effects.dsp import Delay
from py_modular.time.transport import GlobalTransport
from py_modular.utils... | 34.366667 | 94 | 0.776916 |
c3e2dd6c4c1023be78c9dcdd4f16bdb00a5ecc57 | 4,211 | py | Python | tests/garage/sampler/test_local_sampler.py | st2yang/garage | 50186a9630df038aeba36d6b06b006ab32ed48f5 | [
"MIT"
] | null | null | null | tests/garage/sampler/test_local_sampler.py | st2yang/garage | 50186a9630df038aeba36d6b06b006ab32ed48f5 | [
"MIT"
] | null | null | null | tests/garage/sampler/test_local_sampler.py | st2yang/garage | 50186a9630df038aeba36d6b06b006ab32ed48f5 | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from garage.envs import GarageEnv, PointEnv
from garage.experiment.task_sampler import SetTaskSampler
from garage.np.policies import FixedPolicy, ScriptedPolicy
from garage.sampler import LocalSampler, WorkerFactory
def test_update_envs_env_update():
max_path_length = 16
env ... | 39.726415 | 78 | 0.575635 |
c04135dad1172914f81fd01031857ba4ee6383d3 | 18,181 | py | Python | responsibleai/tests/test_model_analysis_validations.py | conradmr94/responsible-ai-widgets | bc88bd164077ae43de47007885e8cbf23f7e7e9d | [
"MIT"
] | null | null | null | responsibleai/tests/test_model_analysis_validations.py | conradmr94/responsible-ai-widgets | bc88bd164077ae43de47007885e8cbf23f7e7e9d | [
"MIT"
] | null | null | null | responsibleai/tests/test_model_analysis_validations.py | conradmr94/responsible-ai-widgets | bc88bd164077ae43de47007885e8cbf23f7e7e9d | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import logging
from unittest.mock import MagicMock
import pandas as pd
import pytest
from responsibleai.exceptions import UserConfigValidationException
from responsibleai.modelanalysis.model_analysis import ModelAnalysis
from .common_utils impo... | 35.440546 | 78 | 0.572521 |
2ba2fe8f1e451952071e2afae018d28cf419dc7f | 528 | py | Python | ark/ext/stx_support.py | pavanchaurasia1998/ark | 58fff8fac19152d2db15324dfb0ebd85809c2b06 | [
"Unlicense"
] | null | null | null | ark/ext/stx_support.py | pavanchaurasia1998/ark | 58fff8fac19152d2db15324dfb0ebd85809c2b06 | [
"Unlicense"
] | null | null | null | ark/ext/stx_support.py | pavanchaurasia1998/ark | 58fff8fac19152d2db15324dfb0ebd85809c2b06 | [
"Unlicense"
] | null | null | null | # --------------------------------------------------------------------------
# This extension adds Syntex support to Ark.
#
# Files with a .stx extension will be rendered as Syntex.
#
# Author: Darren Mulholland <darren@mulholland.xyz>
# License: Public Domain
# ---------------------------------------------------------... | 27.789474 | 76 | 0.522727 |
2932dba767c8acafcf2a3f89e4548b3de34894c4 | 217 | py | Python | test_adding_frenzy.py | dave1432/adding_frenzy | 6c949857c0378c67993ec2802d49be08c88537eb | [
"Unlicense"
] | null | null | null | test_adding_frenzy.py | dave1432/adding_frenzy | 6c949857c0378c67993ec2802d49be08c88537eb | [
"Unlicense"
] | null | null | null | test_adding_frenzy.py | dave1432/adding_frenzy | 6c949857c0378c67993ec2802d49be08c88537eb | [
"Unlicense"
] | null | null | null | from adding_frenzy import add
def test_adding_positive_numbers():
assert add(5, 10) == 15
def test_adding_negative_numbers():
assert add(-3, -1) == -4
def test_adding_zeroes():
assert add(0, 0) == 0
| 15.5 | 35 | 0.677419 |
97443cf28a77cda98ea7180b232969d679548f49 | 6,539 | py | Python | libraries/botbuilder-schema/botbuilder/schema/__init__.py | victor-kironde/botbuilder-python | e893d9b036d7cf33cf9c9afd1405450c354cdbcd | [
"MIT"
] | 1 | 2021-03-02T22:56:09.000Z | 2021-03-02T22:56:09.000Z | libraries/botbuilder-schema/botbuilder/schema/__init__.py | victor-kironde/botbuilder-python | e893d9b036d7cf33cf9c9afd1405450c354cdbcd | [
"MIT"
] | null | null | null | libraries/botbuilder-schema/botbuilder/schema/__init__.py | victor-kironde/botbuilder-python | e893d9b036d7cf33cf9c9afd1405450c354cdbcd | [
"MIT"
] | 1 | 2020-07-30T12:18:00.000Z | 2020-07-30T12:18:00.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 32.695 | 76 | 0.730999 |
858320143ca90451734d76eb9e98a476e0a15a4a | 543 | py | Python | thinc/layers/softmax_activation.py | TheVinhLuong102/thinc | 7b54f728ddec7765a1d8a5e553d4b4b90b9edaec | [
"MIT"
] | 2,542 | 2016-10-20T07:02:59.000Z | 2022-03-30T20:18:35.000Z | thinc/layers/softmax_activation.py | TheVinhLuong102/thinc | 7b54f728ddec7765a1d8a5e553d4b4b90b9edaec | [
"MIT"
] | 453 | 2016-10-19T21:09:35.000Z | 2022-03-31T11:01:15.000Z | thinc/layers/softmax_activation.py | TheVinhLuong102/thinc | 7b54f728ddec7765a1d8a5e553d4b4b90b9edaec | [
"MIT"
] | 265 | 2016-11-14T14:53:58.000Z | 2022-03-31T02:25:24.000Z | from typing import Tuple, Callable
from ..model import Model
from ..config import registry
from ..types import Floats2d
InT = Floats2d
OutT = Floats2d
@registry.layers("softmax_activation.v1")
def softmax_activation() -> Model[InT, OutT]:
return Model("softmax_activation", forward)
def forward(model: Model[I... | 22.625 | 86 | 0.707182 |
8bcfa53499fe249e6594f416c5a1f5bb02f25e54 | 1,204 | py | Python | azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.484848 | 80 | 0.620432 |
c316865ad8bbb522559c9a6cf3e75d5e759203a6 | 2,878 | py | Python | osgparse/cli.py | zzxuanyuan/osgparse | f894729f159c7f06dcbe14f7c70889a19db3fcb9 | [
"BSD-3-Clause"
] | null | null | null | osgparse/cli.py | zzxuanyuan/osgparse | f894729f159c7f06dcbe14f7c70889a19db3fcb9 | [
"BSD-3-Clause"
] | null | null | null | osgparse/cli.py | zzxuanyuan/osgparse | f894729f159c7f06dcbe14f7c70889a19db3fcb9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Zhe Zhang, zzxuanyuan@gmail.com
#
# This module is part of failure analysis of OSG project and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
import argparse
import sys
import osgparse
def create_parser():
print ... | 39.972222 | 113 | 0.718555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.