hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7216293508f30856c09ec8f6cc0f0a4c59f840b | 400 | py | Python | test/distributed/test_ddp_under_dist_autograd.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | null | null | null | test/distributed/test_ddp_under_dist_autograd.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | null | null | null | test/distributed/test_ddp_under_dist_autograd.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | null | null | null | #!/usr/bin/env python3
from torch.testing._internal.distributed import ddp_under_dist_autograd_test
from torch.testing._internal.common_utils import (
run_tests,
)
class TestDdpUnderDistAutogradWrapper(ddp_under_dist_autograd_test.TestDdpUnderDistAutograd):
pass
class TestDdpComparison(ddp_under_dist_autogra... | 25 | 93 | 0.82 |
from torch.testing._internal.distributed import ddp_under_dist_autograd_test
from torch.testing._internal.common_utils import (
run_tests,
)
class TestDdpUnderDistAutogradWrapper(ddp_under_dist_autograd_test.TestDdpUnderDistAutograd):
pass
class TestDdpComparison(ddp_under_dist_autograd_test.TestDdpComparis... | true | true |
f7216360a3f39f268083811c68d247e2aa9fdaad | 5,037 | py | Python | models/pointnet_seg.py | 3D-semantic-Sgmentation/pointnet | 029c0217143e6b69e685ab57cf243e322d47860f | [
"MIT"
] | null | null | null | models/pointnet_seg.py | 3D-semantic-Sgmentation/pointnet | 029c0217143e6b69e685ab57cf243e322d47860f | [
"MIT"
] | null | null | null | models/pointnet_seg.py | 3D-semantic-Sgmentation/pointnet | 029c0217143e6b69e685ab57cf243e322d47860f | [
"MIT"
] | null | null | null | # import tensorflow as tf
import numpy as np
import math
import sys
import os
import tensorflow.compat.v1 as tf
import tensorflow as tf2
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from transform_nets import input_tr... | 40.95122 | 84 | 0.592416 |
import numpy as np
import math
import sys
import os
import tensorflow.compat.v1 as tf
import tensorflow as tf2
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from transform_nets import input_transform_net, feature_tran... | true | true |
f721636de9ed88c4501fc4920a1f38058472b148 | 8,344 | py | Python | tests/adapters/test_dataframe_input.py | vedashree29296/BentoML | 79f94d543a0684e04551207d102a2d254b770ad3 | [
"Apache-2.0"
] | null | null | null | tests/adapters/test_dataframe_input.py | vedashree29296/BentoML | 79f94d543a0684e04551207d102a2d254b770ad3 | [
"Apache-2.0"
] | null | null | null | tests/adapters/test_dataframe_input.py | vedashree29296/BentoML | 79f94d543a0684e04551207d102a2d254b770ad3 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=redefined-outer-name
import itertools
import json
import math
import time
import flask
import numpy as np
import pandas as pd
import psutil # noqa # pylint: disable=unused-import
import pytest
from bentoml.adapters import DataframeInput
from bentoml.adapters.dataframe_input import read_dataframes_... | 32.341085 | 87 | 0.647651 |
import itertools
import json
import math
import time
import flask
import numpy as np
import pandas as pd
import psutil apters import DataframeInput
from bentoml.adapters.dataframe_input import read_dataframes_from_json_n_csv
from bentoml.utils.csv import csv_splitlines
from bentoml.utils.dataframe_util import guess... | true | true |
f721649ced49c4e8a9613dfffcb798078e8b305e | 383 | py | Python | vespa-cloud/cord-19-search/scripts/convert-to-feed.py | kuipertan/sample-apps | d52b942ea228336435d29a7ed007e72113aec827 | [
"Apache-2.0"
] | null | null | null | vespa-cloud/cord-19-search/scripts/convert-to-feed.py | kuipertan/sample-apps | d52b942ea228336435d29a7ed007e72113aec827 | [
"Apache-2.0"
] | null | null | null | vespa-cloud/cord-19-search/scripts/convert-to-feed.py | kuipertan/sample-apps | d52b942ea228336435d29a7ed007e72113aec827 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
import sys
import json
json_file = sys.argv[1]
with open(json_file, 'r') as f:
data = json.load(f)
for doc in data:
vespa_doc = {
'put': 'id:covid-19:doc::%s' % doc['id'... | 23.9375 | 111 | 0.64752 |
import sys
import json
json_file = sys.argv[1]
with open(json_file, 'r') as f:
data = json.load(f)
for doc in data:
vespa_doc = {
'put': 'id:covid-19:doc::%s' % doc['id'],
'fields': doc
}
print(json.dumps(vespa_doc))
| true | true |
f72164ba62f9af6d6912ac1fc695a0949c138d93 | 1,051 | py | Python | webservice/search/zeroconf_factory.py | PedalController/PedalPiREST | aa9418d44f2f5dbec604753a03bf8a74057c627c | [
"Apache-2.0"
] | null | null | null | webservice/search/zeroconf_factory.py | PedalController/PedalPiREST | aa9418d44f2f5dbec604753a03bf8a74057c627c | [
"Apache-2.0"
] | 42 | 2016-07-04T11:17:54.000Z | 2018-03-18T18:36:09.000Z | webservice/search/zeroconf_factory.py | PedalController/PedalPiREST | aa9418d44f2f5dbec604753a03bf8a74057c627c | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 SrMouraSilva
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 33.903226 | 74 | 0.744053 |
from unittest.mock import MagicMock
from webservice.search.pybonjour_service import PybonjourService
from webservice.search.zeroconf_service import ZeroconfService
class ZeroconfFactory(object):
@staticmethod
def generate(name, port):
if PybonjourService.has_support():
retu... | true | true |
f72164bc7374018f80baa8ffb8176085266dae60 | 397 | py | Python | CodingTest_Study1/week11/ex9095.py | FridayAlgorithm/taesong_study | 50c07ee6ead0fb5bb80e0decb03b801cbbbabf9c | [
"MIT"
] | null | null | null | CodingTest_Study1/week11/ex9095.py | FridayAlgorithm/taesong_study | 50c07ee6ead0fb5bb80e0decb03b801cbbbabf9c | [
"MIT"
] | null | null | null | CodingTest_Study1/week11/ex9095.py | FridayAlgorithm/taesong_study | 50c07ee6ead0fb5bb80e0decb03b801cbbbabf9c | [
"MIT"
] | 2 | 2020-12-27T15:03:46.000Z | 2021-03-06T14:13:34.000Z | # BOJ 1,2,3 더하기 9095
T = int(input()) # 테스트 케이스의 개수 T가 주어짐
sum_list = []
for i in range(T):
n = int(input())
sum_list.append(n)
def oneTwoThreeSum(n):
if n == 1:
return 1
if n == 2:
return 2
if n == 3:
return 4
else:
return oneTwoThreeSum(n-3) + oneTwoThreeSum(... | 18.045455 | 78 | 0.561713 |
T = int(input())
sum_list = []
for i in range(T):
n = int(input())
sum_list.append(n)
def oneTwoThreeSum(n):
if n == 1:
return 1
if n == 2:
return 2
if n == 3:
return 4
else:
return oneTwoThreeSum(n-3) + oneTwoThreeSum(n-2) + oneTwoThreeSum(n-1)
for k in su... | true | true |
f7216512710c309d4a2ab0b0e09080660ee5e81b | 1,794 | py | Python | src/features/utils.py | iamhuy/rumour-veracity-verification | e7e7f0c100545c2758584719e9f20f20cb6d0a85 | [
"MIT"
] | null | null | null | src/features/utils.py | iamhuy/rumour-veracity-verification | e7e7f0c100545c2758584719e9f20f20cb6d0a85 | [
"MIT"
] | 7 | 2020-03-24T15:24:51.000Z | 2021-06-01T21:43:16.000Z | src/features/utils.py | iamhuy/rumour-veracity-verification | e7e7f0c100545c2758584719e9f20f20cb6d0a85 | [
"MIT"
] | null | null | null | from dateutil import parser
import preprocessor as p
def timestamp_to_date(timestamp):
"""
Conver a twitter timestamp to a datetime object
:param timestamp: a string represent the timestamp
:return: a datetime object
"""
return parser.parse(timestamp)
def day_diff(timestamp1, timestamp2)... | 29.9 | 107 | 0.696767 | from dateutil import parser
import preprocessor as p
def timestamp_to_date(timestamp):
return parser.parse(timestamp)
def day_diff(timestamp1, timestamp2):
return (timestamp_to_date(timestamp1) - timestamp_to_date(timestamp2)).days
def read_brown_cluster_file(brown_cluster_text_file):
brown_cluster_... | true | true |
f72165731dd934a6ef471e84e61e6bbeae4d50c9 | 2,651 | py | Python | vtpl_api/models/destination_type.py | vtpl1/videonetics_api | bef179df12f449db0c50c3910daca50b7d40ac49 | [
"RSA-MD"
] | null | null | null | vtpl_api/models/destination_type.py | vtpl1/videonetics_api | bef179df12f449db0c50c3910daca50b7d40ac49 | [
"RSA-MD"
] | 1 | 2021-02-26T07:31:37.000Z | 2021-02-26T07:31:37.000Z | vtpl_api/models/destination_type.py | vtpl1/videonetics_api | bef179df12f449db0c50c3910daca50b7d40ac49 | [
"RSA-MD"
] | 2 | 2020-11-04T02:52:55.000Z | 2020-11-05T08:09:50.000Z | # coding: utf-8
"""
Engine api
Engine APIs # noqa: E501
OpenAPI spec version: 1.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DestinationType(object):
"""NOTE: This class is auto generated by the swagger co... | 25.990196 | 80 | 0.536024 |
import pprint
import re
import six
class DestinationType(object):
NONE = "none"
RTSP = "rtsp"
HTTP = "http"
FILE = "file"
FTP = "ftp"
VMS = "vms"
MQTT = "mqtt"
AMQP = "amqp"
S3 = "S3"
VS3 = "VS3"
BASEURL = "BaseUrl"
RELATIVEURL = "RelativeUrl"
ZEROMQ = "ZeroMQ... | true | true |
f721659832fd95400b106db9d00e562f8df54211 | 183 | py | Python | shopee_crawler/toolkit/__init__.py | ptrkhh/shopee-crawler | 6d85748daa802ad9bb2f42ba56695b31d692f4b4 | [
"MIT"
] | 5 | 2021-09-09T18:32:49.000Z | 2022-01-10T10:31:17.000Z | shopee_crawler/toolkit/__init__.py | ptrkhh/shopee-crawler | 6d85748daa802ad9bb2f42ba56695b31d692f4b4 | [
"MIT"
] | 2 | 2021-09-10T14:28:52.000Z | 2021-09-12T14:57:41.000Z | shopee_crawler/toolkit/__init__.py | ptrkhh/shopee-crawler | 6d85748daa802ad9bb2f42ba56695b31d692f4b4 | [
"MIT"
] | 6 | 2021-09-25T14:03:57.000Z | 2022-03-19T14:44:04.000Z | from .crawl_by_cat_url import crawl_by_cat_url
from .crawl_by_search import crawl_by_search
from .crawl_by_shop_url import crawl_by_shop_url
from .crawl_cat_list import crawl_cat_list | 45.75 | 48 | 0.896175 | from .crawl_by_cat_url import crawl_by_cat_url
from .crawl_by_search import crawl_by_search
from .crawl_by_shop_url import crawl_by_shop_url
from .crawl_cat_list import crawl_cat_list | true | true |
f72166b67f4730956f03af23668fb17b0bfb75ba | 170 | py | Python | old/dronekit-python/dronekit/util.py | sirmammingtonham/droneee | 1c0e1921a902b26958d298f3a0204465bf3e960d | [
"Unlicense"
] | null | null | null | old/dronekit-python/dronekit/util.py | sirmammingtonham/droneee | 1c0e1921a902b26958d298f3a0204465bf3e960d | [
"Unlicense"
] | null | null | null | old/dronekit-python/dronekit/util.py | sirmammingtonham/droneee | 1c0e1921a902b26958d298f3a0204465bf3e960d | [
"Unlicense"
] | null | null | null | from __future__ import print_function
import sys
def errprinter(*args):
logger(*args)
def logger(*args):
print(*args, file=sys.stderr)
sys.stderr.flush()
| 14.166667 | 37 | 0.7 | from __future__ import print_function
import sys
def errprinter(*args):
logger(*args)
def logger(*args):
print(*args, file=sys.stderr)
sys.stderr.flush()
| true | true |
f72168144f40c3dc94f255559a486ee91e85c71f | 10,646 | py | Python | userbot/plugins/chatinfo.py | meaall-com/Telebot | a08193ae6c3e5814b309d079e95c4951eafcbc19 | [
"MIT"
] | 3 | 2020-09-04T09:34:51.000Z | 2020-09-04T09:39:26.000Z | userbot/plugins/chatinfo.py | meaall-com/Telebot | a08193ae6c3e5814b309d079e95c4951eafcbc19 | [
"MIT"
] | null | null | null | userbot/plugins/chatinfo.py | meaall-com/Telebot | a08193ae6c3e5814b309d079e95c4951eafcbc19 | [
"MIT"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Credits to Hitalo-Sama and FTG Modules
from datetime import datetime
from emoji import emojize
from math import sqrt... | 46.286957 | 138 | 0.656021 |
from datetime import datetime
from emoji import emojize
from math import sqrt
from telethon.tl.functions.channels import GetFullChannelRequest, GetParticipantsRequest
from telethon.tl.functions.messages import GetFullChatRequest, GetHistoryRequest
from telethon.tl.types import MessageActionChannelMigrateFrom, Ch... | true | true |
f72168324e6096dddf572876cab151217254f430 | 3,592 | py | Python | examples/resume_train_segm.py | dani-lbnl/msdnet | 20f503322524ceb340379448f1778a58bb1f9a18 | [
"MIT"
] | 24 | 2019-08-24T06:42:51.000Z | 2021-10-09T14:27:51.000Z | examples/resume_train_segm.py | dani-lbnl/msdnet | 20f503322524ceb340379448f1778a58bb1f9a18 | [
"MIT"
] | 12 | 2019-07-31T06:56:19.000Z | 2020-12-05T18:08:54.000Z | examples/resume_train_segm.py | dani-lbnl/msdnet | 20f503322524ceb340379448f1778a58bb1f9a18 | [
"MIT"
] | 11 | 2019-09-17T02:39:24.000Z | 2022-03-30T21:28:35.000Z | #-----------------------------------------------------------------------
#Copyright 2019 Centrum Wiskunde & Informatica, Amsterdam
#
#Author: Daniel M. Pelt
#Contact: D.M.Pelt@cwi.nl
#Website: http://dmpelt.github.io/msdnet/
#License: MIT
#
#This file is part of MSDNet, a Python implementation of the
#Mixed-Scale Dense... | 43.277108 | 178 | 0.700724 |
import msdnet
from pathlib import Path
flsin = sorted((Path('train') / 'noisy').glob('*.tiff'))
flstg = sorted((Path('train') / 'label').glob('*.tiff'))
dats = []
for i in range(len(flsin)):
d = msdnet.data.ImageFileDataPoint(str(flsin[i]),str(flstg[i]))
d_oh = msdnet.data.OneHo... | true | true |
f721694c28a049e466ab20f52517ffcffb2f736f | 1,578 | py | Python | github.py | anoadragon453/msc-chatbot | ae8bc4b900df500e4f31b85041de2ebfbedd8dd9 | [
"Apache-2.0"
] | 2 | 2019-10-06T18:13:46.000Z | 2019-12-07T22:02:40.000Z | github.py | anoadragon453/msc-chatbot | ae8bc4b900df500e4f31b85041de2ebfbedd8dd9 | [
"Apache-2.0"
] | null | null | null | github.py | anoadragon453/msc-chatbot | ae8bc4b900df500e4f31b85041de2ebfbedd8dd9 | [
"Apache-2.0"
] | null | null | null | import requests
import json
from errors import BotException
import logging
logger = logging.getLogger(__name__)
class Github(object):
def __init__(self, repo_slug: str):
"""
Args:
repo_slug: The slug (user/repo_name) of the github repository
"""
# TODO: Add support fo... | 30.941176 | 100 | 0.603295 | import requests
import json
from errors import BotException
import logging
logger = logging.getLogger(__name__)
class Github(object):
def __init__(self, repo_slug: str):
self.repo_slug = repo_slug
self.api_base = "https://api.github.com"
def get_info_for_issue_pr(self, num: int) ->... | true | true |
f721696ba4b25105e5eb43dca6f3445e9352f0a4 | 265 | py | Python | ctfweb/admin.py | pdogg/ctfmanager | d8f0ac7d7e12d7973b7eb39cd30a0bc81e4cb770 | [
"BSD-3-Clause"
] | 10 | 2015-01-27T23:01:03.000Z | 2016-12-14T01:00:49.000Z | ctfweb/admin.py | pdogg/ctfmanager | d8f0ac7d7e12d7973b7eb39cd30a0bc81e4cb770 | [
"BSD-3-Clause"
] | null | null | null | ctfweb/admin.py | pdogg/ctfmanager | d8f0ac7d7e12d7973b7eb39cd30a0bc81e4cb770 | [
"BSD-3-Clause"
] | 8 | 2015-03-01T16:57:05.000Z | 2022-02-20T03:48:04.000Z | from django.contrib import admin
from ctfweb.models import *
admin.site.register(Game)
admin.site.register(Category)
admin.site.register(Challenge)
admin.site.register(Hint)
admin.site.register(Competitor)
admin.site.register(Solved)
admin.site.register(RegCodes)
| 24.090909 | 32 | 0.822642 | from django.contrib import admin
from ctfweb.models import *
admin.site.register(Game)
admin.site.register(Category)
admin.site.register(Challenge)
admin.site.register(Hint)
admin.site.register(Competitor)
admin.site.register(Solved)
admin.site.register(RegCodes)
| true | true |
f7216b0dc1766301347181cd7059ad601ead0155 | 11,484 | py | Python | components/app_update/otatool.py | thomasonw/esp-idf | abea9e4c02bb17e86298aec4e299780399e4789f | [
"Apache-2.0"
] | 6 | 2018-12-28T04:00:22.000Z | 2021-05-17T08:01:41.000Z | components/app_update/otatool.py | Wangrenai/esp-idf | abea9e4c02bb17e86298aec4e299780399e4789f | [
"Apache-2.0"
] | 1 | 2019-02-15T06:43:13.000Z | 2019-02-15T06:43:13.000Z | components/app_update/otatool.py | Wangrenai/esp-idf | abea9e4c02bb17e86298aec4e299780399e4789f | [
"Apache-2.0"
] | 1 | 2019-05-01T14:00:23.000Z | 2019-05-01T14:00:23.000Z | #!/usr/bin/env python
#
# otatool is used to perform ota-level operations - flashing ota partition
# erasing ota partition and switching ota partition
#
# Copyright 2018 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complia... | 35.012195 | 154 | 0.698015 |
function, division
import argparse
import os
import sys
import binascii
import subprocess
import tempfile
import collections
import struct
__version__ = '1.0'
IDF_COMPONENTS_PATH = os.path.expandvars(os.path.join("$IDF_PATH", "components"))
PARTTOOL_PY = os.path.join(IDF_COMPONENTS_PATH, "partition_table"... | true | true |
f7216b59c00f5f5b82ec9c7b9bf5292699ace5fe | 82 | py | Python | akshare/fx/__init__.py | ghmole/akshare | eeeec96f90c6738bcd9ce92fcfa6b9c9176928a6 | [
"MIT"
] | 12 | 2020-12-30T02:50:01.000Z | 2021-11-08T11:32:51.000Z | akshare/fx/__init__.py | ghmole/akshare | eeeec96f90c6738bcd9ce92fcfa6b9c9176928a6 | [
"MIT"
] | 3 | 2021-01-26T09:31:43.000Z | 2021-12-08T08:31:54.000Z | akshare/fx/__init__.py | ghmole/akshare | eeeec96f90c6738bcd9ce92fcfa6b9c9176928a6 | [
"MIT"
] | 13 | 2020-07-08T08:48:33.000Z | 2022-03-23T08:37:11.000Z | # -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2019/10/20 10:57
Desc:
"""
| 11.714286 | 22 | 0.54878 | true | true | |
f7216c4cb45aea88f34bb4f84f11c15334366e5e | 6,588 | py | Python | tools/Polygraphy/tests/comparator/test_comparator.py | SsisyphusTao/TensorRT | 69f5a5093a39184e137a55c908d5c4d1340b009a | [
"Apache-2.0"
] | 5,249 | 2019-06-17T17:20:34.000Z | 2022-03-31T17:56:05.000Z | tools/Polygraphy/tests/comparator/test_comparator.py | SsisyphusTao/TensorRT | 69f5a5093a39184e137a55c908d5c4d1340b009a | [
"Apache-2.0"
] | 1,721 | 2019-06-17T18:13:29.000Z | 2022-03-31T16:09:53.000Z | tools/Polygraphy/tests/comparator/test_comparator.py | SsisyphusTao/TensorRT | 69f5a5093a39184e137a55c908d5c4d1340b009a | [
"Apache-2.0"
] | 1,414 | 2019-06-18T04:01:17.000Z | 2022-03-31T09:16:53.000Z | #
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 43.92 | 117 | 0.696266 |
import subprocess as sp
import numpy as np
import pytest
import tensorrt as trt
from polygraphy.backend.onnx import BytesFromOnnx, OnnxFromTfGraph, GsFromOnnx
from polygraphy.backend.onnxrt import OnnxrtRunner, SessionFromOnnx
from polygraphy.backend.pluginref import PluginRefRunner
from polygraphy.back... | true | true |
f7216d1ac89a7301575efb5070db47b073f062f7 | 1,614 | py | Python | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/sub_protection_policy.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/sub_protection_policy.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/sub_protection_policy.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.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 ... | 39.365854 | 82 | 0.64746 |
from msrest.serialization import Model
class SubProtectionPolicy(Model):
_attribute_map = {
'policy_type': {'key': 'policyType', 'type': 'str'},
'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'},
'retention_policy': {'key': 'retentionPolicy', 'type': 'Reten... | true | true |
f7216ef57361718e2a601232dbdfdcdcad313aad | 640 | py | Python | backend/colaboradores/schema.py | leonunesbs/medico | 384796f346b001d028e1bec2676ae7242749a79a | [
"MIT"
] | 1 | 2021-12-26T03:27:26.000Z | 2021-12-26T03:27:26.000Z | backend/colaboradores/schema.py | leonunesbs/medico | 384796f346b001d028e1bec2676ae7242749a79a | [
"MIT"
] | 6 | 2021-09-01T19:52:46.000Z | 2022-02-15T20:48:27.000Z | backend/colaboradores/schema.py | leonunesbs/medico | 384796f346b001d028e1bec2676ae7242749a79a | [
"MIT"
] | null | null | null | from graphene import relay, ObjectType
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from .models import Colaborador
class ColaboradorNode(DjangoObjectType):
class Meta:
model = Colaborador
filter_fields = '__all__'
interfaces ... | 22.068966 | 68 | 0.753125 | from graphene import relay, ObjectType
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from .models import Colaborador
class ColaboradorNode(DjangoObjectType):
class Meta:
model = Colaborador
filter_fields = '__all__'
interfaces ... | true | true |
f721704148332e77abcaafead1bc2fa7b96d4007 | 1,233 | py | Python | src/server/services/mp/settings/save.py | jhchen3121/wechat_shop | c9d9ad009df1e5bb0eb23ca8d830dd5c15df5328 | [
"Apache-2.0"
] | null | null | null | src/server/services/mp/settings/save.py | jhchen3121/wechat_shop | c9d9ad009df1e5bb0eb23ca8d830dd5c15df5328 | [
"Apache-2.0"
] | 5 | 2021-01-28T21:18:27.000Z | 2022-03-25T19:10:01.000Z | src/server/services/mp/settings/save.py | jhchen3121/wechat_shop | c9d9ad009df1e5bb0eb23ca8d830dd5c15df5328 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from core_backend import context
from core_backend.service import handler
from core_backend.libs.exception import Error
from server.domain.models import WechatshopUser
import re
import time
im... | 25.163265 | 87 | 0.633414 |
from __future__ import unicode_literals
from __future__ import absolute_import
from core_backend import context
from core_backend.service import handler
from core_backend.libs.exception import Error
from server.domain.models import WechatshopUser
import re
import time
import base64
import logging
import settings
... | true | true |
f7217194f4c19697a8e59fe9babfa90a23edf214 | 2,031 | py | Python | tests/test_db_utils.py | larssl780/thin_wrappers | c0791d76a734303708892a25cce2e237caf9920a | [
"MIT"
] | null | null | null | tests/test_db_utils.py | larssl780/thin_wrappers | c0791d76a734303708892a25cce2e237caf9920a | [
"MIT"
] | 4 | 2022-02-04T15:18:31.000Z | 2022-02-07T15:07:43.000Z | tests/test_db_utils.py | larssl780/thin_wrappers | c0791d76a734303708892a25cce2e237caf9920a | [
"MIT"
] | null | null | null | import pytest
import pathlib
import sys
import requests
import io
import zipfile
import tempfile
import pandas as pd
import os
HERE = pathlib.Path(__file__).resolve().parent
# insert at 1, 0 is the script path (or '' in REPL)
# temporary hack until package is published and we can inherit from there:
sys.path.inser... | 30.313433 | 148 | 0.65485 | import pytest
import pathlib
import sys
import requests
import io
import zipfile
import tempfile
import pandas as pd
import os
HERE = pathlib.Path(__file__).resolve().parent
sys.path.insert(1, '%s/thin_wrappers' % HERE.parent)
import db_utils as db
def headers():
return {'Accept': 'application/json, tex... | true | true |
f721726ac088dd61876dfef95afdd66374bad3ee | 9,061 | py | Python | cinder/tests/unit/image/fake.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/image/fake.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/image/fake.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 Justin Santa Barbara
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | 36.833333 | 79 | 0.522238 |
import copy
import datetime
import mock
import uuid
from cinder import exception
import cinder.image.glance
class _FakeImageService(object):
def __init__(self):
self.images = {}
# So, make sure we've got one..
timestamp = datetime.datetime(2011, 1, 1, 1, 2, 3)
... | true | true |
f721754672bebac235baff6704cad30073fc6e3a | 2,231 | py | Python | recipes/python/template/template/trainingdataloader.py | tumulurik/acp-data-services-dsw-reference | 4ec0a161203a1097069bb5c0044eb6df137c5f6d | [
"Apache-2.0"
] | null | null | null | recipes/python/template/template/trainingdataloader.py | tumulurik/acp-data-services-dsw-reference | 4ec0a161203a1097069bb5c0044eb6df137c5f6d | [
"Apache-2.0"
] | null | null | null | recipes/python/template/template/trainingdataloader.py | tumulurik/acp-data-services-dsw-reference | 4ec0a161203a1097069bb5c0044eb6df137c5f6d | [
"Apache-2.0"
] | 1 | 2018-11-15T19:15:50.000Z | 2018-11-15T19:15:50.000Z | #####################################################################
# ADOBE CONFIDENTIAL
# ___________________
#
# Copyright 2017 Adobe
# All Rights Reserved.
#
# NOTICE: All information contained herein is, and remains
# the property of Adobe and its suppliers, if any. The intellectual
# and technical concepts co... | 34.859375 | 88 | 0.556253 | true | true | |
f72175eba1256181da7f1dbcf593e18eb8a344a6 | 7,472 | py | Python | neo/io/__init__.py | Warfley/python-neo | 875e23a417e1a65d5cb45403e6e3261155e2741d | [
"BSD-3-Clause"
] | 1 | 2020-06-08T14:00:03.000Z | 2020-06-08T14:00:03.000Z | neo/io/__init__.py | Warfley/python-neo | 875e23a417e1a65d5cb45403e6e3261155e2741d | [
"BSD-3-Clause"
] | 22 | 2016-09-13T13:31:25.000Z | 2019-05-14T17:07:16.000Z | neo/io/__init__.py | Warfley/python-neo | 875e23a417e1a65d5cb45403e6e3261155e2741d | [
"BSD-3-Clause"
] | null | null | null | """
:mod:`neo.io` provides classes for reading and/or writing
electrophysiological data files.
Note that if the package dependency is not satisfied for one io, it does not
raise an error but a warning.
:attr:`neo.io.iolist` provides a list of successfully imported io classes.
Functions:
.. autofunction:: neo.io.get... | 22.172107 | 79 | 0.720021 |
import os.path
try:
import neuroshare as ns
except ImportError as err:
from neo.io.neurosharectypesio import NeurosharectypesIO as NeuroshareIO
else:
from neo.io.neuroshareapiio import NeuroshareapiIO as NeuroshareIO
from neo.io.alphaomegaio import AlphaOmegaIO
from neo.io.as... | true | true |
f721766457ab8501938015654594e370b906deb0 | 3,890 | py | Python | workflow/scripts/combine_virsorter_virfinder.py | rdenise/virome_pipeline | 3c629aef75b184bf39f2d14043f94e8787e3ea14 | [
"MIT"
] | 1 | 2022-03-29T21:18:53.000Z | 2022-03-29T21:18:53.000Z | workflow/scripts/combine_virsorter_virfinder.py | rdenise/virome_pipeline | 3c629aef75b184bf39f2d14043f94e8787e3ea14 | [
"MIT"
] | null | null | null | workflow/scripts/combine_virsorter_virfinder.py | rdenise/virome_pipeline | 3c629aef75b184bf39f2d14043f94e8787e3ea14 | [
"MIT"
] | null | null | null | from Bio import SeqIO
import pandas as pd
import sys
import os
# Put error and out into the log file
sys.stderr = sys.stdout = open(snakemake.log[0], "w")
###########################################################
###########################################################
# List that will contains all the contigs ... | 31.626016 | 81 | 0.648072 | from Bio import SeqIO
import pandas as pd
import sys
import os
sys.stderr = sys.stdout = open(snakemake.log[0], "w")
| true | true |
f7217746e68b217cef673ded6405c62a5976ac18 | 5,365 | py | Python | Benchmarking/CM_Benchmark/basic_benchmark/rde.py | CipiOrhei/eecvf | 759fb2127c8d65a570ba2df536ff8429ccf5bdf2 | [
"MIT"
] | 1 | 2021-04-02T15:33:12.000Z | 2021-04-02T15:33:12.000Z | Benchmarking/CM_Benchmark/basic_benchmark/rde.py | CipiOrhei/eecvf | 759fb2127c8d65a570ba2df536ff8429ccf5bdf2 | [
"MIT"
] | null | null | null | Benchmarking/CM_Benchmark/basic_benchmark/rde.py | CipiOrhei/eecvf | 759fb2127c8d65a570ba2df536ff8429ccf5bdf2 | [
"MIT"
] | 1 | 2021-08-14T09:07:22.000Z | 2021-08-14T09:07:22.000Z | import math
import os
from math import log10
# noinspection PyPackageRequirements
import cv2
import numpy as np
from scipy.ndimage import distance_transform_edt
import config_main
from Utils.log_handler import log_setup_info_to_console, log_error_to_console, log_benchmark_info_to_console
from Benchmarking.Ut... | 37.517483 | 146 | 0.608574 | import math
import os
from math import log10
import cv2
import numpy as np
from scipy.ndimage import distance_transform_edt
import config_main
from Utils.log_handler import log_setup_info_to_console, log_error_to_console, log_benchmark_info_to_console
from Benchmarking.Util.image_parsing import find_img_exte... | true | true |
f7217797ff9948fe15504b1554d32d09382f057d | 3,899 | py | Python | PaddleCV/tracking/ltr/data/loader.py | zhousanfu/paddle-demo | 56860c5241874fe6111def46ea2f3f91e3ba80de | [
"Apache-2.0"
] | 1 | 2021-07-07T11:04:11.000Z | 2021-07-07T11:04:11.000Z | PaddleCV/tracking/ltr/data/loader.py | zhousanfu/paddle_demo | 56860c5241874fe6111def46ea2f3f91e3ba80de | [
"Apache-2.0"
] | null | null | null | PaddleCV/tracking/ltr/data/loader.py | zhousanfu/paddle_demo | 56860c5241874fe6111def46ea2f3f91e3ba80de | [
"Apache-2.0"
] | 1 | 2021-05-18T06:36:32.000Z | 2021-05-18T06:36:32.000Z | import os
import sys
import dataflow as df
import numpy as np
class LTRLoader(df.DataFlow):
"""
Data loader. Combines a dataset and a sampler, and provides
single- or multi-process iterators over the dataset.
Note: an additional option stack_dim is available to
select along which dimensi... | 39.383838 | 90 | 0.60118 | import os
import sys
import dataflow as df
import numpy as np
class LTRLoader(df.DataFlow):
__initialized = False
def __init__(self,
name,
dataset,
training=True,
batch_size=1,
shuffle=False,
sampler=None,... | true | true |
f72177dda3702aa0aa6df33982088a3eb433c9ba | 13,260 | py | Python | Lib/test/test_module.py | ErikBjare/cpython | b68431fadb3150134ac6ccbf501cdfeaf4c75678 | [
"0BSD"
] | 5 | 2021-12-03T23:11:53.000Z | 2022-01-08T21:02:50.000Z | Lib/test/test_module.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 8 | 2022-01-07T11:31:11.000Z | 2022-03-04T00:07:16.000Z | Lib/test/test_module.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 1 | 2022-03-27T18:34:54.000Z | 2022-03-27T18:34:54.000Z | # Test the module type
import unittest
import weakref
from test.support import gc_collect
from test.support import import_helper
from test.support.script_helper import assert_python_ok
import sys
ModuleType = type(sys)
class FullLoader:
@classmethod
def module_repr(cls, m):
return "<module '{}' (craft... | 35.74124 | 80 | 0.597511 |
import unittest
import weakref
from test.support import gc_collect
from test.support import import_helper
from test.support.script_helper import assert_python_ok
import sys
ModuleType = type(sys)
class FullLoader:
@classmethod
def module_repr(cls, m):
return "<module '{}' (crafted)>".format(m.__name_... | true | true |
f7217a596eab242de146ed6262830949ee89e841 | 3,214 | py | Python | tsa/links/crawl.py | chbrown/topic-sentiment-authorship | e8cacf11b06583d9ed85ff790e1d5322e59f2fd6 | [
"MIT"
] | null | null | null | tsa/links/crawl.py | chbrown/topic-sentiment-authorship | e8cacf11b06583d9ed85ff790e1d5322e59f2fd6 | [
"MIT"
] | null | null | null | tsa/links/crawl.py | chbrown/topic-sentiment-authorship | e8cacf11b06583d9ed85ff790e1d5322e59f2fd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import socket
import urllib.parse
from datetime import datetime
import requests
import requests.exceptions as reqexc
import sqlalchemy.exc as sqlexc
from tsa import stdoutn
from tsa.lib import html
from tsa.models import Endpoint, create_session
from tsa import logging
logger = logging.getLogger... | 32.14 | 90 | 0.641257 |
import socket
import urllib.parse
from datetime import datetime
import requests
import requests.exceptions as reqexc
import sqlalchemy.exc as sqlexc
from tsa import stdoutn
from tsa.lib import html
from tsa.models import Endpoint, create_session
from tsa import logging
logger = logging.getLogger(__name__)
whitespac... | true | true |
f7217b021c92c57203280273bd959699cf6039c7 | 46,777 | py | Python | learningTolearn/backbone/common.py | ximingxing/Learning-To-Learn | 0135cb41521a61d1f3248cf3fe409e51f824fe25 | [
"MIT"
] | 5 | 2019-12-01T02:52:39.000Z | 2020-10-20T01:51:40.000Z | learningTolearn/backbone/common.py | ximingxing/DeepLearningWithPytorch | 0135cb41521a61d1f3248cf3fe409e51f824fe25 | [
"MIT"
] | 1 | 2019-11-18T13:26:50.000Z | 2019-11-18T13:26:50.000Z | learningTolearn/backbone/common.py | ximingxing/Learning-To-Learn | 0135cb41521a61d1f3248cf3fe409e51f824fe25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Description : Common routines for models in PyTorch.
Author : xxm
"""
__all__ = ['round_channels', 'Identity', 'Swish', 'HSigmoid', 'HSwish', 'get_activation_layer', 'conv1x1', 'conv3x3',
'depthwise_conv3x3', 'ConvBlock', 'conv1x1_block', 'conv3x3_block', 'conv7x7... | 31.122422 | 120 | 0.579195 |
__all__ = ['round_channels', 'Identity', 'Swish', 'HSigmoid', 'HSwish', 'get_activation_layer', 'conv1x1', 'conv3x3',
'depthwise_conv3x3', 'ConvBlock', 'conv1x1_block', 'conv3x3_block', 'conv7x7_block', 'dwconv_block',
'dwconv3x3_block', 'dwconv5x5_block', 'dwsconv3x3_block', 'PreConvBlock', 'pr... | true | true |
f7217b1eb67a285016b2a98bb8fdd6162553f11b | 1,418 | py | Python | crds/jwst/__init__.py | nden/crds | b72f14cf07531ca70b61daa6b58e762e5899afa4 | [
"BSD-3-Clause"
] | null | null | null | crds/jwst/__init__.py | nden/crds | b72f14cf07531ca70b61daa6b58e762e5899afa4 | [
"BSD-3-Clause"
] | null | null | null | crds/jwst/__init__.py | nden/crds | b72f14cf07531ca70b61daa6b58e762e5899afa4 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os.path
from crds import reftypes
HERE = os.path.dirname(__file__) or "."
TYPES = reftypes.from_package_file(__file__)
INSTRUMENTS = TYPES.instruments
EXTENSIONS = TYPES.extensions
TEXT_DESCR = TYPES... | 33.761905 | 146 | 0.738364 | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os.path
from crds import reftypes
HERE = os.path.dirname(__file__) or "."
TYPES = reftypes.from_package_file(__file__)
INSTRUMENTS = TYPES.instruments
EXTENSIONS = TYPES.extensions
TEXT_DESCR = TYPES... | true | true |
f7217bf8d6fabaf470f63ef2822e2cba3024153c | 7,292 | py | Python | tensorflow_datasets/audio/fuss.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | 2 | 2022-02-14T09:51:39.000Z | 2022-02-14T13:27:49.000Z | tensorflow_datasets/audio/fuss.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/audio/fuss.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | 1 | 2020-12-13T22:11:33.000Z | 2020-12-13T22:11:33.000Z | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 37.782383 | 187 | 0.62932 |
import os
from absl import logging
import tensorflow as tf
import tensorflow_datasets.public_api as tfds
_CITATION = r"""\
@inproceedings{wisdom2020fuss,
title = {What's All the {FUSS} About Free Universal Sound Separation Data?},
author = {Scott Wisdom and Hakan Erdogan and Daniel P. W. Ellis and ... | true | true |
f7217c7974021f0ec405e5dff2a600a77498317d | 538 | py | Python | src/svm/get_vocab_dict.py | dimart10/machine-learning | 0f33bef65a9335c0f7fed680f1112419bae8fabc | [
"MIT"
] | null | null | null | src/svm/get_vocab_dict.py | dimart10/machine-learning | 0f33bef65a9335c0f7fed680f1112419bae8fabc | [
"MIT"
] | null | null | null | src/svm/get_vocab_dict.py | dimart10/machine-learning | 0f33bef65a9335c0f7fed680f1112419bae8fabc | [
"MIT"
] | null | null | null | def getVocabDict(reverse=False):
"""
Function to read in the supplied vocab list text file into a dictionary.
Dictionary key is the stemmed word, value is the index in the text file
If "reverse", the keys and values are switched.
"""
vocab_dict = {}
with open("../data/emails/vocab.txt") as f... | 31.647059 | 76 | 0.581784 | def getVocabDict(reverse=False):
vocab_dict = {}
with open("../data/emails/vocab.txt") as f:
for line in f:
(val, key) = line.split()
if not reverse:
vocab_dict[key] = int(val)
else:
vocab_dict[int(val)] = key
return vocab_dict
| true | true |
f7217cb6c5888d602826730dbf6b55ce8ad59ff8 | 1,125 | py | Python | clients/python/marquez_client/models.py | aridwiprayogo/marquez | b15e44fb7c2a0efcbe8ee8ce412144ac5ee68e0e | [
"Apache-2.0"
] | 999 | 2018-07-07T01:36:21.000Z | 2022-03-31T18:25:18.000Z | clients/python/marquez_client/models.py | aridwiprayogo/marquez | b15e44fb7c2a0efcbe8ee8ce412144ac5ee68e0e | [
"Apache-2.0"
] | 1,681 | 2018-07-19T23:45:31.000Z | 2022-03-31T22:21:07.000Z | clients/python/marquez_client/models.py | aridwiprayogo/marquez | b15e44fb7c2a0efcbe8ee8ce412144ac5ee68e0e | [
"Apache-2.0"
] | 182 | 2018-08-02T11:35:45.000Z | 2022-03-31T07:02:14.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 25 | 74 | 0.688889 |
from enum import Enum
class DatasetId:
def __init__(self, namespace: str, name: str):
self.namespace = namespace
self.name = name
class JobId:
def __init__(self, namespace: str, name: str):
self.namespace = namespace
self.name = name
class DatasetType(Enum):
... | true | true |
f7217ef251ef43a682f902818aa9a8aa8f1b0d93 | 2,145 | py | Python | app/s3_client/s3_csv_client.py | alphagov/notify-admin-frontend | 70f2a6a97aefe2432d7a3b54dc1555c030dd3693 | [
"MIT"
] | 33 | 2016-01-11T20:16:17.000Z | 2021-11-23T12:50:29.000Z | app/s3_client/s3_csv_client.py | alphagov/notify-admin-frontend | 70f2a6a97aefe2432d7a3b54dc1555c030dd3693 | [
"MIT"
] | 1,249 | 2015-11-30T16:43:21.000Z | 2022-03-24T13:04:55.000Z | app/s3_client/s3_csv_client.py | alphagov/notify-admin-frontend | 70f2a6a97aefe2432d7a3b54dc1555c030dd3693 | [
"MIT"
] | 36 | 2015-12-02T09:49:26.000Z | 2021-04-10T18:05:41.000Z | import uuid
import botocore
from flask import current_app
from notifications_utils.s3 import s3upload as utils_s3upload
from app.s3_client.s3_logo_client import get_s3_object
FILE_LOCATION_STRUCTURE = 'service-{}-notify/{}.csv'
def get_csv_location(service_id, upload_id, bucket=None):
return (
bucket o... | 31.544118 | 91 | 0.699301 | import uuid
import botocore
from flask import current_app
from notifications_utils.s3 import s3upload as utils_s3upload
from app.s3_client.s3_logo_client import get_s3_object
FILE_LOCATION_STRUCTURE = 'service-{}-notify/{}.csv'
def get_csv_location(service_id, upload_id, bucket=None):
return (
bucket o... | true | true |
f7217f0a995fcc98786c4617f284dd074799a176 | 3,622 | py | Python | dfs_search.py | orionoiro/path_searcher | 198888a4570b40812a53e8485387e8cd59fe20ee | [
"MIT"
] | null | null | null | dfs_search.py | orionoiro/path_searcher | 198888a4570b40812a53e8485387e8cd59fe20ee | [
"MIT"
] | 1 | 2021-06-08T19:43:09.000Z | 2021-06-08T19:43:09.000Z | dfs_search.py | orionoiro/path_searcher | 198888a4570b40812a53e8485387e8cd59fe20ee | [
"MIT"
] | null | null | null | from graph import Digraph, Node, WeightedEdge
def load_map(map_filename):
"""
Parses the map file and constructs a directed graph
Assumes:
Each entry in the map file consists of the following four positive
integers, separated by a blank space:
32 76 54 23
This entry wou... | 32.927273 | 93 | 0.570403 | from graph import Digraph, Node, WeightedEdge
def load_map(map_filename):
g = Digraph()
with open(map_filename, 'r') as file:
read_data = file.read().split('\n')
for elem in read_data:
read_data[read_data.index(elem)] = elem.split(' ')
read_data.remove([''])
for elem in read_dat... | true | true |
f72180e784ecfee3622da10e4ca8c64c9fb89d32 | 3,450 | py | Python | tests/functional/test_cli.py | garnaat/aws-lambda-builders | 0ce436cacb7e5e756c65cb4fa4d78877ada307e5 | [
"Apache-2.0"
] | 2 | 2020-11-12T22:58:17.000Z | 2021-03-22T16:13:34.000Z | tests/functional/test_cli.py | awood45/aws-lambda-builders | 3744cea731403fc5d5aad36c4f60d9512231fd78 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_cli.py | awood45/aws-lambda-builders | 3744cea731403fc5d5aad36c4f60d9512231fd78 | [
"Apache-2.0"
] | null | null | null |
import json
import os
import shutil
import tempfile
import subprocess
import copy
from unittest import TestCase
from parameterized import parameterized
class TestCliWithHelloWorkflow(TestCase):
HELLO_WORKFLOW_MODULE = "hello_workflow.write_hello"
TEST_WORKFLOWS_FOLDER = os.path.join(os.path.dirname(__file_... | 35.9375 | 123 | 0.630145 |
import json
import os
import shutil
import tempfile
import subprocess
import copy
from unittest import TestCase
from parameterized import parameterized
class TestCliWithHelloWorkflow(TestCase):
HELLO_WORKFLOW_MODULE = "hello_workflow.write_hello"
TEST_WORKFLOWS_FOLDER = os.path.join(os.path.dirname(__file_... | true | true |
f721837c57c136970d438343cccd809cda08ff22 | 19,515 | py | Python | pype/vendor/capture_gui/accordion.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | 52 | 2017-03-28T02:44:25.000Z | 2021-08-13T08:32:56.000Z | pype/vendor/capture_gui/accordion.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | 51 | 2017-04-05T08:27:29.000Z | 2020-05-08T14:40:31.000Z | pype/vendor/capture_gui/accordion.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | 12 | 2016-09-19T11:55:03.000Z | 2021-10-15T09:21:31.000Z | from .vendor.Qt import QtCore, QtWidgets, QtGui
class AccordionItem(QtWidgets.QGroupBox):
trigger = QtCore.Signal(bool)
def __init__(self, accordion, title, widget):
QtWidgets.QGroupBox.__init__(self, parent=accordion)
# create the layout
layout = QtWidgets.QVBoxLayout()
layo... | 31.224 | 92 | 0.564386 | from .vendor.Qt import QtCore, QtWidgets, QtGui
class AccordionItem(QtWidgets.QGroupBox):
trigger = QtCore.Signal(bool)
def __init__(self, accordion, title, widget):
QtWidgets.QGroupBox.__init__(self, parent=accordion)
layout = QtWidgets.QVBoxLayout()
layout.setContentsMargi... | true | true |
f721842d767265f7f548ee0d34b73c892bd60f1b | 183 | py | Python | pystrometry/example_subpkg/setup_package.py | Johannes-Sahlmann/pystrometry | 79dc67369be2ce46ddb0ebc73e5fe3570d20c025 | [
"BSD-3-Clause"
] | 9 | 2019-12-06T13:12:33.000Z | 2021-10-05T12:47:15.000Z | pystrometry/example_subpkg/setup_package.py | Johannes-Sahlmann/pystrometry | 79dc67369be2ce46ddb0ebc73e5fe3570d20c025 | [
"BSD-3-Clause"
] | 2 | 2019-11-28T17:20:27.000Z | 2019-12-09T18:44:35.000Z | pystrometry/example_subpkg/setup_package.py | Johannes-Sahlmann/pystrometry | 79dc67369be2ce46ddb0ebc73e5fe3570d20c025 | [
"BSD-3-Clause"
] | 3 | 2019-11-28T17:04:22.000Z | 2021-10-19T13:12:34.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import
def get_package_data():
return {'pystrometry.example_subpkg': ['data/*']}
| 26.142857 | 63 | 0.754098 |
from __future__ import absolute_import
def get_package_data():
return {'pystrometry.example_subpkg': ['data/*']}
| true | true |
f721854d6db9efb92a7df07e88cf428c0d746223 | 3,699 | py | Python | muti/glmu.py | invertedv/utilities | 42c331893b1beee73b2d21df6cb2bad73b872bb7 | [
"MIT"
] | null | null | null | muti/glmu.py | invertedv/utilities | 42c331893b1beee73b2d21df6cb2bad73b872bb7 | [
"MIT"
] | null | null | null | muti/glmu.py | invertedv/utilities | 42c331893b1beee73b2d21df6cb2bad73b872bb7 | [
"MIT"
] | null | null | null | from muti import genu
import clickhouse_driver
import pandas as pd
from modeling.glm import glm
import numpy as np
import math
def build_model_formula(features_dict: dict, target: str):
"""
Builds the model formula for glm from modeling based on the features_dict specification.
Does not included embedded ... | 41.561798 | 112 | 0.651798 | from muti import genu
import clickhouse_driver
import pandas as pd
from modeling.glm import glm
import numpy as np
import math
def build_model_formula(features_dict: dict, target: str):
ms = target + '~'
extra = ''
for feature in features_dict:
if features_dict[feature][0] == 'cts':
ms... | true | true |
f7218599cb5a20deb178638895ef1d333f863936 | 4,015 | py | Python | scripts/fastRequests.py | Hitoshirenu/muchspace | e3db813b148941d6caf6e3b13e82c0fc48f454bf | [
"MIT"
] | null | null | null | scripts/fastRequests.py | Hitoshirenu/muchspace | e3db813b148941d6caf6e3b13e82c0fc48f454bf | [
"MIT"
] | null | null | null | scripts/fastRequests.py | Hitoshirenu/muchspace | e3db813b148941d6caf6e3b13e82c0fc48f454bf | [
"MIT"
] | null | null | null | # import threading
from pathlib import Path
from multiprocessing.dummy import Pool as ThreadPool
from more_itertools import unique_everseen
import requests, json, datetime
from scripts.byteSize import human_byte_size
# Initialization
Total_Size = 0
Processed_URLs = 0
Progress = 0
Total_URLs = 0
Rate = 0
Re... | 43.641304 | 187 | 0.646077 |
from pathlib import Path
from multiprocessing.dummy import Pool as ThreadPool
from more_itertools import unique_everseen
import requests, json, datetime
from scripts.byteSize import human_byte_size
Total_Size = 0
Processed_URLs = 0
Progress = 0
Total_URLs = 0
Rate = 0
Report = False
ReportJson = []
def ... | true | true |
f72186852716593e8409116793bd82e2b2526084 | 2,714 | py | Python | src/pipelines/epidemiology/nl_authority.py | nelhage/data | 50a1ab91b786c9f89a8ff6ff10ea57ea5335490d | [
"Apache-2.0"
] | null | null | null | src/pipelines/epidemiology/nl_authority.py | nelhage/data | 50a1ab91b786c9f89a8ff6ff10ea57ea5335490d | [
"Apache-2.0"
] | null | null | null | src/pipelines/epidemiology/nl_authority.py | nelhage/data | 50a1ab91b786c9f89a8ff6ff10ea57ea5335490d | [
"Apache-2.0"
] | null | null | null | # 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 agreed to in writing, ... | 37.178082 | 91 | 0.637804 |
from datetime import datetime
from typing import Any, Dict, List
from pandas import DataFrame, concat, merge
from lib.pipeline import DataSource
from lib.time import datetime_isoformat
from lib.utils import grouped_diff
class NetherlandsDataSource(DataSource):
def parse_dataframes(
self, dat... | true | true |
f72187bfd6178c0257c0f81666097723e96f4c4d | 21,206 | py | Python | tests/controller_test.py | elmopl/homekit_python | bb2b07e66fce3c3034b012ef679695a3da77f787 | [
"Apache-2.0"
] | null | null | null | tests/controller_test.py | elmopl/homekit_python | bb2b07e66fce3c3034b012ef679695a3da77f787 | [
"Apache-2.0"
] | null | null | null | tests/controller_test.py | elmopl/homekit_python | bb2b07e66fce3c3034b012ef679695a3da77f787 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Joachim Lusiardi
#
# 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 wri... | 42.927126 | 113 | 0.650712 |
import unittest
import tempfile
import threading
import time
from homekit import Controller
from homekit import AccessoryServer
from homekit.exceptions import AccessoryNotFoundError, AlreadyPairedError, UnavailableError, FormatError, \
ConfigLoadingError, ConfigSavingError, MalformedPinError
from h... | true | true |
f721880fe59e59ce9a574f51f4ac11921a0ea939 | 4,792 | py | Python | zendesk/endpoints.py | optixx/zendesk | 7a4439f1c5b46913acad6b3153266d52f011c11e | [
"MIT"
] | 31 | 2015-01-02T01:44:18.000Z | 2021-06-10T16:29:54.000Z | zendesk/endpoints.py | optixx/zendesk | 7a4439f1c5b46913acad6b3153266d52f011c11e | [
"MIT"
] | 1 | 2015-04-08T07:54:50.000Z | 2015-04-09T14:29:38.000Z | zendesk/endpoints.py | optixx/zendesk | 7a4439f1c5b46913acad6b3153266d52f011c11e | [
"MIT"
] | 23 | 2015-01-12T23:42:34.000Z | 2021-09-08T11:20:12.000Z | """
API MAPPING
"""
mapping_table = {
# Rest API: Organizations
'list_organizations': {
'path': '/organizations.json',
'method': 'GET',
'status': 200,
},
'show_organization': {
'path': '/organizations/{{organization_id}}.json',
'method': 'GET',
'status':... | 24.701031 | 82 | 0.459098 |
mapping_table = {
'list_organizations': {
'path': '/organizations.json',
'method': 'GET',
'status': 200,
},
'show_organization': {
'path': '/organizations/{{organization_id}}.json',
'method': 'GET',
'status': 200,
},
'create_organization': {
... | true | true |
f721881eea115b79515a4c824cdd061fe585c80c | 6,885 | py | Python | logging/tests/unit/handlers/test__helpers.py | rodrigodias27/google-cloud-python | 7d1161f70744c0dbbe67a3f472ea95667eaafe50 | [
"Apache-2.0"
] | 1 | 2021-01-04T11:40:17.000Z | 2021-01-04T11:40:17.000Z | logging/tests/unit/handlers/test__helpers.py | rodrigodias27/google-cloud-python | 7d1161f70744c0dbbe67a3f472ea95667eaafe50 | [
"Apache-2.0"
] | null | null | null | logging/tests/unit/handlers/test__helpers.py | rodrigodias27/google-cloud-python | 7d1161f70744c0dbbe67a3f472ea95667eaafe50 | [
"Apache-2.0"
] | null | null | null | # 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 a... | 30.197368 | 78 | 0.679448 |
import json
import unittest
import mock
import six
try:
from webapp2 import RequestHandler
except SyntaxError:
RequestHandler = object
class Test_get_trace_id_from_flask(unittest.TestCase):
@staticmethod
def _call_fut():
from google.cloud.logging.handlers import _hel... | true | true |
f7218951799b74c37930bbca42f5a8dabc271ee3 | 8,665 | py | Python | pattoo/ingest/files.py | palisadoes/pattoo | 57bd3e82e49d51e3426b13ad53ed8326a735ce29 | [
"Apache-2.0"
] | null | null | null | pattoo/ingest/files.py | palisadoes/pattoo | 57bd3e82e49d51e3426b13ad53ed8326a735ce29 | [
"Apache-2.0"
] | null | null | null | pattoo/ingest/files.py | palisadoes/pattoo | 57bd3e82e49d51e3426b13ad53ed8326a735ce29 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Pattoo classes that manage various data."""
# Standard imports
import os
import time
# Import project libraries
from pattoo_shared import log, files, converter
from pattoo.configuration import ConfigIngester as Config
from pattoo.constants import PATTOO_API_AGENT_NAME, PATTOO_INGESTER_NAME
... | 30.191638 | 79 | 0.599308 |
import os
import time
from pattoo_shared import log, files, converter
from pattoo.configuration import ConfigIngester as Config
from pattoo.constants import PATTOO_API_AGENT_NAME, PATTOO_INGESTER_NAME
from .records import Records
class Cache():
def __init__(self, batch_size=500, age=0):
co... | true | true |
f7218963b535569939ecb7f8ec24da1fd34de53b | 8,127 | py | Python | Pytorch/class_wrapper.py | BensonRen/idlm_Ben | 0d83780232d6341575daf88792959542aef82132 | [
"MIT"
] | 3 | 2019-08-28T17:10:29.000Z | 2020-11-22T14:06:45.000Z | Pytorch/class_wrapper.py | BensonRen/idlm_Ben | 0d83780232d6341575daf88792959542aef82132 | [
"MIT"
] | 1 | 2019-11-03T12:02:43.000Z | 2019-11-20T02:04:36.000Z | Pytorch/class_wrapper.py | BensonRen/idlm_Ben | 0d83780232d6341575daf88792959542aef82132 | [
"MIT"
] | 2 | 2019-08-29T02:32:56.000Z | 2019-12-22T17:44:26.000Z | """
The class wrapper for the networks
"""
# Built-in
import os
import time
# Torch
import torch
from torch import nn
from torch.utils.tensorboard import SummaryWriter
from torchsummary import summary
# Libs
import numpy as np
# Own module
class Network(object):
def __init__(self, model_fn, flags, train_loader... | 47.526316 | 135 | 0.556909 |
import os
import time
import torch
from torch import nn
from torch.utils.tensorboard import SummaryWriter
from torchsummary import summary
import numpy as np
class Network(object):
def __init__(self, model_fn, flags, train_loader, test_loader,
ckpt_dir=os.path.join(os.path.abspath(''), 'mo... | true | true |
f72189c34849c418bee945e1e54df7340ce233c9 | 435 | py | Python | virtual/lib/python3.8/site-packages/wtforms/fields/__init__.py | Esther-Anyona/mylearner | d49d1c4c8dbeb93cc384f2037c48236be5dc89e1 | [
"MIT"
] | 3 | 2022-01-04T18:26:21.000Z | 2022-02-02T00:10:50.000Z | venv/lib/python3.10/site-packages/wtforms/fields/__init__.py | superiorkid/rbac | 40f45849687075bc46a52985af22eab6cf83cbda | [
"MIT"
] | 1 | 2021-12-30T10:36:57.000Z | 2021-12-30T10:36:57.000Z | venv/lib/python3.10/site-packages/wtforms/fields/__init__.py | superiorkid/rbac | 40f45849687075bc46a52985af22eab6cf83cbda | [
"MIT"
] | 2 | 2022-02-12T15:33:59.000Z | 2022-02-14T15:36:31.000Z | from wtforms.fields.choices import *
from wtforms.fields.choices import SelectFieldBase
from wtforms.fields.core import Field
from wtforms.fields.core import Flags
from wtforms.fields.core import Label
from wtforms.fields.datetime import *
from wtforms.fields.form import *
from wtforms.fields.list import *
from wtforms... | 36.25 | 53 | 0.832184 | from wtforms.fields.choices import *
from wtforms.fields.choices import SelectFieldBase
from wtforms.fields.core import Field
from wtforms.fields.core import Flags
from wtforms.fields.core import Label
from wtforms.fields.datetime import *
from wtforms.fields.form import *
from wtforms.fields.list import *
from wtforms... | true | true |
f7218c5841c78da8df7b09b9049a325f9cfeaba6 | 8,968 | py | Python | custom_admin/views.py | samuira/TutionMastor | 5b6d89efc90a9ebb54766530554d7dc9d5ee8298 | [
"MIT"
] | 1 | 2019-11-09T17:18:10.000Z | 2019-11-09T17:18:10.000Z | custom_admin/views.py | abhisek11/TutionMastor | 5b6d89efc90a9ebb54766530554d7dc9d5ee8298 | [
"MIT"
] | 19 | 2019-12-05T00:13:31.000Z | 2022-03-11T23:58:13.000Z | custom_admin/views.py | abhisek11/TutionMastor | 5b6d89efc90a9ebb54766530554d7dc9d5ee8298 | [
"MIT"
] | 1 | 2020-02-29T07:35:25.000Z | 2020-02-29T07:35:25.000Z | from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.core.exceptions import ValidationError
from django.shortcuts import render
from django.http import JsonResponse, HttpResponse, HttpResponseRedirect
from django.urls import reverse_lazy, reverse
from django.utils.... | 33.092251 | 126 | 0.748104 | from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.core.exceptions import ValidationError
from django.shortcuts import render
from django.http import JsonResponse, HttpResponse, HttpResponseRedirect
from django.urls import reverse_lazy, reverse
from django.utils.... | true | true |
f7218c9e437eabf2dfc69680b59fad493a030b44 | 1,925 | py | Python | src/braille/braille_translator.py | stuart-stanley/dotspicejar | bcf0c4656764011744581c5ea052b47ee70a34f1 | [
"MIT"
] | null | null | null | src/braille/braille_translator.py | stuart-stanley/dotspicejar | bcf0c4656764011744581c5ea052b47ee70a34f1 | [
"MIT"
] | null | null | null | src/braille/braille_translator.py | stuart-stanley/dotspicejar | bcf0c4656764011744581c5ea052b47ee70a34f1 | [
"MIT"
] | null | null | null | from .braille_cell import BrailleCell
from .braille_string import BrailleString
class BrailleTranslator(object):
_simple_cells = None
def __init__(self, text):
self.__raw_text = text
if BrailleTranslator._simple_cells is None:
self.__setup_class_simple_cells()
@property
d... | 37.745098 | 54 | 0.424935 | from .braille_cell import BrailleCell
from .braille_string import BrailleString
class BrailleTranslator(object):
_simple_cells = None
def __init__(self, text):
self.__raw_text = text
if BrailleTranslator._simple_cells is None:
self.__setup_class_simple_cells()
@property
d... | true | true |
f7218cb7a745b7fd90503d36440f0281125e16d4 | 3,402 | py | Python | cogs/error.py | Py-Verse/PyBot | dfbb029925f4d207eaabbb4d02884c27fb3c4164 | [
"MIT"
] | 8 | 2021-03-07T08:52:31.000Z | 2021-04-24T21:44:36.000Z | cogs/error.py | Developing-Studio/ci-PyBot | 4eb5aa44c0e469e2ec4f4fb51094229c3bee9441 | [
"MIT"
] | 1 | 2021-03-07T10:21:08.000Z | 2021-03-07T10:32:08.000Z | cogs/error.py | Developing-Studio/ci-PyBot | 4eb5aa44c0e469e2ec4f4fb51094229c3bee9441 | [
"MIT"
] | 4 | 2021-03-07T10:30:51.000Z | 2021-03-11T14:30:14.000Z | import math
import os
import sys
import traceback
import discord
from discord.ext import commands
class Errors(commands.Cog):
"""
Error handler
"""
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_ready(self):
print("Error cog loaded successfully... | 30.648649 | 109 | 0.531452 | import math
import os
import sys
import traceback
import discord
from discord.ext import commands
class Errors(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_ready(self):
print("Error cog loaded successfully")
@commands.Cog.listener()
... | true | true |
f7218d6bb7dd8dbb82f3a28fabfbe622d4a4680d | 220 | py | Python | userlogin_test.py | kilonzijnr/passstore | e1f73d2599bbbd209e0242416c706c4ce259d3a5 | [
"MIT"
] | null | null | null | userlogin_test.py | kilonzijnr/passstore | e1f73d2599bbbd209e0242416c706c4ce259d3a5 | [
"MIT"
] | null | null | null | userlogin_test.py | kilonzijnr/passstore | e1f73d2599bbbd209e0242416c706c4ce259d3a5 | [
"MIT"
] | null | null | null | import unittest
from userlogin import User
class TestUser(unittest.TestCase):
"""
Test class to define test cases for the User class
Args:
unittest.TestCase: TestCase class creates test cases
""" | 24.444444 | 60 | 0.709091 | import unittest
from userlogin import User
class TestUser(unittest.TestCase): | true | true |
f7218df71a44862b66afa5b5c925534e4b131f25 | 3,289 | py | Python | computer_vision/learning-opencv-practical/image-process-100ask/Question_31_40/answers/answer_40.py | magic428/subjects_notes | 6930adbb3f445c11ca9d024abb12a53d6aca19e7 | [
"MIT"
] | 2 | 2020-03-18T17:13:00.000Z | 2020-03-25T02:34:03.000Z | computer_vision/learning-opencv-practical/image-process-100ask/Question_31_40/answers/answer_40.py | magic428/subjects_notes | 6930adbb3f445c11ca9d024abb12a53d6aca19e7 | [
"MIT"
] | null | null | null | computer_vision/learning-opencv-practical/image-process-100ask/Question_31_40/answers/answer_40.py | magic428/subjects_notes | 6930adbb3f445c11ca9d024abb12a53d6aca19e7 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
# Read image
img = cv2.imread("imori.jpg").astype(np.float32)
H, W, C = img.shape
# RGB > YCbCr
Y = 0.2990 * img[..., 2] + 0.5870 * img[..., 1] + 0.1140 * img[..., 0]
Cb = -0.1687 * img[..., 2] - 0.3313 * img[..., 1] + 0.5 * img[..., 0] + 128.
C... | 32.245098 | 97 | 0.419884 | import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread("imori.jpg").astype(np.float32)
H, W, C = img.shape
Y = 0.2990 * img[..., 2] + 0.5870 * img[..., 1] + 0.1140 * img[..., 0]
Cb = -0.1687 * img[..., 2] - 0.3313 * img[..., 1] + 0.5 * img[..., 0] + 128.
Cr = 0.5 * img[..., 2] - 0.4... | true | true |
f72190bc142f0445507b2063ace8933a5d98baaf | 2,238 | py | Python | examples/visexp.py | BatsiBoy/PyFrac | a898f6111295fa9196c382613639fc84e73d6035 | [
"MIT"
] | null | null | null | examples/visexp.py | BatsiBoy/PyFrac | a898f6111295fa9196c382613639fc84e73d6035 | [
"MIT"
] | null | null | null | examples/visexp.py | BatsiBoy/PyFrac | a898f6111295fa9196c382613639fc84e73d6035 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#Name: Fractal Example - Exponential Curves
#Author: Sean Pope
#Example use of the fractal engine and coefficient block.
#Creates random coefficient blocks and draws frames to create a simple animation.
#This one is optimized for the exponential variation.
import matplotlib.pyplot as plt
impor... | 34.430769 | 109 | 0.683199 |
import matplotlib.pyplot as plt
import PyFrac as pf
plt.style.use('dark_background')
ax = plt.subplot(111,frameon=False)
ax.axes.get_xaxis().set_visible(False)
ax.axes.get_yaxis().set_visible(False)
plt.xlim(-1,1)
plt.ylim(-1,1)
def quitloop(*args):
global run
run = 0
return
fig = ... | true | true |
f721923f0db0c229c58f961a74feaeb820d768fc | 306 | py | Python | src/basic/011_thirds/use_requests.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 6 | 2020-03-24T15:58:42.000Z | 2020-04-18T13:32:41.000Z | src/basic/011_thirds/use_requests.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 1 | 2022-01-13T03:51:17.000Z | 2022-01-13T03:51:17.000Z | src/basic/011_thirds/use_requests.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 1 | 2020-02-01T09:36:05.000Z | 2020-02-01T09:36:05.000Z | import requests
r = requests.get('https://www.baidu.com/')
print(f'status_code:{r.status_code}')
print(f'text:{r.text}')
r = requests.get('https://www.baidu.com/', params={'wd': 'python'})
print(f'url:{r.url}')
print(f'status_code:{r.status_code}')
print(f'text:{r.text}')
print(f'encoding:{r.encoding}') | 27.818182 | 67 | 0.679739 | import requests
r = requests.get('https://www.baidu.com/')
print(f'status_code:{r.status_code}')
print(f'text:{r.text}')
r = requests.get('https://www.baidu.com/', params={'wd': 'python'})
print(f'url:{r.url}')
print(f'status_code:{r.status_code}')
print(f'text:{r.text}')
print(f'encoding:{r.encoding}') | true | true |
f721925123231063587335f88669b985aa41c584 | 489 | py | Python | examples/loadsheet.py | Daviid1010/ethercalc-python | af79cb5c69e2caa0b7f1d88b14be5ca60e7d6a0b | [
"BSD-2-Clause"
] | 3 | 2017-01-26T11:29:18.000Z | 2018-02-02T14:54:03.000Z | examples/loadsheet.py | Daviid1010/ethercalc-python | af79cb5c69e2caa0b7f1d88b14be5ca60e7d6a0b | [
"BSD-2-Clause"
] | null | null | null | examples/loadsheet.py | Daviid1010/ethercalc-python | af79cb5c69e2caa0b7f1d88b14be5ca60e7d6a0b | [
"BSD-2-Clause"
] | 6 | 2016-05-11T15:42:59.000Z | 2022-02-25T19:50:34.000Z | #!/usr/bin/env python3
import ethercalc
import argparse
import pprint
import sys
parser = argparse.ArgumentParser(description="Dump ethercalc sheet")
parser.add_argument("sheet", metavar='sheet', help="sheet name")
parser.add_argument("-f", "--format", dest="format",
help="format", default="socialca... | 28.764706 | 68 | 0.715746 |
import ethercalc
import argparse
import pprint
import sys
parser = argparse.ArgumentParser(description="Dump ethercalc sheet")
parser.add_argument("sheet", metavar='sheet', help="sheet name")
parser.add_argument("-f", "--format", dest="format",
help="format", default="socialcalc")
args = parser.par... | true | true |
f72194e07175df8c6208e51d9aafe054145aca68 | 200 | py | Python | drone_squadron/api/thruster_api.py | OrderAndCh4oS/drone_squadron_api_prototype | 4d7c22cebb03576986d443634b17910cb460a60f | [
"MIT"
] | 1 | 2020-05-20T09:44:37.000Z | 2020-05-20T09:44:37.000Z | drone_squadron/api/thruster_api.py | sarcoma/drone_squadron_api_prototype | 4d7c22cebb03576986d443634b17910cb460a60f | [
"MIT"
] | 1 | 2021-06-01T22:30:10.000Z | 2021-06-01T22:30:10.000Z | drone_squadron/api/thruster_api.py | OrderAndCh4oS/drone_squadron_api_prototype | 4d7c22cebb03576986d443634b17910cb460a60f | [
"MIT"
] | null | null | null | from drone_squadron.api.base_api import BaseApi
from drone_squadron.crud.thruster_crud import ThrusterCrud
class ThrusterApi(BaseApi):
def __init__(self):
super().__init__(ThrusterCrud)
| 25 | 58 | 0.79 | from drone_squadron.api.base_api import BaseApi
from drone_squadron.crud.thruster_crud import ThrusterCrud
class ThrusterApi(BaseApi):
def __init__(self):
super().__init__(ThrusterCrud)
| true | true |
f7219557f313231bf047af09d8d81a13981c3f2b | 368 | py | Python | durgo_sdk/integrations/django/middleware.py | safwanrahman/durgo-python | 79b740e0500e1ba2bce7edcb47996587a9449964 | [
"BSD-3-Clause"
] | 1 | 2020-08-12T21:56:45.000Z | 2020-08-12T21:56:45.000Z | durgo_sdk/integrations/django/middleware.py | Alig1493/durgo-python | 79b740e0500e1ba2bce7edcb47996587a9449964 | [
"BSD-3-Clause"
] | null | null | null | durgo_sdk/integrations/django/middleware.py | Alig1493/durgo-python | 79b740e0500e1ba2bce7edcb47996587a9449964 | [
"BSD-3-Clause"
] | 1 | 2020-03-21T18:30:28.000Z | 2020-03-21T18:30:28.000Z | from django.utils import timezone
class DurgoMiddleware:
def __init__(self, get_response):
self.get_response = get_response
# One-time configuration and initialization.
def __call__(self, request):
start_time = timezone.now()
response = self.get_response(request)
end... | 21.647059 | 52 | 0.673913 | from django.utils import timezone
class DurgoMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
start_time = timezone.now()
response = self.get_response(request)
end_time = timezone.now()
return respo... | true | true |
f72196382b201f0b3ce9c05e95a1507ab101ac39 | 367 | py | Python | test/testDepthfilling.py | zer01ike/HoleFilling | b1591485f37975c0793839880dbb6185a132d3f9 | [
"Apache-2.0"
] | 4 | 2019-02-18T08:58:19.000Z | 2021-11-05T01:20:32.000Z | test/testDepthfilling.py | zer01ike/HoleFilling | b1591485f37975c0793839880dbb6185a132d3f9 | [
"Apache-2.0"
] | null | null | null | test/testDepthfilling.py | zer01ike/HoleFilling | b1591485f37975c0793839880dbb6185a132d3f9 | [
"Apache-2.0"
] | 6 | 2018-05-21T10:08:20.000Z | 2021-11-05T01:20:35.000Z | from DepthFilling import DepthFilling
import cv2
DepthedImg = cv2.imread('../DataSet/Sequence/Warped/depth_0_w.bmp', 0)
DF = DepthFilling.DepthFilling(DepthedImg,63,63)
#depth_filled = DF.testKmeans(DepthedImg)
depth_filled = DF.depthfill()
cv2.imshow('depth', depth_filled)
cv2.imwrite('depthfill_book_0.bmp',depth_... | 28.230769 | 70 | 0.792916 | from DepthFilling import DepthFilling
import cv2
DepthedImg = cv2.imread('../DataSet/Sequence/Warped/depth_0_w.bmp', 0)
DF = DepthFilling.DepthFilling(DepthedImg,63,63)
depth_filled = DF.depthfill()
cv2.imshow('depth', depth_filled)
cv2.imwrite('depthfill_book_0.bmp',depth_filled)
cv2.waitKey(0)
cv2.destroyAllWindo... | true | true |
f7219684ce3f2077f43b7fa0f52973b32fe1628b | 1,607 | py | Python | tests/components/recorder/test_util.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | null | null | null | tests/components/recorder/test_util.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | null | null | null | tests/components/recorder/test_util.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | 1 | 2019-04-24T14:10:08.000Z | 2019-04-24T14:10:08.000Z | """Test util methods."""
from unittest.mock import MagicMock, patch
import pytest
from openpeerpower.components.recorder import util
from openpeerpower.components.recorder.const import DATA_INSTANCE
from tests.common import get_test_open_peer_power, init_recorder_component
@pytest.fixture
def opp_recorder():
"... | 25.109375 | 74 | 0.684505 | from unittest.mock import MagicMock, patch
import pytest
from openpeerpower.components.recorder import util
from openpeerpower.components.recorder.const import DATA_INSTANCE
from tests.common import get_test_open_peer_power, init_recorder_component
@pytest.fixture
def opp_recorder():
opp = get_test_open_peer_p... | true | true |
f72196e96928e506436940a1aaab2796da44a560 | 31,440 | py | Python | 02 Main/mainRUN.py | dengniewei/Face-Recognition-Class-Attendance-System | 58aa85ff3b378991da3ccebd69e6ace5ec2af93f | [
"MIT"
] | null | null | null | 02 Main/mainRUN.py | dengniewei/Face-Recognition-Class-Attendance-System | 58aa85ff3b378991da3ccebd69e6ace5ec2af93f | [
"MIT"
] | null | null | null | 02 Main/mainRUN.py | dengniewei/Face-Recognition-Class-Attendance-System | 58aa85ff3b378991da3ccebd69e6ace5ec2af93f | [
"MIT"
] | null | null | null | # 导入必要的模块
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox, QInputDialog
from PyQt5.QtGui import QImage, QIcon, QPixmap
from PyQt5.QtCore import QTimer, QDateTime, QCoreApplication, QThread
import sys, os
import cv2, imutils
# 导入UI主界面
import main
# 导入信息采集框界面
impor... | 39.847909 | 132 | 0.535401 |
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox, QInputDialog
from PyQt5.QtGui import QImage, QIcon, QPixmap
from PyQt5.QtCore import QTimer, QDateTime, QCoreApplication, QThread
import sys, os
import cv2, imutils
import main
import infoUI
import ChinesePutText... | true | true |
f721978ae0032f3792c8f2bb1e955820288a7de7 | 33,135 | py | Python | src/urllib3/response.py | imkaka/urllib3 | c96cf403fb4f24d414f40faf4691174e4c54ea0b | [
"MIT"
] | null | null | null | src/urllib3/response.py | imkaka/urllib3 | c96cf403fb4f24d414f40faf4691174e4c54ea0b | [
"MIT"
] | 1 | 2022-01-04T12:19:09.000Z | 2022-01-04T12:19:09.000Z | src/urllib3/response.py | sethmlarson/urllib3 | d4c25791cd5002a5234d882a28040db94ca38595 | [
"MIT"
] | null | null | null | import io
import json as _json
import logging
import zlib
from contextlib import contextmanager
from http.client import HTTPMessage as _HttplibHTTPMessage
from http.client import HTTPResponse as _HttplibHTTPResponse
from socket import timeout as SocketTimeout
from typing import (
TYPE_CHECKING,
Any,
Generat... | 34.952532 | 110 | 0.582979 | import io
import json as _json
import logging
import zlib
from contextlib import contextmanager
from http.client import HTTPMessage as _HttplibHTTPMessage
from http.client import HTTPResponse as _HttplibHTTPResponse
from socket import timeout as SocketTimeout
from typing import (
TYPE_CHECKING,
Any,
Generat... | true | true |
f7219c3cecb551332ea0053120d9d5497f55a298 | 4,400 | py | Python | pongcontroller.py | afghanimah/Pong | ad799bae29ed5f5cff2f2f70a7e42a5f02df7336 | [
"MIT"
] | null | null | null | pongcontroller.py | afghanimah/Pong | ad799bae29ed5f5cff2f2f70a7e42a5f02df7336 | [
"MIT"
] | 5 | 2020-02-29T01:15:24.000Z | 2020-02-29T21:55:03.000Z | pongcontroller.py | afghanimah/Pong | ad799bae29ed5f5cff2f2f70a7e42a5f02df7336 | [
"MIT"
] | null | null | null | from pyglet.window import key
import random
from pygletplus.controller import Controller
class PongController(Controller):
def __init__(self, scene):
super().__init__(scene)
self.keys = scene.keys
self.player = scene.player
self.cpu = scene.cpu
self.ball = scene.ball
... | 39.285714 | 113 | 0.588636 | from pyglet.window import key
import random
from pygletplus.controller import Controller
class PongController(Controller):
def __init__(self, scene):
super().__init__(scene)
self.keys = scene.keys
self.player = scene.player
self.cpu = scene.cpu
self.ball = scene.ball
... | true | true |
f7219cec0e09ba36054e4f7cf2c47cdd0bc5592a | 397 | py | Python | greaterwms/wsgi.py | chinxianjun2016/GreaterWMS | aacd0e15e0114f103eb57002e93670c008cce63b | [
"Apache-2.0"
] | 1 | 2021-02-17T14:04:29.000Z | 2021-02-17T14:04:29.000Z | greaterwms/wsgi.py | AntInso/GreaterWMS | 9eabb1b9b0f5376dcccd89ed86dd76995955a8ec | [
"Apache-2.0"
] | null | null | null | greaterwms/wsgi.py | AntInso/GreaterWMS | 9eabb1b9b0f5376dcccd89ed86dd76995955a8ec | [
"Apache-2.0"
] | null | null | null | """
WSGI config for greaterwms project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'greaterwms.settings')
application = get_wsgi_application()
| true | true |
f7219e0b94e3c48818431af7be65a1ddd8fdbbac | 2,454 | py | Python | tests/settings.py | hugorodgerbrown/django-onfido | 9e534f4725b61d982ffb2cd6a018ed1fffc353b6 | [
"MIT"
] | 6 | 2016-11-14T13:31:46.000Z | 2022-02-17T20:39:42.000Z | tests/settings.py | hugorodgerbrown/django-onfido | 9e534f4725b61d982ffb2cd6a018ed1fffc353b6 | [
"MIT"
] | 23 | 2016-10-21T11:18:34.000Z | 2021-12-08T17:33:01.000Z | tests/settings.py | hugorodgerbrown/django-onfido | 9e534f4725b61d982ffb2cd6a018ed1fffc353b6 | [
"MIT"
] | 7 | 2016-11-14T18:19:09.000Z | 2021-10-01T11:34:48.000Z | from os import getenv, path
from django.core.exceptions import ImproperlyConfigured
DEBUG = True
TEMPLATE_DEBUG = True
USE_TZ = True
USE_L10N = True
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "onfido.db"}}
INSTALLED_APPS = (
"django.contrib.admin",
"django.contrib.auth",
"... | 26.106383 | 87 | 0.609617 | from os import getenv, path
from django.core.exceptions import ImproperlyConfigured
DEBUG = True
TEMPLATE_DEBUG = True
USE_TZ = True
USE_L10N = True
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "onfido.db"}}
INSTALLED_APPS = (
"django.contrib.admin",
"django.contrib.auth",
"... | true | true |
f7219f3f9ed21cb04bfe7f510681ceaf677c32c5 | 4,351 | py | Python | src/dataload/contrib/docm/__init__.py | IsmailM/myvariant.info | 5af6ad68fc2c1eb539ab9e683a34bafd51ed5cb1 | [
"Apache-2.0"
] | null | null | null | src/dataload/contrib/docm/__init__.py | IsmailM/myvariant.info | 5af6ad68fc2c1eb539ab9e683a34bafd51ed5cb1 | [
"Apache-2.0"
] | null | null | null | src/dataload/contrib/docm/__init__.py | IsmailM/myvariant.info | 5af6ad68fc2c1eb539ab9e683a34bafd51ed5cb1 | [
"Apache-2.0"
] | 1 | 2018-11-17T09:16:59.000Z | 2018-11-17T09:16:59.000Z | __METADATA__ = {
"src_name": 'DOCM',
"src_url": 'http://docm.genome.wustl.edu/',
"version": None,
"field": "docm"
}
def load_data():
'''docm data are pre-loaded in our db.'''
raise NotImplementedError
def get_mapping():
mapping = {
"docm": {
"properties": {
... | 30.858156 | 79 | 0.290738 | __METADATA__ = {
"src_name": 'DOCM',
"src_url": 'http://docm.genome.wustl.edu/',
"version": None,
"field": "docm"
}
def load_data():
raise NotImplementedError
def get_mapping():
mapping = {
"docm": {
"properties": {
"domain": {
"type": ... | true | true |
f721a0175b21509fd3c11cdf9bddad74e4242372 | 12,176 | py | Python | yolov3_tf2/models.py | AVsolutionsai/YOLOv3_custom | d974e8305310cef31621b20128ba29c3b09ce2af | [
"MIT",
"OLDAP-2.2.1",
"Unlicense"
] | null | null | null | yolov3_tf2/models.py | AVsolutionsai/YOLOv3_custom | d974e8305310cef31621b20128ba29c3b09ce2af | [
"MIT",
"OLDAP-2.2.1",
"Unlicense"
] | null | null | null | yolov3_tf2/models.py | AVsolutionsai/YOLOv3_custom | d974e8305310cef31621b20128ba29c3b09ce2af | [
"MIT",
"OLDAP-2.2.1",
"Unlicense"
] | null | null | null | from absl import flags
from absl.flags import FLAGS
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import (
Add,
Concatenate,
Conv2D,
Input,
Lambda,
LeakyReLU,
MaxPool2D,
UpSampling2D,
ZeroPadding2D,
)
from tensorflow.keras.... | 37.235474 | 87 | 0.604221 | from absl import flags
from absl.flags import FLAGS
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import (
Add,
Concatenate,
Conv2D,
Input,
Lambda,
LeakyReLU,
MaxPool2D,
UpSampling2D,
ZeroPadding2D,
)
from tensorflow.keras.... | true | true |
f721a01f25bf915b93bced32999e9d5635c07fda | 5,196 | py | Python | data_steward/cdr_cleaner/cleaning_rules/null_person_birthdate.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 16 | 2017-06-30T20:05:05.000Z | 2022-03-08T21:03:19.000Z | data_steward/cdr_cleaner/cleaning_rules/null_person_birthdate.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 342 | 2017-06-23T21:37:40.000Z | 2022-03-30T16:44:16.000Z | data_steward/cdr_cleaner/cleaning_rules/null_person_birthdate.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 33 | 2017-07-01T00:12:20.000Z | 2022-01-26T18:06:53.000Z | """
Null Person Table Birth Date Fields
In the person table, the fields month_of_birth, day_of_birth, and birth_datetime should be nulled.
The year_of_birth field should remain unchanged.
Original Issue: DC-1356
"""
# Python imports
import logging
# Project imports
import constants.bq_utils as bq_consts
from cdr_cl... | 37.381295 | 105 | 0.659738 |
import logging
import constants.bq_utils as bq_consts
from cdr_cleaner.cleaning_rules.base_cleaning_rule import BaseCleaningRule
from constants.cdr_cleaner import clean_cdr as cdr_consts
from common import JINJA_ENV, PERSON
from utils import pipeline_logging
LOGGER = logging.getLogger(__name__)
NULL_DATE_QUERY = ... | true | true |
f721a117918ff0bd279746d0e2b01e1cd2ecaeab | 183 | py | Python | benchmark/pysam_fasta_random_access.py | DishSri1/pyfastx | 4bfa6662fb50b7244565ad00ef6e99962b4f3169 | [
"MIT"
] | 122 | 2019-10-21T16:22:27.000Z | 2022-03-31T06:07:45.000Z | benchmark/pysam_fasta_random_access.py | DishSri1/pyfastx | 4bfa6662fb50b7244565ad00ef6e99962b4f3169 | [
"MIT"
] | 40 | 2019-11-08T14:38:51.000Z | 2022-03-15T13:07:38.000Z | benchmark/pysam_fasta_random_access.py | DishSri1/pyfastx | 4bfa6662fb50b7244565ad00ef6e99962b4f3169 | [
"MIT"
] | 8 | 2020-01-20T01:31:51.000Z | 2021-07-30T10:28:35.000Z | import sys
import pysam
idfile, fafile = sys.argv[1:]
fa = pysam.FastaFile(fafile)
with open(idfile) as fh:
for line in fh:
seqid = line.strip()
s = str(fa[seqid])
print(s)
| 14.076923 | 29 | 0.666667 | import sys
import pysam
idfile, fafile = sys.argv[1:]
fa = pysam.FastaFile(fafile)
with open(idfile) as fh:
for line in fh:
seqid = line.strip()
s = str(fa[seqid])
print(s)
| true | true |
f721a16e8f02f666fcdc92caae18ad6f00ef9e1f | 12,817 | py | Python | tests/utils/log/elasticmock/fake_elasticsearch.py | wileeam/airflow | f46be8152a4d89c57db4ca46f5b3339e4876b723 | [
"Apache-2.0"
] | 1 | 2020-02-17T17:40:14.000Z | 2020-02-17T17:40:14.000Z | tests/utils/log/elasticmock/fake_elasticsearch.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 2 | 2021-05-12T12:41:51.000Z | 2021-09-29T17:47:43.000Z | tests/utils/log/elasticmock/fake_elasticsearch.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"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... | 37.920118 | 105 | 0.581727 |
import json
from elasticsearch import Elasticsearch
from elasticsearch.client.utils import query_params
from elasticsearch.exceptions import NotFoundError
from .utilities import get_random_id
class FakeElasticsearch(Elasticsearch):
__documents_dict = None
def __ini... | true | true |
f721a1a1b37e686e4f48a58bde1c7698c1b3c997 | 6,863 | py | Python | secret/gama/genetic_programming/compilers/scikitlearn.py | israel-cj/GAMA-GEISHA | 210101df0e280d5c2eb5d325fc26d551bba74ed6 | [
"Apache-2.0"
] | null | null | null | secret/gama/genetic_programming/compilers/scikitlearn.py | israel-cj/GAMA-GEISHA | 210101df0e280d5c2eb5d325fc26d551bba74ed6 | [
"Apache-2.0"
] | null | null | null | secret/gama/genetic_programming/compilers/scikitlearn.py | israel-cj/GAMA-GEISHA | 210101df0e280d5c2eb5d325fc26d551bba74ed6 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import logging
import os
import time
from typing import Callable, Tuple, Optional, Sequence
import stopit
from sklearn.base import TransformerMixin, is_classifier
from sklearn.model_selection import ShuffleSplit, cross_validate, check_cv
from sklearn.pipeline import Pipeline
from gama.ut... | 37.298913 | 88 | 0.652047 | from datetime import datetime
import logging
import os
import time
from typing import Callable, Tuple, Optional, Sequence
import stopit
from sklearn.base import TransformerMixin, is_classifier
from sklearn.model_selection import ShuffleSplit, cross_validate, check_cv
from sklearn.pipeline import Pipeline
from gama.ut... | true | true |
f721a1be56454def41dd34025c62ee217a56159a | 70,696 | py | Python | venv/Lib/site-packages/networkx/algorithms/shortest_paths/weighted.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 5 | 2022-01-05T00:41:46.000Z | 2022-03-21T07:22:58.000Z | venv/Lib/site-packages/networkx/algorithms/shortest_paths/weighted.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 25 | 2021-04-17T09:26:47.000Z | 2022-01-02T20:06:55.000Z | venv/Lib/site-packages/networkx/algorithms/shortest_paths/weighted.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 20 | 2021-11-07T13:55:56.000Z | 2021-12-02T10:54:01.000Z | """
Shortest path algorithms for weighed graphs.
"""
from collections import deque
from heapq import heappush, heappop
from itertools import count
import networkx as nx
from networkx.algorithms.shortest_paths.generic import _build_paths_from_predecessors
__all__ = [
"dijkstra_path",
"dijkstra_path_length",
... | 32.018116 | 88 | 0.620445 |
from collections import deque
from heapq import heappush, heappop
from itertools import count
import networkx as nx
from networkx.algorithms.shortest_paths.generic import _build_paths_from_predecessors
__all__ = [
"dijkstra_path",
"dijkstra_path_length",
"bidirectional_dijkstra",
"single_source_dijks... | true | true |
f721a2657cff9163e52336d5c42f2f8b73f6cf7e | 383 | py | Python | configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | _base_ = './faster_rcnn_r50_fpn_1x_coco.py'
model = dict(
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=di... | 27.357143 | 54 | 0.563969 | _base_ = './faster_rcnn_r50_fpn_1x_coco.py'
model = dict(
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=di... | true | true |
f721a43045ff008abbe0323da19119831a8f5c4e | 4,415 | py | Python | howtolens/simulators/chapter_4/mass_sie__source_sersic__2.py | rakaar/PyAutoLens | bc140c5d196c426092c1178b8abfa492c6fab859 | [
"MIT"
] | null | null | null | howtolens/simulators/chapter_4/mass_sie__source_sersic__2.py | rakaar/PyAutoLens | bc140c5d196c426092c1178b8abfa492c6fab859 | [
"MIT"
] | null | null | null | howtolens/simulators/chapter_4/mass_sie__source_sersic__2.py | rakaar/PyAutoLens | bc140c5d196c426092c1178b8abfa492c6fab859 | [
"MIT"
] | null | null | null | from os import path
import autolens as al
"""
This script simulates `Imaging` of a strong lens where:
- The lens `Galaxy`'s total mass distribution is a *SphericalIsothermal*.
- The source `Galaxy`'s `LightProfile` is a *SphericalExponential*.
This dataset is used in chapter 2, tutorials 1-3.
"""
"""
... | 39.070796 | 120 | 0.727973 | from os import path
import autolens as al
dataset_type = "chapter_4"
dataset_name = "mass_sie__source_sersic__2"
dataset_path = path.join("dataset", "howtolens", dataset_type, dataset_name)
grid = al.GridIterate.uniform(
shape_2d=(150, 150),
pixel_scales=0.05,
fractional_accuracy=0.9999,
... | true | true |
f721a452377d10ba2fe32cd315a6bdce392c234d | 594 | py | Python | hc/accounts/tests/test_team_access_middleware.py | andela/-healthchecks_spartans | 4dd6480fc178996c0e386548816ca8c74e4af50d | [
"BSD-3-Clause"
] | null | null | null | hc/accounts/tests/test_team_access_middleware.py | andela/-healthchecks_spartans | 4dd6480fc178996c0e386548816ca8c74e4af50d | [
"BSD-3-Clause"
] | null | null | null | hc/accounts/tests/test_team_access_middleware.py | andela/-healthchecks_spartans | 4dd6480fc178996c0e386548816ca8c74e4af50d | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth.models import User
from django.test import TestCase
from hc.accounts.models import Profile
class TeamAccessMiddlewareTestCase(TestCase):
def test_it_handles_missing_profile(self):
user = User(username="ned", email="ned@example.org")
user.set_password("password")
u... | 31.263158 | 74 | 0.695286 | from django.contrib.auth.models import User
from django.test import TestCase
from hc.accounts.models import Profile
class TeamAccessMiddlewareTestCase(TestCase):
def test_it_handles_missing_profile(self):
user = User(username="ned", email="ned@example.org")
user.set_password("password")
u... | true | true |
f721a4751de1cbbd852750a103606b9e45275fbe | 2,081 | py | Python | pysptools/skl/docstring.py | ctherien/pysptools | fbcd3ecaa7ab27f0158b28b4327537c3e75db160 | [
"Apache-2.0"
] | 35 | 2016-03-20T15:25:07.000Z | 2022-03-29T04:05:56.000Z | pysptools/skl/docstring.py | ctherien/pysptools | fbcd3ecaa7ab27f0158b28b4327537c3e75db160 | [
"Apache-2.0"
] | 12 | 2016-03-24T13:38:52.000Z | 2021-04-06T07:11:19.000Z | pysptools/skl/docstring.py | ctherien/pysptools | fbcd3ecaa7ab27f0158b28b4327537c3e75db160 | [
"Apache-2.0"
] | 14 | 2016-03-21T17:26:46.000Z | 2022-01-18T08:39:27.000Z | #
#------------------------------------------------------------------------------
# Copyright (c) 2013-2017, Christian Therien
#
# 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://ww... | 32.515625 | 79 | 0.566555 |
plot_fi_docstring = """
Plot the feature importances.
The output can be split in n graphs.
Parameters:
path: `string`
The path where to save the plot.
n_labels: `string or integer`
The number of labels to output by graph.... | true | true |
f721a4c6a5e4336c0f4cb7515b1636b493ef02d6 | 6,182 | py | Python | tools/pysa_integration_tests/utils.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | 1 | 2022-02-10T10:51:32.000Z | 2022-02-10T10:51:32.000Z | tools/pysa_integration_tests/utils.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | null | null | null | tools/pysa_integration_tests/utils.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import json
import logging
import subprocess
import sys
from pathlib import Path
from typing import fina... | 32.197917 | 88 | 0.651084 |
from __future__ import annotations
import json
import logging
import subprocess
import sys
from pathlib import Path
from typing import final, Sequence, Optional
LOG: logging.Logger = logging.getLogger(__name__)
@final
class PyreErrorException(Exception):
pass
def normalized_json_dump(
results: str, ... | true | true |
f721a628ef8e42f4b26f07888d6e70148b933809 | 4,668 | py | Python | homeassistant/components/velux/cover.py | orcema/core | ce144bf63145813c76fbbe4f9423341764695057 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/velux/cover.py | orcema/core | ce144bf63145813c76fbbe4f9423341764695057 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/velux/cover.py | orcema/core | ce144bf63145813c76fbbe4f9423341764695057 | [
"Apache-2.0"
] | null | null | null | """Support for Velux covers."""
from __future__ import annotations
from typing import Any
from pyvlx import OpeningDevice, Position
from pyvlx.opening_device import Awning, Blind, GarageDoor, Gate, RollerShutter, Window
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
Cover... | 35.097744 | 89 | 0.673522 | from __future__ import annotations
from typing import Any
from pyvlx import OpeningDevice, Position
from pyvlx.opening_device import Awning, Blind, GarageDoor, Gate, RollerShutter, Window
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
CoverDeviceClass,
CoverEntity,
... | true | true |
f721a6360f0511e109d096adce51015e18e66e23 | 5,135 | py | Python | Scripts/Slicer.py | rhong3/GBM | 088b1e99f4fe02395b62d324ec4f9e8402417651 | [
"MIT"
] | null | null | null | Scripts/Slicer.py | rhong3/GBM | 088b1e99f4fe02395b62d324ec4f9e8402417651 | [
"MIT"
] | null | null | null | Scripts/Slicer.py | rhong3/GBM | 088b1e99f4fe02395b62d324ec4f9e8402417651 | [
"MIT"
] | null | null | null | """
Tile real scn/svs files; used by Cutter.py
Created on 11/19/2018
*** Removed imlist storage to minimize memory usage 01/24/2019 ***
@author: RH
"""
from openslide import OpenSlide
import numpy as np
import pandas as pd
import multiprocessing as mp
import staintools
from PIL import Image
# check if a tile is ba... | 37.210145 | 120 | 0.63408 | from openslide import OpenSlide
import numpy as np
import pandas as pd
import multiprocessing as mp
import staintools
from PIL import Image
def bgcheck(img, ts):
the_imagea = np.array(img)[:, :, :3]
the_imagea = np.nan_to_num(the_imagea)
mask = (the_imagea[:, :, :3] > 200).astype(np.uint8)
maskb = (t... | true | true |
f721a64b1ed80dcb38fc20d3f17da57445b5b1a0 | 9,626 | py | Python | python/ht/ui/menus/parmmenu.py | Hengle/Houdini-Toolbox | a1fd7d3dd73d3fc4cea78e29aeff1d190c41bae3 | [
"MIT"
] | 136 | 2015-01-03T04:03:23.000Z | 2022-02-07T11:08:57.000Z | python/ht/ui/menus/parmmenu.py | Hengle/Houdini-Toolbox | a1fd7d3dd73d3fc4cea78e29aeff1d190c41bae3 | [
"MIT"
] | 11 | 2017-02-09T20:05:04.000Z | 2021-01-24T22:25:59.000Z | python/ht/ui/menus/parmmenu.py | Hengle/Houdini-Toolbox | a1fd7d3dd73d3fc4cea78e29aeff1d190c41bae3 | [
"MIT"
] | 26 | 2015-08-18T12:11:02.000Z | 2020-12-19T01:53:31.000Z | """This module contains functions supporting custom PARMmenu.xml entries."""
# =============================================================================
# IMPORTS
# =============================================================================
# Standard Library
from typing import Dict, List
# Houdini
import hou
... | 34.134752 | 88 | 0.601911 |
from typing import Dict, List
import hou
def _valid_to_convert_to_absolute_reference(parm: hou.Parm) -> bool:
parm_template = parm.parmTemplate()
if isinstance(parm_template, hou.StringParmTemplate):
if parm_template.stringType() == hou.stringParmType.NodeReference:
... | true | true |
f721a752d81135177ab54ecb6768ca98ba8ac9c6 | 6,793 | py | Python | controller/modules/Logger.py | avinashnatesan/Controllers | 85a005a87e61d50a3ada660e8d90739745e211af | [
"MIT"
] | null | null | null | controller/modules/Logger.py | avinashnatesan/Controllers | 85a005a87e61d50a3ada660e8d90739745e211af | [
"MIT"
] | null | null | null | controller/modules/Logger.py | avinashnatesan/Controllers | 85a005a87e61d50a3ada660e8d90739745e211af | [
"MIT"
] | null | null | null | # ipop-project
# Copyright 2016, University of Florida
#
# 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, m... | 45.590604 | 97 | 0.602532 |
import logging
import logging.handlers as lh
import os
from controller.framework.ControllerModule import ControllerModule
class Logger(ControllerModule):
def __init__(self, cfx_handle, module_config, module_name):
super(Logger, self).__init__(cfx_handle, module_config, module_name)
... | true | true |
f721aa11249df76d852759230ba85c6a027c2c3e | 3,271 | py | Python | libs/parse_ansible.py | realglobe-Inc/atom-autocomplete-ansible | 3752b7d893be35ca93a8e424c960e328c0d75bb9 | [
"MIT"
] | 32 | 2016-07-22T06:17:00.000Z | 2021-09-24T16:19:11.000Z | libs/parse_ansible.py | realglobe-Inc/atom-autocomplete-ansible | 3752b7d893be35ca93a8e424c960e328c0d75bb9 | [
"MIT"
] | 50 | 2016-06-28T09:36:00.000Z | 2022-03-18T13:03:18.000Z | libs/parse_ansible.py | realglobe-Inc/atom-autocomplete-ansible | 3752b7d893be35ca93a8e424c960e328c0d75bb9 | [
"MIT"
] | 22 | 2016-09-20T16:56:04.000Z | 2022-03-25T23:24:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import __main__
import json
import os
from ansible.cli.doc import DocCLI
from ansible.playbook import Play
from ansible.playbook.block import Block
from ansible.playbook.role import Role
from ansible.playbook.task im... | 32.068627 | 75 | 0.64812 |
from __future__ import print_function, unicode_literals
import __main__
import json
import os
from ansible.cli.doc import DocCLI
from ansible.playbook import Play
from ansible.playbook.block import Block
from ansible.playbook.role import Role
from ansible.playbook.task import Task
from ansible.utils.display import ... | true | true |
f721aa8af2cd7cf530a4b76cbb10ce9276f81044 | 5,616 | py | Python | espnet/asr/pytorch_backend/asr_recog.py | MarkWuNLP/StreamingTransformer | df9bfe348608b7e55ef1ff70464070c0055ea799 | [
"Apache-2.0"
] | null | null | null | espnet/asr/pytorch_backend/asr_recog.py | MarkWuNLP/StreamingTransformer | df9bfe348608b7e55ef1ff70464070c0055ea799 | [
"Apache-2.0"
] | null | null | null | espnet/asr/pytorch_backend/asr_recog.py | MarkWuNLP/StreamingTransformer | df9bfe348608b7e55ef1ff70464070c0055ea799 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Training/decoding definition for the speech recognition task."""
import json
import logging
import os
import numpy as np
import torch
from espnet.asr.a... | 34.036364 | 110 | 0.615028 |
import json
import logging
import os
import numpy as np
import torch
from espnet.asr.asr_utils import add_results_to_json, add_single_results
from espnet.asr.asr_utils import get_model_conf
from espnet.asr.asr_utils import torch_load
from espnet.asr.pytorch_backend.asr_init import load_trained_model
import esp... | true | true |
f721ab5c5621aefa332a1c1c49b2c98c1ff4fa57 | 2,408 | py | Python | pythonup/operations/common.py | uranusjr/pythonup-windows | af25844af1c5fdc8a90ae95435c8ce322e5e41e5 | [
"0BSD"
] | 22 | 2018-01-18T21:03:26.000Z | 2021-06-29T00:19:44.000Z | pythonup/operations/common.py | uranusjr/pythonup-windows | af25844af1c5fdc8a90ae95435c8ce322e5e41e5 | [
"0BSD"
] | 22 | 2018-02-22T17:08:50.000Z | 2021-11-07T09:20:18.000Z | pythonup/operations/common.py | uranusjr/pythonup-windows | af25844af1c5fdc8a90ae95435c8ce322e5e41e5 | [
"0BSD"
] | 2 | 2018-01-18T21:03:30.000Z | 2021-01-18T05:14:18.000Z | import functools
import click
from .. import configs, metadata, versions
def check_installation(version, *, installed=True, on_exit=None):
try:
installation = version.get_installation()
except FileNotFoundError:
if not installed: # Expected to be absent. Return None.
return Non... | 28 | 79 | 0.618355 | import functools
import click
from .. import configs, metadata, versions
def check_installation(version, *, installed=True, on_exit=None):
try:
installation = version.get_installation()
except FileNotFoundError:
if not installed:
return None
message = '{} is not instal... | true | true |
f721ab81cbd00ed051aca6942799ab865c6412c5 | 238 | py | Python | frappe/website/doctype/website_route_redirect/website_route_redirect.py | ssuda777/frappe | d3f3df2ce15154aecc1d9d6d07d947e72c2e8c6e | [
"MIT"
] | 1 | 2021-06-03T07:04:48.000Z | 2021-06-03T07:04:48.000Z | frappe/website/doctype/website_route_redirect/website_route_redirect.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 3 | 2021-02-27T11:50:14.000Z | 2021-05-03T06:48:49.000Z | frappe/website/doctype/website_route_redirect/website_route_redirect.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 2 | 2021-09-02T09:51:55.000Z | 2021-09-07T04:55:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class WebsiteRouteRedirect(Document):
pass
| 23.8 | 58 | 0.768908 |
from frappe.model.document import Document
class WebsiteRouteRedirect(Document):
pass
| true | true |
f721abc28aeee16569cf14634251ef073a83b8f1 | 2,289 | py | Python | core/models.py | mackay/ble_detector | 4d7c3e9edd7bbeeea0bd0bebce43c1bb9d02ee41 | [
"MIT"
] | null | null | null | core/models.py | mackay/ble_detector | 4d7c3e9edd7bbeeea0bd0bebce43c1bb9d02ee41 | [
"MIT"
] | null | null | null | core/models.py | mackay/ble_detector | 4d7c3e9edd7bbeeea0bd0bebce43c1bb9d02ee41 | [
"MIT"
] | null | null | null | from peewee import *
import json
from datetime import datetime
#set sane default log levels
import logging
logging.getLogger('peewee').setLevel(logging.INFO)
logging.getLogger("peewee.pool").setLevel(logging.DEBUG)
database = SqliteDatabase('detector.db')
class JSONField(TextField):
def db_value(self, value):
... | 24.094737 | 74 | 0.70118 | from peewee import *
import json
from datetime import datetime
import logging
logging.getLogger('peewee').setLevel(logging.INFO)
logging.getLogger("peewee.pool").setLevel(logging.DEBUG)
database = SqliteDatabase('detector.db')
class JSONField(TextField):
def db_value(self, value):
if value is not None... | true | true |
f721ae2772712944094b9c2e009ee6bae9dce86c | 827 | py | Python | app/main/models/EMI.py | pOrgz-dev/financial-api | edf849cfbcedf74a8b81f70683a1edfbea172fb7 | [
"MIT"
] | null | null | null | app/main/models/EMI.py | pOrgz-dev/financial-api | edf849cfbcedf74a8b81f70683a1edfbea172fb7 | [
"MIT"
] | null | null | null | app/main/models/EMI.py | pOrgz-dev/financial-api | edf849cfbcedf74a8b81f70683a1edfbea172fb7 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from .. import db
class EMI_Information(db.Model):
__tablename__ = "EMI_Information"
EMI_Identifier = db.Column(db.String(45),primary_key = True, nullable = False)
ItemName = db.Column(db.String(45), nullable = False)
ProductPrice = db.Column(db.Float, nullable = False)
... | 41.35 | 128 | 0.666264 |
from .. import db
class EMI_Information(db.Model):
__tablename__ = "EMI_Information"
EMI_Identifier = db.Column(db.String(45),primary_key = True, nullable = False)
ItemName = db.Column(db.String(45), nullable = False)
ProductPrice = db.Column(db.Float, nullable = False)
InterestRate = db.Colu... | true | true |
f721aeecd78fde51b1f23b627ac73ea974b16e4f | 5,118 | py | Python | draw_tracking_line.py | jiyauppal/face-mask-detector.github.io | 210ce81fa37c441a076fbb8db28376268e634412 | [
"Apache-2.0"
] | 1 | 2021-05-13T07:54:08.000Z | 2021-05-13T07:54:08.000Z | draw_tracking_line.py | jiyauppal/face-mask-detector.github.io | 210ce81fa37c441a076fbb8db28376268e634412 | [
"Apache-2.0"
] | null | null | null | draw_tracking_line.py | jiyauppal/face-mask-detector.github.io | 210ce81fa37c441a076fbb8db28376268e634412 | [
"Apache-2.0"
] | null | null | null | import cv2
import datetime
import imutils
import numpy as np
from centroidtracker import CentroidTracker
from collections import defaultdict
protopath = "MobileNetSSD_deploy.prototxt"
modelpath = "MobileNetSSD_deploy.caffemodel"
detector = cv2.dnn.readNetFromCaffe(prototxt=protopath, caffeModel=modelpath)
... | 33.45098 | 106 | 0.524424 | import cv2
import datetime
import imutils
import numpy as np
from centroidtracker import CentroidTracker
from collections import defaultdict
protopath = "MobileNetSSD_deploy.prototxt"
modelpath = "MobileNetSSD_deploy.caffemodel"
detector = cv2.dnn.readNetFromCaffe(prototxt=protopath, caffeModel=modelpath)
... | true | true |
f721aef7525b920408840cd454d2a33a4df2714c | 1,953 | py | Python | setup.py | PyXRD/pyxrd | 26bacdf64f3153fa74b8caa62e219b76d91a55c1 | [
"BSD-2-Clause"
] | 27 | 2018-06-15T15:28:18.000Z | 2022-03-10T12:23:50.000Z | setup.py | PyXRD/pyxrd | 26bacdf64f3153fa74b8caa62e219b76d91a55c1 | [
"BSD-2-Clause"
] | 22 | 2018-06-14T08:29:16.000Z | 2021-07-05T13:33:44.000Z | setup.py | PyXRD/pyxrd | 26bacdf64f3153fa74b8caa62e219b76d91a55c1 | [
"BSD-2-Clause"
] | 8 | 2019-04-13T13:03:51.000Z | 2021-06-19T09:29:11.000Z | #!/usr/bin/env python3
import os
from setuptools import setup, find_packages
def get_version():
from pyxrd.__version import __version__
if __version__.startswith("v"):
__version__ = __version__.replace("v", "")
return "%s" % __version__
def get_install_requires():
return [
'setuptools... | 31.5 | 154 | 0.622632 |
import os
from setuptools import setup, find_packages
def get_version():
from pyxrd.__version import __version__
if __version__.startswith("v"):
__version__ = __version__.replace("v", "")
return "%s" % __version__
def get_install_requires():
return [
'setuptools',
'numpy>=1.1... | true | true |
f721afa5606a9e63a7128757986d8b2a4eb9a224 | 2,755 | py | Python | scripts/py_scripts/calculate_cluster_average.py | Elenadisa/PhenCo | f320fc286b90ec566afb5edfe3d6d1e3dcc28497 | [
"MIT"
] | 3 | 2020-12-12T03:17:13.000Z | 2021-02-21T01:43:29.000Z | scripts/py_scripts/calculate_cluster_average.py | Elenadisa/PhenCo | f320fc286b90ec566afb5edfe3d6d1e3dcc28497 | [
"MIT"
] | 5 | 2021-02-03T04:15:03.000Z | 2021-03-17T07:29:14.000Z | scripts/py_scripts/calculate_cluster_average.py | Elenadisa/PhenCo | f320fc286b90ec566afb5edfe3d6d1e3dcc28497 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
##############################################################################################################################################
# METHODS
##################################################################################################################################... | 50.090909 | 154 | 0.450091 | true | true | |
f721b00012139ce758efe463a3d3ca112283819e | 1,375 | py | Python | docs/development/custom-vectors/secp256k1/verify_secp256k1.py | dvaerum/cryptography | 63dfc57fca688d0f8d0515001f249c317d5e54dc | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2015-01-29T19:16:40.000Z | 2021-01-08T05:55:03.000Z | docs/development/custom-vectors/secp256k1/verify_secp256k1.py | dvaerum/cryptography | 63dfc57fca688d0f8d0515001f249c317d5e54dc | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 12 | 2021-01-05T06:46:37.000Z | 2022-03-30T19:06:26.000Z | docs/development/custom-vectors/secp256k1/verify_secp256k1.py | dvaerum/cryptography | 63dfc57fca688d0f8d0515001f249c317d5e54dc | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2015-11-06T01:47:01.000Z | 2021-12-01T00:22:52.000Z | from __future__ import absolute_import, print_function
import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.asymmetric.utils import (
encode_dss_signature,
)... | 25.943396 | 79 | 0.744 | from __future__ import absolute_import, print_function
import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.asymmetric.utils import (
encode_dss_signature,
)... | true | true |
f721b0aaa3a21ebd95d28ba898211ca8c479b10e | 4,747 | py | Python | mlprodict/onnx_tools/optim/onnx_optimisation_identity.py | henrywu2019/mlprodict | 4c09dc39d5ba7a7235fa321d80c81b5bf4f078ad | [
"MIT"
] | null | null | null | mlprodict/onnx_tools/optim/onnx_optimisation_identity.py | henrywu2019/mlprodict | 4c09dc39d5ba7a7235fa321d80c81b5bf4f078ad | [
"MIT"
] | null | null | null | mlprodict/onnx_tools/optim/onnx_optimisation_identity.py | henrywu2019/mlprodict | 4c09dc39d5ba7a7235fa321d80c81b5bf4f078ad | [
"MIT"
] | null | null | null | """
@file
@brief Optimisation of :epkg:`ONNX` graphs.
"""
from onnx.helper import make_graph
from ._onnx_optimisation_common import ( # pylint: disable=E0611
_rename_node_input,
_rename_node_output,
_apply_optimisation_on_graph,
_apply_remove_node_fct_node
)
def onnx_remove_node_identity... | 39.231405 | 87 | 0.52391 | from onnx.helper import make_graph
from ._onnx_optimisation_common import (
_rename_node_input,
_rename_node_output,
_apply_optimisation_on_graph,
_apply_remove_node_fct_node
)
def onnx_remove_node_identity(onnx_model, recursive=True, debug_info=None, **options):
if debug_info is None:
... | true | true |
f721b154eb6f80cea86ed321cc3199bcce85024f | 300 | py | Python | 01-code-scripts/example.py | calekochenour/python-formatter-env | 9cc0b484e9b8b8d17a8abe5d2f9f49af953a7790 | [
"BSD-3-Clause"
] | null | null | null | 01-code-scripts/example.py | calekochenour/python-formatter-env | 9cc0b484e9b8b8d17a8abe5d2f9f49af953a7790 | [
"BSD-3-Clause"
] | null | null | null | 01-code-scripts/example.py | calekochenour/python-formatter-env | 9cc0b484e9b8b8d17a8abe5d2f9f49af953a7790 | [
"BSD-3-Clause"
] | null | null | null | def example_function(first_parameter, second_parameter, third_parameter, fourth_parameter, fifth_parameter):
"""Example function to test the code formatter."""
parameter_sum = first_parameter + second_parameter + third_parameter + fourth_parameter + fifth_parameter
return parameter_sum
| 50 | 109 | 0.806667 | def example_function(first_parameter, second_parameter, third_parameter, fourth_parameter, fifth_parameter):
parameter_sum = first_parameter + second_parameter + third_parameter + fourth_parameter + fifth_parameter
return parameter_sum
| true | true |
f721b168bc3ebd2c6a8be74cae0fb14973d58fc0 | 4,618 | py | Python | examples/orcid_app.py | jennur/invenio-oauthclient | 9b8bd7bc8bcbbe178aad3f0f8a2e620749c9980b | [
"MIT"
] | 3 | 2015-08-19T12:50:05.000Z | 2017-10-25T00:58:05.000Z | examples/orcid_app.py | jennur/invenio-oauthclient | 9b8bd7bc8bcbbe178aad3f0f8a2e620749c9980b | [
"MIT"
] | 169 | 2015-08-03T11:25:49.000Z | 2022-02-10T08:06:20.000Z | examples/orcid_app.py | jennur/invenio-oauthclient | 9b8bd7bc8bcbbe178aad3f0f8a2e620749c9980b | [
"MIT"
] | 73 | 2015-08-03T15:16:05.000Z | 2022-03-07T15:34:36.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
r"""Minimal Flask application example for development with orcid handler.
SPHINX-STA... | 28.8625 | 80 | 0.750325 |
import os
from flask import Flask, redirect, url_for
from flask_babelex import Babel
from flask_login import current_user
from flask_menu import Menu as FlaskMenu
from invenio_accounts import InvenioAccounts
from invenio_accounts.views import blueprint as blueprint_user
from invenio_db import InvenioDB
from i... | true | true |
f721b1ff207ea23d5cdd699f29d320911240c621 | 743 | py | Python | notes/migrations/0001_initial.py | chalikavanyaa/stu-do-list | b6af2f1072936240a59f1b63cc7fc32999132da4 | [
"Unlicense"
] | 2 | 2021-12-02T07:15:24.000Z | 2021-12-15T06:27:53.000Z | notes/migrations/0001_initial.py | chalikavanyaa/stu-do-list | b6af2f1072936240a59f1b63cc7fc32999132da4 | [
"Unlicense"
] | 1 | 2021-11-05T12:42:12.000Z | 2021-11-05T12:42:12.000Z | notes/migrations/0001_initial.py | chalikavanyaa/stu-do-list | b6af2f1072936240a59f1b63cc7fc32999132da4 | [
"Unlicense"
] | 6 | 2021-10-30T13:44:16.000Z | 2021-12-29T09:14:18.000Z | # Generated by Django 3.2.7 on 2021-11-04 20:13
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NotesModel',
fields=[
('id'... | 27.518519 | 118 | 0.537012 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NotesModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary... | true | true |
f721b33e8da5aa1935c59645b23cb35201dfccdd | 340 | py | Python | Hackerrank/swap-case.py | sourav1122/Hacktoberfest | 3e3a6e1a537632b1f2b7af3b3b69c8696355047c | [
"MIT"
] | 1 | 2019-10-13T13:43:18.000Z | 2019-10-13T13:43:18.000Z | Hackerrank/swap-case.py | sourav1122/Hacktoberfest | 3e3a6e1a537632b1f2b7af3b3b69c8696355047c | [
"MIT"
] | null | null | null | Hackerrank/swap-case.py | sourav1122/Hacktoberfest | 3e3a6e1a537632b1f2b7af3b3b69c8696355047c | [
"MIT"
] | null | null | null | #!/bin/python3
# Swaps case of all chars in provided string
def swap_case(s):
formattedStr = "".join(map(swapChar, s))
return formattedStr
def swapChar(char):
if char.islower():
return char.upper()
else:
return char.lower()
n=input()
if len(n)==1:
print(swapChar(n))
else:
... | 17.894737 | 44 | 0.623529 |
def swap_case(s):
formattedStr = "".join(map(swapChar, s))
return formattedStr
def swapChar(char):
if char.islower():
return char.upper()
else:
return char.lower()
n=input()
if len(n)==1:
print(swapChar(n))
else:
print(swap_case(n))
| true | true |
f721b3f846fa3924e1f8ff5e8b545d82d1f3e494 | 205 | py | Python | 1072.py | FahimFBA/URI-Problem-Solve | d718a95e5a873dffbce19d850998e8917ec87ebb | [
"Apache-2.0"
] | 3 | 2020-11-25T19:05:31.000Z | 2021-03-29T07:29:36.000Z | 1072.py | FahimFBA/URI-Problem-Solve | d718a95e5a873dffbce19d850998e8917ec87ebb | [
"Apache-2.0"
] | null | null | null | 1072.py | FahimFBA/URI-Problem-Solve | d718a95e5a873dffbce19d850998e8917ec87ebb | [
"Apache-2.0"
] | null | null | null | qte = int(input())
sim = 0
nao = 0
for i in range(qte):
valor = int(input())
if(valor >= 10 and valor <= 20):
sim += 1
else:
nao += 1
print("%d in" %sim)
print("%d out" %nao) | 14.642857 | 36 | 0.487805 | qte = int(input())
sim = 0
nao = 0
for i in range(qte):
valor = int(input())
if(valor >= 10 and valor <= 20):
sim += 1
else:
nao += 1
print("%d in" %sim)
print("%d out" %nao) | true | true |
f721b4abc95f52800b933cdfce1558f764e48a65 | 1,087 | py | Python | utils/fonts_scanner.py | sunnywalden/oss_management | 4d417801ba0c55493788b356921c4e3ea462a851 | [
"Apache-2.0"
] | null | null | null | utils/fonts_scanner.py | sunnywalden/oss_management | 4d417801ba0c55493788b356921c4e3ea462a851 | [
"Apache-2.0"
] | null | null | null | utils/fonts_scanner.py | sunnywalden/oss_management | 4d417801ba0c55493788b356921c4e3ea462a851 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: sunnywalden@gmail.com
import os
from utils.get_logger import Log
def get_fonts_from_local():
log = Log()
logger = log.logger_generate('font_scanner')
# fonts_lists = []
for root, dirs, files in os.walk('../fonts'):
logger.info('File foun... | 29.378378 | 90 | 0.601656 |
import os
from utils.get_logger import Log
def get_fonts_from_local():
log = Log()
logger = log.logger_generate('font_scanner')
for root, dirs, files in os.walk('../fonts'):
logger.info('File found %s, dirs: %s' % (files, dirs))
for file in files:
logger.info('File fo... | true | true |
f721b4f5eb357708bf5747da4008cd53e3881f89 | 1,359 | py | Python | pyblas/level1/scnrm2.py | timleslie/pyblas | 9109f2cc24e674cf59a3b39f95c2d7b8116ae884 | [
"BSD-3-Clause"
] | null | null | null | pyblas/level1/scnrm2.py | timleslie/pyblas | 9109f2cc24e674cf59a3b39f95c2d7b8116ae884 | [
"BSD-3-Clause"
] | 1 | 2020-10-10T23:23:06.000Z | 2020-10-10T23:23:06.000Z | pyblas/level1/scnrm2.py | timleslie/pyblas | 9109f2cc24e674cf59a3b39f95c2d7b8116ae884 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from ..util import slice_
def scnrm2(N, X, INCX):
"""Computes the Euclidean norm of the vector x
Parameters
----------
N : int
Number of elements in input vector
X : numpy.ndarray
A single precision complex array, dimension (1 + (`N` - 1)*abs(`INCX`))
INCX :... | 29.543478 | 113 | 0.636497 | import numpy as np
from ..util import slice_
def scnrm2(N, X, INCX):
if N <= 0:
return 0
return np.sqrt((X[slice_(N, INCX)].conj() * X[slice_(N, INCX)]).sum().real)
| true | true |
f721b541788468f6224ba9b4f3e9d2a8b01d2637 | 3,999 | py | Python | tests/manage/monitoring/prometheus/test_deployment_status.py | shivamdurgbuns/ocs-ci | 0fa3a19cab39dcc76843338e4af357c197c08843 | [
"MIT"
] | null | null | null | tests/manage/monitoring/prometheus/test_deployment_status.py | shivamdurgbuns/ocs-ci | 0fa3a19cab39dcc76843338e4af357c197c08843 | [
"MIT"
] | null | null | null | tests/manage/monitoring/prometheus/test_deployment_status.py | shivamdurgbuns/ocs-ci | 0fa3a19cab39dcc76843338e4af357c197c08843 | [
"MIT"
] | null | null | null | import logging
import pytest
from ocs_ci.framework.testlib import tier4, tier4a
from ocs_ci.ocs import constants
from ocs_ci.utility import prometheus
from ocs_ci.ocs.ocp import OCP
log = logging.getLogger(__name__)
@tier4
@tier4a
@pytest.mark.polarion_id("OCS-1052")
def test_ceph_manager_stopped(measure_stop_ceph... | 29.189781 | 82 | 0.632908 | import logging
import pytest
from ocs_ci.framework.testlib import tier4, tier4a
from ocs_ci.ocs import constants
from ocs_ci.utility import prometheus
from ocs_ci.ocs.ocp import OCP
log = logging.getLogger(__name__)
@tier4
@tier4a
@pytest.mark.polarion_id("OCS-1052")
def test_ceph_manager_stopped(measure_stop_ceph... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.