hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b7286793431599e58da81b53c698ba6999fd3f4e | 1,630 | py | Python | day02/ex04/ai42/logging/log.py | d-r-e/Machine-Learning-Bootcamp | 618cad97c04d15fec6e8a371c526ad8e08cae35a | [
"MIT"
] | null | null | null | day02/ex04/ai42/logging/log.py | d-r-e/Machine-Learning-Bootcamp | 618cad97c04d15fec6e8a371c526ad8e08cae35a | [
"MIT"
] | 6 | 2021-05-25T08:51:39.000Z | 2021-05-25T08:51:40.000Z | day02/ex04/ai42/logging/log.py | d-r-e/Python-Bootcamp-42AI | 618cad97c04d15fec6e8a371c526ad8e08cae35a | [
"MIT"
] | null | null | null | # **************************************************************************** #
# #
# ::: :::::::: #
# logger.py :+: :+: :+... | 41.794872 | 81 | 0.282209 | 0 | 0 | 0 | 0 | 589 | 0.36135 | 0 | 0 | 964 | 0.591411 |
b72a583373d3c6cb8d5d4af07ff2faff1162f56a | 2,550 | py | Python | examples/avatar_example.py | ZSD-tim/dayu_widgets | 31c2530bdc4161d9311574d9850c2e9471e53072 | [
"MIT"
] | 157 | 2019-03-10T05:55:21.000Z | 2022-03-31T09:07:00.000Z | examples/avatar_example.py | kanbang/dayu_widgets | 6ff101e6c6f8fcf10e5cb578023a12ccdcef9164 | [
"MIT"
] | 16 | 2019-07-15T11:30:53.000Z | 2021-12-16T14:17:59.000Z | examples/avatar_example.py | kanbang/dayu_widgets | 6ff101e6c6f8fcf10e5cb578023a12ccdcef9164 | [
"MIT"
] | 56 | 2019-06-19T03:35:27.000Z | 2022-03-22T08:07:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: Mu yanru
# Date : 2019.2
# Email : [email protected]
###################################################################
from dayu_widgets.avatar import MAvatar
from dayu_widgets.divider import... | 34.931507 | 87 | 0.59098 | 1,738 | 0.681569 | 0 | 0 | 0 | 0 | 0 | 0 | 496 | 0.19451 |
b72c5b0b453dbcbfe1f73085f19a64855959a7ec | 1,254 | py | Python | ch9/note9.4.py | YChanHuang/Python-for-every-body-notes | 771db11ceb00341b533b4b1bf5235fb988978f65 | [
"MIT"
] | null | null | null | ch9/note9.4.py | YChanHuang/Python-for-every-body-notes | 771db11ceb00341b533b4b1bf5235fb988978f65 | [
"MIT"
] | null | null | null | ch9/note9.4.py | YChanHuang/Python-for-every-body-notes | 771db11ceb00341b533b4b1bf5235fb988978f65 | [
"MIT"
] | null | null | null | #Assignment 9.4
#print('Hello World')
fname = input('Enter name: ')
if len(fname) < 1 : fname = 'mbox-short.txt'
handle = open(fname)
di = {} #create an empty dictionary
for line in handle:
line = line.rstrip()
wds = line.split()
#the second for-loop to print each word in the list
for w in wds :
... | 29.857143 | 83 | 0.585327 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 762 | 0.607656 |
b72cde7853e529893263c2d30f32b8dad4c30116 | 7,467 | py | Python | ava/common/check.py | indeedsecurity/ava-ce | 4483b301034a096b716646a470a6642b3df8ce61 | [
"Apache-2.0"
] | 2 | 2019-03-26T15:37:48.000Z | 2020-01-03T03:47:30.000Z | ava/common/check.py | indeedsecurity/ava-ce | 4483b301034a096b716646a470a6642b3df8ce61 | [
"Apache-2.0"
] | 2 | 2021-03-25T21:27:09.000Z | 2021-06-01T21:20:04.000Z | ava/common/check.py | indeedsecurity/ava-ce | 4483b301034a096b716646a470a6642b3df8ce61 | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
from difflib import SequenceMatcher
class _Check:
"""
Parent check class. All other checks should be a subclass of this class.
"""
key = "check"
name = "Check"
description = "Parent check"
class _BlindCheck(_Check):
"""
These checks identify issues in in... | 34.892523 | 117 | 0.656489 | 7,380 | 0.988349 | 0 | 0 | 0 | 0 | 0 | 0 | 4,441 | 0.59475 |
b72dfc9dbad5e8ddb1f77fb1efb1c89913e0c025 | 2,863 | py | Python | backend/translator/admin.py | Gobaan/menu-translator-django | db2a922dce844cd60a66b0325d4c074696126ca4 | [
"MIT"
] | null | null | null | backend/translator/admin.py | Gobaan/menu-translator-django | db2a922dce844cd60a66b0325d4c074696126ca4 | [
"MIT"
] | 4 | 2020-06-05T23:09:23.000Z | 2021-06-10T18:51:26.000Z | backend/translator/admin.py | Gobaan/menu-translator-django | db2a922dce844cd60a66b0325d4c074696126ca4 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django import forms
from .models import Annotation, Clip, Food, Image, Language, Website, UserProfile
class AnnotationAdminForm(forms.ModelForm):
class Meta:
model = Annotation
fields = '__all__'
class AnnotationAdmin(admin.ModelAdmin):
form = Annotation... | 26.027273 | 126 | 0.689487 | 2,372 | 0.828502 | 0 | 0 | 0 | 0 | 0 | 0 | 779 | 0.272092 |
b72e4a239b1f333096c89a02d6bb509de560e64e | 252 | py | Python | colibris/docs/openapi/__init__.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 6 | 2019-06-22T19:36:10.000Z | 2021-11-16T08:07:21.000Z | colibris/docs/openapi/__init__.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 34 | 2019-07-07T18:01:41.000Z | 2020-11-01T16:14:58.000Z | colibris/docs/openapi/__init__.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 2 | 2020-09-01T13:07:17.000Z | 2021-07-29T12:16:29.000Z | from os.path import abspath, join, dirname
from colibris.conf import settings
STATIC_PATH = abspath(join(dirname(__file__), 'swagger'))
UI_URL = settings.API_DOCS_URL
STATIC_URL = '{}/static'.format(UI_URL)
APISPEC_URL = '{}/apispec'.format(UI_URL)
| 25.2 | 57 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 0.126984 |
b72e8bfc6d83afc48f73ce1ff4c1bc304fbf13db | 145 | py | Python | arc/__init__.py | jtguibas/arc | e9df473ce5051f2b9f3981ef219b6a02076bdb42 | [
"MIT"
] | 6 | 2020-06-06T03:29:52.000Z | 2022-03-05T08:28:30.000Z | arc/__init__.py | jtguibas/arc | e9df473ce5051f2b9f3981ef219b6a02076bdb42 | [
"MIT"
] | null | null | null | arc/__init__.py | jtguibas/arc | e9df473ce5051f2b9f3981ef219b6a02076bdb42 | [
"MIT"
] | 5 | 2020-08-02T05:07:33.000Z | 2022-02-03T17:46:55.000Z | #!/usr/bin/env python
from arc import models
from arc import methods
from arc import black_boxes
from arc import others
from arc import coverage
| 20.714286 | 27 | 0.813793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 0.144828 |
b72ea37d9a980314ac78bb261e8ab6314ebd4e84 | 961 | py | Python | qcloudsdkbatch/TerminateTaskInstanceRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkbatch/TerminateTaskInstanceRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkbatch/TerminateTaskInstanceRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class TerminateTaskInstanceRequest(Request):
def __init__(self):
super(TerminateTaskInstanceRequest, self).__init__(
'batch', 'qcloudcliV1', 'TerminateTaskInstance', 'batch.api.qcloud.com')
def get_JobId(self):
ret... | 28.264706 | 84 | 0.681582 | 892 | 0.9282 | 0 | 0 | 0 | 0 | 0 | 0 | 178 | 0.185224 |
b72f78f385c7b5879e4c81e4664cd6e4111978d3 | 329 | py | Python | altair/vegalite/v2/examples/step_chart.py | hydrosquall/altair | ded897b0967a88a467828b1e2c133bd92862de23 | [
"BSD-3-Clause"
] | null | null | null | altair/vegalite/v2/examples/step_chart.py | hydrosquall/altair | ded897b0967a88a467828b1e2c133bd92862de23 | [
"BSD-3-Clause"
] | null | null | null | altair/vegalite/v2/examples/step_chart.py | hydrosquall/altair | ded897b0967a88a467828b1e2c133bd92862de23 | [
"BSD-3-Clause"
] | null | null | null | """
Step Chart
-----------------
This example shows Google's stock price over time.
"""
import altair as alt
from vega_datasets import data
source = data.stocks()
chart = alt.Chart(source).mark_line(interpolate = 'step-after').encode(
x = 'date',
y = 'price'
)
chart.transform = [{"filter": "datum.symbol==='... | 18.277778 | 71 | 0.638298 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 143 | 0.43465 |
b72fded642f589b2e698b4de11aaec30fbbd5f3f | 5,429 | py | Python | graphit/graph_networkx.py | py-graphit/py-graphit | 533ef47e279fc07d9a88f86cc9d19f09d56176f9 | [
"Apache-2.0"
] | 1 | 2018-12-02T18:56:34.000Z | 2018-12-02T18:56:34.000Z | graphit/graph_networkx.py | py-graphit/py-graphit | 533ef47e279fc07d9a88f86cc9d19f09d56176f9 | [
"Apache-2.0"
] | null | null | null | graphit/graph_networkx.py | py-graphit/py-graphit | 533ef47e279fc07d9a88f86cc9d19f09d56176f9 | [
"Apache-2.0"
] | 1 | 2018-12-02T15:29:41.000Z | 2018-12-02T15:29:41.000Z | # -*- coding: utf-8 -*-
"""
file: graph_networkx.py
Provides a NetworkX compliant Graph class.
"""
from graphit.graph import GraphBase
from graphit.graph_exceptions import GraphitException, GraphitNodeNotFound
from graphit.graph_algorithms import degree, size
from graphit.graph_utils.graph_utilities import graph_und... | 25.729858 | 118 | 0.596611 | 5,044 | 0.929085 | 235 | 0.043286 | 138 | 0.025419 | 0 | 0 | 1,773 | 0.326579 |
b72ff8b09a0b3b3377f4450ff20722334a0f1163 | 260 | py | Python | Chapter02/Shuffle.py | Tanishadel/Mastering-Machine-Learning-for-Penetration-Testing | 5aecc2603faaa97dafc1fa4c86f4e5f530bb4877 | [
"MIT"
] | 241 | 2018-06-14T15:58:34.000Z | 2022-03-27T08:47:40.000Z | Chapter02/Shuffle.py | Tanishadel/Mastering-Machine-Learning-for-Penetration-Testing | 5aecc2603faaa97dafc1fa4c86f4e5f530bb4877 | [
"MIT"
] | 5 | 2018-11-05T20:40:58.000Z | 2021-09-17T12:35:42.000Z | Chapter02/Shuffle.py | Tanishadel/Mastering-Machine-Learning-for-Penetration-Testing | 5aecc2603faaa97dafc1fa4c86f4e5f530bb4877 | [
"MIT"
] | 144 | 2018-06-21T12:50:25.000Z | 2022-03-21T13:47:51.000Z | import os
import random
#initiate a list called emails_list
emails_list = []
Directory = '/home/azureuser/spam_filter/enron1/emails/'
Dir_list = os.listdir(Directory)
for file in Dir_list:
f = open(Directory + file, 'r')
emails_list.append(f.read())
f.close()
| 23.636364 | 56 | 0.753846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 0.315385 |
b73291a3b8e47fc42f8a646649597c72205d287e | 1,135 | py | Python | computer vision/pose_module.py | Francois-Adham/OpenCV | ccbace109086d3f4fcccc1bd9261ac336cfc49ef | [
"MIT"
] | null | null | null | computer vision/pose_module.py | Francois-Adham/OpenCV | ccbace109086d3f4fcccc1bd9261ac336cfc49ef | [
"MIT"
] | null | null | null | computer vision/pose_module.py | Francois-Adham/OpenCV | ccbace109086d3f4fcccc1bd9261ac336cfc49ef | [
"MIT"
] | null | null | null | import cv2 as cv
import mediapipe as mp
class PoseDetector:
def __init__(self, mode=False, complexity=1, smooth=False, confidence=0.5, tracking_confidence=0.5) -> None:
self.mode = mode
self.complexity = complexity
self.smooth = smooth
self.confidence = confidence
s... | 33.382353 | 121 | 0.661674 | 846 | 0.745374 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.014978 |
b732eb90f353db0b4fec7fc27c2742a5319bf251 | 3,012 | py | Python | Irene/base.py | mghasemi/Irene | 2ecf58329310a0e98d1e28d4853ddb49f0a23311 | [
"MIT"
] | 12 | 2018-10-25T19:59:22.000Z | 2022-03-08T03:27:29.000Z | Irene/base.py | mghasemi/Irene | 2ecf58329310a0e98d1e28d4853ddb49f0a23311 | [
"MIT"
] | 1 | 2022-03-08T03:27:36.000Z | 2022-03-08T05:42:26.000Z | Irene/base.py | mghasemi/Irene | 2ecf58329310a0e98d1e28d4853ddb49f0a23311 | [
"MIT"
] | null | null | null | r"""
This is the base module for all other objects of the package.
+ `LaTeX` returns a LaTeX string out of an `Irene` object.
+ `base` is the parent of all `Irene` objects.
"""
def LaTeX(obj):
r"""
Returns LaTeX representation of Irene's objects.
"""
from sympy.core.core import all_classes
... | 30.734694 | 98 | 0.534197 | 2,382 | 0.790837 | 0 | 0 | 0 | 0 | 0 | 0 | 809 | 0.268592 |
b733a705c894e170baefe76d8fe393fd92a6fb35 | 4,346 | py | Python | demo/corenlp.py | Rvlis/stanza | 58237519740b27b83c00c6c23d53ba434132dcca | [
"Apache-2.0"
] | null | null | null | demo/corenlp.py | Rvlis/stanza | 58237519740b27b83c00c6c23d53ba434132dcca | [
"Apache-2.0"
] | null | null | null | demo/corenlp.py | Rvlis/stanza | 58237519740b27b83c00c6c23d53ba434132dcca | [
"Apache-2.0"
] | null | null | null | from stanza.server import CoreNLPClient
import os
# example text
print('---')
print('input text')
print('')
# text = "Chris Manning is a nice person. Chris wrote a simple sentence. He also gives oranges to people."
text = "PyTables is built on top of the HDF5 library, using the Python language and the NumPy package.... | 35.048387 | 155 | 0.645651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,137 | 0.721813 |
b7340fcc54385aec310fcaab55c9c4530b0dc98a | 1,617 | py | Python | basic/fasta.py | JinyuanSun/my_bio_script | ceb84e2e32c38b0889956f12c380354d23b28dc1 | [
"MIT"
] | null | null | null | basic/fasta.py | JinyuanSun/my_bio_script | ceb84e2e32c38b0889956f12c380354d23b28dc1 | [
"MIT"
] | null | null | null | basic/fasta.py | JinyuanSun/my_bio_script | ceb84e2e32c38b0889956f12c380354d23b28dc1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# By Jinyuan Sun
def fasta2dic(fastafilename): #read a fasta file into a dict
fasta_dict = {}
with open(fastafilename) as fastafile:
for line in fastafile:
if line[0] == ">":
head = line.strip()
fasta_dict[head] = ''
else:
... | 25.666667 | 82 | 0.568336 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 248 | 0.15337 |
b73487d3a2f5ed600768a510984d20ecb9e2c8c6 | 10,248 | py | Python | tea_client/http.py | alefnula/tea-client | 976416fe00ed075394064c86c42665dcda341c17 | [
"Apache-2.0"
] | 1 | 2020-12-22T16:06:09.000Z | 2020-12-22T16:06:09.000Z | tea_client/http.py | alefnula/tea-client | 976416fe00ed075394064c86c42665dcda341c17 | [
"Apache-2.0"
] | null | null | null | tea_client/http.py | alefnula/tea-client | 976416fe00ed075394064c86c42665dcda341c17 | [
"Apache-2.0"
] | null | null | null | import enum
from typing import Optional, Dict
import httpx
from tea import serde
from tea_client import errors
from tea_client.models import TeaClientModel
class AuthorizationMethod(enum.Enum):
basic = "Basic"
token = "Token"
jwt = "JWT"
class HttpClient:
"""Generic requests handler.
Handles ... | 32.741214 | 79 | 0.518443 | 10,084 | 0.983997 | 0 | 0 | 0 | 0 | 0 | 0 | 3,867 | 0.377342 |
b734d2e12cf5fc6c54fb0dd62f0ce018d2ee9551 | 3,809 | py | Python | PRPConnector/TestPRPConnector.py | manuelbieri/PRP-APIConnect | 78c4772dce22686da82cdd27e246724edd5bcf0a | [
"MIT"
] | null | null | null | PRPConnector/TestPRPConnector.py | manuelbieri/PRP-APIConnect | 78c4772dce22686da82cdd27e246724edd5bcf0a | [
"MIT"
] | null | null | null | PRPConnector/TestPRPConnector.py | manuelbieri/PRP-APIConnect | 78c4772dce22686da82cdd27e246724edd5bcf0a | [
"MIT"
] | null | null | null | import unittest
from typing import List
import Connector
class PRPConnectorTest(unittest.TestCase):
connection: Connector.PRPConnector = Connector.PRPConnector('admin', 'adminTest', 'https://marblch.pythonanywhere.com/')
def test_test_message(self):
response: dict = PRPConnectorTest.connection.test_... | 56.850746 | 159 | 0.719349 | 3,745 | 0.983198 | 0 | 0 | 0 | 0 | 0 | 0 | 755 | 0.198215 |
b73585b3b1af0b7be3ca9e5f9af38dd53d4fa51d | 1,302 | py | Python | competitors/VAE.py | umarov90/DeepFake | e65c72f255817532e8a8a3afe2138ae270477601 | [
"Apache-2.0"
] | 3 | 2021-01-28T08:08:20.000Z | 2021-10-30T02:15:54.000Z | competitors/VAE.py | umarov90/DeepCellState | e65c72f255817532e8a8a3afe2138ae270477601 | [
"Apache-2.0"
] | null | null | null | competitors/VAE.py | umarov90/DeepCellState | e65c72f255817532e8a8a3afe2138ae270477601 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:56:49.000Z | 2022-03-09T14:56:49.000Z | import tensorflow as tf
from tensorflow import keras
class VAE(keras.Model):
def __init__(self, encoder, decoder, **kwargs):
super(VAE, self).__init__(**kwargs)
self.encoder = encoder
self.decoder = decoder
self.e_count = 0
def train_step(self, data):
# if isinstance(... | 35.189189 | 101 | 0.612135 | 1,247 | 0.957757 | 0 | 0 | 0 | 0 | 0 | 0 | 113 | 0.08679 |
b7366ab4b541a6d00ae9df7ac65ca2ada6762d7d | 2,121 | py | Python | test/unit/database/test_work.py | matiasmorant/py2neo | 521c9799f386fcae262f9f1b379bca9e24184d16 | [
"Apache-2.0"
] | null | null | null | test/unit/database/test_work.py | matiasmorant/py2neo | 521c9799f386fcae262f9f1b379bca9e24184d16 | [
"Apache-2.0"
] | null | null | null | test/unit/database/test_work.py | matiasmorant/py2neo | 521c9799f386fcae262f9f1b379bca9e24184d16 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2020, Nigel Small
#
# 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
#
# Unle... | 22.806452 | 74 | 0.701556 | 609 | 0.287129 | 0 | 0 | 240 | 0.113154 | 0 | 0 | 620 | 0.292315 |
b73713a84bd73916c488c2d607e11c9d22b75380 | 6,070 | py | Python | extract/read_acc.py | YutoNakayachi/jankenEstimate | 64ca3b6da78c1d84204d709c0c0a398277f4dafb | [
"MIT"
] | null | null | null | extract/read_acc.py | YutoNakayachi/jankenEstimate | 64ca3b6da78c1d84204d709c0c0a398277f4dafb | [
"MIT"
] | null | null | null | extract/read_acc.py | YutoNakayachi/jankenEstimate | 64ca3b6da78c1d84204d709c0c0a398277f4dafb | [
"MIT"
] | null | null | null | #from https://github.com/mfurukawa/imu_sensor/tree/master/src/Python
# September 03, 2020
# Yuto Nakayachi
from __future__ import unicode_literals ,print_function
import serial
from time import sleep
import numpy as np
import matplotlib.pyplot as plt
import io
import csv
import time
import datetime
import stru... | 27.590909 | 257 | 0.549918 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,605 | 0.264415 |
b739046fc9ac3dbe4de500836eb668496db9cf82 | 1,754 | py | Python | scripts/backup/eval.py | vafaei-ar/Ngene | 9735f9729bdde70624ec9af73196b418f2e1b2f2 | [
"MIT"
] | null | null | null | scripts/backup/eval.py | vafaei-ar/Ngene | 9735f9729bdde70624ec9af73196b418f2e1b2f2 | [
"MIT"
] | null | null | null | scripts/backup/eval.py | vafaei-ar/Ngene | 9735f9729bdde70624ec9af73196b418f2e1b2f2 | [
"MIT"
] | null | null | null | import matplotlib as mpl
mpl.use('agg')
import glob
import argparse
from time import time
import numpy as np
import pylab as plt
import rficnn as rfc
parser = argparse.ArgumentParser()
parser.add_argument('--arch', required=False, help='choose architecture', type=str, default='1')
parser.add_argument('--trsh', requir... | 29.728814 | 99 | 0.661345 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 280 | 0.159635 |
b739279244be21a77769468b2146bbedb6b82ebb | 4,544 | py | Python | ctemail.py | dyike/CTEmail | d94416401198393df01f143047acb1fb7c227492 | [
"MIT"
] | 47 | 2017-10-15T08:23:55.000Z | 2021-03-21T04:05:25.000Z | ctemail.py | bobo18801737494/CTEmail | d94416401198393df01f143047acb1fb7c227492 | [
"MIT"
] | null | null | null | ctemail.py | bobo18801737494/CTEmail | d94416401198393df01f143047acb1fb7c227492 | [
"MIT"
] | 7 | 2017-10-16T02:23:12.000Z | 2020-07-08T13:32:28.000Z | from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.header import Header
from email.mime.base import MIMEBase
from email import encoders
import os
import uuid
import smtplib
import re
class CTEmail(object):
def __i... | 34.953846 | 102 | 0.569762 | 4,259 | 0.93728 | 0 | 0 | 0 | 0 | 0 | 0 | 1,415 | 0.3114 |
b73959dcfef900a0482e8a66a74254dfbae2b5e0 | 3,782 | py | Python | alipay/aop/api/domain/RequestExtShopItem.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/RequestExtShopItem.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/RequestExtShopItem.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class RequestExtShopItem(object):
def __init__(self):
self._brand_code = None
self._category_code = None
self._description = None
self._item_code = None
self._kb... | 28.870229 | 77 | 0.574299 | 3,665 | 0.969064 | 0 | 0 | 1,646 | 0.435219 | 0 | 0 | 464 | 0.122686 |
b739c6c3b975479392baa34036d389264f7e0a34 | 9,644 | py | Python | tornado/s3server.py | suocean16/osu_study | c86da00312b16ade5d7ed4586ffbe7ffc78781a1 | [
"Apache-2.0"
] | 9 | 2015-02-04T08:45:56.000Z | 2017-06-25T02:01:30.000Z | tornado/s3server.py | suocean16/osu_study | c86da00312b16ade5d7ed4586ffbe7ffc78781a1 | [
"Apache-2.0"
] | null | null | null | tornado/s3server.py | suocean16/osu_study | c86da00312b16ade5d7ed4586ffbe7ffc78781a1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | 37.671875 | 76 | 0.606595 | 7,927 | 0.821962 | 0 | 0 | 0 | 0 | 0 | 0 | 2,057 | 0.213293 |
b73c912fbef2f1e9dcedeede8d2e7747a1107d54 | 6,697 | py | Python | multitest_transport/api/test_result_api.py | maksonlee/multitest_transport | 9c20a48ac856307950a204854f52be7335705054 | [
"Apache-2.0"
] | null | null | null | multitest_transport/api/test_result_api.py | maksonlee/multitest_transport | 9c20a48ac856307950a204854f52be7335705054 | [
"Apache-2.0"
] | null | null | null | multitest_transport/api/test_result_api.py | maksonlee/multitest_transport | 9c20a48ac856307950a204854f52be7335705054 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.596273 | 80 | 0.721368 | 5,522 | 0.824548 | 0 | 0 | 5,596 | 0.835598 | 0 | 0 | 2,005 | 0.299388 |
b73d9b6a2ed597b2e555f0e71f5965ac6e15c17b | 462 | py | Python | remcall/schema/typeref.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | remcall/schema/typeref.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | remcall/schema/typeref.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | class TypeRef:
'''Represents temporary type references by an integer; to be resolved
to actual types later
'''
def __init__(self, type_ref: int):
self.type_ref = type_ref
def __hash__(self):
return hash(self.type_ref)
def __eq__(self, other):
return isinstance(other,... | 28.875 | 77 | 0.655844 | 461 | 0.997835 | 0 | 0 | 0 | 0 | 0 | 0 | 114 | 0.246753 |
b740609fa3b2a0150f07fc35f914d2369bdcd573 | 260 | py | Python | visualize_loss/loss_verification.py | entn-at/RL-LightSpeech | c8ba120216c7c3117d2e7eae2eebe726bc02d6d3 | [
"MIT"
] | 1 | 2021-09-22T01:30:05.000Z | 2021-09-22T01:30:05.000Z | visualize_loss/loss_verification.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | null | null | null | visualize_loss/loss_verification.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | 1 | 2021-09-22T01:32:06.000Z | 2021-09-22T01:32:06.000Z | import numpy as np
loss_arr = np.array(list())
with open("total_loss.txt", "r") as f_loss:
cnt = 0
for loss in f_loss.readlines():
cnt += 1
# print(loss)
loss_arr = np.append(loss_arr, float(loss))
print(cnt)
| 23.636364 | 52 | 0.561538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 33 | 0.126923 |
b7407fa4aa1e99e15cc05919bc7ed96eeb510a89 | 443 | py | Python | road_roughness_prediction/tools/image_utils.py | mknz/dsr-road-roughness-prediction | 5f56b6ba5da70a09f2c967b7f32c740072e20ed1 | [
"MIT"
] | 7 | 2019-04-04T06:40:29.000Z | 2020-11-12T10:53:30.000Z | road_roughness_prediction/tools/image_utils.py | mknz/dsr-road-roughness-prediction | 5f56b6ba5da70a09f2c967b7f32c740072e20ed1 | [
"MIT"
] | 1 | 2021-09-28T07:11:05.000Z | 2021-09-28T07:11:05.000Z | road_roughness_prediction/tools/image_utils.py | mknz/dsr-road-roughness-prediction | 5f56b6ba5da70a09f2c967b7f32c740072e20ed1 | [
"MIT"
] | null | null | null | '''Image utils'''
from io import BytesIO
from PIL import Image
import matplotlib.pyplot as plt
def save_and_open(save_func):
'''Save to in-memory buffer and re-open '''
buf = BytesIO()
save_func(buf)
buf.seek(0)
bytes_ = buf.read()
buf_ = BytesIO(bytes_)
return buf_
def fig_to_pil(fig: ... | 20.136364 | 47 | 0.670429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 101 | 0.227991 |
b741d52a9805602a91b772fcb3382611b832a2b5 | 15,070 | py | Python | machida/lib/wallaroo/experimental/connectors.py | pvmsikrsna/wallaroo | a08ef579ec809e5bf4ffe10937b2be20059a0530 | [
"Apache-2.0"
] | null | null | null | machida/lib/wallaroo/experimental/connectors.py | pvmsikrsna/wallaroo | a08ef579ec809e5bf4ffe10937b2be20059a0530 | [
"Apache-2.0"
] | null | null | null | machida/lib/wallaroo/experimental/connectors.py | pvmsikrsna/wallaroo | a08ef579ec809e5bf4ffe10937b2be20059a0530 | [
"Apache-2.0"
] | null | null | null | import hashlib
import logging
from struct import unpack
import sys
import time
from . import (connector_wire_messages as cwm,
AtLeastOnceSourceConnector,
ProtocolError,
ConnectorError)
if sys.version_info.major == 2:
from .base_meta2 import BaseMeta, abstractmethod
e... | 37.394541 | 210 | 0.557996 | 14,679 | 0.974054 | 0 | 0 | 1,256 | 0.083344 | 0 | 0 | 5,617 | 0.372727 |
b743ed3e1bbeb444d21c50b6157a6fabbd1aba1e | 3,090 | py | Python | pytorch_lightning/callbacks/device_stats_monitor.py | Code-Cornelius/pytorch-lightning | ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057 | [
"Apache-2.0"
] | 4 | 2021-12-10T01:30:35.000Z | 2022-02-12T17:25:36.000Z | pytorch_lightning/callbacks/device_stats_monitor.py | Code-Cornelius/pytorch-lightning | ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057 | [
"Apache-2.0"
] | 4 | 2021-11-07T02:22:34.000Z | 2021-11-15T12:58:43.000Z | pytorch_lightning/callbacks/device_stats_monitor.py | Code-Cornelius/pytorch-lightning | ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057 | [
"Apache-2.0"
] | 2 | 2021-12-08T22:29:39.000Z | 2022-03-26T04:46:09.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 37.228916 | 118 | 0.703883 | 1,983 | 0.641748 | 0 | 0 | 0 | 0 | 0 | 0 | 1,452 | 0.469903 |
b7447c7e63cef72744a2596b6bfed0bc8c930ff6 | 147 | py | Python | plugins/Hikvision_app.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | 22 | 2016-09-01T08:27:07.000Z | 2021-01-11T13:32:59.000Z | plugins/Hikvision_app.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | null | null | null | plugins/Hikvision_app.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | 20 | 2015-11-07T19:09:48.000Z | 2018-05-02T03:10:41.000Z | #!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_file(pluginname, "doc/page/login.asp", "Hikvision")
| 21 | 74 | 0.721088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 0.469388 |
3f74e2e86d84e340b05f4456f8d63e50bac1ee3e | 495 | py | Python | package/awesome_panel/database/settings.py | mycarta/awesome-panel | dae17d11f686daaedd48b8e74ac4307c89e2b031 | [
"Apache-2.0"
] | 1 | 2020-05-08T21:44:37.000Z | 2020-05-08T21:44:37.000Z | package/awesome_panel/database/settings.py | mycarta/awesome-panel | dae17d11f686daaedd48b8e74ac4307c89e2b031 | [
"Apache-2.0"
] | null | null | null | package/awesome_panel/database/settings.py | mycarta/awesome-panel | dae17d11f686daaedd48b8e74ac4307c89e2b031 | [
"Apache-2.0"
] | null | null | null | """In this module we provide a list paths, urls and other usefull settings."""
GITHUB_URL = "https://github.com/MarcSkovMadsen/awesome-panel/"
GITHUB_BLOB_MASTER_URL = "https://github.com/MarcSkovMadsen/awesome-panel/blob/master/"
GITHUB_RAW_URL = "https://raw.githubusercontent.com/MarcSkovMadsen/awesome-panel/maste... | 55 | 92 | 0.775758 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 376 | 0.759596 |
3f787b4695b11190d523827faaa3e059aacc4c9c | 1,789 | py | Python | astropy/coordinates/tests/test_pickle.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | 1 | 2019-03-11T12:26:49.000Z | 2019-03-11T12:26:49.000Z | astropy/coordinates/tests/test_pickle.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | 1 | 2019-10-09T18:54:27.000Z | 2019-10-09T18:54:27.000Z | astropy/coordinates/tests/test_pickle.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | 1 | 2020-02-18T04:10:00.000Z | 2020-02-18T04:10:00.000Z | import pickle
import pytest
import numpy as np
from astropy.coordinates import Longitude
from astropy import coordinates as coord
from astropy.tests.helper import pickle_protocol, check_pickling_recovery # noqa
# Can't test distances without scipy due to cosmology deps
from astropy.utils.compat.optional_deps import ... | 24.847222 | 81 | 0.579094 | 0 | 0 | 0 | 0 | 360 | 0.20123 | 0 | 0 | 227 | 0.126887 |
3f78ac0f4821a9877cc3b9aefc54f11d9894ac13 | 3,683 | py | Python | articles/Machine Learning/SupervisedLearning/knn_classify/knn.py | wjiec/packages | 4ccaf8f717265a1f8a9af533f9a998b935efb32a | [
"MIT"
] | null | null | null | articles/Machine Learning/SupervisedLearning/knn_classify/knn.py | wjiec/packages | 4ccaf8f717265a1f8a9af533f9a998b935efb32a | [
"MIT"
] | 1 | 2016-09-15T07:06:15.000Z | 2016-09-15T07:06:15.000Z | articles/Machine Learning/SupervisedLearning/knn_classify/knn.py | wjiec/packages | 4ccaf8f717265a1f8a9af533f9a998b935efb32a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (C) 2017 ShadowMan
#
import operator
import numpy as np
group = np.array([
[1.0, 1.1],
[1.0, 1.0],
[0.0, 0.0],
[0.0, 0.1]
])
labels = ['A', 'A', 'B','B']
def auto_normal(data_set):
# 寻找一行/列中的最小值
# axis:表示行(1)或者列(0)
min_values = data_set.min(axis = 0)
... | 36.83 | 111 | 0.541406 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,052 | 0.628371 |
3f79f05e8ea447c87ecd650d6cef267e990945dc | 3,101 | py | Python | src/pymir-controller/controller/label_model/label_runner.py | IJtLJZ8Rm4Yr/ymir-backend | 73baa7822bb0d8ec1d152b07d9cabaddb2ae895d | [
"Apache-2.0"
] | null | null | null | src/pymir-controller/controller/label_model/label_runner.py | IJtLJZ8Rm4Yr/ymir-backend | 73baa7822bb0d8ec1d152b07d9cabaddb2ae895d | [
"Apache-2.0"
] | null | null | null | src/pymir-controller/controller/label_model/label_runner.py | IJtLJZ8Rm4Yr/ymir-backend | 73baa7822bb0d8ec1d152b07d9cabaddb2ae895d | [
"Apache-2.0"
] | null | null | null | import os
from typing import Tuple, List
from controller.invoker.invoker_task_exporting import TaskExportingInvoker
from controller import config
from controller.label_model.label_studio import LabelStudio
from controller.utils.app_logger import logger
def prepare_label_dir(working_dir: str, task_id: str) -> Tuple[s... | 34.842697 | 124 | 0.718478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 414 | 0.133505 |
3f7a60ea385d7fdaeb685b99834b8a082b01d925 | 719 | py | Python | run-workflow-cloud-run/main.py | UriKatsirPrivate/gcp-workflows | 35fa813bdc5335d8f06aee2f2d2e12b773f43872 | [
"MIT"
] | 1 | 2021-07-07T07:43:55.000Z | 2021-07-07T07:43:55.000Z | run-workflow-cloud-run/main.py | UriKatsirPrivate/gcp-workflows | 35fa813bdc5335d8f06aee2f2d2e12b773f43872 | [
"MIT"
] | null | null | null | run-workflow-cloud-run/main.py | UriKatsirPrivate/gcp-workflows | 35fa813bdc5335d8f06aee2f2d2e12b773f43872 | [
"MIT"
] | null | null | null | import os
from flask import Flask
from googleapiclient.discovery import build
import json
import sys
from google.oauth2 import service_account
import googleapiclient.discovery
app = Flask(__name__)
workflow_service = build('workflowexecutions', 'v1')
@app.route("/")
def hello_world():
parent = "projects/uri-... | 23.966667 | 94 | 0.727399 | 0 | 0 | 0 | 0 | 351 | 0.488178 | 0 | 0 | 189 | 0.262865 |
3f7b2d2414e53d9ad204b36035beffc35a3a5a76 | 9,264 | py | Python | rendering/viewer.py | MTKat/FloorplanTransformation | de10a1177e685267185de05dbce3230c25ef1d16 | [
"MIT"
] | 323 | 2017-10-24T07:45:12.000Z | 2022-03-05T15:25:17.000Z | rendering/viewer.py | MTKat/FloorplanTransformation | de10a1177e685267185de05dbce3230c25ef1d16 | [
"MIT"
] | 32 | 2017-11-20T12:44:27.000Z | 2022-03-22T01:59:23.000Z | rendering/viewer.py | MTKat/FloorplanTransformation | de10a1177e685267185de05dbce3230c25ef1d16 | [
"MIT"
] | 137 | 2017-11-13T10:06:00.000Z | 2022-03-23T10:26:30.000Z | from math import pi, sin, cos
from panda3d.core import *
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from floorplan import Floorplan
import numpy as np
import random
import copy
class Viewer(ShowBase):
def __init__(self):
ShowBase.__init__(self)
#self.scene = self.loader.loadM... | 35.358779 | 186 | 0.636118 | 9,025 | 0.974201 | 0 | 0 | 0 | 0 | 0 | 0 | 1,374 | 0.148316 |
3f7bd6bf0cb9919cde3364ef2571e57284b86425 | 118,425 | py | Python | application/gen/today/TodayInternalApiService.py | today-app/today-api | a77adbad509d485e643023efc64f62b69fd364cc | [
"MIT"
] | null | null | null | application/gen/today/TodayInternalApiService.py | today-app/today-api | a77adbad509d485e643023efc64f62b69fd364cc | [
"MIT"
] | null | null | null | application/gen/today/TodayInternalApiService.py | today-app/today-api | a77adbad509d485e643023efc64f62b69fd364cc | [
"MIT"
] | 1 | 2021-06-04T06:02:36.000Z | 2021-06-04T06:02:36.000Z | #
# Autogenerated by Thrift Compiler (0.9.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
... | 31.156275 | 188 | 0.673574 | 117,851 | 0.995153 | 0 | 0 | 0 | 0 | 0 | 0 | 8,992 | 0.07593 |
3f7d049cc55342fe3c9001df6677acf8bf2011d5 | 626 | py | Python | common/kalman/simple_kalman_old.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 114 | 2020-02-24T14:18:01.000Z | 2022-03-19T03:42:00.000Z | common/kalman/simple_kalman_old.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 15 | 2020-02-25T03:37:44.000Z | 2021-09-08T01:51:15.000Z | common/kalman/simple_kalman_old.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 73 | 2018-12-03T19:34:42.000Z | 2020-07-27T05:10:23.000Z | import numpy as np
class KF1D:
# this EKF assumes constant covariance matrix, so calculations are much simpler
# the Kalman gain also needs to be precomputed using the control module
def __init__(self, x0, A, C, K):
self.x = x0
self.A = A
self.C = C
self.K = K
self.A_K = self.A - np.dot(se... | 26.083333 | 81 | 0.634185 | 604 | 0.964856 | 0 | 0 | 0 | 0 | 0 | 0 | 315 | 0.503195 |
3f7dac25b4b548d364d5151417f67ef21dc2df87 | 3,985 | py | Python | serverless/apps/qctokyo/horoscope.py | snuffkin/qctokyo | 25d457cce402a21fe1a009c82cfb5131fb7db526 | [
"Apache-2.0"
] | 8 | 2020-06-15T23:08:12.000Z | 2022-01-30T00:14:48.000Z | serverless/apps/qctokyo/horoscope.py | snuffkin/qctokyo | 25d457cce402a21fe1a009c82cfb5131fb7db526 | [
"Apache-2.0"
] | 1 | 2022-03-09T18:33:26.000Z | 2022-03-09T18:33:26.000Z | serverless/apps/qctokyo/horoscope.py | snuffkin/qctokyo | 25d457cce402a21fe1a009c82cfb5131fb7db526 | [
"Apache-2.0"
] | 1 | 2020-06-16T00:30:08.000Z | 2020-06-16T00:30:08.000Z | import datetime
import logging
import os
import boto3
from qiskit import IBMQ
from qiskit import QuantumCircuit, execute
logger = logging.getLogger()
logger.setLevel(logging.INFO)
backend_candidates = [
"ibmq_athens",
"ibmq_santiago",
"ibmq_belem",
"ibmq_quito",
"ibmq_lima",
]
def _get_provider... | 29.738806 | 98 | 0.647679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,027 | 0.257716 |
3f7e03214470e23d0a5adb54a209d5b572903083 | 8,558 | py | Python | boot/rpi/tools/patman/func_test.py | yodaos-project/yodaos | d0d7bbc277c0fc1c64e2e0a1c82fe6e63f6eb954 | [
"Apache-2.0"
] | 1,144 | 2018-12-18T09:46:47.000Z | 2022-03-07T14:51:46.000Z | boot/rpi/tools/patman/func_test.py | Rokid/YodaOS | d0d7bbc277c0fc1c64e2e0a1c82fe6e63f6eb954 | [
"Apache-2.0"
] | 16 | 2019-01-28T06:08:40.000Z | 2019-12-04T10:26:41.000Z | boot/rpi/tools/patman/func_test.py | Rokid/YodaOS | d0d7bbc277c0fc1c64e2e0a1c82fe6e63f6eb954 | [
"Apache-2.0"
] | 129 | 2018-12-18T09:46:50.000Z | 2022-03-30T07:30:13.000Z | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: GPL-2.0+
#
# Copyright 2017 Google, Inc
#
import contextlib
import os
import re
import shutil
import sys
import tempfile
import unittest
import gitutil
import patchstream
import settings
@contextlib.contextmanager
def capture():
import sys
from cStringIO im... | 35.218107 | 80 | 0.557373 | 7,953 | 0.928763 | 337 | 0.039355 | 744 | 0.086885 | 0 | 0 | 3,358 | 0.392152 |
3f7e4f78011ff12caa466b7a88c18ef168733660 | 832 | py | Python | anime downloaders/animeblkom downloader.py | badr286/anime-stuff | 2083e612ff2dbd079e68d8c49eb3fcddbfbfc031 | [
"MIT"
] | null | null | null | anime downloaders/animeblkom downloader.py | badr286/anime-stuff | 2083e612ff2dbd079e68d8c49eb3fcddbfbfc031 | [
"MIT"
] | null | null | null | anime downloaders/animeblkom downloader.py | badr286/anime-stuff | 2083e612ff2dbd079e68d8c49eb3fcddbfbfc031 | [
"MIT"
] | null | null | null | from animeblkom import Animeblkom, animeblkom_episode
from downloader import blkom
from requests import get
download_list = []
anime_url = input('Anime Url: ') # ex. https://animeblkom.net/watch/one-piece
episodes = Animeblkom.get_anime_episodes(anime_url)
print(f'{len(episodes)} episodes found.')
episodes... | 24.470588 | 78 | 0.689904 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 155 | 0.186298 |
3f814f9f3699e39e3b921e760844dbc2795a7e64 | 225 | py | Python | src/spaceone/monitoring/interface/rest/v1/common.py | xellos00/monitoring | deb5363a2152e7b3f85a08d27bdede0e00023824 | [
"Apache-2.0"
] | null | null | null | src/spaceone/monitoring/interface/rest/v1/common.py | xellos00/monitoring | deb5363a2152e7b3f85a08d27bdede0e00023824 | [
"Apache-2.0"
] | null | null | null | src/spaceone/monitoring/interface/rest/v1/common.py | xellos00/monitoring | deb5363a2152e7b3f85a08d27bdede0e00023824 | [
"Apache-2.0"
] | null | null | null | import logging
from fastapi import APIRouter
from spaceone.core.locator import Locator
_LOGGER = logging.getLogger(__name__)
router = APIRouter()
@router.get('/check')
async def check():
return {'status': 'SERVING'}
| 16.071429 | 41 | 0.742222 | 0 | 0 | 0 | 0 | 73 | 0.324444 | 51 | 0.226667 | 25 | 0.111111 |
3f8398d930cd82cdfb7464d288fada9e7ec31ac8 | 7,617 | py | Python | figures/kCSD_properties/figure_eigensources_M_1D.py | rdarie/kCSD-python | 5b9e1b1dce2ff95c0d981c2c4015b7a75199de9a | [
"BSD-3-Clause"
] | 11 | 2017-11-06T21:24:18.000Z | 2022-02-07T21:17:13.000Z | figures/kCSD_properties/figure_eigensources_M_1D.py | aeladly91/kCSD-python | 4dd0015e9c5598e7eceeeb25668e696e495b2026 | [
"BSD-3-Clause"
] | 105 | 2017-12-13T12:49:54.000Z | 2022-03-19T12:25:51.000Z | figures/kCSD_properties/figure_eigensources_M_1D.py | aeladly91/kCSD-python | 4dd0015e9c5598e7eceeeb25668e696e495b2026 | [
"BSD-3-Clause"
] | 27 | 2017-06-08T07:32:32.000Z | 2022-02-07T21:17:15.000Z | """
@author: mkowalska
"""
import os
import numpy as np
from numpy.linalg import LinAlgError
import matplotlib.pyplot as plt
from figure_properties import *
import matplotlib.gridspec as gridspec
from kcsd import KCSD1D
import targeted_basis as tb
__abs_file__ = os.path.abspath(__file__)
def _html(r, g, b):
ret... | 32.412766 | 79 | 0.52606 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,200 | 0.288828 |
3f83a4002afc61816d499ce9af2515b129624aaf | 392 | py | Python | examples/task1.py | qqgg231/Allegro | d5300bfb8eb58168d5efbd6a7e211561fce569e0 | [
"MIT"
] | 27 | 2017-04-22T03:00:04.000Z | 2017-11-28T08:40:47.000Z | examples/task1.py | qqgg231/Allegro | d5300bfb8eb58168d5efbd6a7e211561fce569e0 | [
"MIT"
] | 2 | 2017-05-18T08:40:29.000Z | 2018-11-07T02:00:20.000Z | examples/task1.py | qqgg231/Allegro | d5300bfb8eb58168d5efbd6a7e211561fce569e0 | [
"MIT"
] | 4 | 2017-04-21T11:49:15.000Z | 2018-10-29T12:01:38.000Z | #!/usr/bin/env python
# coding=utf-8
from celery import Celery
from pprint import pprint
import time
app = Celery('tasks', backend='redis://localhost:6379/0', broker = 'redis://localhost:6379/0')
@app.task
def get(message):
#===========
#pprint(message)
#===========
return {"app":"Get Got"}
@app.tas... | 17.818182 | 94 | 0.614796 | 0 | 0 | 0 | 0 | 189 | 0.482143 | 0 | 0 | 178 | 0.454082 |
3f880cabd29a75530eb1d2132bd05625f3e4cd8e | 98 | py | Python | checkov/common/comment/enum.py | antonblr/checkov | 9415c6593c537945c08f7a19f28bdd8b96966f67 | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | checkov/common/comment/enum.py | antonblr/checkov | 9415c6593c537945c08f7a19f28bdd8b96966f67 | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | checkov/common/comment/enum.py | antonblr/checkov | 9415c6593c537945c08f7a19f28bdd8b96966f67 | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | import re
COMMENT_REGEX = re.compile(r'(checkov:skip=|bridgecrew:skip=) *([A-Z_\d]+)(:[^\n]+)?')
| 24.5 | 86 | 0.622449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 58 | 0.591837 |
3f89aa8877a0c320a25f1232234def2b63591b67 | 438 | py | Python | chris_backend/plugins/migrations/0034_auto_20200420_2320.py | rudolphpienaar/ChRIS_ultron_backEnd | 5de4e255fb151ac7a6f900327704831da11dcd1f | [
"MIT"
] | 26 | 2016-05-26T14:09:35.000Z | 2022-01-28T19:12:43.000Z | chris_backend/plugins/migrations/0034_auto_20200420_2320.py | rudolphpienaar/ChRIS_ultron_backEnd | 5de4e255fb151ac7a6f900327704831da11dcd1f | [
"MIT"
] | 168 | 2016-06-24T11:07:15.000Z | 2022-03-21T12:33:43.000Z | chris_backend/plugins/migrations/0034_auto_20200420_2320.py | rudolphpienaar/ChRIS_ultron_backEnd | 5de4e255fb151ac7a6f900327704831da11dcd1f | [
"MIT"
] | 45 | 2017-08-16T16:41:40.000Z | 2022-03-31T18:12:14.000Z | # Generated by Django 2.1.4 on 2020-04-20 23:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plugins', '0033_pluginparameter_short_flag'),
]
operations = [
migrations.AlterField(
model_name='computeresource',
... | 23.052632 | 64 | 0.639269 | 345 | 0.787671 | 0 | 0 | 0 | 0 | 0 | 0 | 135 | 0.308219 |
3f8a0dda01eeac406db001e56651f4bc81dfa178 | 4,112 | py | Python | src/StarTrac/forms.py | Stdubic/Track | 853df13178967ab9b5c1918d6d56fa7fe2831b0f | [
"MIT"
] | 1 | 2015-09-14T19:54:56.000Z | 2015-09-14T19:54:56.000Z | src/StarTrac/forms.py | Stdubic/Track | 853df13178967ab9b5c1918d6d56fa7fe2831b0f | [
"MIT"
] | null | null | null | src/StarTrac/forms.py | Stdubic/Track | 853df13178967ab9b5c1918d6d56fa7fe2831b0f | [
"MIT"
] | null | null | null | '''
Created on Dec 21, 2014
@author: Milos
'''
'''
Forma za eventualna prosirenja djangovog user-a
'''
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404... | 31.875969 | 100 | 0.63643 | 3,600 | 0.875486 | 0 | 0 | 0 | 0 | 0 | 0 | 874 | 0.212549 |
3f8a3a645b102cb7225f8c5a5422dfe385638911 | 4,775 | py | Python | mysite/settings/base.py | HumanCellAtlas/HCA-Tracker | 4b3df2b8a99582b7b654253d6e0faf537298a876 | [
"MIT"
] | 3 | 2019-09-09T15:43:23.000Z | 2020-12-03T23:29:45.000Z | mysite/settings/base.py | HumanCellAtlas/HCA-Tracker | 4b3df2b8a99582b7b654253d6e0faf537298a876 | [
"MIT"
] | 45 | 2019-09-30T19:00:04.000Z | 2020-12-03T23:50:35.000Z | mysite/settings/base.py | HumanCellAtlas/HCA-Tracker | 4b3df2b8a99582b7b654253d6e0faf537298a876 | [
"MIT"
] | 1 | 2021-01-11T21:30:52.000Z | 2021-01-11T21:30:52.000Z | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 2.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
imp... | 27.923977 | 99 | 0.685654 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,330 | 0.697382 |
3f8a7855be2c7792001f6241d146c5b377cdb431 | 932 | py | Python | setup.py | kiranmantri/python-remote-import | 2724e320377c3f2328dafd61707aad4d5eed2f10 | [
"MIT"
] | null | null | null | setup.py | kiranmantri/python-remote-import | 2724e320377c3f2328dafd61707aad4d5eed2f10 | [
"MIT"
] | null | null | null | setup.py | kiranmantri/python-remote-import | 2724e320377c3f2328dafd61707aad4d5eed2f10 | [
"MIT"
] | null | null | null | """Create the distribution file (pypi)."""
import importlib
import setuptools
from pathlib import Path
this_package_name = 'remote_import'
version_file = Path(__file__).absolute().parent / this_package_name / "__version__.py"
setuptools.setup(
name=this_package_name,
url="https://github.com/kiranmantri/pytho... | 35.846154 | 105 | 0.724249 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 367 | 0.393777 |
3f8aa0798a7df35cc97e5a10a092cb9ce9a9bf74 | 1,958 | py | Python | flaskr/test/unit/webapp/test_aquarium_mode.py | UnibucProjects/SmartAquarium | 6f3c16fb7a45218e763b46223568f6c3e5b66bfd | [
"MIT"
] | 6 | 2022-02-02T19:37:57.000Z | 2022-02-03T15:12:32.000Z | flaskr/test/unit/webapp/test_aquarium_mode.py | UnibucProjects/SmartAquarium | 6f3c16fb7a45218e763b46223568f6c3e5b66bfd | [
"MIT"
] | 18 | 2022-01-29T22:47:46.000Z | 2022-02-03T15:30:28.000Z | flaskr/test/unit/webapp/test_aquarium_mode.py | UnibucProjects/SmartAquarium | 6f3c16fb7a45218e763b46223568f6c3e5b66bfd | [
"MIT"
] | null | null | null |
from flask import request
import pytest
import json
from app import create_app, create_rest_api
from db import get_db
@pytest.fixture
def client():
local_app = create_app()
create_rest_api(local_app)
client = local_app.test_client()
yield client
def test_get_aquarium_invalid_id(client):
with c... | 26.459459 | 84 | 0.64811 | 0 | 0 | 128 | 0.065373 | 144 | 0.073544 | 0 | 0 | 376 | 0.192033 |
3f8aeedaa1eeb40e7b048cb7a40313232cfd6bb4 | 4,172 | py | Python | get_anns.py | hoangnt2601/RAPiD | 8e765ccec45e192305ca3d9d547967dbb4299cc3 | [
"MIT"
] | null | null | null | get_anns.py | hoangnt2601/RAPiD | 8e765ccec45e192305ca3d9d547967dbb4299cc3 | [
"MIT"
] | null | null | null | get_anns.py | hoangnt2601/RAPiD | 8e765ccec45e192305ca3d9d547967dbb4299cc3 | [
"MIT"
] | null | null | null | import json
import os
import cv2
import imutils
import numpy as np
import torch
import torchvision.transforms.functional as tvf
from PIL import Image
from models.rapid import RAPiD
from tracker.deep_sort import DeepSort
from utils import utils
weights_path = "weights/pL1_HBCP608_Apr14_6000.ckpt"
model = RAPiD(backbo... | 28.972222 | 88 | 0.514382 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 636 | 0.152445 |
3f8b0d6e16b2a41fa16dedea3dc287034f8c9ddf | 5,194 | py | Python | src/pypipegraph2/util.py | TyberiusPrime/pypipegraph2 | 16f5d3a471b3dae71fafca98f63c4c80882dc20a | [
"MIT"
] | null | null | null | src/pypipegraph2/util.py | TyberiusPrime/pypipegraph2 | 16f5d3a471b3dae71fafca98f63c4c80882dc20a | [
"MIT"
] | null | null | null | src/pypipegraph2/util.py | TyberiusPrime/pypipegraph2 | 16f5d3a471b3dae71fafca98f63c4c80882dc20a | [
"MIT"
] | 1 | 2021-09-01T11:20:46.000Z | 2021-09-01T11:20:46.000Z | import os
import sys
from loguru import logger
from rich.console import Console
console_args = {}
if "pytest" in sys.modules:
console_args["width"] = 120
console = Console(**console_args)
cpu_count = None
def escape_logging(s):
return str(s).replace("<", "\\<").replace("{", "{{").replace("}", "}}")
def CP... | 29.344633 | 87 | 0.622256 | 0 | 0 | 254 | 0.048903 | 0 | 0 | 0 | 0 | 1,120 | 0.215633 |
3f8d947a33583e1607214e59c7b361284124cdbb | 1,808 | py | Python | hwk/tests/unit/test_udev.py | jaypipes/os-hardware | b43be56fafc7e853614cafc7d02c734aadb72cbe | [
"Apache-2.0"
] | null | null | null | hwk/tests/unit/test_udev.py | jaypipes/os-hardware | b43be56fafc7e853614cafc7d02c734aadb72cbe | [
"Apache-2.0"
] | 7 | 2017-06-02T00:41:49.000Z | 2017-06-19T23:00:12.000Z | hwk/tests/unit/test_udev.py | jaypipes/hwk | b43be56fafc7e853614cafc7d02c734aadb72cbe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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, softw... | 30.644068 | 76 | 0.776549 | 1,167 | 0.645465 | 0 | 0 | 1,131 | 0.625553 | 0 | 0 | 1,421 | 0.785951 |
3f8dbacf9ded6ecf935b85a50c2260653a9563a1 | 618 | py | Python | app/resources/continent.py | visar/world | c609dcf343e94d6bb5cd242cd093ad646c744575 | [
"MIT"
] | 2 | 2021-03-20T05:53:33.000Z | 2021-04-12T04:38:58.000Z | app/resources/continent.py | visar/world | c609dcf343e94d6bb5cd242cd093ad646c744575 | [
"MIT"
] | null | null | null | app/resources/continent.py | visar/world | c609dcf343e94d6bb5cd242cd093ad646c744575 | [
"MIT"
] | null | null | null | from http import HTTPStatus
from flask_restful import Resource
from ..extensions import cache
from ..models.country import Country
from ..schemas.continent import ContinentSchema
continent_list_schema = ContinentSchema(many=True)
class ContinentListResource(Resource):
@cache.cached(timeout=60, query_string=Tru... | 29.428571 | 110 | 0.745955 | 382 | 0.618123 | 0 | 0 | 339 | 0.548544 | 0 | 0 | 46 | 0.074434 |
3f8e2e50dac6d87bfd7ff239f2e32c8c791e0ddb | 14,547 | py | Python | sublimebookmark.py | gwenzek/sublimeBookmark | 02a08c8249c5203fa9a46fd19e71bc68e6e0be9a | [
"Apache-2.0"
] | null | null | null | sublimebookmark.py | gwenzek/sublimeBookmark | 02a08c8249c5203fa9a46fd19e71bc68e6e0be9a | [
"Apache-2.0"
] | null | null | null | sublimebookmark.py | gwenzek/sublimeBookmark | 02a08c8249c5203fa9a46fd19e71bc68e6e0be9a | [
"Apache-2.0"
] | null | null | null | import sublime
import sublime_plugin
import threading
import os.path
from pickle import dump, load, UnpicklingError, PicklingError
from copy import deepcopy
from .common import *
from .bookmark import *
from .visibilityHandler import *
from .ui import *
BOOKMARKS = []
UID = None
#list of bookmarks that have ben d... | 28.083012 | 121 | 0.72771 | 13,652 | 0.938475 | 0 | 0 | 0 | 0 | 0 | 0 | 4,698 | 0.322953 |
3f8e75a7037cb0591f30cdca4d67c840b9c842f3 | 3,677 | py | Python | xrpc/examples/exemplary_rpc.py | andreycizov/python-xrpc | ed403ae74d5e89e0ebac68bcc58591d6b32742ff | [
"Apache-2.0"
] | null | null | null | xrpc/examples/exemplary_rpc.py | andreycizov/python-xrpc | ed403ae74d5e89e0ebac68bcc58591d6b32742ff | [
"Apache-2.0"
] | null | null | null | xrpc/examples/exemplary_rpc.py | andreycizov/python-xrpc | ed403ae74d5e89e0ebac68bcc58591d6b32742ff | [
"Apache-2.0"
] | null | null | null | import logging
import random
from typing import Dict
from xrpc.dsl import rpc, RPCType, regular, signal
from xrpc.error import TerminationException
from xrpc.runtime import sender, service
# todo: the issue is actually that not only the request-reply pattern wouldn't work
# todo: but also the fact that an RPC might h... | 29.653226 | 101 | 0.627686 | 3,167 | 0.8613 | 0 | 0 | 2,697 | 0.733478 | 0 | 0 | 892 | 0.242589 |
3f8ee60500939b288620ad55089e24b11d028c78 | 413 | py | Python | tests/__init__.py | sgbaird/ml-matrics | e0560af810b12cae3a34dd818d628360de2d96e5 | [
"MIT"
] | 11 | 2021-07-12T02:12:02.000Z | 2022-02-14T19:06:22.000Z | tests/__init__.py | sgbaird/ml-matrics | e0560af810b12cae3a34dd818d628360de2d96e5 | [
"MIT"
] | 7 | 2021-10-14T10:00:01.000Z | 2022-03-01T21:09:30.000Z | tests/__init__.py | sgbaird/ml-matrics | e0560af810b12cae3a34dd818d628360de2d96e5 | [
"MIT"
] | 2 | 2021-10-01T10:00:50.000Z | 2022-02-12T08:50:22.000Z | import matplotlib.pyplot as plt
import pandas as pd
import pytest
from ml_matrics import ROOT
@pytest.fixture(autouse=True)
def run_around_tests():
# Code that runs before each test
yield
# Code that runs after each test
plt.close()
y_binary, y_proba, y_clf = pd.read_csv(f"{ROOT}/data/rand_clf.cs... | 20.65 | 80 | 0.723971 | 0 | 0 | 126 | 0.305085 | 156 | 0.377724 | 0 | 0 | 120 | 0.290557 |
3f8f4d8b9a542512c36e38813053e17bfd674f61 | 2,907 | py | Python | example_run.py | altsoph/community_loglike | ea8800217097575558f8bfb97f7737d12cad2339 | [
"BSD-3-Clause"
] | 16 | 2018-02-14T23:14:32.000Z | 2021-09-15T09:38:47.000Z | example_run.py | altsoph/community_loglike | ea8800217097575558f8bfb97f7737d12cad2339 | [
"BSD-3-Clause"
] | null | null | null | example_run.py | altsoph/community_loglike | ea8800217097575558f8bfb97f7737d12cad2339 | [
"BSD-3-Clause"
] | 7 | 2019-05-09T10:25:24.000Z | 2020-06-06T09:37:18.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
from __future__ import print_function
import community_ext
import networkx as nx
fn1 = "datasets/polblogs/polblogs.edges"
fn2 = fn1.replace(".edges",".clusters")
print("DATASET:",fn1)
# load graph
G = nx.Graph()
for line in open(fn1):
from_node, to_node = map(int, li... | 38.76 | 144 | 0.68765 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 931 | 0.320261 |
3f8f5e2babed8a1212595d0eeba5f9b572718ef4 | 1,961 | py | Python | rebalanced_balanced_tests/evalr.py | zhanghuiying2319/Master | 1f4d11dd8277517b7e63d34651a9629f58dd7070 | [
"MIT"
] | null | null | null | rebalanced_balanced_tests/evalr.py | zhanghuiying2319/Master | 1f4d11dd8277517b7e63d34651a9629f58dd7070 | [
"MIT"
] | null | null | null | rebalanced_balanced_tests/evalr.py | zhanghuiying2319/Master | 1f4d11dd8277517b7e63d34651a9629f58dd7070 | [
"MIT"
] | null | null | null |
import os,sys,math,numpy as np, matplotlib.pyplot as plt
def runstuff():
#savept= './scores_v2_23042021' #0.7580982029438019 0.5812124161981046
#savept= './scores_v2_23042021_sizes' #0.7552803814411163 0.583345946110785
#savept= './scores_v2_23042021_sizes_posenc' #0.7596977412700654 0.583193539083004
#savep... | 35.017857 | 109 | 0.740948 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 985 | 0.502295 |
3f8f66290e622881703269fb324e879e53d1763e | 5,282 | py | Python | recognize.py | pg992/face-recognition | 61db03a7fc5efeae6d88a49cf60dca3e426a2b04 | [
"Apache-2.0"
] | null | null | null | recognize.py | pg992/face-recognition | 61db03a7fc5efeae6d88a49cf60dca3e426a2b04 | [
"Apache-2.0"
] | null | null | null | recognize.py | pg992/face-recognition | 61db03a7fc5efeae6d88a49cf60dca3e426a2b04 | [
"Apache-2.0"
] | null | null | null | from keras.models import Model, Sequential
from keras.layers import Input, Convolution2D, ZeroPadding2D, MaxPooling2D, Flatten, Dense, Dropout, Activation
import numpy as np
from os import listdir,path
from os.path import isfile, join
from PIL import Image
from keras.preprocessing.image import load_img, save_img, img_t... | 37.197183 | 125 | 0.72624 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 650 | 0.123059 |
3f94e4db1e0637fc4c005e79e78b67f9d50a7128 | 3,879 | py | Python | learning_journal/views/default.py | famavott/pyramid-learning-journal | 07d1c6c8699e7cb1cdb8b8eb856c8477455f4fa9 | [
"MIT"
] | null | null | null | learning_journal/views/default.py | famavott/pyramid-learning-journal | 07d1c6c8699e7cb1cdb8b8eb856c8477455f4fa9 | [
"MIT"
] | null | null | null | learning_journal/views/default.py | famavott/pyramid-learning-journal | 07d1c6c8699e7cb1cdb8b8eb856c8477455f4fa9 | [
"MIT"
] | null | null | null | """Module with view functions that serve each uri."""
from datetime import datetime
from learning_journal.models.mymodel import Journal
from learning_journal.security import is_authenticated
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from pyramid.security import NO_PERMISSION_REQUIRED, forget, remem... | 33.439655 | 109 | 0.675432 | 0 | 0 | 0 | 0 | 3,496 | 0.901263 | 0 | 0 | 929 | 0.239495 |
3f94e6b56b89d77a4cf091db5423e2787e19e58b | 4,854 | py | Python | algorithms/search/depth_first_search/depth_first_search_power_set.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | algorithms/search/depth_first_search/depth_first_search_power_set.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | algorithms/search/depth_first_search/depth_first_search_power_set.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | """
Created by Joseph Edradan
Github: https://github.com/josephedradan
Date created: 3/23/2020
Purpose:
The most generic DFS algorithm capable of being modified to Fit your needs.
It is also optimized.
Details:
Description:
Notes:
IMPORTANT NOTES:
Explanation:
Time Complexity:
Reference:
"""
from typi... | 28.892857 | 119 | 0.63391 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,338 | 0.68768 |
3f95236c19c4a6142c354065a15b5c5f4828679e | 657 | py | Python | apps/core/models/cb_media_movel/parameters_MM.py | bispojr/observatorio-ufj-covid19 | 8667fae1367b95a7dfa8558fbac3b1b0b708af8d | [
"MIT"
] | 3 | 2020-04-02T21:59:19.000Z | 2020-12-03T12:37:26.000Z | apps/core/models/cb_media_movel/parameters_MM.py | bispojr/observatorio-ufj-covid19 | 8667fae1367b95a7dfa8558fbac3b1b0b708af8d | [
"MIT"
] | 68 | 2020-03-28T22:40:08.000Z | 2020-07-08T18:04:07.000Z | apps/core/models/cb_media_movel/parameters_MM.py | bispojr/observatorio-ufj-covid19 | 8667fae1367b95a7dfa8558fbac3b1b0b708af8d | [
"MIT"
] | 5 | 2020-03-28T21:35:30.000Z | 2020-06-10T01:28:14.000Z | from django.db import models
import json
class ParametersMM():
corGrafico = {
"Novos Casos": "pink",
"Média Móvel": "red"
}
def cores(self, tipo):
cores = []
for cat in self.categorias(self, tipo):
cores.append(self.corGrafico[cat])
... | 21.193548 | 48 | 0.482496 | 618 | 0.934947 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 0.130106 |
3f971a075f4d4a4954da5f6fa16233c6818129bb | 4,151 | py | Python | httprider/model/app_data_reader.py | iSWORD/http-rider | 5d9e5cc8c5166ab58f81d30d21b3ce2497bf09b9 | [
"MIT"
] | 27 | 2019-12-20T00:10:28.000Z | 2022-03-09T18:04:23.000Z | httprider/model/app_data_reader.py | iSWORD/http-rider | 5d9e5cc8c5166ab58f81d30d21b3ce2497bf09b9 | [
"MIT"
] | 6 | 2019-10-13T08:50:21.000Z | 2020-06-05T12:23:08.000Z | httprider/model/app_data_reader.py | iSWORD/http-rider | 5d9e5cc8c5166ab58f81d30d21b3ce2497bf09b9 | [
"MIT"
] | 7 | 2019-08-10T01:38:31.000Z | 2021-08-23T05:28:46.000Z | import json
import logging
from PyQt5.QtCore import QObject, pyqtSignal
from ..core.constants import (
API_TEST_CASE_RECORD_TYPE,
HTTP_EXCHANGE_RECORD_TYPE,
ENVIRONMENT_RECORD_TYPE,
PROJECT_INFO_RECORD_TYPE,
APP_STATE_RECORD_TYPE,
API_CALL_RECORD_TYPE,
)
from ..model.app_data import (
ApiC... | 33.747967 | 88 | 0.695977 | 3,722 | 0.896651 | 0 | 0 | 0 | 0 | 0 | 0 | 186 | 0.044808 |
3f978f4cb297bf98d9722f54f27227c0fe655e28 | 120,882 | py | Python | tests/parsers/test_pwscf.py | jgaff/pif-dft | 0fcc136560973f0f99cd257108cdfbc497207e4f | [
"Apache-2.0"
] | null | null | null | tests/parsers/test_pwscf.py | jgaff/pif-dft | 0fcc136560973f0f99cd257108cdfbc497207e4f | [
"Apache-2.0"
] | null | null | null | tests/parsers/test_pwscf.py | jgaff/pif-dft | 0fcc136560973f0f99cd257108cdfbc497207e4f | [
"Apache-2.0"
] | null | null | null | import unittest
from dfttopif.parsers.pwscf import PwscfParser
from ..test_pif import unpack_example, delete_example
from pypif.obj.common.value import Value
import os
import shutil
class TestPWSCFParser(unittest.TestCase):
def get_parser(self,name):
'''Get a PwscfParser for a certain test'''
... | 470.357977 | 65,484 | 0.668983 | 120,642 | 0.998015 | 0 | 0 | 0 | 0 | 0 | 0 | 1,236 | 0.010225 |
3f9839dc98473c8e4ea48d01106d9d7e95ce9755 | 1,009 | py | Python | labels/migrations/0002_auto_20210210_0110.py | plaf2000/webspec | 487ccccff088ddbda0e5e475aaad167a01f4aab2 | [
"MIT"
] | null | null | null | labels/migrations/0002_auto_20210210_0110.py | plaf2000/webspec | 487ccccff088ddbda0e5e475aaad167a01f4aab2 | [
"MIT"
] | null | null | null | labels/migrations/0002_auto_20210210_0110.py | plaf2000/webspec | 487ccccff088ddbda0e5e475aaad167a01f4aab2 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2021-02-10 01:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('labels', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='species',
name='de',
field=m... | 26.552632 | 63 | 0.544103 | 916 | 0.90783 | 0 | 0 | 0 | 0 | 0 | 0 | 129 | 0.127849 |
3f9a7e714891705f693edf84f2253bf5255cd0d3 | 399 | py | Python | src/MeshSegmentation/conjgrad.py | paigeco/VirtualGoniometer | 536e7e77fbb036ad8d777b42e751a0f3e80b8242 | [
"CC0-1.0"
] | 1 | 2021-02-22T02:53:26.000Z | 2021-02-22T02:53:26.000Z | src/MeshSegmentation/conjgrad.py | paigeco/VirtualGoniometer | 536e7e77fbb036ad8d777b42e751a0f3e80b8242 | [
"CC0-1.0"
] | 5 | 2021-03-26T15:15:34.000Z | 2021-06-11T20:16:00.000Z | src/MeshSegmentation/conjgrad.py | paigeco/VirtualGoniometer | 536e7e77fbb036ad8d777b42e751a0f3e80b8242 | [
"CC0-1.0"
] | null | null | null | import numpy as np
def conjgrad(A, b, x, T, tol):
r = b - A@x
p = r
rsold = np.sum(r * r, 0)
for i in range(T):
Ap = A@p
alpha = rsold / np.sum(p*Ap, 0)
x = x + alpha*p
r = r - alpha*Ap
rsnew = np.sum(r*r, 0)
if np.sqrt(np.sum(rsnew)) < tol:
b... | 22.166667 | 40 | 0.43609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3f9ba869b5d88cbcf4492c69120be7f5826782f4 | 569 | py | Python | handlers/_my.py | MelomanCool/telegram-stickers | 62ee6e5c89bf6793a6d64ec0865b6f79582b3974 | [
"MIT"
] | null | null | null | handlers/_my.py | MelomanCool/telegram-stickers | 62ee6e5c89bf6793a6d64ec0865b6f79582b3974 | [
"MIT"
] | 7 | 2017-12-18T20:07:57.000Z | 2021-06-21T13:50:30.000Z | handlers/_my.py | MelomanCool/telegram-stickers | 62ee6e5c89bf6793a6d64ec0865b6f79582b3974 | [
"MIT"
] | null | null | null | import model
sticker_storage = model.get_storage()
def my(_, update):
"""Prints stickers added by user"""
message = update.message
user_id = update.message.from_user.id
stickers = sticker_storage.get_for_owner(user_id, max_count=20, tagged=True)
text = '\n\n'.join(
'Tags: {tags}\n'
... | 22.76 | 80 | 0.602812 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 118 | 0.207381 |
3f9c9921caf4c6f97ced7380a73a7c255bf458f6 | 9,587 | py | Python | src/forest/main.py | ADVRHumanoids/forest | 22995b7bebf9809d49b0887dcb4a35c907fb3e13 | [
"MIT"
] | null | null | null | src/forest/main.py | ADVRHumanoids/forest | 22995b7bebf9809d49b0887dcb4a35c907fb3e13 | [
"MIT"
] | 6 | 2022-02-24T14:00:39.000Z | 2022-03-31T14:35:18.000Z | src/forest/main.py | ADVRHumanoids/forest | 22995b7bebf9809d49b0887dcb4a35c907fb3e13 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import getpass
import os
import sys
import argcomplete
from datetime import datetime
from forest import cmake_tools
from forest.common.eval_handler import EvalHandler
from forest.common.install import install_package, write_setup_file, write_ws_file, check_ws_file, uninstall_pac... | 45.870813 | 240 | 0.682487 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,224 | 0.336289 |
3f9ec030fef5007a3fee6e257fb29f26ca2ccd76 | 1,849 | py | Python | csc140/divideAndConquer/maximumSubArray.py | Matt-Crow/SmallPythonPrograms | 660dad09e1e8472e4bb4f0464117ccac63dbd7ea | [
"MIT"
] | 1 | 2019-12-11T21:56:59.000Z | 2019-12-11T21:56:59.000Z | csc140/divideAndConquer/maximumSubArray.py | Matt-Crow/SmallPythonPrograms | 660dad09e1e8472e4bb4f0464117ccac63dbd7ea | [
"MIT"
] | null | null | null | csc140/divideAndConquer/maximumSubArray.py | Matt-Crow/SmallPythonPrograms | 660dad09e1e8472e4bb4f0464117ccac63dbd7ea | [
"MIT"
] | null | null | null | """
Given an array of numbers, find the subarray that maximizes the sum of all
elements in the array. Note that these numbers can be negative
"""
import random
def createArray(n):
nums = []
for i in range(n):
nums.append(random.randint(-10, 10))
return nums
def bruteForceBest(a):
best = a... | 24.012987 | 74 | 0.567334 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 529 | 0.286101 |
3f9f5148d14b1213378b99075bb02d7c56142c61 | 1,101 | py | Python | setup.py | thusoy/blag | 183f5c5c6be16d8f22b269e574396d957d5f1895 | [
"MIT"
] | null | null | null | setup.py | thusoy/blag | 183f5c5c6be16d8f22b269e574396d957d5f1895 | [
"MIT"
] | 10 | 2015-02-23T22:55:15.000Z | 2022-01-07T19:48:42.000Z | setup.py | thusoy/blag | 183f5c5c6be16d8f22b269e574396d957d5f1895 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup, find_packages
import os
def package_files(directory, relative_to):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
full_path = os.path.join(path, filename)
final... | 25.022727 | 92 | 0.629428 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 266 | 0.241379 |
3fa22069ae5fe18f29c6332040788c47fba607ea | 469 | py | Python | DataStructures/Stacks/TextEditor.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Stacks/TextEditor.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Stacks/TextEditor.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
N = int(raw_input())
S = ''
stack = [S]
for _ in xrange(N):
s = raw_input()
if s.startswith('1'):
S = ''.join((S, s.split()[-1]))
stack.append(S)
elif s.startswith('2'):
k = int(s.split()[-1])
S = S[:-k]
stack.append(S)
elif s.startswith('3'):
... | 19.541667 | 39 | 0.447761 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0.061834 |
3fa25fe67ade7748177cb9602ea922bfde19db47 | 2,601 | py | Python | backend/server/services.py | Masyru/gisspot | 472e7d6c321c3a9db01ffdb8573e612caaf8a13b | [
"Apache-2.0"
] | null | null | null | backend/server/services.py | Masyru/gisspot | 472e7d6c321c3a9db01ffdb8573e612caaf8a13b | [
"Apache-2.0"
] | null | null | null | backend/server/services.py | Masyru/gisspot | 472e7d6c321c3a9db01ffdb8573e612caaf8a13b | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from typing import Optional, List, Dict
import sys
sys.path.append("../../")
from backend.server.pd_model import *
from backend.queue.services import add_task, stop_all_ws_task
from backend.database.main import gis_stac
__all__ = ["preview_processing", "vector_processing", "refuse_proces... | 34.68 | 89 | 0.626682 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 459 | 0.17499 |
3fa285fbe23a04fd466fb79a701560d794e0830d | 530 | py | Python | openwater/views.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | 3 | 2015-05-25T07:41:42.000Z | 2020-05-18T05:50:40.000Z | openwater/views.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | null | null | null | openwater/views.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.base import TemplateView
from diario.models import Entry
from observations.models import Measurement
class HomePageView(TemplateView):
template_name = "home.html"
def get_context_data(self, **kwargs):
context = super(HomePageV... | 27.894737 | 92 | 0.711321 | 352 | 0.664151 | 0 | 0 | 0 | 0 | 0 | 0 | 105 | 0.198113 |
3fa32905c78137776bdb65ffa8ff14608ab1abe6 | 1,516 | py | Python | backtrace_with_time/backtrace_with_time.py | chimicus/addons | 0fa1110df999fc9a8622a12e00453fc67b62fce1 | [
"BSD-3-Clause"
] | null | null | null | backtrace_with_time/backtrace_with_time.py | chimicus/addons | 0fa1110df999fc9a8622a12e00453fc67b62fce1 | [
"BSD-3-Clause"
] | 6 | 2019-08-23T15:53:05.000Z | 2021-07-14T08:24:06.000Z | backtrace_with_time/backtrace_with_time.py | chimicus/addons | 0fa1110df999fc9a8622a12e00453fc67b62fce1 | [
"BSD-3-Clause"
] | 3 | 2019-11-04T12:02:11.000Z | 2020-03-05T13:57:11.000Z | """
Adds a ubt command which adds basic block counts to frames within a backtrace.
Usage: ubt
Contributors: Isa Smith, Toby Lloyd Davies
Copyright (C) 2019 Undo Ltd
"""
import gdb
from undodb.debugger_extensions import (
debugger_utils,
udb,
)
class BacktraceWithTime(gdb.Command):
def __init__(self)... | 31.583333 | 79 | 0.566623 | 1,233 | 0.813325 | 0 | 0 | 1,116 | 0.736148 | 0 | 0 | 511 | 0.337071 |
3fa6b41c13b8399c331e3ed2f410f771408be4f8 | 680 | py | Python | envoy/examples/puma-proxy/internal_lib/backend/netflix/database_connect.py | kevinjesse/puma | 163a363275bf5d84d1957aaf23783be84053e40f | [
"MIT"
] | null | null | null | envoy/examples/puma-proxy/internal_lib/backend/netflix/database_connect.py | kevinjesse/puma | 163a363275bf5d84d1957aaf23783be84053e40f | [
"MIT"
] | null | null | null | envoy/examples/puma-proxy/internal_lib/backend/netflix/database_connect.py | kevinjesse/puma | 163a363275bf5d84d1957aaf23783be84053e40f | [
"MIT"
] | null | null | null | #
# @author Kevin Jesse
# @email [email protected]
#
"""
Database Connect serves to connect to the database postgres, as the master user. Autocommit has been turned on so
all inserts, updates, and deletes will be enforced atomically
"""
import psycopg2
def db_connect():
cur = None
try:
conn = p... | 30.909091 | 125 | 0.695588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 450 | 0.661765 |
3fa903d69a123b3bf76665218092b5512ddf68eb | 6,590 | py | Python | tests/integration_tests/data_steward/cdr_cleaner/cleaning_rules/remove_participants_under_18years_test.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 16 | 2017-06-30T20:05:05.000Z | 2022-03-08T21:03:19.000Z | tests/integration_tests/data_steward/cdr_cleaner/cleaning_rules/remove_participants_under_18years_test.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 342 | 2017-06-23T21:37:40.000Z | 2022-03-30T16:44:16.000Z | tests/integration_tests/data_steward/cdr_cleaner/cleaning_rules/remove_participants_under_18years_test.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 33 | 2017-07-01T00:12:20.000Z | 2022-01-26T18:06:53.000Z | """
Integration test for remove_participants_under_18years module
Original Issues: DC-1724
The intent is to remove data for participants under 18 years old from all the domain tables."""
# Python Imports
import os
import datetime
# Project Imports
from common import VISIT_OCCURRENCE, OBSERVATION
from common import... | 42.792208 | 113 | 0.579363 | 4,505 | 0.683612 | 0 | 0 | 1,282 | 0.194537 | 0 | 0 | 3,176 | 0.481942 |
3fa9343aaf14f40f21e088d8570e50cd71a50d99 | 609 | py | Python | exercises/en/solution_08_15.py | Lavendulaa/programming-in-python-for-data-science | bc41da8afacf4c180ae0ff9c6dc26a7e6292252f | [
"MIT"
] | 1 | 2020-06-26T20:15:44.000Z | 2020-06-26T20:15:44.000Z | exercises/en/solution_08_15.py | Lavendulaa/programming-in-python-for-data-science | bc41da8afacf4c180ae0ff9c6dc26a7e6292252f | [
"MIT"
] | 20 | 2020-06-15T23:05:20.000Z | 2020-09-01T22:07:45.000Z | exercises/en/solution_08_15.py | UBC-MDS/MCL-programming-in-python | 22836d9013d3e3d1b1074678ba7dc3ee2e66f398 | [
"MIT"
] | 1 | 2020-05-09T03:49:02.000Z | 2020-05-09T03:49:02.000Z | import pandas as pd
canucks = pd.read_csv('data/canucks.csv')
# Identify any columns with null values with .info()
# Save this dataframe as canucks_info
canucks_info = canucks.info()
canucks_info
# Create a new column in the dataframe named Wealth
# where all the values equal "comfortable"
# Name the new dataframe ... | 27.681818 | 78 | 0.770115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 395 | 0.648604 |
3faaaf65e1a880fbb043da470d287b3c90f587fb | 1,412 | py | Python | 题源分类/LeetCode/LeetCode日刷/python/461.汉明距离.py | ZhengyangXu/Algorithm-Daily-Practice | 3017a3d476fc9a857026190ea4fae2911058df59 | [
"MIT"
] | null | null | null | 题源分类/LeetCode/LeetCode日刷/python/461.汉明距离.py | ZhengyangXu/Algorithm-Daily-Practice | 3017a3d476fc9a857026190ea4fae2911058df59 | [
"MIT"
] | null | null | null | 题源分类/LeetCode/LeetCode日刷/python/461.汉明距离.py | ZhengyangXu/Algorithm-Daily-Practice | 3017a3d476fc9a857026190ea4fae2911058df59 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=461 lang=python3
#
# [461] 汉明距离
#
# https://leetcode-cn.com/problems/hamming-distance/description/
#
# algorithms
# Easy (79.21%)
# Likes: 459
# Dislikes: 0
# Total Accepted: 137K
# Total Submissions: 170K
# Testcase Example: '1\n4'
#
# 两个整数之间的汉明距离指的是这两个数字对应二进制位不同的位置的数目。
#
# 给出两个整数 x ... | 18.578947 | 64 | 0.431303 | 190 | 0.118899 | 0 | 0 | 0 | 0 | 0 | 0 | 1,195 | 0.74781 |
3fab256836e3c2695afaebffbd3e344034438d33 | 4,413 | py | Python | emissionsapi/db.py | brennerm/emissions-api | 577fa209ffd27476ff1ad0904ecc081564cf8f53 | [
"MIT"
] | null | null | null | emissionsapi/db.py | brennerm/emissions-api | 577fa209ffd27476ff1ad0904ecc081564cf8f53 | [
"MIT"
] | null | null | null | emissionsapi/db.py | brennerm/emissions-api | 577fa209ffd27476ff1ad0904ecc081564cf8f53 | [
"MIT"
] | null | null | null | """Database Layer for the Emmission API.
"""
from functools import wraps
from sqlalchemy import create_engine, Column, DateTime, Integer, Float, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
import geoalchemy2
from emissionsapi.config import config
import emi... | 30.226027 | 78 | 0.686155 | 911 | 0.206436 | 0 | 0 | 493 | 0.111715 | 0 | 0 | 2,310 | 0.523453 |
3fabfef911568657e72bad1d7f657b6017f3f593 | 2,217 | py | Python | cmdb/views.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | 3 | 2015-11-05T07:29:00.000Z | 2021-06-17T23:44:17.000Z | cmdb/views.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | 1 | 2016-05-04T10:54:48.000Z | 2016-05-04T10:54:56.000Z | cmdb/views.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of the Edison Project.
# Please refer to the LICENSE document that was supplied with this software for information on how it can be used.
# Create your views here.
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response, get_object_or_404
from django.template im... | 36.344262 | 162 | 0.722598 | 76 | 0.034281 | 0 | 0 | 1,380 | 0.622463 | 0 | 0 | 625 | 0.281912 |
3fac52a8d1c05423e274506bc3a7a1b6ae3c1a67 | 553 | py | Python | setup.py | williamgilpin/pypdb_legacy | 5c0586128415ec64804d17dd3efa0a4e52b64734 | [
"MIT"
] | null | null | null | setup.py | williamgilpin/pypdb_legacy | 5c0586128415ec64804d17dd3efa0a4e52b64734 | [
"MIT"
] | null | null | null | setup.py | williamgilpin/pypdb_legacy | 5c0586128415ec64804d17dd3efa0a4e52b64734 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name = 'pypdb',
packages = ['pypdb'], # same as 'name'
version = '1.310',
install_requires=[
'xmltodict',
'beautifulsoup4',
'requests'
],
description = 'A Python wrapper for the RCSB Protein Data Bank (PDB) API',
author = 'William Gilpin',
author_... | 26.333333 | 76 | 0.652803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 300 | 0.542495 |
3fac820670f21ea8c46cbcd7d979941dd6e7c18a | 409,678 | py | Python | 3algo/homo/1_10_10datap.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | null | null | null | 3algo/homo/1_10_10datap.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | null | null | null | 3algo/homo/1_10_10datap.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | 1 | 2021-03-21T17:54:26.000Z | 2021-03-21T17:54:26.000Z |
wt1_10_10 = {'192.168.122.110': [5.5754, 5.5952, 9.2422, 8.5338, 9.0058, 8.4025, 8.7557, 8.4405, 8.1397, 8.1318, 8.0657, 7.8501, 8.1701, 8.0757, 7.8899, 7.7329, 7.6153, 7.9967, 7.9363, 7.838, 8.7936, 8.6351, 8.5151, 8.6381, 8.7262, 8.816, 8.8984, 8.7799, 8.8584, 8.9543, 8.8833, 8.794, 8.6935, 8.735, 8.635, 8.5429, 8.6... | 25,604.875 | 386,495 | 0.620085 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 333 | 0.000813 |
3facb12be8784f2c2576c973d9abccef35b78a25 | 940 | py | Python | awwards/urls.py | cossie14/slyawwards | 8babb043843dee836644b311809c5c1727e1de69 | [
"MIT"
] | null | null | null | awwards/urls.py | cossie14/slyawwards | 8babb043843dee836644b311809c5c1727e1de69 | [
"MIT"
] | 4 | 2021-03-19T03:24:59.000Z | 2021-09-08T01:16:07.000Z | awwards/urls.py | cossie14/slyawwards | 8babb043843dee836644b311809c5c1727e1de69 | [
"MIT"
] | null | null | null |
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import include,url
from . import views
urlpatterns=[
url(r'api/user/user-id/(?P<pk>[0-9]+)/$',
views.UserDescription.as_view()),
url(r'api/project/project-id/(?P<pk>[0-9]+)/$',
views.ProjectDesc... | 33.571429 | 81 | 0.667021 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 267 | 0.284043 |
3faf19d3bce07009761ea272b335839c3b750a3e | 3,485 | py | Python | webinar_part_2/2.0_nxos_existing_with_netbox/setup.py | Miradot/webinar | d6f4b54477e2dabf856406d65ad585c98066bc2f | [
"MIT"
] | 1 | 2021-12-21T21:20:48.000Z | 2021-12-21T21:20:48.000Z | webinar_part_2/2.0_nxos_existing_with_netbox/setup.py | Miradot/webinar | d6f4b54477e2dabf856406d65ad585c98066bc2f | [
"MIT"
] | null | null | null | webinar_part_2/2.0_nxos_existing_with_netbox/setup.py | Miradot/webinar | d6f4b54477e2dabf856406d65ad585c98066bc2f | [
"MIT"
] | null | null | null | import yaml
import argparse
from ansible_vault import Vault
def create_file(args):
svc = open("netbox_tools/webhook_proxy_svc.py", "r")
all_lines = svc.readlines()
svc = open("netbox_tools/webhook_proxy_svc.py", "w")
for index, content in enumerate(all_lines):
if "'token'" in content:
... | 37.880435 | 115 | 0.631564 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,192 | 0.342037 |
3fb0b9f6019a06b844fd3dd799c2b173e97e1ff6 | 448 | py | Python | Core/solar/performance_ratio.py | ncatunda/hive | 721731ce83c9ccd4ff1db224824a234035fbcd30 | [
"MIT"
] | null | null | null | Core/solar/performance_ratio.py | ncatunda/hive | 721731ce83c9ccd4ff1db224824a234035fbcd30 | [
"MIT"
] | null | null | null | Core/solar/performance_ratio.py | ncatunda/hive | 721731ce83c9ccd4ff1db224824a234035fbcd30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The data is (should be) based on the lecture Energie und Klimasysteme II,
Erneuerbare Energieerzeugung am Gebäude, FS 2019, Folie 30,
"""
from __future__ import print_function
def get_performance_ratio(performance_scenario):
# return "\n".join("{key}: {value}".format(key=key, value=va... | 37.333333 | 74 | 0.705357 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 315 | 0.701559 |
3fb1e5989581de8b3d3c0c1f32458f03c00fd7bf | 2,901 | py | Python | tests/e2e/process_chm15k/tests.py | actris-cloudnet/data-processing | 8ab6fccd5cf48e10e985addcf339b9698a9b09cd | [
"MIT"
] | null | null | null | tests/e2e/process_chm15k/tests.py | actris-cloudnet/data-processing | 8ab6fccd5cf48e10e985addcf339b9698a9b09cd | [
"MIT"
] | 5 | 2020-08-27T12:34:08.000Z | 2021-09-28T14:49:20.000Z | tests/e2e/process_chm15k/tests.py | actris-cloudnet/data-processing | 8ab6fccd5cf48e10e985addcf339b9698a9b09cd | [
"MIT"
] | null | null | null | import netCDF4
from os import path
from test_utils.utils import count_strings, read_log_file
import pytest
SCRIPT_PATH = path.dirname(path.realpath(__file__))
class TestChm15kProcessing:
product = 'lidar'
instrument = 'chm15k'
@pytest.fixture(autouse=True)
def _fetch_params(self, params):
s... | 32.595506 | 122 | 0.641848 | 2,738 | 0.943812 | 0 | 0 | 2,620 | 0.903137 | 0 | 0 | 922 | 0.317821 |
3fb2a77029f3ade78cfb9fb154c1aca159746d1e | 1,371 | py | Python | type_page/models.py | dumel93/project- | f9ad52d9c8449953e2151fd1c13b39631113eea7 | [
"MIT"
] | null | null | null | type_page/models.py | dumel93/project- | f9ad52d9c8449953e2151fd1c13b39631113eea7 | [
"MIT"
] | null | null | null | type_page/models.py | dumel93/project- | f9ad52d9c8449953e2151fd1c13b39631113eea7 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
from .validators import validate_bet, validate_course
class User(AbstractUser):
email = models.EmailField('email address', unique=True)
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['username']
class FootballType(models.Model... | 33.439024 | 94 | 0.66229 | 1,230 | 0.897155 | 0 | 0 | 325 | 0.237053 | 0 | 0 | 55 | 0.040117 |
3fb31909a92b7362c0a031af95a6855ca677513e | 759 | py | Python | applications/pytorch/cnns/utils/distributed.py | kew96/GraphcoreExamples | 22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb | [
"MIT"
] | null | null | null | applications/pytorch/cnns/utils/distributed.py | kew96/GraphcoreExamples | 22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb | [
"MIT"
] | null | null | null | applications/pytorch/cnns/utils/distributed.py | kew96/GraphcoreExamples | 22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import logging
import popdist
import popdist.poptorch
import horovod.torch as hvd
def handle_distributed_settings(opts):
# Initialise popdist
if popdist.isPopdistEnvSet():
init_popdist(opts)
else:
opts.use_popdist = False
def init_... | 30.36 | 122 | 0.732543 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 176 | 0.231884 |
3fb348a99aed4f8624038b9f92d6819ccde7fa22 | 589 | py | Python | aiohttp_apispec/decorators/__init__.py | maksimvrs/aiohttp-apispec | 186e354ce244ccc4b36999bca56a9d8ca41e63d0 | [
"MIT"
] | null | null | null | aiohttp_apispec/decorators/__init__.py | maksimvrs/aiohttp-apispec | 186e354ce244ccc4b36999bca56a9d8ca41e63d0 | [
"MIT"
] | null | null | null | aiohttp_apispec/decorators/__init__.py | maksimvrs/aiohttp-apispec | 186e354ce244ccc4b36999bca56a9d8ca41e63d0 | [
"MIT"
] | null | null | null | from .docs import docs
from .request import (
request_schema,
use_kwargs, # for backward compatibility
path_schema, # request_schema with locations=["path"]
querystring_schema, # request_schema with locations=["querystring"]
form_schema, # request_schema with locations=["form"]
json_schema, ... | 36.8125 | 72 | 0.730051 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 309 | 0.524618 |
3fb43581afcabab87376ae372e835742ac18f05a | 1,943 | py | Python | tests/api/v1/test_tags.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 17 | 2016-09-02T09:21:29.000Z | 2021-09-27T11:33:58.000Z | tests/api/v1/test_tags.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 80 | 2015-12-09T09:29:26.000Z | 2021-01-06T08:24:22.000Z | tests/api/v1/test_tags.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 10 | 2015-09-29T21:34:53.000Z | 2021-09-27T11:34:01.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 30.84127 | 75 | 0.654658 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 875 | 0.450335 |
3fb4a33534aa6e53058ff51d1739c3dcfd4acdde | 4,355 | py | Python | graypy/rabbitmq.py | bakkerd/graypy | e2782c7a5174c7c5f1006ff444f6d59487ef3c7f | [
"BSD-3-Clause"
] | null | null | null | graypy/rabbitmq.py | bakkerd/graypy | e2782c7a5174c7c5f1006ff444f6d59487ef3c7f | [
"BSD-3-Clause"
] | null | null | null | graypy/rabbitmq.py | bakkerd/graypy | e2782c7a5174c7c5f1006ff444f6d59487ef3c7f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Logging Handler integrating RabbitMQ and
Graylog Extended Log Format (GELF)"""
import json
from logging import Filter
from logging.handlers import SocketHandler
from amqplib import client_0_8 as amqp # pylint: disable=import-error
from graypy.handler import BaseGELF... | 31.330935 | 79 | 0.622503 | 3,833 | 0.880138 | 0 | 0 | 0 | 0 | 0 | 0 | 1,423 | 0.326751 |
3fb6cccbe58ab4aa99341ff7ff29997ad198d655 | 1,323 | py | Python | workmail-translate-email/src/translate_helper.py | zjt/amazon-workmail-lambda-templates | 27bcdee78634527c11c5083ecdc67360295a99e0 | [
"Apache-2.0"
] | 31 | 2019-02-20T04:52:45.000Z | 2022-03-28T14:55:27.000Z | workmail-translate-email/src/translate_helper.py | zjt/amazon-workmail-lambda-templates | 27bcdee78634527c11c5083ecdc67360295a99e0 | [
"Apache-2.0"
] | 4 | 2021-06-29T16:21:16.000Z | 2021-09-17T22:58:52.000Z | workmail-translate-email/src/translate_helper.py | zjt/amazon-workmail-lambda-templates | 27bcdee78634527c11c5083ecdc67360295a99e0 | [
"Apache-2.0"
] | 16 | 2019-02-21T13:27:10.000Z | 2021-12-25T18:49:13.000Z | import boto3
comprehend = boto3.client(service_name='comprehend')
translate = boto3.client(service_name='translate')
def detect_language(text):
"""
Detects the dominant language in a text
Parameters
----------
text: string, required
Input text
Returns
-------
string
Rep... | 29.4 | 94 | 0.665155 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 688 | 0.52003 |
3fb7186eaada6a7909f15b3f783b895109917928 | 3,768 | py | Python | mylearner.py | USC-MCL/Func-Pool | 20c43df0eb2da68d8d2e01c03d66a1a4e4e06081 | [
"MIT"
] | 3 | 2020-01-24T19:03:44.000Z | 2021-04-13T17:22:36.000Z | mylearner.py | USC-MCL/Func-Pool | 20c43df0eb2da68d8d2e01c03d66a1a4e4e06081 | [
"MIT"
] | null | null | null | mylearner.py | USC-MCL/Func-Pool | 20c43df0eb2da68d8d2e01c03d66a1a4e4e06081 | [
"MIT"
] | 3 | 2020-01-24T19:03:45.000Z | 2020-04-13T08:27:13.000Z | # 2020.05.10
# update topNscore
# learner on subspace
# particular designed for encounter missing class in this subspace
# if one class do not exists in training data, probability for this class would be zeros under anytime
#
# learner: a regressor or classifier, must have methods named 'predict'
# num_class: tota... | 36.582524 | 112 | 0.551221 | 2,565 | 0.680732 | 0 | 0 | 0 | 0 | 0 | 0 | 575 | 0.152601 |
3fb92b9dfc88175ad72437eeb1e0e07300b64bc1 | 1,077 | py | Python | pritunl_wireguard_client/utils/token.py | SuperBo/pritunl-wireguard-cient | bed4407bf2b7811f7180d72446a2dc26d45db90d | [
"MIT"
] | 1 | 2021-02-16T07:08:46.000Z | 2021-02-16T07:08:46.000Z | pritunl_wireguard_client/utils/token.py | SuperBo/pritunl-wireguard-cient | bed4407bf2b7811f7180d72446a2dc26d45db90d | [
"MIT"
] | 1 | 2022-02-08T13:34:18.000Z | 2022-02-08T13:34:18.000Z | pritunl_wireguard_client/utils/token.py | SuperBo/pritunl-wireguard-cient | bed4407bf2b7811f7180d72446a2dc26d45db90d | [
"MIT"
] | 1 | 2021-03-18T14:34:41.000Z | 2021-03-18T14:34:41.000Z | import time
import pritunl_wireguard_client.utils.random as utils
class Tokens:
def __init__(self):
self.store = dict()
def get(self, profile_id: str, ttl: int):
"""Return token for profile_id"""
if profile_id not in self.store:
self.init(profile_id, ttl)
self.upda... | 27.615385 | 53 | 0.557103 | 1,008 | 0.935933 | 0 | 0 | 0 | 0 | 0 | 0 | 153 | 0.142061 |
3fb9b92107c88b93e0868bfec40b6ae263c31ca9 | 16,812 | py | Python | github_util.py | dglo/svn2git_tools | 72aea47d801c7c674e4fe9f053a613ef88fc38c4 | [
"BSD-3-Clause"
] | null | null | null | github_util.py | dglo/svn2git_tools | 72aea47d801c7c674e4fe9f053a613ef88fc38c4 | [
"BSD-3-Clause"
] | null | null | null | github_util.py | dglo/svn2git_tools | 72aea47d801c7c674e4fe9f053a613ef88fc38c4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from __future__ import print_function
import getpass
import os
import shutil
import time
from datetime import datetime
from github import Github, GithubException, GithubObject
from git import git_init
class GithubUtilException(Exception):
"General GitHub utilities exception"
class Met... | 35.171548 | 79 | 0.583393 | 16,563 | 0.985189 | 0 | 0 | 4,427 | 0.263324 | 0 | 0 | 2,704 | 0.160837 |
3fba31ce0598188d4268a711f23cf7223b613738 | 2,299 | py | Python | moabb/analysis/__init__.py | plcrodrigues/moabb | aa4274fe7905631864e854c121c92e1927061f29 | [
"BSD-3-Clause"
] | 321 | 2017-06-03T16:14:45.000Z | 2022-03-28T17:43:59.000Z | moabb/analysis/__init__.py | plcrodrigues/moabb | aa4274fe7905631864e854c121c92e1927061f29 | [
"BSD-3-Clause"
] | 223 | 2017-06-03T17:41:57.000Z | 2022-03-29T09:07:44.000Z | moabb/analysis/__init__.py | girafe-ai/moabb | 78bbb48a2a0058b0725ebeba1ba1e3203f0eacd5 | [
"BSD-3-Clause"
] | 118 | 2017-06-03T18:36:35.000Z | 2022-03-16T06:22:02.000Z | import logging
import os
import platform
from datetime import datetime
from moabb.analysis import plotting as plt
from moabb.analysis.meta_analysis import ( # noqa: E501
compute_dataset_statistics,
find_significant_differences,
)
from moabb.analysis.results import Results # noqa: F401
log = logging.getLogg... | 32.380282 | 82 | 0.68769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 822 | 0.357547 |
3fba37decae8c7ead3f5cde9a2d0f4e93d890495 | 2,180 | py | Python | smm/lemm/numba_optimisations.py | jamesthomasgriffin/smm | 5f1f6432e17f84f7f793d60cb9831ac5c79991e6 | [
"BSD-3-Clause"
] | 2 | 2019-10-17T15:33:13.000Z | 2020-01-16T10:05:36.000Z | smm/lemm/numba_optimisations.py | jamesthomasgriffin/smm | 5f1f6432e17f84f7f793d60cb9831ac5c79991e6 | [
"BSD-3-Clause"
] | null | null | null | smm/lemm/numba_optimisations.py | jamesthomasgriffin/smm | 5f1f6432e17f84f7f793d60cb9831ac5c79991e6 | [
"BSD-3-Clause"
] | 1 | 2020-01-16T10:06:10.000Z | 2020-01-16T10:06:10.000Z | from numba import guvectorize, float64, int64, njit
import numpy as np
from smm import numba_target as target_preset
@guvectorize([(int64, float64, float64[:, :], float64[:])],
'(),(),(M,n)->(n)',
nopython=True,
target=target_preset)
def indexed_x_axpy(ix, a, x, res): # pragma:... | 31.142857 | 77 | 0.509633 | 0 | 0 | 0 | 0 | 2,045 | 0.938073 | 0 | 0 | 514 | 0.23578 |
3fba7d34fac65f02b80c4c96594e7743e1629ab8 | 783 | py | Python | exercices_todo/duplicates_find.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | exercices_todo/duplicates_find.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | exercices_todo/duplicates_find.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | """
How to find only the duplicates
"""
some_list = ['a', 'b', 'c', 'b', 'd', 'm', 'n', 'n']
duplicates = [] # o noua lista unde adaugam duplicatele
for value in some_list:
if some_list.count(value) > 1: # cand in lista numaram fiecare valoarea si se gaseste mai mult de o data
if value not in duplicates... | 35.590909 | 117 | 0.664112 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 453 | 0.578544 |