hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7d9ac85937a400f5b0999ceb5de1982633cc4044 | 62,485 | py | Python | kmip/tests/unit/core/messages/payloads/test_signature_verify.py | ondrap/PyKMIP | c8ea17d8faf827e0f9d004972835128a1a71569f | [
"Apache-2.0"
] | 179 | 2015-03-20T06:08:59.000Z | 2022-03-14T02:24:38.000Z | kmip/tests/unit/core/messages/payloads/test_signature_verify.py | imharshr/PyKMIP | 9403ff3d2aa83de4c786b8eedeb85d169fd4a594 | [
"Apache-2.0"
] | 600 | 2015-04-08T14:14:48.000Z | 2022-03-28T13:49:47.000Z | kmip/tests/unit/core/messages/payloads/test_signature_verify.py | imharshr/PyKMIP | 9403ff3d2aa83de4c786b8eedeb85d169fd4a594 | [
"Apache-2.0"
] | 131 | 2015-03-30T12:51:49.000Z | 2022-03-23T04:34:34.000Z | # Copyright (c) 2017 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 39.397856 | 79 | 0.63324 |
e949fb49596fbd7ae9efb11436322ef3d5b912de | 64 | py | Python | tests/test_tipo_bot/test_utils.py | Kel0/tipo_bot | bb310e42767adc6832ff324ac7f42d05a8a2840f | [
"MIT"
] | null | null | null | tests/test_tipo_bot/test_utils.py | Kel0/tipo_bot | bb310e42767adc6832ff324ac7f42d05a8a2840f | [
"MIT"
] | 1 | 2020-11-08T14:53:19.000Z | 2020-11-13T14:45:13.000Z | tests/test_tipo_bot/test_utils.py | Kel0/tipo_bot | bb310e42767adc6832ff324ac7f42d05a8a2840f | [
"MIT"
] | null | null | null | import pytest
from tipo_bot import utils
# TODO: Write tests
| 9.142857 | 26 | 0.765625 |
6161658c9986655189090fdeaf7e88eddce488cd | 420 | py | Python | package_test/DebugDirectionalDataAnomalyDetection.py | ground0state/Kullback-Leibler-Density-Ratio-Estimation | 68f9f6a28f78f3bc354c2cdd1771feedfd7f4de4 | [
"MIT"
] | null | null | null | package_test/DebugDirectionalDataAnomalyDetection.py | ground0state/Kullback-Leibler-Density-Ratio-Estimation | 68f9f6a28f78f3bc354c2cdd1771feedfd7f4de4 | [
"MIT"
] | null | null | null | package_test/DebugDirectionalDataAnomalyDetection.py | ground0state/Kullback-Leibler-Density-Ratio-Estimation | 68f9f6a28f78f3bc354c2cdd1771feedfd7f4de4 | [
"MIT"
] | 1 | 2019-10-13T14:21:22.000Z | 2019-10-13T14:21:22.000Z | import matplotlib.pyplot as plt
import numpy as np
from pyanom.outlier_detection import DirectionalDataAnomalyDetection
normal_data = np.loadtxt(
"../input/normal_direction_data.csv", delimiter=",")
error_data = np.loadtxt("../input/error_direction_data.csv", delimiter=",")
model = DirectionalDataAnomalyDetection... | 28 | 75 | 0.785714 |
1a50eb8cd36fe18ec33cc9c79c9b6456b947fe77 | 159 | py | Python | enhanced_emails/urls.py | Theodo-UK/django-enhanced-emails | 08089fa43ac292585d9a7691659828a2ccafb737 | [
"MIT"
] | 24 | 2018-04-16T15:11:37.000Z | 2019-02-13T11:46:46.000Z | enhanced_emails/urls.py | Theodo-UK/django-enhanced-emails | 08089fa43ac292585d9a7691659828a2ccafb737 | [
"MIT"
] | 5 | 2018-11-19T12:39:20.000Z | 2021-02-02T21:52:17.000Z | enhanced_emails/urls.py | Theodo-UK/django-enhanced-emails | 08089fa43ac292585d9a7691659828a2ccafb737 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import EmailView
urlpatterns = [path("<uuid:pk>", EmailView.as_view(), name="email")]
app_name = "enhanced_emails"
| 19.875 | 68 | 0.735849 |
4a39d9bf2c924808a377d96b59ea8e6ca5df1408 | 19,582 | py | Python | aiogoogle/auth/managers.py | iburinoc/aiogoogle | 6f702c0d19599fce1bd36b7a32922e76aaa74008 | [
"MIT"
] | null | null | null | aiogoogle/auth/managers.py | iburinoc/aiogoogle | 6f702c0d19599fce1bd36b7a32922e76aaa74008 | [
"MIT"
] | null | null | null | aiogoogle/auth/managers.py | iburinoc/aiogoogle | 6f702c0d19599fce1bd36b7a32922e76aaa74008 | [
"MIT"
] | null | null | null | '''
.. note::
* These are the default auth managers. They won't perform any file io.
* If you want auth managers with file io capabilities, then you'll have to implement AbstractAuthManager's interface or inherent from any of this module's managers.
* In most cases you won't need to implement new man... | 37.157495 | 256 | 0.644163 |
67c98b31f8e80eabbc9e24b5e885c432cf21d7ec | 905 | py | Python | app/model.py | varandrew/room-air-quality-forecast | eee8eae3732f328492364a68698b8e692f91132d | [
"MIT"
] | null | null | null | app/model.py | varandrew/room-air-quality-forecast | eee8eae3732f328492364a68698b8e692f91132d | [
"MIT"
] | null | null | null | app/model.py | varandrew/room-air-quality-forecast | eee8eae3732f328492364a68698b8e692f91132d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project :bottle-iot
@File :database.py
@Author :Qiuji Chen
@Date :2021/11/12 3:47 下午
"""
from sklearn.ensemble import RandomForestRegressor # 随机树森林模型
import joblib # 保存模型为pkl
from sklearn.metrics import mean_absolute_error # MAE评估方法
from process imp... | 26.617647 | 69 | 0.637569 |
b50b469c1cd057685423f7f277fc3c393ae0b36a | 1,395 | py | Python | examples/rosen_bench.py | brunorigal/autograd_minimize | c405cd150d2d47c48a4b71f90ec312874d8788da | [
"MIT"
] | 8 | 2021-05-24T09:30:34.000Z | 2022-02-21T18:12:24.000Z | examples/rosen_bench.py | brunorigal/autograd_minimize | c405cd150d2d47c48a4b71f90ec312874d8788da | [
"MIT"
] | 1 | 2021-12-16T14:50:10.000Z | 2022-02-04T08:56:34.000Z | examples/rosen_bench.py | brunorigal/autograd_minimize | c405cd150d2d47c48a4b71f90ec312874d8788da | [
"MIT"
] | 1 | 2022-02-25T20:47:21.000Z | 2022-02-25T20:47:21.000Z | from time import time
import numpy as np
import tensorflow as tf
from autograd_minimize import minimize
import pandas as pd
def rosen_tst(backend='torch'):
"""
Adapated from: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html
"""
def rosen_tf(x):
return tf.redu... | 26.826923 | 105 | 0.5319 |
ab9aeb4ef223178ab37fa7ac8620c361f3a2ac74 | 15,748 | py | Python | tests/test_rds2/test_filters.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | 1 | 2019-10-18T16:10:01.000Z | 2019-10-18T16:10:01.000Z | tests/test_rds2/test_filters.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | 4 | 2017-09-30T07:52:52.000Z | 2021-12-13T06:56:55.000Z | tests/test_rds2/test_filters.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | 2 | 2021-11-24T08:05:43.000Z | 2021-11-25T16:18:48.000Z | from __future__ import unicode_literals
import boto3
import pytest
import sure # noqa
from botocore.exceptions import ClientError
from moto import mock_rds2
class TestDBInstanceFilters(object):
mock_rds = mock_rds2()
@classmethod
def setup_class(cls):
cls.mock_rds.start()
client = bot... | 43.027322 | 88 | 0.61919 |
89173861914633b242a07b97c2335bc0856e7560 | 1,741 | py | Python | saas/backend/biz/system.py | Canway-shiisa/bk-iam-saas | 73c3770d9647c9cc8d515427cd1d053d8af9d071 | [
"MIT"
] | null | null | null | saas/backend/biz/system.py | Canway-shiisa/bk-iam-saas | 73c3770d9647c9cc8d515427cd1d053d8af9d071 | [
"MIT"
] | null | null | null | saas/backend/biz/system.py | Canway-shiisa/bk-iam-saas | 73c3770d9647c9cc8d515427cd1d053d8af9d071 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 37.042553 | 115 | 0.727743 |
b386873cb694cc7bab496759edc3ec21cecea465 | 30,112 | py | Python | test_htree.py | waylan/HTMLTree | b52e794fb51485d2989f4566525c58e0d4223999 | [
"BSD-3-Clause"
] | 3 | 2015-08-07T02:05:40.000Z | 2021-03-21T18:10:35.000Z | test_htree.py | waylan/HTMLTree | b52e794fb51485d2989f4566525c58e0d4223999 | [
"BSD-3-Clause"
] | null | null | null | test_htree.py | waylan/HTMLTree | b52e794fb51485d2989f4566525c58e0d4223999 | [
"BSD-3-Clause"
] | 1 | 2020-04-23T13:51:36.000Z | 2020-04-23T13:51:36.000Z | #!/usr/bin/env python
from __future__ import unicode_literals
import unittest
import textwrap
import htree
def dedent(text):
return textwrap.dedent(text).lstrip('\n')
class TestTypes(unittest.TestCase):
def test_Text_type(self):
node = htree.Text('Some text.')
self.assertTrue(htree.is_node... | 35.095571 | 92 | 0.582625 |
1bba58f0058881ef0058f89453f60d6a8f1dfbb3 | 3,890 | py | Python | ykdl/extractors/acfun/acbase.py | iovxw/ykdl | 57d2a0091a63e6fa65e36d0acf3af48520caf713 | [
"MIT"
] | null | null | null | ykdl/extractors/acfun/acbase.py | iovxw/ykdl | 57d2a0091a63e6fa65e36d0acf3af48520caf713 | [
"MIT"
] | null | null | null | ykdl/extractors/acfun/acbase.py | iovxw/ykdl | 57d2a0091a63e6fa65e36d0acf3af48520caf713 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ykdl.util.html import get_content, add_header
from ykdl.util.match import match1, matchall
from ykdl.extractor import VideoExtractor
from ykdl.videoinfo import VideoInfo
from ykdl.compact import urljoin
import json
import random
class AcBase(VideoExtractor):
st... | 35.363636 | 137 | 0.497172 |
1f04720a966d05283e41e163246e199e6e130c49 | 1,725 | py | Python | ShiCi/items.py | HC1058503505/ShiCI | 2d3cfd87790267b1bcb4430a1a43d574eb2922f4 | [
"MIT"
] | null | null | null | ShiCi/items.py | HC1058503505/ShiCI | 2d3cfd87790267b1bcb4430a1a43d574eb2922f4 | [
"MIT"
] | null | null | null | ShiCi/items.py | HC1058503505/ShiCI | 2d3cfd87790267b1bcb4430a1a43d574eb2922f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class ShiciItem(scrapy.Item):
# define the fields for your item here like:
poem_id = scrapy.Field()
# 诗的题目
poem_title = scrapy.Field(... | 16.911765 | 52 | 0.613333 |
be275febaa34ee66aceee50ac407311c9e752485 | 8,323 | py | Python | GUI/Dialog/DMachineSetup/SWSlot/PWSlot29/Ui_PWSlot29.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | GUI/Dialog/DMachineSetup/SWSlot/PWSlot29/Ui_PWSlot29.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | GUI/Dialog/DMachineSetup/SWSlot/PWSlot29/Ui_PWSlot29.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\Raphael\Desktop\Git\PyManatee\pyleecan\GUI\Dialog\DMachineSetup\SWSlot\PWSlot29\PWSlot29.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, Qt... | 51.695652 | 254 | 0.669951 |
70b5322ecfad9663c6f645867c023709cb5c040b | 6,424 | py | Python | wunderkafka/hotfixes/watchdog/__init__.py | severstal-digital/wunderkafka | 8c56fa4559a8576af7f005fd916bf97127576278 | [
"Apache-2.0"
] | null | null | null | wunderkafka/hotfixes/watchdog/__init__.py | severstal-digital/wunderkafka | 8c56fa4559a8576af7f005fd916bf97127576278 | [
"Apache-2.0"
] | null | null | null | wunderkafka/hotfixes/watchdog/__init__.py | severstal-digital/wunderkafka | 8c56fa4559a8576af7f005fd916bf97127576278 | [
"Apache-2.0"
] | null | null | null | import os
import time
import subprocess
from typing import Any, Dict, Tuple, Optional, Set
from threading import Thread
from dataclasses import dataclass
from confluent_kafka import libversion
from wunderkafka.time import ts2dt
from wunderkafka.logger import logger
from wunderkafka.config.rdkafka import RDKafkaConfig... | 32.94359 | 118 | 0.644614 |
3fcf42979543c175b9770a248afb3c9acd85ff97 | 684 | py | Python | tests/utils.py | gvcgael/matrix-trivia-bot | 0fe67cebaf2af647369734a5d48444cfee00ea28 | [
"Apache-2.0"
] | 55 | 2019-09-25T12:42:44.000Z | 2022-03-19T14:14:32.000Z | tests/utils.py | gvcgael/matrix-trivia-bot | 0fe67cebaf2af647369734a5d48444cfee00ea28 | [
"Apache-2.0"
] | 17 | 2019-11-30T10:44:47.000Z | 2021-12-07T01:09:16.000Z | tests/utils.py | gvcgael/matrix-trivia-bot | 0fe67cebaf2af647369734a5d48444cfee00ea28 | [
"Apache-2.0"
] | 28 | 2019-10-03T11:10:42.000Z | 2022-03-16T04:39:12.000Z | # Utility functions to make testing easier
import asyncio
from typing import Any, Awaitable
def run_coroutine(result: Awaitable[Any]) -> Any:
"""Wrapper for asyncio functions to allow them to be run from synchronous functions"""
loop = asyncio.get_event_loop()
result = loop.run_until_complete(result)
... | 29.73913 | 90 | 0.714912 |
e55f3c08109eda0a6704767c3da9e6850d47dc35 | 6,164 | py | Python | scripts/push_and_run_folder_seg.py | JonasFrey96/RPOSE | 7da77499ab777ce7ee37b731541982870da8d40b | [
"BSD-3-Clause"
] | null | null | null | scripts/push_and_run_folder_seg.py | JonasFrey96/RPOSE | 7da77499ab777ce7ee37b731541982870da8d40b | [
"BSD-3-Clause"
] | null | null | null | scripts/push_and_run_folder_seg.py | JonasFrey96/RPOSE | 7da77499ab777ce7ee37b731541982870da8d40b | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
import os
import argparse
import yaml
from os.path import expanduser
import logging
import coloredlogs
coloredlogs.install()
logging.getLogger("paramiko").setLevel(logging.WARNING)
"""
python scripts/push_and_run_folder_seg.py --exp=1 --time=4 --gpus=1 --mem=10240 --workers=32 --ram=60 --scratc... | 36.258824 | 179 | 0.632868 |
44046c6d645b4dd335010bac8aadeed366d34959 | 2,155 | py | Python | share/qt/extract_strings_qt.py | theduly/dulyquark | 5e345b45518a6cb6662ba466a571de69323f8ac7 | [
"MIT"
] | 1 | 2019-02-22T10:34:40.000Z | 2019-02-22T10:34:40.000Z | share/qt/extract_strings_qt.py | theduly/dulyquark | 5e345b45518a6cb6662ba466a571de69323f8ac7 | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | theduly/dulyquark | 5e345b45518a6cb6662ba466a571de69323f8ac7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/dulystrings.cpp"
... | 25.654762 | 105 | 0.618097 |
003b1007c94e5408cef3a2de8f77f6688f375b3a | 511 | py | Python | basic/day_first/03-functions.py | evermorn/skillbox-chat | f0d9392ec916aefd7f88d6d1a4dd6db6848628da | [
"MIT"
] | null | null | null | basic/day_first/03-functions.py | evermorn/skillbox-chat | f0d9392ec916aefd7f88d6d1a4dd6db6848628da | [
"MIT"
] | 4 | 2021-03-19T02:47:58.000Z | 2022-01-13T01:32:10.000Z | basic/day_first/03-functions.py | evermorn/skillbox-chat | f0d9392ec916aefd7f88d6d1a4dd6db6848628da | [
"MIT"
] | 1 | 2022-01-19T08:24:32.000Z | 2022-01-19T08:24:32.000Z | # Created by Artem Manchenkov
# artyom@manchenkoff.me
#
# Copyright © 2019
#
# Работа с функциями, аргументы и возвращаемое значение
#
def my_print(message: str):
print("MY PRINT: " + message)
my_print("some 1")
my_print("some 2")
def show_counter(step, max_step):
while step <= max_step:
print... | 14.194444 | 56 | 0.671233 |
48c7721ba2e8a9478c0733bfb5058ba12797bdbe | 66 | py | Python | test/hello.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | 10 | 2017-10-30T22:38:00.000Z | 2018-12-12T06:10:10.000Z | test/hello.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | 37 | 2017-10-19T12:06:54.000Z | 2018-12-13T10:18:23.000Z | test/hello.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | 3 | 2018-02-28T12:37:21.000Z | 2018-06-23T08:32:54.000Z | from time import sleep
print('hello from a subprocess')
sleep(60)
| 16.5 | 32 | 0.772727 |
0433890df044173277c341be31f16ab0b8795bc2 | 55,010 | py | Python | tests/cases.py | kdutia/pykeen | 55d73324a957f3ce466869899abeac7e34e596fb | [
"MIT"
] | null | null | null | tests/cases.py | kdutia/pykeen | 55d73324a957f3ce466869899abeac7e34e596fb | [
"MIT"
] | null | null | null | tests/cases.py | kdutia/pykeen | 55d73324a957f3ce466869899abeac7e34e596fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test cases for PyKEEN."""
import logging
import os
import pathlib
import tempfile
import timeit
import traceback
import unittest
from abc import ABC, abstractmethod
from typing import (
Any, ClassVar, Collection, Dict, Iterable, Mapping, MutableMapping, Optional, Sequence, Tuple, Type, ... | 38.657765 | 119 | 0.636757 |
22e0b7d1cdf2e656db8a61d272fa5541bb41013e | 701 | py | Python | pdf/examples/ex19.py | xjh093/LearnPythonTheHardWay | ee7f6063e592948e7d6c9bd65b1287f5cd5ef39a | [
"MIT"
] | 1 | 2018-06-11T06:28:16.000Z | 2018-06-11T06:28:16.000Z | pdf/examples/ex19.py | xjh093/LearnPythonTheHardWay | ee7f6063e592948e7d6c9bd65b1287f5cd5ef39a | [
"MIT"
] | null | null | null | pdf/examples/ex19.py | xjh093/LearnPythonTheHardWay | ee7f6063e592948e7d6c9bd65b1287f5cd5ef39a | [
"MIT"
] | null | null | null | #! /usr/bin/python3
# p65
def cheese_and_crackers(cheese_count, boxes_of_crackers):
print("You have %d cheeses!" % cheese_count)
print("You have %d boxes of crackers!" % boxes_of_crackers)
print("Man that's enough for a party!")
print("Get a blanket.\n")
print("We can just give the function numbers directly:")
ch... | 29.208333 | 66 | 0.770328 |
059e2a96e3534350381af0ef0ebabb2dfd0f4df3 | 11,377 | py | Python | kgtk/join/unique.py | shashank73744/kgtk | e8b45e35e97cbe788edeaf0962742e48b24e309c | [
"MIT"
] | null | null | null | kgtk/join/unique.py | shashank73744/kgtk | e8b45e35e97cbe788edeaf0962742e48b24e309c | [
"MIT"
] | null | null | null | kgtk/join/unique.py | shashank73744/kgtk | e8b45e35e97cbe788edeaf0962742e48b24e309c | [
"MIT"
] | null | null | null | """Count the unique values in a column in an KGTK file. Generate an output
KGTK node or edge file with the counts. Empty values are omitted from the
output KGTK file unless a non-empty substitute value is provided.
TODO: Consider other output formats. Perhaps seperate counts for each node1
(node2, etc.) value in the... | 48.828326 | 163 | 0.605256 |
50099111a8fd0338de1ee74d8a5f7708af27bad5 | 1,400 | py | Python | client-server/server/tornado_.py | duboviy/async | 5055daddc66e5335fb772aeb59493cc63e4a2739 | [
"MIT"
] | 6 | 2016-10-05T16:12:55.000Z | 2019-04-22T11:43:21.000Z | client-server/server/tornado_.py | duboviy/async | 5055daddc66e5335fb772aeb59493cc63e4a2739 | [
"MIT"
] | null | null | null | client-server/server/tornado_.py | duboviy/async | 5055daddc66e5335fb772aeb59493cc63e4a2739 | [
"MIT"
] | 2 | 2016-11-01T21:32:27.000Z | 2016-12-24T14:00:43.000Z | import errno
import functools
import socket
from tornado import ioloop, iostream
host = ''
port = 8001
clients = []
class Connection(object):
def __init__(self, connection):
clients.append(self)
self.stream = iostream.IOStream(connection)
self.read()
def read(self):
self.str... | 24.137931 | 63 | 0.615 |
e935eebb6277f5c803a7901945ce1e01fa3a1f53 | 396 | py | Python | bitcom/service/system/get_system_cod_status.py | bitcom-exchange/bitcom-python-api | 1491481f376ba7e7d4a7d2edb2f4400b8e4d7ec3 | [
"MIT"
] | 4 | 2021-03-04T00:10:24.000Z | 2021-12-15T01:49:39.000Z | bitcom/service/system/get_system_cod_status.py | bitcom-exchange/bitcom-python-api | 1491481f376ba7e7d4a7d2edb2f4400b8e4d7ec3 | [
"MIT"
] | null | null | null | bitcom/service/system/get_system_cod_status.py | bitcom-exchange/bitcom-python-api | 1491481f376ba7e7d4a7d2edb2f4400b8e4d7ec3 | [
"MIT"
] | null | null | null | from bitcom.connection.restapi_sync_client import RestApiSyncClient
from bitcom.constant import HttpMethod
class GetSystemCodStatusService:
def __init__(self, params):
self.params = params
def request(self, **kwargs):
channel = "/v1/system/cancel_only_status"
return RestApiSyncClien... | 24.75 | 104 | 0.752525 |
c963fa23dd553de8c9b717a470dc3e2d107fe7f5 | 61,376 | py | Python | tests/helpers.py | tiffanyn108/ocs-ci | 30350e0958d14100edeadbbc5f3fe557954a76b8 | [
"MIT"
] | null | null | null | tests/helpers.py | tiffanyn108/ocs-ci | 30350e0958d14100edeadbbc5f3fe557954a76b8 | [
"MIT"
] | null | null | null | tests/helpers.py | tiffanyn108/ocs-ci | 30350e0958d14100edeadbbc5f3fe557954a76b8 | [
"MIT"
] | null | null | null | """
Helper functions file for OCS QE
"""
import logging
import re
import datetime
import statistics
import os
from subprocess import TimeoutExpired
import tempfile
import time
import yaml
import threading
from ocs_ci.ocs.ocp import OCP
from uuid import uuid4
from ocs_ci.ocs.exceptions import TimeoutExpiredError, Unex... | 32.134031 | 112 | 0.640071 |
5641d1a96f72bec0c516842f3d0f79067e52b050 | 9,927 | py | Python | google/cloud/dialogflow_v2beta1/services/documents/transports/base.py | galz10/python-dialogflow | 652e2e8d860f369b62e7866d6cf220204740ade8 | [
"Apache-2.0"
] | 80 | 2020-05-19T20:54:47.000Z | 2022-03-27T01:35:30.000Z | google/cloud/dialogflow_v2beta1/services/documents/transports/base.py | galz10/python-dialogflow | 652e2e8d860f369b62e7866d6cf220204740ade8 | [
"Apache-2.0"
] | 135 | 2020-12-10T00:33:13.000Z | 2022-03-27T16:14:25.000Z | google/cloud/dialogflow_v2beta1/services/documents/transports/base.py | galz10/python-dialogflow | 652e2e8d860f369b62e7866d6cf220204740ade8 | [
"Apache-2.0"
] | 37 | 2020-12-12T15:09:15.000Z | 2022-03-08T02:25:28.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.179775 | 103 | 0.662436 |
0143931b0d3c16182286959d77a5d97f4ecbce03 | 1,086 | py | Python | hardware/testing/flame.py | haziquehaikal/smartdb | 0a20f47b949bf448cf61d7d8f802a2d3927412f7 | [
"Apache-2.0"
] | null | null | null | hardware/testing/flame.py | haziquehaikal/smartdb | 0a20f47b949bf448cf61d7d8f802a2d3927412f7 | [
"Apache-2.0"
] | null | null | null | hardware/testing/flame.py | haziquehaikal/smartdb | 0a20f47b949bf448cf61d7d8f802a2d3927412f7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
import json
import urllib3
# GPIO SETUP
channel = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel, GPIO.IN)
def calluser():
data = {'error': False, 'fire_detect': True}
encoded_data = json.dumps(data).encode('utf-8')
http = urllib3.PoolManager()
r =... | 24.133333 | 103 | 0.665746 |
82dcfd5536fc8a63494d7edfb4ff2311e15acdf4 | 5,519 | py | Python | tests/chainer_tests/training_tests/updaters_tests/test_standard_updater.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | null | null | null | tests/chainer_tests/training_tests/updaters_tests/test_standard_updater.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | 2 | 2018-01-09T23:05:30.000Z | 2018-01-19T01:19:34.000Z | tests/chainer_tests/training_tests/updaters_tests/test_standard_updater.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | null | null | null | import unittest
import mock
import numpy
import chainer
from chainer import dataset
from chainer import testing
from chainer import training
class DummyIterator(dataset.Iterator):
epoch = 1
is_new_epoch = True
def __init__(self, next_data):
self.finalize_called = 0
self.next_called = 0... | 29.513369 | 78 | 0.657909 |
3c817fbc9b17f66aec2f84ee34466a31dc67c223 | 54,874 | py | Python | test/unit/common/test_internal_client.py | heemanshu/swift_liberty | f4b62440ee4d8315ae4a2670617059070f11dc88 | [
"Apache-2.0"
] | null | null | null | test/unit/common/test_internal_client.py | heemanshu/swift_liberty | f4b62440ee4d8315ae4a2670617059070f11dc88 | [
"Apache-2.0"
] | null | null | null | test/unit/common/test_internal_client.py | heemanshu/swift_liberty | f4b62440ee4d8315ae4a2670617059070f11dc88 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 39.966497 | 79 | 0.593505 |
b1c4738463abff6c1898fe45d456a0c7d4be9cdf | 1,154 | py | Python | website_multi_company_demo/__manifest__.py | marcel1981/website-addons | b276b41c8f97ac9614cf54e1783ef3fc3adc8470 | [
"MIT"
] | 1 | 2020-03-01T03:04:21.000Z | 2020-03-01T03:04:21.000Z | website_multi_company_demo/__manifest__.py | marcel1981/website-addons | b276b41c8f97ac9614cf54e1783ef3fc3adc8470 | [
"MIT"
] | null | null | null | website_multi_company_demo/__manifest__.py | marcel1981/website-addons | b276b41c8f97ac9614cf54e1783ef3fc3adc8470 | [
"MIT"
] | null | null | null | {
"name": """Website Demo Data""",
"summary": """Provides demo websites""",
"category": "Hidden",
# "live_test_URL": "",
"images": [],
"version": "13.0.1.0.0",
"application": False,
"author": "IT-Projects LLC, Ivan Yelizariev",
"support": "apps@itpp.dev",
"website": "https://it-p... | 28.146341 | 55 | 0.555459 |
ff198a304e62a2419a72097ce813ce8d6b3857c7 | 2,982 | py | Python | rmltraintfmobilepose/rmltraintfmobilepose/core.py | autognc/ravenML-plugins | 0a7e63a6d1fcf937599c688d3b567978f0c51b8b | [
"MIT"
] | null | null | null | rmltraintfmobilepose/rmltraintfmobilepose/core.py | autognc/ravenML-plugins | 0a7e63a6d1fcf937599c688d3b567978f0c51b8b | [
"MIT"
] | 13 | 2020-04-25T00:29:21.000Z | 2022-02-10T02:15:57.000Z | rmltraintfmobilepose/rmltraintfmobilepose/core.py | autognc/ravenML-plugins | 0a7e63a6d1fcf937599c688d3b567978f0c51b8b | [
"MIT"
] | 1 | 2021-04-29T23:06:45.000Z | 2021-04-29T23:06:45.000Z | from ravenml.train.options import pass_train
from ravenml.train.interfaces import TrainInput, TrainOutput
from comet_ml import Experiment
from contextlib import ExitStack
import numpy as np
import click
import json
import os
from .train import KeypointsModel
from . import scripts
import pkgutil
import importlib
@clic... | 33.133333 | 94 | 0.716968 |
d111c4fffe03d5f1d9219269ada8f8fda183aed1 | 1,046 | py | Python | vivarium/experiments/glucose_phosphorylation.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/experiments/glucose_phosphorylation.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/experiments/glucose_phosphorylation.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | """
======================================
Toy Glucose Phosphorylation Experiment
======================================
This is a toy example referred to by the documentation.
"""
from vivarium.core.experiment import Experiment
from vivarium.compartments.injected_glc_phosphorylation import (
InjectedGlcPhosphory... | 29.055556 | 64 | 0.626195 |
5581076ecd4cc1cf18fb26e5fe1db105df6420b2 | 25,801 | py | Python | src/icosahedron.py | sglim2/py_ellipsoids | 0f9209495ce977a999c8c76fbdf114ea5181f9ef | [
"MIT"
] | null | null | null | src/icosahedron.py | sglim2/py_ellipsoids | 0f9209495ce977a999c8c76fbdf114ea5181f9ef | [
"MIT"
] | null | null | null | src/icosahedron.py | sglim2/py_ellipsoids | 0f9209495ce977a999c8c76fbdf114ea5181f9ef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 26 09:41:29 2015
@author: sacim
"""
import numpy as np
import math
#=============================================================================
class Icosahedron:
def __init__(self, ngrid, name='ellipsoid'):
self.name = name # A short n... | 40.440439 | 109 | 0.415255 |
63c34c2e552e0698efdf7e4d311cb03e32c3e57e | 6,954 | py | Python | kedro/runner/runner.py | martwetzels/kedro | 25bf2dfc8af7b3fda7f5bb4e6c00f16b3768e2e9 | [
"Apache-2.0"
] | null | null | null | kedro/runner/runner.py | martwetzels/kedro | 25bf2dfc8af7b3fda7f5bb4e6c00f16b3768e2e9 | [
"Apache-2.0"
] | null | null | null | kedro/runner/runner.py | martwetzels/kedro | 25bf2dfc8af7b3fda7f5bb4e6c00f16b3768e2e9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 QuantumBlack Visual Analytics 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 36.6 | 86 | 0.658326 |
5a93c0a8ff434adb5fc8cd98ab38dee218476592 | 7,554 | py | Python | tests/run-memcached.py | kurtace72/lighttpd2 | 505bfb053f481b39ffd0f03336e4a8511f45883e | [
"Apache-2.0"
] | null | null | null | tests/run-memcached.py | kurtace72/lighttpd2 | 505bfb053f481b39ffd0f03336e4a8511f45883e | [
"Apache-2.0"
] | null | null | null | tests/run-memcached.py | kurtace72/lighttpd2 | 505bfb053f481b39ffd0f03336e4a8511f45883e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import asyncore
import socket
import time
import random
import traceback
class MemcacheEntry:
def __init__(self, flags, exptime, data, cas):
self.flags = flags
self.data = data
self.cas = cas
self.setExptime(exptime)
def _ttl(self, str):
v = int(str)
if v <... | 26.048276 | 106 | 0.649722 |
b0b4c6803e5bb5ff25075c2782d1ea9fdb5ca4df | 1,019 | py | Python | src/table_tennis/tests/moveit_tests.py | sidharthsharma96/Tabletennis | c3d5bd09bc4f8deeb4961178222fd9c6fef6c649 | [
"BSD-2-Clause"
] | 1 | 2021-03-30T12:22:13.000Z | 2021-03-30T12:22:13.000Z | src/table_tennis/tests/moveit_tests.py | sidharthsharma96/Tabletennis | c3d5bd09bc4f8deeb4961178222fd9c6fef6c649 | [
"BSD-2-Clause"
] | null | null | null | src/table_tennis/tests/moveit_tests.py | sidharthsharma96/Tabletennis | c3d5bd09bc4f8deeb4961178222fd9c6fef6c649 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import rospy
import numpy as np
import geometry_msgs.msg
from moveit_commander import MoveGroupCommander, roscpp_initialize
from math import pi
rospy.init_node('moveit_tests', anonymous=False)
roscpp_initialize(sys.argv)
group = MoveGroupCommander('manipulator','/iiwa/robot_descripti... | 22.152174 | 75 | 0.789009 |
c82a7daed49794874f6d57772e557d3c69d7558d | 4,475 | py | Python | layers/attention.py | AlbertoPaz/ABSA-PyTorch | 070a4b6f20cde0e2021c72b84c534659d749f36e | [
"MIT"
] | 20 | 2018-12-12T16:51:31.000Z | 2021-01-26T07:13:41.000Z | layers/attention.py | AlbertoPaz/ABSA-PyTorch | 070a4b6f20cde0e2021c72b84c534659d749f36e | [
"MIT"
] | null | null | null | layers/attention.py | AlbertoPaz/ABSA-PyTorch | 070a4b6f20cde0e2021c72b84c534659d749f36e | [
"MIT"
] | 5 | 2018-10-30T15:57:09.000Z | 2021-01-26T12:26:21.000Z | # -*- coding: utf-8 -*-
# file: attention.py
# author: songyouwei <youwei0314@gmail.com>
# Copyright (C) 2018. All Rights Reserved.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
def __init__(self, embed_dim, hidden_dim=None, n_head=1, score_function='s... | 49.175824 | 138 | 0.53676 |
5c7512234e58baf004bd3e04c69d857bbd0bfd64 | 3,314 | py | Python | leo/plugins/mod_autosave.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 1,550 | 2015-01-14T16:30:37.000Z | 2022-03-31T08:55:58.000Z | leo/plugins/mod_autosave.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 2,009 | 2015-01-13T16:28:52.000Z | 2022-03-31T18:21:48.000Z | leo/plugins/mod_autosave.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 200 | 2015-01-05T15:07:41.000Z | 2022-03-07T17:05:01.000Z | #@+leo-ver=5-thin
#@+node:edream.110203113231.724: * @file ../plugins/mod_autosave.py
""" Autosaves the Leo outline every so often.
The time between saves is given by the setting, with default as shown::
@int mod_autosave_interval = 300
This plugin is active only if::
@bool mod_autosave_active = True
"""
... | 34.884211 | 87 | 0.59656 |
01373be8338777db864df2c222e546e89bb4672b | 2,243 | py | Python | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ConvertBandwidthPackageRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ConvertBandwidthPackageRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ConvertBandwidthPackageRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # 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... | 36.770492 | 81 | 0.780205 |
aacebb95a1c39e9931e567d7c4c966e5dad5c07a | 50,703 | py | Python | setup.py | dmyerscough/salt | d7b19ab64f0695568f78c12b4ba209e033903804 | [
"Apache-2.0"
] | null | null | null | setup.py | dmyerscough/salt | d7b19ab64f0695568f78c12b4ba209e033903804 | [
"Apache-2.0"
] | null | null | null | setup.py | dmyerscough/salt | d7b19ab64f0695568f78c12b4ba209e033903804 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
The setup script for salt
'''
# pylint: disable=file-perms,ungrouped-imports,wrong-import-order,wrong-import-position,repr-flag-used-in-string
# pylint: disable=3rd-party-local-module-not-gated,resource-leakage
# pylint: disable=C0111,E1101,E1103,F0401,W0611,W0201,W023... | 39.488318 | 127 | 0.561959 |
73e6b63f8b1ce81ddafa4c47c08ccfa62cd0151e | 748 | py | Python | evaluation/examveda/transform_data.py | Aunsiels/CSK | c88609bc76d865b4987aaf30ddf1247a2031b1a6 | [
"MIT"
] | 16 | 2019-11-28T13:26:37.000Z | 2022-02-09T09:53:10.000Z | evaluation/examveda/transform_data.py | Aunsiels/CSK | c88609bc76d865b4987aaf30ddf1247a2031b1a6 | [
"MIT"
] | 1 | 2021-03-26T20:31:48.000Z | 2021-07-15T08:52:47.000Z | evaluation/examveda/transform_data.py | Aunsiels/CSK | c88609bc76d865b4987aaf30ddf1247a2031b1a6 | [
"MIT"
] | 3 | 2020-08-14T23:23:25.000Z | 2021-12-24T14:02:35.000Z | import json
res = []
with open("questions_examveda2.tsv") as f:
res = []
id = 0
for line in f:
line = line.strip().split("\t")
if len(line) != 10:
continue
temp = dict()
temp["id"] = str(id)
id += 1
temp["question"] = dict()
temp["question... | 24.933333 | 53 | 0.47861 |
d906df5f545a753c201f7d3bb20483aaf0d5fdc5 | 722 | py | Python | setup.py | 0sahilahmed/dbt-mssql | 06f53e589fc004b83512fb3aeded61582b2abe45 | [
"Apache-2.0"
] | 9 | 2019-08-02T03:56:19.000Z | 2021-04-07T11:34:58.000Z | setup.py | 0sahilahmed/dbt-mssql | 06f53e589fc004b83512fb3aeded61582b2abe45 | [
"Apache-2.0"
] | 25 | 2019-07-30T17:57:08.000Z | 2021-01-05T17:53:49.000Z | setup.py | 0sahilahmed/dbt-mssql | 06f53e589fc004b83512fb3aeded61582b2abe45 | [
"Apache-2.0"
] | 5 | 2019-08-16T18:29:24.000Z | 2020-10-01T09:14:04.000Z | #!/usr/bin/env python
from setuptools import find_packages
from distutils.core import setup
package_name = "dbt-mssql"
package_version = "1.0.8"
description = """The mssql adpter plugin for dbt (data build tool)"""
setup(
name=package_name,
version=package_version,
description=description,
long_descri... | 24.066667 | 69 | 0.630194 |
b29a8b6b3814ba872ebe6d7b87c4fcb1f395d1b7 | 8,397 | py | Python | data_resource_api/factories/orm_factory.py | brighthive/data-resource-api | a012fc0743f1ce2b72ddacf348c57adf44245cfa | [
"MIT"
] | 4 | 2019-02-14T01:07:54.000Z | 2019-11-04T17:28:35.000Z | data_resource_api/factories/orm_factory.py | brighthive/data-resource-api | a012fc0743f1ce2b72ddacf348c57adf44245cfa | [
"MIT"
] | 39 | 2019-05-30T22:08:46.000Z | 2022-02-17T02:47:00.000Z | data_resource_api/factories/orm_factory.py | brighthive/data-resource-api | a012fc0743f1ce2b72ddacf348c57adf44245cfa | [
"MIT"
] | 1 | 2020-04-29T18:16:20.000Z | 2020-04-29T18:16:20.000Z | """ORM Factory.
A factory for building SQLAlchemy ORM models from a Frictionless
TableSchema specification.
"""
import warnings
from data_resource_api.app.utils.junc_holder import JuncHolder
from data_resource_api.factories.table_schema_types import (
TABLESCHEMA_TO_SQLALCHEMY_TYPES,
)
from data_resource_api.log... | 35.884615 | 87 | 0.528879 |
ff7b8994bc688e270c93c5355f193d1a6a6d940d | 17,193 | py | Python | datalad_next/tests/test_create_sibling_webdav.py | datalad/datalad-next | 8fd1dd76b5f6bc0ba51837d73e04a9773b2a9580 | [
"MIT"
] | null | null | null | datalad_next/tests/test_create_sibling_webdav.py | datalad/datalad-next | 8fd1dd76b5f6bc0ba51837d73e04a9773b2a9580 | [
"MIT"
] | 2 | 2022-03-31T07:39:42.000Z | 2022-03-31T10:35:34.000Z | datalad_next/tests/test_create_sibling_webdav.py | datalad/datalad-next | 8fd1dd76b5f6bc0ba51837d73e04a9773b2a9580 | [
"MIT"
] | null | null | null | from pathlib import Path
from unittest.mock import (
call,
patch,
)
from urllib.parse import quote as urlquote
from datalad.cli.tests.test_main import run_main
from datalad.tests.utils import (
assert_equal,
assert_in,
assert_in_results,
assert_raises,
assert_result_count,
assert_status... | 31.546789 | 90 | 0.606177 |
fdb6290a4edc1992cda70baacd8bd728573523a6 | 17,381 | py | Python | sdk/python/pulumi_azure_native/desktopvirtualization/v20201102preview/host_pool.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/desktopvirtualization/v20201102preview/host_pool.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/desktopvirtualization/v20201102preview/host_pool.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 47.881543 | 1,625 | 0.672286 |
2d340ce302f496bdba99b91f2aa7ef7179f45d64 | 7,656 | py | Python | mac/google-cloud-sdk/lib/third_party/kubernetes/client/models/extensions_v1beta1_ingress.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | mac/google-cloud-sdk/lib/third_party/kubernetes/client/models/extensions_v1beta1_ingress.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | mac/google-cloud-sdk/lib/third_party/kubernetes/client/models/extensions_v1beta1_ingress.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | 1 | 2020-07-25T18:17:57.000Z | 2020-07-25T18:17:57.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen
https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | 29.90625 | 107 | 0.649817 |
32f42032086de4d2f6db2269bba47b310fe7311c | 258 | py | Python | api/daos/shortened_url_dao.py | RichardOB/url-shortener-api | b180608893c0b93881e7587756f054e722452cff | [
"MIT"
] | null | null | null | api/daos/shortened_url_dao.py | RichardOB/url-shortener-api | b180608893c0b93881e7587756f054e722452cff | [
"MIT"
] | null | null | null | api/daos/shortened_url_dao.py | RichardOB/url-shortener-api | b180608893c0b93881e7587756f054e722452cff | [
"MIT"
] | null | null | null | import uuid
from api.model.models import db, ShortenedUrl
def create(url):
shortened_url = ShortenedUrl(url=url)
db.session.add(shortened_url)
return shortened_url
def fetch(id):
return db.session.query(ShortenedUrl).filter_by(id=id).one()
| 23.454545 | 64 | 0.748062 |
0294accc4c0b5e79bcec2e1499609b6e7e564ae5 | 2,296 | py | Python | utils.py | Arnaud15/ProjectMSE226 | 11db7260611242ba0e464c0fab266591afb3c1a6 | [
"MIT"
] | null | null | null | utils.py | Arnaud15/ProjectMSE226 | 11db7260611242ba0e464c0fab266591afb3c1a6 | [
"MIT"
] | null | null | null | utils.py | Arnaud15/ProjectMSE226 | 11db7260611242ba0e464c0fab266591afb3c1a6 | [
"MIT"
] | null | null | null | import sklearn as sk
from sklearn import linear_model
import matplotlib.pyplot as plt
from itertools import cycle
import numpy as np
def evaluate_cv(X, y, model, cv=10):
scores = sk.model_selection.cross_val_score(model, X, y, cv)
return scores
def lassoPath(X, y, coef_names, eps=5e-3, save_fig=True): # th... | 33.764706 | 113 | 0.669425 |
41e9418efc89e1ec5c85976d5a32e49a3157a9e5 | 3,724 | py | Python | google-rank-checker.py | thejeffchen/google-keyword-rank-checker | 4f45cc644eb765e723583a192bfd8b03fc87137c | [
"MIT"
] | 19 | 2018-03-23T00:02:44.000Z | 2021-12-12T14:18:07.000Z | google-rank-checker.py | thejeffchen/google-keyword-rank-checker | 4f45cc644eb765e723583a192bfd8b03fc87137c | [
"MIT"
] | 11 | 2018-03-23T22:49:10.000Z | 2021-12-13T19:45:51.000Z | google-rank-checker.py | thejeffchen/google-keyword-rank-checker | 4f45cc644eb765e723583a192bfd8b03fc87137c | [
"MIT"
] | 13 | 2018-03-23T23:24:34.000Z | 2022-02-07T05:20:42.000Z | from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import csv
import os
import random
import time
# Proxy use - IP:PORT or HOST:PORT, use at your own risk. Google seems to be pretty good at detecting proxy usage, I was stopped fairly quickly. Uncomment lines 4... | 34.165138 | 242 | 0.648765 |
4a850f3b4c24a40affd9e09ee02b1505f303e0a3 | 495 | py | Python | _site/tomat/apps/pages/middleware.py | Lisaveta-K/lisaveta-k.github.io | 96306c4d2634d62e6d0ac504aee8ca91f8b3de11 | [
"MIT"
] | null | null | null | _site/tomat/apps/pages/middleware.py | Lisaveta-K/lisaveta-k.github.io | 96306c4d2634d62e6d0ac504aee8ca91f8b3de11 | [
"MIT"
] | null | null | null | _site/tomat/apps/pages/middleware.py | Lisaveta-K/lisaveta-k.github.io | 96306c4d2634d62e6d0ac504aee8ca91f8b3de11 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.http import Http404
from django.conf import settings
from pages.views import read
class PageFallbackMiddleware(object):
def process_response(self, request, response):
if response.status_code != 404:
return response
try:
return read(re... | 21.521739 | 51 | 0.608081 |
ebe61a829e72c61a7e238de2dc0daede0c57e715 | 2,128 | py | Python | update_kubeconfig.py | sso2712/python | 885ea630717c6a9ae8a8c4fb952dcb7be3a0bbc6 | [
"MIT"
] | null | null | null | update_kubeconfig.py | sso2712/python | 885ea630717c6a9ae8a8c4fb952dcb7be3a0bbc6 | [
"MIT"
] | null | null | null | update_kubeconfig.py | sso2712/python | 885ea630717c6a9ae8a8c4fb952dcb7be3a0bbc6 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
import argparse
import sys
import configparser
import yaml
import re
CREDENTIALS_FILE = "/Users/simon.so/.aws/credentials"
KUBECONFIG = "/Users/simon.so/.kube/config"
parser = argparse.ArgumentParser(
description='Write AWS credentials into kubeconfig')
parser.add_argument('-c', '--clust... | 28 | 104 | 0.666823 |
7b933312d565eb12db41d0b43ec0b1eb698feece | 6,650 | py | Python | ipfspinsteem/ipfspinsteem2.py | Johnn3y/ipfs-pin-steem | f7db4d421201e2f161afc79fe436959e135f31da | [
"Unlicense"
] | 4 | 2018-04-03T16:53:01.000Z | 2018-11-15T00:19:33.000Z | ipfspinsteem/ipfspinsteem2.py | Johnn3y/ipfs-pin-steem | f7db4d421201e2f161afc79fe436959e135f31da | [
"Unlicense"
] | 1 | 2018-04-23T08:56:30.000Z | 2018-04-23T18:15:07.000Z | ipfspinsteem/ipfspinsteem2.py | Johnn3y/ipfs-pin-steem | f7db4d421201e2f161afc79fe436959e135f31da | [
"Unlicense"
] | null | null | null | import ast,ipfshttpclient,json
try:
from beem.comment import Comment as C
from beem.account import Account as A
from beem.exceptions import ContentDoesNotExistsException
except ImportError:
try:
from steem.steemd import Steemd as S
except ImportError:
pass
import requests
import random
import ipfspinsteem.s... | 26.6 | 122 | 0.62797 |
cec173910c1895ab0334925d32ad200f61f1b973 | 8,546 | py | Python | ocd_backend/items/__init__.py | fransward/open-cultuur-data | 38db2476ad0c5c1328315d418ae92d6abe3a5f0b | [
"CC-BY-4.0"
] | 1 | 2019-02-07T14:32:29.000Z | 2019-02-07T14:32:29.000Z | ocd_backend/items/__init__.py | fransward/open-cultuur-data | 38db2476ad0c5c1328315d418ae92d6abe3a5f0b | [
"CC-BY-4.0"
] | null | null | null | ocd_backend/items/__init__.py | fransward/open-cultuur-data | 38db2476ad0c5c1328315d418ae92d6abe3a5f0b | [
"CC-BY-4.0"
] | null | null | null | from hashlib import sha1
from datetime import datetime
from collections import MutableMapping
from ocd_backend.exceptions import UnableToGenerateObjectId
class BaseItem(object):
"""Represents a single extracted and transformed item.
:param source_definition: The configuration of a single source in
t... | 33.124031 | 96 | 0.644512 |
69191cb33f77292a8cb617fd35c91b20f5c8a132 | 142 | py | Python | netsgiro/constants.py | jodal/python-netsgiro | b180ad3e6c8e4788c2dc539bdcd35b64b2bf6247 | [
"Apache-2.0"
] | null | null | null | netsgiro/constants.py | jodal/python-netsgiro | b180ad3e6c8e4788c2dc539bdcd35b64b2bf6247 | [
"Apache-2.0"
] | null | null | null | netsgiro/constants.py | jodal/python-netsgiro | b180ad3e6c8e4788c2dc539bdcd35b64b2bf6247 | [
"Apache-2.0"
] | null | null | null | """Constants that are useful when working with OCR files."""
__all__ = ['NETS_ID']
#: Nets' data sender/recipient ID.
NETS_ID = '00008080'
| 17.75 | 60 | 0.697183 |
760ea305c13e1851172ad4e40209a7b652fe7bc1 | 6,686 | py | Python | test.py | safamathl/ResUnet | 04968053ddfedc8ef7e6d82d2b3a9b46f28d1692 | [
"MIT"
] | 3 | 2020-12-18T21:19:21.000Z | 2022-01-20T12:38:42.000Z | test.py | safamathl/ResUnet | 04968053ddfedc8ef7e6d82d2b3a9b46f28d1692 | [
"MIT"
] | null | null | null | test.py | safamathl/ResUnet | 04968053ddfedc8ef7e6d82d2b3a9b46f28d1692 | [
"MIT"
] | 2 | 2021-09-24T08:44:48.000Z | 2022-03-17T06:45:11.000Z | """
Test
"""
import os
import copy
import collections
from time import time
import torch
import numpy as np
import pandas as pd
import scipy.ndimage as ndimage
import SimpleITK as sitk
import skimage.measure as measure
import skimage.morphology as morphology
from net.ResUNet import ResUNet
from utilities.calculate_... | 28.330508 | 152 | 0.680227 |
b0bc3563446af2009d6eb4e8b5d7e495c1cf5f11 | 3,806 | py | Python | acapy_client/models/v20_cred_proposal.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | 4 | 2021-08-05T09:20:34.000Z | 2021-08-08T19:37:29.000Z | acapy_client/models/v20_cred_proposal.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | null | null | null | acapy_client/models/v20_cred_proposal.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | 2 | 2021-08-12T18:18:45.000Z | 2021-08-14T13:22:28.000Z | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.attach_decorator import AttachDecorator
from ..models.v20_cred_format import V20CredFormat
from ..models.v20_cred_preview import V20CredPreview
from ..types import UNSET, Unset
T = TypeVar("T", bound="V20CredProposal")
@attr.s(auto_... | 31.454545 | 83 | 0.638203 |
9085da42d290f5963d77c8cc9d0891d9b8729969 | 3,088 | py | Python | The game.py | vivzoftheGalaxy/Calculator-Actually-a-game- | 36b2f285da079dc5949e1d84b8ff9e4b484529f6 | [
"BSD-3-Clause"
] | null | null | null | The game.py | vivzoftheGalaxy/Calculator-Actually-a-game- | 36b2f285da079dc5949e1d84b8ff9e4b484529f6 | [
"BSD-3-Clause"
] | null | null | null | The game.py | vivzoftheGalaxy/Calculator-Actually-a-game- | 36b2f285da079dc5949e1d84b8ff9e4b484529f6 | [
"BSD-3-Clause"
] | null | null | null | print("This is the calculator!")
a=int(input("Choose a number:"))
b=int(input("Choose another number:"))
#The next line will take and give the sum.
print('Divided, these numbers are',a/b)
print('But, if you want floor division, the answer is,',a//b)
print("Now,")
c=float(input('choose a number that is a float (decimal)... | 46.787879 | 181 | 0.640544 |
b8b4486605fd1d712d3ad533df2c2ac137574b3d | 370 | py | Python | server/Lib/site-packages/pymysql/constants/FIELD_TYPE.py | BrandonGrimaldoM/gameoverweb | 8663a06b9205a2f84399985a4d37d8d8a0e41cc2 | [
"MIT"
] | 6,773 | 2015-01-03T16:01:30.000Z | 2022-03-31T09:59:46.000Z | server/Lib/site-packages/pymysql/constants/FIELD_TYPE.py | BrandonGrimaldoM/gameoverweb | 8663a06b9205a2f84399985a4d37d8d8a0e41cc2 | [
"MIT"
] | 630 | 2015-01-11T07:34:26.000Z | 2022-03-31T05:00:59.000Z | server/Lib/site-packages/pymysql/constants/FIELD_TYPE.py | BrandonGrimaldoM/gameoverweb | 8663a06b9205a2f84399985a4d37d8d8a0e41cc2 | [
"MIT"
] | 1,495 | 2015-01-03T01:07:12.000Z | 2022-03-29T08:58:02.000Z | DECIMAL = 0
TINY = 1
SHORT = 2
LONG = 3
FLOAT = 4
DOUBLE = 5
NULL = 6
TIMESTAMP = 7
LONGLONG = 8
INT24 = 9
DATE = 10
TIME = 11
DATETIME = 12
YEAR = 13
NEWDATE = 14
VARCHAR = 15
BIT = 16
JSON = 245
NEWDECIMAL = 246
ENUM = 247
SET = 248
TINY_BLOB = 249
MEDIUM_BLOB = 250
LONG_BLOB = 251
BLOB = 252
VAR_STRING = 253
STRING ... | 11.5625 | 17 | 0.672973 |
ebc9189aa17bdab10aff89212b4ec39a40f4ebdc | 21,018 | py | Python | src/ferm/train.py | TaoHuang13/SurRoL-imitation | 27e349787819acbdbc9ac40a81971d4f3e1bb698 | [
"MIT"
] | null | null | null | src/ferm/train.py | TaoHuang13/SurRoL-imitation | 27e349787819acbdbc9ac40a81971d4f3e1bb698 | [
"MIT"
] | null | null | null | src/ferm/train.py | TaoHuang13/SurRoL-imitation | 27e349787819acbdbc9ac40a81971d4f3e1bb698 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import argparse
import os
import math
import gym
import sys
import random
import time
import json
import copy
import utils
from logger import Logger
from video import VideoRecorder
from curl_sac import CurlSacAgent, RadSacAgent
from torchvision import transforms
import env_wrapper
d... | 39.359551 | 291 | 0.6336 |
73344c8dedfeae0f333335baa6d60bb926fbb390 | 1,849 | py | Python | utils/helpers.py | ademyanchuk/pytorch_segmentation | b615d584631c09b1223670bdb409f90199e1b4ae | [
"MIT"
] | null | null | null | utils/helpers.py | ademyanchuk/pytorch_segmentation | b615d584631c09b1223670bdb409f90199e1b4ae | [
"MIT"
] | null | null | null | utils/helpers.py | ademyanchuk/pytorch_segmentation | b615d584631c09b1223670bdb409f90199e1b4ae | [
"MIT"
] | null | null | null | import os
import torch
import torch.nn as nn
import numpy as np
import math
import PIL
def dir_exists(path):
if not os.path.exists(path):
os.makedirs(path)
def initialize_weights(*models):
for model in models:
for m in model.modules():
if isinstance(m, nn.Conv2d):
... | 27.191176 | 82 | 0.608978 |
95bfc5bb9527a9366f52cfb77ffe7403b9df0e48 | 50,283 | py | Python | pysnmp/DPI-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/DPI-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/DPI-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module DPI-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DPI-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:39:17 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)... | 129.262211 | 8,350 | 0.769922 |
ff514e9a5320338df7df8042c360d24722e45275 | 3,210 | py | Python | toughradius/manage/tasks/radius_stat.py | geosson/GSRadius | 5870e3d055e8366f98b8e65220a1520b5da22f6d | [
"Apache-2.0"
] | 1 | 2019-05-12T15:06:58.000Z | 2019-05-12T15:06:58.000Z | toughradius/manage/tasks/radius_stat.py | geosson/GSRadius | 5870e3d055e8366f98b8e65220a1520b5da22f6d | [
"Apache-2.0"
] | null | null | null | toughradius/manage/tasks/radius_stat.py | geosson/GSRadius | 5870e3d055e8366f98b8e65220a1520b5da22f6d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#coding:utf-8
import sys, struct
import msgpack
import time
import datetime
from toughlib import utils
from toughlib import logger
from txradius import statistics
from toughradius.manage.tasks.task_base import TaseBasic
from twisted.internet import reactor,defer
from txzmq import ZmqEndpoint, ZmqF... | 37.325581 | 106 | 0.64081 |
d08a379b98361e2725fd39f418ebd90c8c4bacd9 | 906 | py | Python | src/qaa/libs/__init__.py | tclick/qaa | f484bd8b15acad5f314292f407d59864a44fcb2f | [
"BSD-3-Clause"
] | 3 | 2021-03-22T04:17:20.000Z | 2021-05-27T12:32:47.000Z | src/qaa/libs/__init__.py | tclick/qaa | f484bd8b15acad5f314292f407d59864a44fcb2f | [
"BSD-3-Clause"
] | 133 | 2021-03-22T13:50:53.000Z | 2022-03-30T12:10:55.000Z | src/qaa/libs/__init__.py | tclick/qaa | f484bd8b15acad5f314292f407d59864a44fcb2f | [
"BSD-3-Clause"
] | 1 | 2021-05-19T12:59:40.000Z | 2021-05-19T12:59:40.000Z | # --------------------------------------------------------------------------------------
# Copyright (C) 2020–2021 by Timothy H. Click <tclick@okstate.edu>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS I... | 56.625 | 88 | 0.613687 |
64be11962bd43c7e2133a35a059c713969dea01e | 1,540 | py | Python | keras/lstm-securitai/model/h5tf.py | PipelineAI/models | d8df07877aa8b10ce9b84983bb440af75e84dca7 | [
"Apache-2.0"
] | 44 | 2017-11-17T06:19:05.000Z | 2021-11-03T06:00:56.000Z | keras/lstm-securitai/model/h5tf.py | PipelineAI/models | d8df07877aa8b10ce9b84983bb440af75e84dca7 | [
"Apache-2.0"
] | 3 | 2018-08-09T14:28:17.000Z | 2018-09-10T03:32:42.000Z | keras/lstm-securitai/model/h5tf.py | PipelineAI/models | d8df07877aa8b10ce9b84983bb440af75e84dca7 | [
"Apache-2.0"
] | 21 | 2017-11-18T15:12:12.000Z | 2020-08-15T07:08:33.000Z | from keras import backend as K
from keras.models import load_model
from tensorflow.python.saved_model import builder as saved_model_builder
from tensorflow.python.saved_model.signature_def_utils import predict_signature_def
from tensorflow.python.saved_model import tag_constants
# Function to export Keras model to Pro... | 39.487179 | 85 | 0.734416 |
7e291217247774e2b5cc0753114d41de27fd9c49 | 13,232 | py | Python | sap/adt/aunit.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | null | null | null | sap/adt/aunit.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | null | null | null | sap/adt/aunit.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | 1 | 2022-01-10T03:58:03.000Z | 2022-01-10T03:58:03.000Z | """ABAP Unit Test framework ADT wrappers"""
from typing import NamedTuple, List
import xml.sax
from xml.sax.handler import ContentHandler
from sap import get_logger
from sap.adt.objects import ADTObjectType, XMLNamespace
from sap.adt.annotations import OrderedClassMembers, XmlElementProperty, XmlNodeProperty, XmlNod... | 33.329975 | 114 | 0.661125 |
61c735eff0bbe571d803d4259a6cafe6e245c5f4 | 1,457 | py | Python | setup.py | jrutila/django-google-analytics | be7404df95a2e69e3358c5566885e549c3070c15 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jrutila/django-google-analytics | be7404df95a2e69e3358c5566885e549c3070c15 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jrutila/django-google-analytics | be7404df95a2e69e3358c5566885e549c3070c15 | [
"BSD-3-Clause"
] | null | null | null | import codecs
import os
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
with codecs.open(os.path.join(HERE, *parts), 'rb', 'utf-8') as f:
return f.read()
setup(
name='django-google-analytics-app',
version='4.3.7',
description=... | 28.568627 | 79 | 0.592313 |
d4048890ce7e9bc89aae550f00b80fb65de09b58 | 4,774 | py | Python | utility/cog/displayer/move.py | DrLarck/DiscordBallZ_ | c274e26efce4c5a757d258c54bc285d118618751 | [
"MIT"
] | 4 | 2020-01-19T13:53:43.000Z | 2020-01-20T13:34:17.000Z | utility/cog/displayer/move.py | DrLarck/DiscordBallZ_ | c274e26efce4c5a757d258c54bc285d118618751 | [
"MIT"
] | 18 | 2020-01-19T17:52:17.000Z | 2020-02-17T15:06:13.000Z | utility/cog/displayer/move.py | DrLarck/DiscordBallZ_ | c274e26efce4c5a757d258c54bc285d118618751 | [
"MIT"
] | 1 | 2020-01-19T16:33:19.000Z | 2020-01-19T16:33:19.000Z | """
Manages the way the move are displayed.
--
Author : DrLarck
Last update : 25/02/20 (DrLarck)
"""
# dependancies
import asyncio
# icon
from configuration.icon import game_icon
# utils
from utility.graphic.embed import Custom_embed
# move displayer
class Move_displayer:
"""
Manages the way the moves ar... | 22.101852 | 99 | 0.498115 |
7ee0331b94912a574fffced093c7b7a896454b42 | 1,059 | py | Python | algorithms/1091.Shortest-Path-in-Binary-Matrix/Python/solution_1.py | hopeness/leetcode | 496455fa967f0704d729b4014f92f52b1d69d690 | [
"MIT"
] | null | null | null | algorithms/1091.Shortest-Path-in-Binary-Matrix/Python/solution_1.py | hopeness/leetcode | 496455fa967f0704d729b4014f92f52b1d69d690 | [
"MIT"
] | null | null | null | algorithms/1091.Shortest-Path-in-Binary-Matrix/Python/solution_1.py | hopeness/leetcode | 496455fa967f0704d729b4014f92f52b1d69d690 | [
"MIT"
] | null | null | null | """
https://leetcode.com/problems/shortest-path-in-binary-matrix/
"""
from typing import List
from queue import Queue
class Solution:
def shortestPathBinaryMatrix(self, grid: List[List[int]]) -> int:
ans = 0
n = len(grid)
dx = [0, 1, 1, 1, 0, -1, -1, -1]
dy = [1, 1, 0, -1, -1, -1,... | 31.147059 | 69 | 0.432483 |
55e13bd21840fe092f2e94c36213c3b67427111d | 3,238 | py | Python | mibbinator/settings.py | fenner/mibbinator | d26db592c9103562baf5eb32dbba157a958c111e | [
"BSD-2-Clause"
] | null | null | null | mibbinator/settings.py | fenner/mibbinator | d26db592c9103562baf5eb32dbba157a958c111e | [
"BSD-2-Clause"
] | 1 | 2016-10-06T16:31:37.000Z | 2016-10-06T16:31:37.000Z | mibbinator/settings.py | fenner/mibbinator | d26db592c9103562baf5eb32dbba157a958c111e | [
"BSD-2-Clause"
] | null | null | null | # Django settings for mibbinator project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
APPEND_SLASH = False
ADMINS = (
('Bill Fenner', 'fenner@research.att.com'),
)
MANAGERS = ADMINS
SERVER_EMAIL = 'The MIBbinator <fenner+mibbinator@gmail.com>'
DEFAULT_FROM_EMAIL = SERVER_EMAIL
DATABASE_ENGINE = 'mysql' # ... | 32.707071 | 109 | 0.727301 |
2745669ccbf4bc2b51cee8f50a85aa89575d7b5e | 361 | py | Python | pythoscope/debug.py | hung135/pythoscope | b4b89b77b5184b25992893e320d58de32ed987f1 | [
"MIT"
] | 78 | 2015-01-03T22:35:30.000Z | 2022-01-09T15:32:57.000Z | pythoscope/debug.py | hung135/pythoscope | b4b89b77b5184b25992893e320d58de32ed987f1 | [
"MIT"
] | 15 | 2015-05-26T14:29:20.000Z | 2020-12-08T11:26:44.000Z | pythoscope/debug.py | hung135/pythoscope | b4b89b77b5184b25992893e320d58de32ed987f1 | [
"MIT"
] | 30 | 2015-06-05T13:02:11.000Z | 2021-05-31T08:03:28.000Z | from util import class_of
def print_assigned_names(assigned_names):
print "ASSIGNED NAMES:"
for obj, name in assigned_names.iteritems():
print " %s: %s(id=%s)" % (name, class_of(obj).__name__, id(obj))
def print_timeline(timeline):
print "TIMELINE:"
for event in timeline:
print " ... | 25.785714 | 75 | 0.648199 |
b482f472127b5ad0a2dafc76242376158049c650 | 4,855 | py | Python | benchmark/startQiskit_Class1784.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class1784.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class1784.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=70
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 33.027211 | 80 | 0.60309 |
f4f71d58c9e1345cd0669b97d480088205037ef3 | 14,695 | py | Python | google/cloud/aiplatform_v1/services/featurestore_service/transports/base.py | conankun/python-aiplatform | d6c1bce7e00186aa5ee3cd0e7b8712b21bd06f2a | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | google/cloud/aiplatform_v1/services/featurestore_service/transports/base.py | conankun/python-aiplatform | d6c1bce7e00186aa5ee3cd0e7b8712b21bd06f2a | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | google/cloud/aiplatform_v1/services/featurestore_service/transports/base.py | conankun/python-aiplatform | d6c1bce7e00186aa5ee3cd0e7b8712b21bd06f2a | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.929095 | 101 | 0.657911 |
41bb377d9d621ac8773f88c883895187cf18a4d2 | 3,868 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/emails/helpers.py | marcosgabarda/cookiecutter-backend | 1d509b95e60dcf36510e582c4251c2780b6a5c96 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/emails/helpers.py | marcosgabarda/cookiecutter-backend | 1d509b95e60dcf36510e582c4251c2780b6a5c96 | [
"BSD-3-Clause"
] | 1 | 2021-06-01T22:46:28.000Z | 2021-06-01T22:46:28.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/emails/helpers.py | marcosgabarda/cookiecutter-django-backend | 1d509b95e60dcf36510e582c4251c2780b6a5c96 | [
"BSD-3-Clause"
] | null | null | null | import warnings
import bleach
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
{%- if cookiecutter.use_celery == "y" %}
from {{ cookiecutter.project_slug }}.emails.tasks import send_ema... | 37.921569 | 108 | 0.644261 |
bc14fa292bef8105594b4d793a576827be81c3df | 1,282 | py | Python | examples/randomized-benchmark/one-qubit-rb/RB_1qb_interleaved.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 21 | 2021-05-21T08:23:34.000Z | 2022-03-25T11:30:55.000Z | examples/randomized-benchmark/one-qubit-rb/RB_1qb_interleaved.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 9 | 2021-05-13T19:56:00.000Z | 2021-12-21T05:11:04.000Z | examples/randomized-benchmark/one-qubit-rb/RB_1qb_interleaved.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 2 | 2021-06-21T10:56:40.000Z | 2021-12-19T14:21:33.000Z | from qm.QuantumMachinesManager import QuantumMachinesManager
from qm.qua import *
from qm import SimulationConfig
from configuration import config
from rb_lib import *
# Open communication with the server.
QMm = QuantumMachinesManager()
QM1 = QMm.open_qm(config)
N_avg = 10
circuit_depth_vec = list(range(... | 29.136364 | 84 | 0.658346 |
4390e0022837a53a11682bd824da7448049ad25f | 1,720 | py | Python | grr/server/grr_response_server/gui/api_integration_tests/api_client_test.py | BA7JCM/grr | c6f3b19e73e1d76a195d3c9a63e894ace6ea2508 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/gui/api_integration_tests/api_client_test.py | BA7JCM/grr | c6f3b19e73e1d76a195d3c9a63e894ace6ea2508 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/gui/api_integration_tests/api_client_test.py | BA7JCM/grr | c6f3b19e73e1d76a195d3c9a63e894ace6ea2508 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from unittest import mock
from absl import app
from grr_response_server import fleetspeak_connector
from grr_response_server import fleetspeak_utils
from grr_response_server.gui import api_integration_test_lib
from grr.test_lib import test_lib
class ApiClientTest(api_integration_test_lib.ApiI... | 35.833333 | 75 | 0.791279 |
af67d49317c932c6e9786a1f6fe0eb9c330959bd | 4,696 | py | Python | distrax/__init__.py | kashif/distrax | 55f2afbcf144be6602a742b41ee6a62efa622f6d | [
"Apache-2.0"
] | null | null | null | distrax/__init__.py | kashif/distrax | 55f2afbcf144be6602a742b41ee6a62efa622f6d | [
"Apache-2.0"
] | null | null | null | distrax/__init__.py | kashif/distrax | 55f2afbcf144be6602a742b41ee6a62efa622f6d | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 38.178862 | 91 | 0.765758 |
f5f5f8a27e2cc2417ee35a4345fec055b85fdc75 | 4,468 | py | Python | main/models.py | fcpauldiaz/Keydex | 35abfc84256d95a5d24259d4fbe7929a0cabba72 | [
"MIT"
] | null | null | null | main/models.py | fcpauldiaz/Keydex | 35abfc84256d95a5d24259d4fbe7929a0cabba72 | [
"MIT"
] | 2 | 2020-06-05T19:40:09.000Z | 2021-12-13T19:53:04.000Z | main/models.py | fcpauldiaz/Keydex | 35abfc84256d95a5d24259d4fbe7929a0cabba72 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from datetime import datetime
from django.db import models
from django.contrib.postgres.fields import ArrayField
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.core.exceptions import Vali... | 36.325203 | 100 | 0.776858 |
7ded85969303a36f5d83e6361713b48f9a08693c | 117 | py | Python | server/database/files.py | KohlbacherLab/deregnet-rest | d512e04b66556fbb52a49e9da465af01ebfdd78a | [
"BSD-3-Clause"
] | null | null | null | server/database/files.py | KohlbacherLab/deregnet-rest | d512e04b66556fbb52a49e9da465af01ebfdd78a | [
"BSD-3-Clause"
] | null | null | null | server/database/files.py | KohlbacherLab/deregnet-rest | d512e04b66556fbb52a49e9da465af01ebfdd78a | [
"BSD-3-Clause"
] | 1 | 2018-01-30T18:38:56.000Z | 2018-01-30T18:38:56.000Z | import gridfs
from deregnet_rest.database.connection import database
files = gridfs.GridFS(database.deregnet_rest)
| 19.5 | 54 | 0.846154 |
501984d3c83f6e39b3bd78e88d9bd309947e4bfd | 2,832 | py | Python | tensorflow_bring_your_own_california_housing_local_training_and_batch_transform/container/california_housing/predictor.py | aws-samples/amazon-sagemaker-local-mode | f470d7b543f7895094816c3f58b9981e044764d8 | [
"MIT-0"
] | 111 | 2020-11-10T18:09:34.000Z | 2022-03-28T12:55:37.000Z | tensorflow_bring_your_own_california_housing_local_training_and_batch_transform/container/california_housing/predictor.py | aws-samples/amazon-sagemaker-local-mode | f470d7b543f7895094816c3f58b9981e044764d8 | [
"MIT-0"
] | 9 | 2020-11-18T10:43:29.000Z | 2022-03-08T08:42:52.000Z | tensorflow_bring_your_own_california_housing_local_training_and_batch_transform/container/california_housing/predictor.py | aws-samples/amazon-sagemaker-local-mode | f470d7b543f7895094816c3f58b9981e044764d8 | [
"MIT-0"
] | 20 | 2020-11-10T09:13:15.000Z | 2022-03-02T14:20:42.000Z | # This is the file that implements a flask server to do inferences. It's the file that you will modify to
# implement the scoring for your own algorithm.
from __future__ import print_function
import io
import os
import flask
import pandas as pd
import tensorflow as tf
prefix = '/opt/ml/'
model_path = os.path.join(p... | 34.120482 | 114 | 0.689619 |
0c101e49fc122864cfa7992fdc5fbc6af44ec31a | 344 | py | Python | keyring/__init__.py | yarikoptic/keyring | 1e25fde80b5e45cc25fe3efdf4edded27706578b | [
"MIT"
] | 1 | 2019-04-02T20:16:22.000Z | 2019-04-02T20:16:22.000Z | keyring/__init__.py | yarikoptic/keyring | 1e25fde80b5e45cc25fe3efdf4edded27706578b | [
"MIT"
] | null | null | null | keyring/__init__.py | yarikoptic/keyring | 1e25fde80b5e45cc25fe3efdf4edded27706578b | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .core import (set_keyring, get_keyring, set_password, get_password,
delete_password)
from .getpassbackend import get_password as get_pass_get_password
__all__ = (
'set_keyring', 'get_keyring', 'set_password', 'get_password',
'delete_password', 'ge... | 31.272727 | 72 | 0.75 |
68e23d9c763f87598e7fdd9451284eec35ac77ce | 1,257 | py | Python | examples/get_object.py | rgeens/minio-py | aab96e33f117dfd35a84fb4a3748966dd2b53096 | [
"Apache-2.0"
] | null | null | null | examples/get_object.py | rgeens/minio-py | aab96e33f117dfd35a84fb4a3748966dd2b53096 | [
"Apache-2.0"
] | null | null | null | examples/get_object.py | rgeens/minio-py | aab96e33f117dfd35a84fb4a3748966dd2b53096 | [
"Apache-2.0"
] | 1 | 2018-07-12T19:31:42.000Z | 2018-07-12T19:31:42.000Z | # -*- coding: utf-8 -*-
# Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Minio, 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/licen... | 36.970588 | 83 | 0.721559 |
f8ebc875d5383f7e5a330fd42ce438cf22932dd7 | 19,739 | py | Python | StarGAN.py | sagars729/StarGAN-Tensorflow | bb6c01563ca9decdf93f79f83c83cf062bb303ab | [
"MIT"
] | null | null | null | StarGAN.py | sagars729/StarGAN-Tensorflow | bb6c01563ca9decdf93f79f83c83cf062bb303ab | [
"MIT"
] | null | null | null | StarGAN.py | sagars729/StarGAN-Tensorflow | bb6c01563ca9decdf93f79f83c83cf062bb303ab | [
"MIT"
] | null | null | null | from ops import *
from utils import *
import time
from tensorflow.contrib.data import prefetch_to_device, shuffle_and_repeat, map_and_batch
import numpy as np
from glob import glob
class StarGAN(object) :
def __init__(self, sess, args):
self.model_name = 'StarGAN'
self.sess = sess
self.chec... | 43.573951 | 198 | 0.592887 |
1840f4362e20df69dc34a04c5e02ccf9ab80c165 | 3,089 | py | Python | vendor.py | ktdreyer/remoto | e3cd0aff4bd5532b2df9cde43039c531f427fe3a | [
"MIT"
] | null | null | null | vendor.py | ktdreyer/remoto | e3cd0aff4bd5532b2df9cde43039c531f427fe3a | [
"MIT"
] | null | null | null | vendor.py | ktdreyer/remoto | e3cd0aff4bd5532b2df9cde43039c531f427fe3a | [
"MIT"
] | null | null | null | import subprocess
import os
from os import path
import re
import traceback
import sys
error_msg = """
This library depends on sources fetched when packaging that failed to be
retrieved.
This means that it will *not* work as expected. Errors encountered:
"""
def run(cmd):
sys.stdout.write('[vendoring] Running c... | 29.141509 | 91 | 0.63451 |
e73a9d4c0e51c6b98593905395379cb485dba20c | 2,824 | py | Python | setup.py | delftswa2014/pip | 19ef5973cd03c8da982789c4ce962ceeaf8b8ed3 | [
"MIT"
] | 1 | 2015-03-03T21:44:50.000Z | 2015-03-03T21:44:50.000Z | setup.py | delftswa2014/pip | 19ef5973cd03c8da982789c4ce962ceeaf8b8ed3 | [
"MIT"
] | null | null | null | setup.py | delftswa2014/pip | 19ef5973cd03c8da982789c4ce962ceeaf8b8ed3 | [
"MIT"
] | null | null | null | import codecs
import os
import re
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
here = os.path.abspath(os.path.dirname(__file__))
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test... | 31.730337 | 76 | 0.615085 |
5b676fd8ad37db78a90f70ca4bec133bf1fb3dee | 7,197 | py | Python | zoe_master/backends/docker/backend.py | AtosCodex/atos-zoe | 36919a787b7675a571674c2b3c61d3b8f98522cc | [
"Apache-2.0"
] | null | null | null | zoe_master/backends/docker/backend.py | AtosCodex/atos-zoe | 36919a787b7675a571674c2b3c61d3b8f98522cc | [
"Apache-2.0"
] | null | null | null | zoe_master/backends/docker/backend.py | AtosCodex/atos-zoe | 36919a787b7675a571674c2b3c61d3b8f98522cc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017, Daniele Venzano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 43.618182 | 154 | 0.664999 |
1b53d3a15378c48d7a3da15b037d899fa1b55243 | 2,405 | py | Python | scripts/sequence_clusters/eggnog/rename_files_from_taxaid_to_species_name.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 10 | 2015-04-28T14:15:04.000Z | 2021-03-15T00:07:38.000Z | scripts/sequence_clusters/eggnog/rename_files_from_taxaid_to_species_name.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | null | null | null | scripts/sequence_clusters/eggnog/rename_files_from_taxaid_to_species_name.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 6 | 2017-03-16T22:38:41.000Z | 2021-08-11T00:22:52.000Z | #!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import os
import shutil
import argparse
from RouToolPa.GeneralRoutines import FileRoutines
from RouToolPa.Collections.General import SynDict
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input_files_dir", action="store", dest="input_files_dir",... | 51.170213 | 103 | 0.679834 |
dfe084027616a4fe5398f54fd81f0cfd5a3c2532 | 2,007 | py | Python | DFP/multi_doom_simulator.py | Ourshanabi/DirectFuturePrediction_CARLA | 50c69ce64c579aafcb2e3f307ebfbc51fd193425 | [
"MIT"
] | null | null | null | DFP/multi_doom_simulator.py | Ourshanabi/DirectFuturePrediction_CARLA | 50c69ce64c579aafcb2e3f307ebfbc51fd193425 | [
"MIT"
] | null | null | null | DFP/multi_doom_simulator.py | Ourshanabi/DirectFuturePrediction_CARLA | 50c69ce64c579aafcb2e3f307ebfbc51fd193425 | [
"MIT"
] | null | null | null | '''
Several doom simulators running otgether
'''
from __future__ import print_function
from .doom_simulator import DoomSimulator
from .Gym_simulator import Gym_simulator
from .carla_simulator import CarlaSimulator
class MultiDoomSimulator:
def __init__(self, all_args):
self.num_simulators = len(all_args)
sel... | 29.086957 | 92 | 0.720977 |
da687303a55f8f09d18b134d56a02d89d468bd34 | 4,273 | py | Python | A2C.py | wyzh98/BipedalWalker_NUS | 7958c1d6c78566211651931369f35668bfbb944e | [
"MIT"
] | 1 | 2021-11-11T07:47:44.000Z | 2021-11-11T07:47:44.000Z | A2C.py | wyzh98/BipedalWalker_NUS | 7958c1d6c78566211651931369f35668bfbb944e | [
"MIT"
] | null | null | null | A2C.py | wyzh98/BipedalWalker_NUS | 7958c1d6c78566211651931369f35668bfbb944e | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import gym
import os
from datetime import datetime
from models import A2C
from utils import discount, RunningStats, make_gif
GAMMA = 0.99
LAMBDA = 0.95
STEPBATCH = 8192
EPISODE_MAX = 100000
IS_HARDCORE = False
IS_RESTORED = False
IS_OUTPUTGIF = True
if IS_RESTORED:
MODEL_... | 35.608333 | 100 | 0.545752 |
e6867e81f4f1230275585c37e7fbaffeeca17ec9 | 14,361 | py | Python | src/the_tale/the_tale/game/workers/supervisor.py | devapromix/the-tale | 2a10efd3270734f8cf482b4cfbc5353ef8f0494c | [
"BSD-3-Clause"
] | 1 | 2020-04-02T11:51:20.000Z | 2020-04-02T11:51:20.000Z | src/the_tale/the_tale/game/workers/supervisor.py | devapromix/the-tale | 2a10efd3270734f8cf482b4cfbc5353ef8f0494c | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/game/workers/supervisor.py | devapromix/the-tale | 2a10efd3270734f8cf482b4cfbc5353ef8f0494c | [
"BSD-3-Clause"
] | null | null | null |
import smart_imports
smart_imports.all()
class SupervisorException(Exception):
pass
class Worker(utils_workers.BaseWorker):
GET_CMD_TIMEOUT = 10
RECEIVE_ANSWERS = True
def clean_queues(self):
super(Worker, self).clean_queues()
self.answers_queue.queue.purge()
self.stop_que... | 41.386167 | 163 | 0.643479 |
ce949bad1b5f006ed59d8f2c8ec085927a655c70 | 1,279 | py | Python | lib/openscad.py | saxmfone1/stlslackbot | cbc3f8750f742bf046b07af4bbf63b9386229f52 | [
"MIT"
] | 1 | 2021-02-05T18:50:12.000Z | 2021-02-05T18:50:12.000Z | lib/openscad.py | saxmfone1/stlslackbot | cbc3f8750f742bf046b07af4bbf63b9386229f52 | [
"MIT"
] | null | null | null | lib/openscad.py | saxmfone1/stlslackbot | cbc3f8750f742bf046b07af4bbf63b9386229f52 | [
"MIT"
] | null | null | null | import os
import os.path
import sarge
import logging
log = logging.getLogger("bot.openscad")
OPENSCAD = "/usr/bin/openscad"
log.debug(f"using openscad binary: {OPENSCAD}")
def get_base_filename(filename: str):
return "".join(os.path.basename(filename).split(".")[:1])
def generate_scad(tempdir: str, filename:... | 31.975 | 91 | 0.694292 |
286607ba53de8b622e609b9d44f7d25cc0674292 | 819 | py | Python | ror/AbstractTieResolver.py | jakub-tomczak/ror | cf9ab38a2d66f4816a1289b9726911960059fce7 | [
"MIT"
] | null | null | null | ror/AbstractTieResolver.py | jakub-tomczak/ror | cf9ab38a2d66f4816a1289b9726911960059fce7 | [
"MIT"
] | null | null | null | ror/AbstractTieResolver.py | jakub-tomczak/ror | cf9ab38a2d66f4816a1289b9726911960059fce7 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import List
from ror.RORParameters import RORParameters
from ror.result_aggregator_utils import SimpleRank
class AbstractTieResolver:
def __init__(self, name: str) -> None:
self._ror_result: 'RORResult' = None
self._ror_parameters: RORParameters = None
... | 32.76 | 107 | 0.695971 |
7947f2d84e8441a05199b8816964ce493113c9ac | 6,918 | py | Python | bindings/python/ensmallen_graph/datasets/string/lachnospiraceaebacteriumfe2018.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/lachnospiraceaebacteriumfe2018.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/lachnospiraceaebacteriumfe2018.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Lachnospiraceae bacterium FE2018.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Date... | 36.219895 | 223 | 0.712778 |
1a694e675eb26ec0a951c8fa079a3ee771dda707 | 4,199 | py | Python | vmtkScripts/vmtkbranchpatching.py | ramtingh/vmtk | 4d6f58ce65d73628353ba2b110cbc29a2e7aa7b3 | [
"Apache-2.0"
] | null | null | null | vmtkScripts/vmtkbranchpatching.py | ramtingh/vmtk | 4d6f58ce65d73628353ba2b110cbc29a2e7aa7b3 | [
"Apache-2.0"
] | null | null | null | vmtkScripts/vmtkbranchpatching.py | ramtingh/vmtk | 4d6f58ce65d73628353ba2b110cbc29a2e7aa7b3 | [
"Apache-2.0"
] | 1 | 2019-06-18T23:41:11.000Z | 2019-06-18T23:41:11.000Z | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkbranchpatching.py,v $
## Language: Python
## Date: $Date: 2006/07/07 10:46:17 $
## Version: $Revision: 1.9 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is di... | 40.375 | 159 | 0.685639 |
0df84aacdc21d1d5ef695d5408e27ba264d3365a | 209 | py | Python | setup.py | LeeJAJA/CBAM | 3d5968c4f43ac78fcf44c394c9ea555f493cc886 | [
"MIT"
] | 44 | 2019-10-24T08:50:34.000Z | 2022-03-16T09:58:21.000Z | setup.py | LeeJAJA/CBAM | 3d5968c4f43ac78fcf44c394c9ea555f493cc886 | [
"MIT"
] | 1 | 2020-06-21T14:04:33.000Z | 2020-06-21T14:04:33.000Z | setup.py | LeeJAJA/CBAM | 3d5968c4f43ac78fcf44c394c9ea555f493cc886 | [
"MIT"
] | 14 | 2020-02-03T14:52:57.000Z | 2022-02-18T05:59:50.000Z | from setuptools import find_packages, setup
setup(
name='cbam',
packages=find_packages(),
version='0.1.0',
description='Reproducing cbam results.',
author='lboucaud',
license='MIT',
)
| 19 | 44 | 0.665072 |
6bf949e81cef55954b729bccf5cc42217aec61ee | 11,124 | py | Python | core/migrations/0001_initial.py | alex-cots/prevention-point | e64813227846c0e23ed41128602bc16eac40c3b7 | [
"MIT"
] | 1 | 2020-07-18T02:14:51.000Z | 2020-07-18T02:14:51.000Z | core/migrations/0001_initial.py | alex-cots/prevention-point | e64813227846c0e23ed41128602bc16eac40c3b7 | [
"MIT"
] | null | null | null | core/migrations/0001_initial.py | alex-cots/prevention-point | e64813227846c0e23ed41128602bc16eac40c3b7 | [
"MIT"
] | 1 | 2020-02-22T18:21:04.000Z | 2020-02-22T18:21:04.000Z | # Generated by Django 2.2.13 on 2020-08-16 23:37
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Form',
... | 56.181818 | 278 | 0.578209 |
97e0519405e6076c48dcc652227a1b7ee573d512 | 66 | py | Python | plugins/influxdb/icon_influxdb/actions/write/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/influxdb/icon_influxdb/actions/write/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/influxdb/icon_influxdb/actions/write/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import Write
| 22 | 39 | 0.757576 |
ad707b036047ace1b9e9b8a4cfecaffe9d10be48 | 12,416 | py | Python | pytorch_lightning/utilities/argparse.py | Code-Cornelius/pytorch-lightning | ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057 | [
"Apache-2.0"
] | 15,666 | 2020-01-14T07:16:15.000Z | 2022-03-31T23:22:26.000Z | pytorch_lightning/utilities/argparse.py | Code-Cornelius/pytorch-lightning | ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057 | [
"Apache-2.0"
] | 9,140 | 2020-01-14T03:10:42.000Z | 2022-03-31T19:57:09.000Z | pytorch_lightning/utilities/argparse.py | Code-Cornelius/pytorch-lightning | ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057 | [
"Apache-2.0"
] | 2,340 | 2020-01-14T06:45:32.000Z | 2022-03-31T22:57:07.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 37.062687 | 120 | 0.650773 |
7cb5976619a795b84cca9f08f7c779d6e3f4975b | 1,508 | py | Python | test/unit/test_sap_odata_errors.py | gtreskas/sapcli | ff82ddb998834e1c83dff799134f026df93b3175 | [
"Apache-2.0"
] | 42 | 2019-01-16T13:16:09.000Z | 2022-03-23T20:13:00.000Z | test/unit/test_sap_odata_errors.py | gtreskas/sapcli | ff82ddb998834e1c83dff799134f026df93b3175 | [
"Apache-2.0"
] | 59 | 2019-02-23T07:16:56.000Z | 2022-02-28T09:34:47.000Z | test/unit/test_sap_odata_errors.py | gtreskas/sapcli | ff82ddb998834e1c83dff799134f026df93b3175 | [
"Apache-2.0"
] | 22 | 2019-03-12T08:15:44.000Z | 2022-01-10T03:56:47.000Z | '''Odata error classes tests'''
#!/usr/bin/env python3
# pylint: disable=missing-function-docstring
import unittest
from unittest.mock import Mock
from sap.odata.errors import (
HTTPRequestError,
UnauthorizedError,
TimedOutRequestError
)
class TestOdataHTTPRequestError(unittest.TestCase):
'''Test Od... | 27.925926 | 95 | 0.678382 |
8f1af1a8772ff91c03a77c43aaa68c48de7b794b | 1,201 | py | Python | simplot/Simplot.py | Ryota0312/simplot | 5c3c7fe9b82817a5ea63b2c39c44f81abaf4a46b | [
"MIT"
] | null | null | null | simplot/Simplot.py | Ryota0312/simplot | 5c3c7fe9b82817a5ea63b2c39c44f81abaf4a46b | [
"MIT"
] | null | null | null | simplot/Simplot.py | Ryota0312/simplot | 5c3c7fe9b82817a5ea63b2c39c44f81abaf4a46b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.font_manager
fontprop = matplotlib.font_manager.FontProperties(fname="/usr/share/fonts/truetype/fonts-japanese-gothic.ttf")
plt.rcParams['font.family'] = 'IPAPGothic'
class Graph:
def __init__(self, title, style):
... | 29.292683 | 110 | 0.555371 |
ab97306bc5b88efedd19421e3ada46830ff25aca | 410 | py | Python | clubs/migrations/0006_club_slug_unique.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | 7 | 2019-08-03T12:25:18.000Z | 2021-11-02T12:51:33.000Z | clubs/migrations/0006_club_slug_unique.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | 11 | 2019-08-20T17:07:37.000Z | 2021-11-23T14:26:07.000Z | clubs/migrations/0006_club_slug_unique.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | 4 | 2020-04-06T11:33:02.000Z | 2021-10-31T09:10:53.000Z | # Generated by Django 2.1.13 on 2019-11-02 11:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clubs', '0005_club_document'),
]
operations = [
migrations.AlterField(
model_name='club',
name='slug',
... | 21.578947 | 84 | 0.602439 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.