hexsha
string | size
int64 | ext
string | lang
string | max_stars_repo_path
string | max_stars_repo_name
string | max_stars_repo_head_hexsha
string | max_stars_repo_licenses
list | max_stars_count
int64 | max_stars_repo_stars_event_min_datetime
string | max_stars_repo_stars_event_max_datetime
string | max_issues_repo_path
string | max_issues_repo_name
string | max_issues_repo_head_hexsha
string | max_issues_repo_licenses
list | max_issues_count
int64 | max_issues_repo_issues_event_min_datetime
string | max_issues_repo_issues_event_max_datetime
string | max_forks_repo_path
string | max_forks_repo_name
string | max_forks_repo_head_hexsha
string | max_forks_repo_licenses
list | max_forks_count
int64 | max_forks_repo_forks_event_min_datetime
string | max_forks_repo_forks_event_max_datetime
string | content
string | avg_line_length
float64 | max_line_length
int64 | alphanum_fraction
float64 | qsc_code_num_words_quality_signal
int64 | qsc_code_num_chars_quality_signal
float64 | qsc_code_mean_word_length_quality_signal
float64 | qsc_code_frac_words_unique_quality_signal
float64 | qsc_code_frac_chars_top_2grams_quality_signal
float64 | qsc_code_frac_chars_top_3grams_quality_signal
float64 | qsc_code_frac_chars_top_4grams_quality_signal
float64 | qsc_code_frac_chars_dupe_5grams_quality_signal
float64 | qsc_code_frac_chars_dupe_6grams_quality_signal
float64 | qsc_code_frac_chars_dupe_7grams_quality_signal
float64 | qsc_code_frac_chars_dupe_8grams_quality_signal
float64 | qsc_code_frac_chars_dupe_9grams_quality_signal
float64 | qsc_code_frac_chars_dupe_10grams_quality_signal
float64 | qsc_code_frac_chars_replacement_symbols_quality_signal
float64 | qsc_code_frac_chars_digital_quality_signal
float64 | qsc_code_frac_chars_whitespace_quality_signal
float64 | qsc_code_size_file_byte_quality_signal
float64 | qsc_code_num_lines_quality_signal
float64 | qsc_code_num_chars_line_max_quality_signal
float64 | qsc_code_num_chars_line_mean_quality_signal
float64 | qsc_code_frac_chars_alphabet_quality_signal
float64 | qsc_code_frac_chars_comments_quality_signal
float64 | qsc_code_cate_xml_start_quality_signal
float64 | qsc_code_frac_lines_dupe_lines_quality_signal
float64 | qsc_code_cate_autogen_quality_signal
float64 | qsc_code_frac_lines_long_string_quality_signal
float64 | qsc_code_frac_chars_string_length_quality_signal
float64 | qsc_code_frac_chars_long_word_length_quality_signal
float64 | qsc_code_frac_lines_string_concat_quality_signal
float64 | qsc_code_cate_encoded_data_quality_signal
float64 | qsc_code_frac_chars_hex_words_quality_signal
float64 | qsc_code_frac_lines_prompt_comments_quality_signal
float64 | qsc_code_frac_lines_assert_quality_signal
float64 | qsc_codepython_cate_ast_quality_signal
float64 | qsc_codepython_frac_lines_func_ratio_quality_signal
float64 | qsc_codepython_cate_var_zero_quality_signal
bool | qsc_codepython_frac_lines_pass_quality_signal
float64 | qsc_codepython_frac_lines_import_quality_signal
float64 | qsc_codepython_frac_lines_simplefunc_quality_signal
float64 | qsc_codepython_score_lines_no_logic_quality_signal
float64 | qsc_codepython_frac_lines_print_quality_signal
float64 | qsc_code_num_words
int64 | qsc_code_num_chars
int64 | qsc_code_mean_word_length
int64 | qsc_code_frac_words_unique
null | qsc_code_frac_chars_top_2grams
int64 | qsc_code_frac_chars_top_3grams
int64 | qsc_code_frac_chars_top_4grams
int64 | qsc_code_frac_chars_dupe_5grams
int64 | qsc_code_frac_chars_dupe_6grams
int64 | qsc_code_frac_chars_dupe_7grams
int64 | qsc_code_frac_chars_dupe_8grams
int64 | qsc_code_frac_chars_dupe_9grams
int64 | qsc_code_frac_chars_dupe_10grams
int64 | qsc_code_frac_chars_replacement_symbols
int64 | qsc_code_frac_chars_digital
int64 | qsc_code_frac_chars_whitespace
int64 | qsc_code_size_file_byte
int64 | qsc_code_num_lines
int64 | qsc_code_num_chars_line_max
int64 | qsc_code_num_chars_line_mean
int64 | qsc_code_frac_chars_alphabet
int64 | qsc_code_frac_chars_comments
int64 | qsc_code_cate_xml_start
int64 | qsc_code_frac_lines_dupe_lines
int64 | qsc_code_cate_autogen
int64 | qsc_code_frac_lines_long_string
int64 | qsc_code_frac_chars_string_length
int64 | qsc_code_frac_chars_long_word_length
int64 | qsc_code_frac_lines_string_concat
null | qsc_code_cate_encoded_data
int64 | qsc_code_frac_chars_hex_words
int64 | qsc_code_frac_lines_prompt_comments
int64 | qsc_code_frac_lines_assert
int64 | qsc_codepython_cate_ast
int64 | qsc_codepython_frac_lines_func_ratio
int64 | qsc_codepython_cate_var_zero
int64 | qsc_codepython_frac_lines_pass
int64 | qsc_codepython_frac_lines_import
int64 | qsc_codepython_frac_lines_simplefunc
int64 | qsc_codepython_score_lines_no_logic
int64 | qsc_codepython_frac_lines_print
int64 | effective
string | hits
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1e5268950470311876f7f86a137de61245cf0a46
| 12,443
|
py
|
Python
|
venv/Lib/site-packages/pymessenger/bot.py
|
shivamsahni/Bot-to-live
|
7b02e02012965bae873ae042aafe0ba76e12e7f5
|
[
"Apache-2.0"
] | null | null | null |
venv/Lib/site-packages/pymessenger/bot.py
|
shivamsahni/Bot-to-live
|
7b02e02012965bae873ae042aafe0ba76e12e7f5
|
[
"Apache-2.0"
] | null | null | null |
venv/Lib/site-packages/pymessenger/bot.py
|
shivamsahni/Bot-to-live
|
7b02e02012965bae873ae042aafe0ba76e12e7f5
|
[
"Apache-2.0"
] | null | null | null |
import json
import requests
from requests_toolbelt import MultipartEncoder
from pymessenger.graph_api import FacebookGraphApi
import pymessenger.utils as utils
class Bot(FacebookGraphApi):
def __init__(self, *args, **kwargs):
super(Bot, self).__init__(*args, **kwargs)
def send_text_message(self, recipient_id, message):
'''Send text messages to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/text-message
Input:
recipient_id: recipient id to send to
message: message to send
Output:
Response from API as <dict>
'''
payload = {
'recipient': {
'id': recipient_id
},
'message': {
'text': message
}
}
return self.send_raw(payload)
def send_message(self, recipient_id, message):
'''Send text messages to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/text-message
Input:
recipient_id: recipient id to send to
message: raw message to send
Output:
Response from API as <dict>
'''
payload = {
'recipient': {
'id': recipient_id
},
'message': message
}
return self.send_raw(payload)
def send_generic_message(self, recipient_id, elements):
'''Send generic messages to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template
Input:
recipient_id: recipient id to send to
elements: generic message elements to send
Output:
Response from API as <dict>
'''
payload = {
'recipient': {
'id': recipient_id
},
'message': {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": elements
}
}
}
}
return self.send_raw(payload)
def send_button_message(self, recipient_id, text, buttons):
'''Send text messages to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template
Input:
recipient_id: recipient id to send to
text: text of message to send
buttons: buttons to send
Output:
Response from API as <dict>
'''
payload = {
'recipient': {
'id': recipient_id
},
'message': {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": text,
"buttons": buttons
}
}
}
}
return self.send_raw(payload)
def send_image(self, recipient_id, image_path):
'''Send an image to the specified recipient.
Image must be PNG or JPEG or GIF (more might be supported).
https://developers.facebook.com/docs/messenger-platform/send-api-reference/image-attachment
Input:
recipient_id: recipient id to send to
image_path: path to image to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'image',
'payload': {}
}
}
),
'filedata': (image_path, open(image_path, 'rb'))
}
multipart_data = MultipartEncoder(payload)
multipart_header = {
'Content-Type': multipart_data.content_type
}
return requests.post(self.base_url, data=multipart_data, headers=multipart_header).json()
def send_image_url(self, recipient_id, image_url):
'''Send an image to specified recipient using URL.
Image must be PNG or JPEG or GIF (more might be supported).
https://developers.facebook.com/docs/messenger-platform/send-api-reference/image-attachment
Input:
recipient_id: recipient id to send to
image_url: url of image to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'image',
'payload': {
'url': image_url
}
}
}
)
}
return self.send_raw(payload)
def send_action(self, recipient_id, action):
'''Send typing indicators or send read receipts to the specified recipient.
Image must be PNG or JPEG.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions
Input:
recipient_id: recipient id to send to
action: action type (mark_seen, typing_on, typing_off)
Output:
Response from API as <dict>
'''
payload = {
'recipient': {
'id': recipient_id
},
'sender_action': action
}
return self.send_raw(payload)
def _send_payload(self, payload):
''' Deprecated, use send_raw instead '''
return self.send_raw(payload)
def send_raw(self, payload):
request_endpoint = '{0}/me/messages'.format(self.graph_url)
response = requests.post(
request_endpoint,
params=self.auth_args,
json=payload
)
result = response.json()
return result
def send_audio(self, recipient_id, audio_path):
'''Send audio to the specified recipient.
Audio must be MP3 or WAV
https://developers.facebook.com/docs/messenger-platform/send-api-reference/audio-attachment
Input:
recipient_id: recipient id to send to
audio_path: path to audio to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'audio',
'payload': {}
}
}
),
'filedata': (audio_path, open(image_path, 'rb'))
}
multipart_data = MultipartEncoder(payload)
multipart_header = {
'Content-Type': multipart_data.content_type
}
return requests.post(self.base_url, data=multipart_data, headers=multipart_header).json()
def send_audio_url(self, recipient_id, audio_url):
'''Send audio to specified recipient using URL.
Audio must be MP3 or WAV
https://developers.facebook.com/docs/messenger-platform/send-api-reference/audio-attachment
Input:
recipient_id: recipient id to send to
audio_url: url of audio to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'audio',
'payload': {
'url': audio_url
}
}
}
)
}
return self.send_raw(payload)
def send_video(self, recipient_id, video_path):
'''Send video to the specified recipient.
Video should be MP4 or MOV, but supports more (https://www.facebook.com/help/218673814818907).
https://developers.facebook.com/docs/messenger-platform/send-api-reference/video-attachment
Input:
recipient_id: recipient id to send to
video_path: path to video to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'audio',
'payload': {}
}
}
),
'filedata': (video_path, open(image_path, 'rb'))
}
multipart_data = MultipartEncoder(payload)
multipart_header = {
'Content-Type': multipart_data.content_type
}
return requests.post(self.base_url, data=multipart_data, headers=multipart_header).json()
def send_video_url(self, recipient_id, video_url):
'''Send video to specified recipient using URL.
Video should be MP4 or MOV, but supports more (https://www.facebook.com/help/218673814818907).
https://developers.facebook.com/docs/messenger-platform/send-api-reference/video-attachment
Input:
recipient_id: recipient id to send to
video_url: url of video to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'audio',
'payload': {
'url': video_url
}
}
}
)
}
return self.send_raw(payload)
def send_file(self, recipient_id, file_path):
'''Send file to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/file-attachment
Input:
recipient_id: recipient id to send to
file_path: path to file to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'file',
'payload': {}
}
}
),
'filedata': (file_path, open(image_path, 'rb'))
}
multipart_data = MultipartEncoder(payload)
multipart_header = {
'Content-Type': multipart_data.content_type
}
return requests.post(self.base_url, data=multipart_data, headers=multipart_header).json()
def send_file_url(self, recipient_id, file_url):
'''Send file to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/file-attachment
Input:
recipient_id: recipient id to send to
file_url: url of file to be sent
Output:
Response from API as <dict>
'''
payload = {
'recipient': json.dumps(
{
'id': recipient_id
}
),
'message': json.dumps(
{
'attachment': {
'type': 'file',
'payload': {
'url': file_url
}
}
}
)
}
return self.send_raw(payload)
| 32.831135
| 102
| 0.486699
| 1,138
| 12,443
| 5.190685
| 0.099297
| 0.106145
| 0.05722
| 0.067039
| 0.786694
| 0.772473
| 0.767902
| 0.74691
| 0.710852
| 0.696293
| 0
| 0.004872
| 0.422647
| 12,443
| 378
| 103
| 32.917989
| 0.817372
| 0.313992
| 0
| 0.487603
| 0
| 0
| 0.088915
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.066116
| false
| 0
| 0.020661
| 0
| 0.152893
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1e5d0515db94e5b2af48b2083b8a5e93feb06991
| 101
|
py
|
Python
|
Python_Network_Automation_II/chapter15_codes/print_hello_friend.py
|
yasser296/Python-Projects
|
eae3598e2d4faf08d9def92c8b417c2e7946c5f4
|
[
"MIT"
] | null | null | null |
Python_Network_Automation_II/chapter15_codes/print_hello_friend.py
|
yasser296/Python-Projects
|
eae3598e2d4faf08d9def92c8b417c2e7946c5f4
|
[
"MIT"
] | null | null | null |
Python_Network_Automation_II/chapter15_codes/print_hello_friend.py
|
yasser296/Python-Projects
|
eae3598e2d4faf08d9def92c8b417c2e7946c5f4
|
[
"MIT"
] | null | null | null |
#print_hello_friend.py
from datetime import datetime
print(datetime.now())
print("G'day Mate!")
| 20.2
| 30
| 0.742574
| 15
| 101
| 4.866667
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128713
| 101
| 4
| 31
| 25.25
| 0.829545
| 0.207921
| 0
| 0
| 0
| 0
| 0.146667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
1e789078e52f00f46c0cd236933246f1a80c7cb5
| 183
|
py
|
Python
|
Beginner/SolutionByJagmeet_CheckEvenOdd.py
|
man21/IOSD-UIETKUK-HacktoberFest-Meetup-2019
|
8ca1a8bf95ee98d303d3a909c448288fa5992210
|
[
"Apache-2.0"
] | 22
|
2019-10-02T16:48:10.000Z
|
2020-11-14T23:28:41.000Z
|
Beginner/SolutionByJagmeet_CheckEvenOdd.py
|
man21/IOSD-UIETKUK-HacktoberFest-Meetup-2019
|
8ca1a8bf95ee98d303d3a909c448288fa5992210
|
[
"Apache-2.0"
] | 46
|
2019-10-01T03:53:30.000Z
|
2020-10-20T16:34:37.000Z
|
Beginner/SolutionByJagmeet_CheckEvenOdd.py
|
man21/IOSD-UIETKUK-HacktoberFest-Meetup-2019
|
8ca1a8bf95ee98d303d3a909c448288fa5992210
|
[
"Apache-2.0"
] | 415
|
2019-10-01T03:48:22.000Z
|
2021-02-27T04:57:28.000Z
|
def checkEvenOdd(num):
if(num%2 == 0):
print("Number ",num," is even ")
elif(num %2 ==1):
print("Number ",num," is odd ")
checkEvenOdd(113)
| 20.333333
| 40
| 0.480874
| 23
| 183
| 3.826087
| 0.608696
| 0.090909
| 0.318182
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057851
| 0.338798
| 183
| 8
| 41
| 22.875
| 0.669421
| 0
| 0
| 0
| 0
| 0
| 0.169399
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.333333
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1e998b03ed3e633be6c3bad25c5af0ce7f26be6b
| 2,062
|
py
|
Python
|
bikeshed/h/__init__.py
|
deniak/bikeshed
|
adf8655b3507377825e3aa77cc43a867687daf7b
|
[
"CC0-1.0"
] | 1
|
2020-12-10T20:26:43.000Z
|
2020-12-10T20:26:43.000Z
|
bikeshed/h/__init__.py
|
deniak/bikeshed
|
adf8655b3507377825e3aa77cc43a867687daf7b
|
[
"CC0-1.0"
] | null | null | null |
bikeshed/h/__init__.py
|
deniak/bikeshed
|
adf8655b3507377825e3aa77cc43a867687daf7b
|
[
"CC0-1.0"
] | null | null | null |
# -*- coding: utf-8 -*-
from .serializer import Serializer
from .dom import addClass
from .dom import addOldIDs
from .dom import appendChild
from .dom import appendContents
from .dom import approximateLineNumber
from .dom import childElements
from .dom import childNodes
from .dom import circledDigits
from .dom import clearContents
from .dom import closestAncestor
from .dom import closestAttr
from .dom import createElement
from .dom import dedupIDs
from .dom import E
from .dom import emptyText
from .dom import escapeAttr
from .dom import escapeCSSIdent
from .dom import escapeHTML
from .dom import escapeUrlFrag
from .dom import filterAncestors
from .dom import find
from .dom import findAll
from .dom import fixSurroundingTypography
from .dom import fixTypography
from .dom import fixupIDs
from .dom import foldWhitespace
from .dom import hasAncestor
from .dom import hasAttr
from .dom import hasAttrs
from .dom import hasChildElements
from .dom import hasClass
from .dom import hashContents
from .dom import hasOnlyChild
from .dom import headingLevelOfElement
from .dom import innerHTML
from .dom import insertAfter
from .dom import insertBefore
from .dom import isElement
from .dom import isEmpty
from .dom import isNormative
from .dom import isOddNode
from .dom import moveContents
from .dom import nodeIter
from .dom import outerHTML
from .dom import parentElement
from .dom import parseDocument
from .dom import parseHTML
from .dom import prependChild
from .dom import previousElements
from .dom import relevantHeadings
from .dom import removeAttr
from .dom import removeClass
from .dom import removeNode
from .dom import replaceAwkwardCSSShorthands
from .dom import replaceContents
from .dom import replaceMacros
from .dom import replaceNode
from .dom import safeID
from .dom import scopingElements
from .dom import sectionName
from .dom import serializeTag
from .dom import textContent
from .dom import textContentIgnoringDecorative
from .dom import treeAttr
from .dom import unescape
from .dom import unfixTypography
from .dom import wrapContents
| 29.042254
| 46
| 0.827837
| 275
| 2,062
| 6.207273
| 0.269091
| 0.274751
| 0.510252
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.000561
| 0.134821
| 2,062
| 71
| 47
| 29.042254
| 0.956278
| 0.010184
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
94c2f25568f08b53a893c433a7bd12a3592cf5f4
| 59
|
py
|
Python
|
utils/__init__.py
|
SiriusKY/pytorch-ocr
|
c739a13116c6833e8dca3be4bc7b66fc757328b4
|
[
"MIT"
] | 2
|
2021-07-05T15:57:54.000Z
|
2021-07-05T15:58:51.000Z
|
utils/__init__.py
|
SiriusKY/pytorch-ocr
|
c739a13116c6833e8dca3be4bc7b66fc757328b4
|
[
"MIT"
] | null | null | null |
utils/__init__.py
|
SiriusKY/pytorch-ocr
|
c739a13116c6833e8dca3be4bc7b66fc757328b4
|
[
"MIT"
] | null | null | null |
from .util import *
from .prefix_beam_search import decode
| 19.666667
| 38
| 0.813559
| 9
| 59
| 5.111111
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135593
| 59
| 2
| 39
| 29.5
| 0.901961
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
94e9bd57fb88963fb602f07741a2e2fafa9948ec
| 83
|
py
|
Python
|
tests/pyflakes_bears/pep8_naming_test_files/E04/invalid.py
|
MacBox7/coala-pyflakes
|
637f8a2e77973384be79d30b0dae1f43072e60c8
|
[
"MIT"
] | null | null | null |
tests/pyflakes_bears/pep8_naming_test_files/E04/invalid.py
|
MacBox7/coala-pyflakes
|
637f8a2e77973384be79d30b0dae1f43072e60c8
|
[
"MIT"
] | 12
|
2018-05-21T06:12:59.000Z
|
2018-07-30T10:37:16.000Z
|
tests/pyflakes_bears/pep8_naming_test_files/E04/invalid.py
|
MacBox7/coala-pyflakes
|
637f8a2e77973384be79d30b0dae1f43072e60c8
|
[
"MIT"
] | 1
|
2018-06-10T16:16:47.000Z
|
2018-06-10T16:16:47.000Z
|
def foo():
'''
>>> from mod import CamelCase as CONST
'''
pass
| 13.833333
| 46
| 0.46988
| 9
| 83
| 4.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.385542
| 83
| 5
| 47
| 16.6
| 0.764706
| 0.457831
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
a20de4d46299ef0961b4698f12c6ce4ceb197edc
| 162
|
py
|
Python
|
tests/conftest.py
|
andredias/rst2html5
|
1f2938c843b4912a2c05df5d3a6708fb4e67eb16
|
[
"MIT"
] | 1
|
2021-04-27T20:25:44.000Z
|
2021-04-27T20:25:44.000Z
|
tests/conftest.py
|
andredias/rst2html5
|
1f2938c843b4912a2c05df5d3a6708fb4e67eb16
|
[
"MIT"
] | 8
|
2020-03-14T23:34:23.000Z
|
2021-04-20T14:06:07.000Z
|
tests/conftest.py
|
andredias/rst2html5
|
1f2938c843b4912a2c05df5d3a6708fb4e67eb16
|
[
"MIT"
] | null | null | null |
import os
from pathlib import Path
from pytest import fixture
@fixture(autouse=True, scope='session')
def chdir() -> None:
os.chdir(Path(__file__).parent)
| 16.2
| 39
| 0.734568
| 23
| 162
| 5
| 0.695652
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 162
| 9
| 40
| 18
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.04321
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0.5
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
bf73ab2efa36aa2f2e67822fb2e61d93d45566d1
| 38
|
py
|
Python
|
src/kgmk/io/writing/__init__.py
|
kagemeka/python
|
486ce39d97360b61029527bacf00a87fdbcf552c
|
[
"MIT"
] | null | null | null |
src/kgmk/io/writing/__init__.py
|
kagemeka/python
|
486ce39d97360b61029527bacf00a87fdbcf552c
|
[
"MIT"
] | null | null | null |
src/kgmk/io/writing/__init__.py
|
kagemeka/python
|
486ce39d97360b61029527bacf00a87fdbcf552c
|
[
"MIT"
] | null | null | null |
from .df_writer import (
DFWriter,
)
| 12.666667
| 24
| 0.710526
| 5
| 38
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184211
| 38
| 3
| 25
| 12.666667
| 0.83871
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bf7d512629d958e60aaa663791c9575360983509
| 131
|
py
|
Python
|
mathics/builtin/files_io/__init__.py
|
skirpichev/Mathics
|
318e06dea8f1c70758a50cb2f95c9900150e3a68
|
[
"Apache-2.0"
] | 1,920
|
2015-01-06T17:56:26.000Z
|
2022-03-24T14:33:29.000Z
|
mathics/builtin/files_io/__init__.py
|
skirpichev/Mathics
|
318e06dea8f1c70758a50cb2f95c9900150e3a68
|
[
"Apache-2.0"
] | 868
|
2015-01-04T06:19:40.000Z
|
2022-03-14T13:39:38.000Z
|
mathics/builtin/files_io/__init__.py
|
skirpichev/Mathics
|
318e06dea8f1c70758a50cb2f95c9900150e3a68
|
[
"Apache-2.0"
] | 240
|
2015-01-16T13:31:26.000Z
|
2022-03-12T12:52:46.000Z
|
"""
Input/Output, Files, and Filesystem
"""
from mathics.version import __version__ # noqa used in loading to check consistency.
| 21.833333
| 85
| 0.755725
| 17
| 131
| 5.588235
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152672
| 131
| 5
| 86
| 26.2
| 0.855856
| 0.603053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
bfa8dff4a33110979569972331ac56feda87a711
| 181
|
py
|
Python
|
example/try1.py
|
sano-jin/go-in-ocaml
|
b5e5fca33e194776477a0db389f6e52bdc0a66fe
|
[
"MIT"
] | 1
|
2021-09-24T10:25:40.000Z
|
2021-09-24T10:25:40.000Z
|
example/try1.py
|
sano-jin/go-in-ocaml
|
b5e5fca33e194776477a0db389f6e52bdc0a66fe
|
[
"MIT"
] | null | null | null |
example/try1.py
|
sano-jin/go-in-ocaml
|
b5e5fca33e194776477a0db389f6e52bdc0a66fe
|
[
"MIT"
] | null | null | null |
try:
print('enter try statement')
raise Exception()
print('exit try statement')
except Exception as inst:
print(inst.__class__.__name__)
| 18.1
| 34
| 0.59116
| 19
| 181
| 5.210526
| 0.631579
| 0.242424
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.320442
| 181
| 9
| 35
| 20.111111
| 0.804878
| 0
| 0
| 0
| 0
| 0
| 0.20442
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
bfb05f1d5382e3ff980e7ec3344781d6b3584404
| 3,393
|
py
|
Python
|
cashup/migrations/0002_auto_20170110_2035.py
|
remarkablerocket/cashup
|
86ee12f20feab2edb383224126aaf824764be656
|
[
"BSD-3-Clause"
] | null | null | null |
cashup/migrations/0002_auto_20170110_2035.py
|
remarkablerocket/cashup
|
86ee12f20feab2edb383224126aaf824764be656
|
[
"BSD-3-Clause"
] | null | null | null |
cashup/migrations/0002_auto_20170110_2035.py
|
remarkablerocket/cashup
|
86ee12f20feab2edb383224126aaf824764be656
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-10 20:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
def populate_new_fields(apps, schema_editor):
TillClosure = apps.get_model('cashup', 'TillClosure')
for tc in TillClosure.objects.all():
tc.identity = tc.pk
tc.object_created_time = tc.close_time
tc.updated_by = tc.closed_by
tc.version_created_time = tc.close_time
tc.save()
class Migration(migrations.Migration):
dependencies = [
('cashup', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='tillclosure',
name='identity',
field=models.PositiveIntegerField(default=0, editable=False, blank=True),
preserve_default=False,
),
migrations.AddField(
model_name='tillclosure',
name='object_created_time',
field=models.DateTimeField(default=django.utils.timezone.now, editable=False, blank=True),
preserve_default=False,
),
migrations.AddField(
model_name='tillclosure',
name='updated_by',
field=models.ForeignKey(editable=False, blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='updated_tillclosures', to='cashup.Personnel'),
),
migrations.AddField(
model_name='tillclosure',
name='version_created_time',
field=models.DateTimeField(default=django.utils.timezone.now, editable=False, blank=True),
preserve_default=False,
),
migrations.AddField(
model_name='tillclosure',
name='version_number',
field=models.PositiveIntegerField(default=1, editable=False, blank=True),
preserve_default=False,
),
migrations.AddField(
model_name='tillclosure',
name='version_superseded_time',
field=models.DateTimeField(editable=False, blank=True, null=True),
),
migrations.RunPython(populate_new_fields, migrations.RunPython.noop),
migrations.AlterField(
model_name='tillclosure',
name='identity',
field=models.PositiveIntegerField(editable=False, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='tillclosure',
name='object_created_time',
field=models.DateTimeField(editable=False, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='tillclosure',
name='updated_by',
field=models.ForeignKey(editable=False, blank=True, on_delete=django.db.models.deletion.PROTECT, related_name='updated_tillclosures', to='cashup.Personnel'),
),
migrations.AlterField(
model_name='tillclosure',
name='version_created_time',
field=models.DateTimeField(editable=False, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='tillclosure',
name='version_number',
field=models.PositiveIntegerField(editable=False, blank=True),
preserve_default=True,
),
]
| 36.880435
| 180
| 0.625995
| 335
| 3,393
| 6.164179
| 0.247761
| 0.047942
| 0.106538
| 0.127845
| 0.768523
| 0.768523
| 0.721065
| 0.712349
| 0.642131
| 0.617918
| 0
| 0.009244
| 0.266726
| 3,393
| 91
| 181
| 37.285714
| 0.82074
| 0.020041
| 0
| 0.695122
| 1
| 0
| 0.118302
| 0.006924
| 0
| 0
| 0
| 0
| 0
| 1
| 0.012195
| false
| 0
| 0.04878
| 0
| 0.097561
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bfc3a943b8a6d0ab083b6d9dede6a66561e87d82
| 97
|
py
|
Python
|
imagenet/__init__.py
|
TrustworthyDL/LeBA
|
3289c1330585f438dc5b931951cbb682c5513053
|
[
"Apache-2.0"
] | 19
|
2020-10-20T10:17:50.000Z
|
2022-03-27T10:56:08.000Z
|
imagenet/__init__.py
|
TrustworthyDL/LeBA
|
3289c1330585f438dc5b931951cbb682c5513053
|
[
"Apache-2.0"
] | 3
|
2020-11-03T03:08:54.000Z
|
2021-01-08T02:38:09.000Z
|
imagenet/__init__.py
|
TrustworthyDL/LeBA
|
3289c1330585f438dc5b931951cbb682c5513053
|
[
"Apache-2.0"
] | 4
|
2020-12-14T06:52:00.000Z
|
2022-01-25T07:58:22.000Z
|
#from .load_data import load_data, preprocess, load_new_images
from .get_model import get_model
| 32.333333
| 62
| 0.835052
| 16
| 97
| 4.6875
| 0.5625
| 0.213333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113402
| 97
| 2
| 63
| 48.5
| 0.872093
| 0.628866
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bfc3b1df590bb8ed76e80c0448b22508ed37ca10
| 45
|
py
|
Python
|
aiomatrix/dispatcher/storage/room_events/engines/__init__.py
|
Forden/aiomatrix
|
d258076bae8eb776495b92be46ee9f4baec8d9a6
|
[
"MIT"
] | 2
|
2021-10-29T18:07:08.000Z
|
2021-11-19T00:25:43.000Z
|
aiomatrix/dispatcher/storage/room_events/engines/__init__.py
|
Forden/aiomatrix
|
d258076bae8eb776495b92be46ee9f4baec8d9a6
|
[
"MIT"
] | 1
|
2022-03-06T11:17:43.000Z
|
2022-03-06T11:17:43.000Z
|
aiomatrix/dispatcher/storage/room_events/engines/__init__.py
|
Forden/aiomatrix
|
d258076bae8eb776495b92be46ee9f4baec8d9a6
|
[
"MIT"
] | null | null | null |
from .sqlite import SqliteEventStorageEngine
| 22.5
| 44
| 0.888889
| 4
| 45
| 10
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088889
| 45
| 1
| 45
| 45
| 0.97561
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bfc41979bb9c66231daf1053424eff7793160759
| 18
|
py
|
Python
|
unko.py
|
kentaroy47/deep_running
|
405d57b21320a127e36665b5bbb939581f4dee85
|
[
"MIT"
] | null | null | null |
unko.py
|
kentaroy47/deep_running
|
405d57b21320a127e36665b5bbb939581f4dee85
|
[
"MIT"
] | null | null | null |
unko.py
|
kentaroy47/deep_running
|
405d57b21320a127e36665b5bbb939581f4dee85
|
[
"MIT"
] | null | null | null |
print("puripuri")
| 9
| 17
| 0.722222
| 2
| 18
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 18
| 1
| 18
| 18
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
bfc70e7bf8036ca3ce90a8747b5de67300cedc53
| 113
|
py
|
Python
|
Python-For-Everyone-Horstmann/Chapter1-Introduction/P1.1.py
|
islayy/Books-solutions
|
5fe05deb4e9f65875284d8af43bd383bf9ae145b
|
[
"MIT"
] | null | null | null |
Python-For-Everyone-Horstmann/Chapter1-Introduction/P1.1.py
|
islayy/Books-solutions
|
5fe05deb4e9f65875284d8af43bd383bf9ae145b
|
[
"MIT"
] | null | null | null |
Python-For-Everyone-Horstmann/Chapter1-Introduction/P1.1.py
|
islayy/Books-solutions
|
5fe05deb4e9f65875284d8af43bd383bf9ae145b
|
[
"MIT"
] | 1
|
2019-09-22T06:27:49.000Z
|
2019-09-22T06:27:49.000Z
|
# Write a program that prints a greeting of your choice, perhaps in a language other
#than English
print("Hey!")
| 28.25
| 84
| 0.761062
| 19
| 113
| 4.526316
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168142
| 113
| 3
| 85
| 37.666667
| 0.914894
| 0.831858
| 0
| 0
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
44e0e614da875d17076dcce581257e2800b24952
| 151
|
py
|
Python
|
run_es_repo_mgr.py
|
wjimenez5271/curator
|
68c2311327dc276394aa8cc4be30296da13fe23f
|
[
"Apache-2.0"
] | null | null | null |
run_es_repo_mgr.py
|
wjimenez5271/curator
|
68c2311327dc276394aa8cc4be30296da13fe23f
|
[
"Apache-2.0"
] | null | null | null |
run_es_repo_mgr.py
|
wjimenez5271/curator
|
68c2311327dc276394aa8cc4be30296da13fe23f
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
"""Wrapper for running es_repo_mgr from source."""
from curator.es_repo_mgr import main
if __name__ == '__main__':
main()
| 16.777778
| 50
| 0.708609
| 23
| 151
| 4.130435
| 0.73913
| 0.126316
| 0.189474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15894
| 151
| 8
| 51
| 18.875
| 0.748032
| 0.430464
| 0
| 0
| 0
| 0
| 0.1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
7807baf056670dd578e2ed8eb9ec36d9c71dac2c
| 43
|
py
|
Python
|
Contest/ABC068/a/main.py
|
mpses/AtCoder
|
9c101fcc0a1394754fcf2385af54b05c30a5ae2a
|
[
"CC0-1.0"
] | null | null | null |
Contest/ABC068/a/main.py
|
mpses/AtCoder
|
9c101fcc0a1394754fcf2385af54b05c30a5ae2a
|
[
"CC0-1.0"
] | null | null | null |
Contest/ABC068/a/main.py
|
mpses/AtCoder
|
9c101fcc0a1394754fcf2385af54b05c30a5ae2a
|
[
"CC0-1.0"
] | null | null | null |
#!/usr/bin/env python3
print("ABC"+input())
| 21.5
| 22
| 0.674419
| 7
| 43
| 4.142857
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02439
| 0.046512
| 43
| 2
| 23
| 21.5
| 0.682927
| 0.488372
| 0
| 0
| 0
| 0
| 0.136364
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
781c4e91ca71190fae5347e85451c2040e6e049e
| 290
|
py
|
Python
|
SpringSemester2021/01_Jupyter-Python/Ex01_01_Sol.py
|
KretschiGL/DataScienceLecture
|
e6bbb3efd531b08aa4757fb6e89d12e959678a44
|
[
"MIT"
] | 1
|
2021-05-09T11:02:35.000Z
|
2021-05-09T11:02:35.000Z
|
SpringSemester2021/01_Jupyter-Python/Ex01_01_Sol.py
|
KretschiGL/DataScienceLecture
|
e6bbb3efd531b08aa4757fb6e89d12e959678a44
|
[
"MIT"
] | null | null | null |
SpringSemester2021/01_Jupyter-Python/Ex01_01_Sol.py
|
KretschiGL/DataScienceLecture
|
e6bbb3efd531b08aa4757fb6e89d12e959678a44
|
[
"MIT"
] | 1
|
2020-05-26T15:35:40.000Z
|
2020-05-26T15:35:40.000Z
|
# Numbers 0 to 10
print(list(range(0,11)))
print()
# Even numbers 0 to 10
print(list(range(0,11,2)))
print()
# Odd numbers 0 to 10
print(list(range(1,11,2)))
print()
# Numbers 20 to 10
print(list(range(20,9,-1)))
print()
# Numbers 45 to 75 divisable by 5
print(list(range(45, 76, 5)))
| 14.5
| 33
| 0.658621
| 58
| 290
| 3.293103
| 0.344828
| 0.235602
| 0.366492
| 0.272251
| 0.534031
| 0.439791
| 0.439791
| 0.303665
| 0.303665
| 0
| 0
| 0.155738
| 0.158621
| 290
| 19
| 34
| 15.263158
| 0.627049
| 0.362069
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
7827a2aba2b29a5cee49d89ade1d4b7fbe15953d
| 7,098
|
py
|
Python
|
python/kmeans.py
|
exTerEX/kmeans
|
1a9be9241d1ccad5755c9a92cdd2c9d4726baa3c
|
[
"MIT"
] | null | null | null |
python/kmeans.py
|
exTerEX/kmeans
|
1a9be9241d1ccad5755c9a92cdd2c9d4726baa3c
|
[
"MIT"
] | 2
|
2022-01-01T07:08:39.000Z
|
2022-03-01T07:03:31.000Z
|
python/kmeans.py
|
exTerEX/kmeans
|
1a9be9241d1ccad5755c9a92cdd2c9d4726baa3c
|
[
"MIT"
] | null | null | null |
from ctypes import *
from typing import *
from pathlib import Path
from numpy import array, cos, ndarray, pi, random, sin, zeros, tan
try:
lib = cdll.LoadLibrary(str(Path(__file__).with_name("libkmeans.so")))
except Exception as E:
print(f"Cannot load DLL")
print(E)
class observation_2d(Structure):
_fields_ = [("x", c_double), ("y", c_double), ("group", c_size_t)]
class observation_3d(Structure):
_fields_ = [("x", c_double), ("y", c_double), ("z", c_double), ("group", c_size_t)]
class cluster_2d(Structure):
_fields_ = [("x", c_double), ("y", c_double), ("count", c_size_t)]
class cluster_3d(Structure):
_fields_ = [("x", c_double), ("y", c_double), ("z", c_double), ("count", c_size_t)]
lib.kmeans_2d.restype = POINTER(cluster_2d)
def kmeans_2d(observations: ndarray, k: Optional[int] = 5) -> Tuple[ndarray, ndarray]:
"""Partition observations into k clusters.
Parameters
----------
observations : ndarray, `shape (N, 2)`
An array of observations (x, y) to be clustered.
Data should be provided as: `[(x, y), (x, y), (x, y), ...]`
k : int, optional
Amount of clusters to partition observations into, by default 5
Returns
-------
center : ndarray, `shape (k, 2)`
An array of positions to center of each cluster.
count : ndarray, `shape (k, )`
Array of counts of datapoints closest to the center of its cluster.
Examples
-------
>>> observations = [[6, 1], [-4, -4], [1, -7], [9, -2], [6, -6]]
>>> center, count = kmeans_2d(observations, k=2)
>>> center
[[-4, -4
5, -3]]
>>> count
[1, 4]
"""
if not isinstance(observations, ndarray):
raise TypeError("Observations must be a ndarray.")
# Fix orientation on data
if observations.shape[-1] == 2:
observations = observations.T
else:
raise ValueError("Provided array should contain ((x, y), ) observations.")
# Find observation_2d length
n = observations.shape[-1]
# Create a Python list of observations
py_observations_list = map(observation_2d, *observations)
# Convert the Python list into a c-array
c_observations_array = (observation_2d * n)(*py_observations_list)
# Get c-array of cluster_2d
c_clusters_array = lib.kmeans_2d(
c_observations_array, c_size_t(n), c_size_t(k))
# Convert c-array of clusters into a python list
py_clusters_list = [c_clusters_array[index] for index in range(k)]
# Split clusters
center = zeros([k, 2], dtype=observations.dtype)
count = zeros(k, dtype=int)
for index, cluster_object in enumerate(py_clusters_list):
center[index][0] = cluster_object.x
center[index][1] = cluster_object.y
count[index] = cluster_object.count
# Pack into DataFrame and return
return (center, count)
lib.kmeans_3d.restype = POINTER(cluster_3d)
def kmeans_3d(observations: ndarray, k: Optional[int] = 5) -> Tuple[ndarray, ndarray]:
"""Partition observations into k clusters.
Parameters
----------
observations : ndarray, `shape (N, 3)`
An array of observations (x, y) to be clustered.
Data should be provided as: `[(x, y, z), (x, y, z), (x, y, z), ...]`
k : int, optional
Amount of clusters to partition observations into, by default 5
Returns
-------
center : ndarray, `shape (k, 3)`
An array of positions to center of each cluster.
count : ndarray, `shape (k, )`
Array of counts of datapoints closest to the center of its cluster.
Examples
-------
>>> observations = [[6, 1, 3], [-4, -4, -4], [1, -7, 7], [9, -2, 1], [6, -6, 6]]
>>> center, count = kmeans_3d(observations, k=2)
>>> center
[[ -0.35830777 -7.41219447 201.90265473]
[ 1.83808572 -5.86460671 -28.00696338]
[ -0.81562641 -1.20418037 1.60364838]]
>>> count
[2, 3]
"""
if not isinstance(observations, ndarray):
raise TypeError("Observations must be a ndarray.")
# Fix orientation on data
if observations.shape[-1] == 3:
observations = observations.T
else:
raise ValueError("Provided array should contain ((x, y, z), ) observations.")
# Find observation_3d length
n = observations.shape[-1]
# Create a Python list of observations
py_observations_list = map(observation_3d, *observations)
# Convert the Python list into a c-array
c_observations_array = (observation_3d * n)(*py_observations_list)
# Get c-array of cluster_2d
c_clusters_array = lib.kmeans_3d(c_observations_array, c_size_t(n), c_size_t(k))
# Convert c-array of clusters into a python list
py_clusters_list = [c_clusters_array[index] for index in range(k)]
# Split clusters
center = zeros([k, 3], dtype=observations.dtype)
count = zeros(k, dtype=int)
for index, cluster_object in enumerate(py_clusters_list):
center[index][0] = cluster_object.x
center[index][1] = cluster_object.y
center[index][2] = cluster_object.z
count[index] = cluster_object.count
# Pack into DataFrame and return
return (center, count)
def kmeans(observations: ndarray, k: Optional[int] = 5) -> Tuple[ndarray, ndarray]:
"""Partition observations into k clusters.
Parameters
----------
observations : ndarray, `shape (N, 2)` or `shape (N, 3)`
An array of observations (x, y) to be clustered.
Data should be provided as:
`[(x, y), (x, y), (x, y), ...]`
or
`[(x, y, z), (x, y, z), (x, y, z), ...]`
k : int, optional
Amount of clusters to partition observations into, by default 5
Returns
-------
center : ndarray, `shape (k, 2)` or `shape (k, 3)`
An array of positions to center of each cluster.
count : ndarray, `shape (k, )`
Array of counts of datapoints closest to the center of its cluster.
Examples
-------
>>> observations = [[6, 1], [-4, -4], [1, -7], [9, -2], [6, -6]]
>>> center, count = kmeans_2d(observations, k=2)
>>> center
[[-4, -4
5, -3]]
>>> count
[1, 4]
"""
if not isinstance(observations, ndarray):
raise TypeError("Observations must be a ndarray.")
if observations.shape[-1] == 3:
return kmeans_3d(observations, k)
elif observations.shape[-1] == 2:
return kmeans_2d(observations, k)
else:
pass
if __name__ == "__main__":
random.seed(1234)
rand_list = random.random(100)
x = 10 * rand_list * cos(2 * pi * rand_list)
y = 10 * rand_list * sin(2 * pi * rand_list)
z = 10 * rand_list * tan(2 * pi * rand_list)
df = array([x, y, z]).T
print(f"Observations:\n{df[0:5]}\n...\n\nshape {len(df), len(df[0])}\n")
centers, count = kmeans(df, 3)
print(f"Centers:\n{centers}\n")
print(f"Count:\n{count}")
observations = [[6, 1], [-4, -4], [1, -7], [9, -2], [6, -6]]
center, count = kmeans_2d(array(observations), k=2)
print(f"Centers:\n{centers}\n")
print(f"Count:\n{count}")
| 29.090164
| 87
| 0.609749
| 979
| 7,098
| 4.297242
| 0.156282
| 0.008557
| 0.01141
| 0.016164
| 0.797243
| 0.782981
| 0.777751
| 0.770145
| 0.770145
| 0.754457
| 0
| 0.041582
| 0.241054
| 7,098
| 243
| 88
| 29.209877
| 0.739373
| 0.394196
| 0
| 0.39759
| 0
| 0.012048
| 0.101409
| 0.020131
| 0
| 0
| 0
| 0
| 0
| 1
| 0.036145
| false
| 0.012048
| 0.048193
| 0
| 0.228916
| 0.084337
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
7841b220284cba0896edfacdffd8303e8fbaac07
| 9,690
|
py
|
Python
|
tests/test_cdigraphlayout.py
|
idekerlab/cdigraphlayout
|
59684fd009e9e43db2b951e130308f014a46e379
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_cdigraphlayout.py
|
idekerlab/cdigraphlayout
|
59684fd009e9e43db2b951e130308f014a46e379
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_cdigraphlayout.py
|
idekerlab/cdigraphlayout
|
59684fd009e9e43db2b951e130308f014a46e379
|
[
"BSD-3-Clause"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_cdigraphlayout
----------------------------------
Tests for `cdigraphlayout` module.
"""
import os
import sys
import unittest
import io
import tempfile
import shutil
import json
import ndex2
from cdigraphlayout import cdigraphlayoutcmd
class TestCdIgraphLayout(unittest.TestCase):
TEST_DIR = os.path.dirname(__file__)
HUNDRED_NODE_DIR = os.path.join(TEST_DIR, 'data',
'100node_example')
def setUp(self):
pass
def tearDown(self):
pass
def test_parse_args_all_defaults(self):
myargs = ['inputarg']
res = cdigraphlayoutcmd._parse_arguments('desc', myargs)
self.assertEqual('inputarg', res.input)
self.assertEqual('auto', res.layout)
self.assertEqual(None, res.scale)
self.assertEqual(None, res.fit_into)
def test_parse_args_scale_and_layoutset(self):
myargs = ['inputarg', '--layout', 'circle',
'--scale', '5.0']
res = cdigraphlayoutcmd._parse_arguments('desc', myargs)
self.assertEqual('inputarg', res.input)
self.assertEqual('circle', res.layout)
self.assertEqual(5.0, res.scale)
self.assertEqual(None, res.fit_into)
def test_parse_args_fit_into_set(self):
myargs = ['inputarg',
'--fit_into', '1,2,3,4']
res = cdigraphlayoutcmd._parse_arguments('desc', myargs)
self.assertEqual('inputarg', res.input)
self.assertEqual('auto', res.layout)
self.assertEqual(None, res.scale)
self.assertEqual('1,2,3,4', res.fit_into)
def test_get_node_size_from_cyvisual_properties_with_none(self):
try:
cdigraphlayoutcmd._get_node_size_from_cyvisual_properties()
self.fail('Expected ValueError')
except ValueError as ve:
self.assertEqual('Network passed in cannot be None',
str(ve))
def test_get_node_size_from_cyvisual_properties_network_missing_aspect(self):
net = ndex2.nice_cx_network.NiceCXNetwork()
res = cdigraphlayoutcmd._get_node_size_from_cyvisual_properties(net_cx=net)
self.assertIsNone(res)
def test_get_node_size_from_cyvisual_properties_on_real_network(self):
five_node = os.path.join(os.path.dirname(__file__), 'data',
'5node.cx')
net = ndex2.create_nice_cx_from_file(five_node)
res = cdigraphlayoutcmd._get_node_size_from_cyvisual_properties(net_cx=net)
self.assertEqual(85.0, res)
def test_get_bounding_box_based_on_node_size_with_none(self):
try:
cdigraphlayoutcmd._get_bounding_box_based_on_node_size()
self.fail('Expected ValueError')
except ValueError as ve:
self.assertEqual('Network passed in cannot be None',
str(ve))
def test_get_bounding_box_based_on_node_size_with_5node(self):
five_node = os.path.join(os.path.dirname(__file__), 'data',
'5node.cx')
net = ndex2.create_nice_cx_from_file(five_node)
res = cdigraphlayoutcmd._get_bounding_box_based_on_node_size(net_cx=net)
self.assertEqual((0.0, 0.0, 550.0, 550.0), res.coords)
def test_get_bounding_box_from_user_str(self):
self.assertIsNone(cdigraphlayoutcmd.
_get_bounding_box_from_user_str(None))
# test empty str
try:
cdigraphlayoutcmd._get_bounding_box_from_user_str('')
self.fail('Expected ValueError')
except ValueError as ve:
self.assertEqual('Could not parse bounding box coordinates from '
'input string: ', str(ve))
# test str with only 1 comma
try:
cdigraphlayoutcmd._get_bounding_box_from_user_str('1,2')
self.fail('Expected ValueError')
except ValueError as ve:
self.assertEqual('Could not parse bounding box coordinates from '
'input string: 1,2', str(ve))
# test str with non numeric values
try:
cdigraphlayoutcmd._get_bounding_box_from_user_str('1,b,c,d')
self.fail('Expected ValueError')
except ValueError as ve:
self.assertTrue('invalid coordinate' in str(ve))
# test valid
res = cdigraphlayoutcmd._get_bounding_box_from_user_str('0.0,1.0,2,3')
self.assertEqual((0.0, 1.0, 2.0, 3.0), res.coords)
def test_runlayout_input_is_not_a_file(self):
temp_dir = tempfile.mkdtemp()
try:
args = cdigraphlayoutcmd._parse_arguments('desc',
[os.path.join(temp_dir,
'input')])
o_stream = io.StringIO()
e_stream = io.StringIO()
res = cdigraphlayoutcmd.run_layout(args, out_stream=o_stream,
err_stream=e_stream)
self.assertEqual(3, res)
finally:
shutil.rmtree(temp_dir)
def test_runlayout_input_is_not_an_empty_file(self):
temp_dir = tempfile.mkdtemp()
try:
input_file = os.path.join(temp_dir, 'input')
open(input_file, 'a').close()
args = cdigraphlayoutcmd._parse_arguments('desc',
[input_file])
o_stream = io.StringIO()
e_stream = io.StringIO()
res = cdigraphlayoutcmd.run_layout(args, out_stream=o_stream,
err_stream=e_stream)
self.assertEqual(4, res)
finally:
shutil.rmtree(temp_dir)
def test_runlayout_on_5node(self):
temp_dir = tempfile.mkdtemp()
try:
five_node = os.path.join(os.path.dirname(__file__), 'data',
'5node.cx')
args = cdigraphlayoutcmd._parse_arguments('desc',
[five_node])
o_stream = io.StringIO()
e_stream = io.StringIO()
res = cdigraphlayoutcmd.run_layout(args, out_stream=o_stream,
err_stream=e_stream)
self.assertEqual('', e_stream.getvalue())
self.assertEqual(0, res)
cart_layout = json.loads(o_stream.getvalue())
self.assertTrue(isinstance(cart_layout, list))
self.assertEqual(5, len(cart_layout))
for entry in cart_layout:
self.assertTrue('node' in entry)
self.assertTrue('x' in entry)
self.assertTrue('y' in entry)
self.assertTrue(entry['node'] in [175, 180, 185, 190, 195])
finally:
shutil.rmtree(temp_dir)
def test_runlayout_on_5node_scale_set(self):
temp_dir = tempfile.mkdtemp()
try:
five_node = os.path.join(os.path.dirname(__file__), 'data',
'5node.cx')
args = cdigraphlayoutcmd._parse_arguments('desc',
[five_node,
'--scale',
'10.0'])
o_stream = io.StringIO()
e_stream = io.StringIO()
res = cdigraphlayoutcmd.run_layout(args, out_stream=o_stream,
err_stream=e_stream)
self.assertEqual('', e_stream.getvalue())
self.assertEqual(0, res)
cart_layout = json.loads(o_stream.getvalue())
self.assertTrue(isinstance(cart_layout, list))
self.assertEqual(5, len(cart_layout))
for entry in cart_layout:
self.assertTrue('node' in entry)
self.assertTrue('x' in entry)
self.assertTrue('y' in entry)
self.assertTrue(entry['node'] in [175, 180, 185, 190, 195])
finally:
shutil.rmtree(temp_dir)
def test_runlayout_on_5node_fit_into_set(self):
temp_dir = tempfile.mkdtemp()
try:
five_node = os.path.join(os.path.dirname(__file__), 'data',
'5node.cx')
args = cdigraphlayoutcmd._parse_arguments('desc',
[five_node,
'--fit_into',
'0.0,0.0,1.0,1.0'])
o_stream = io.StringIO()
e_stream = io.StringIO()
res = cdigraphlayoutcmd.run_layout(args, out_stream=o_stream,
err_stream=e_stream)
self.assertEqual('', e_stream.getvalue())
self.assertEqual(0, res)
cart_layout = json.loads(o_stream.getvalue())
self.assertTrue(isinstance(cart_layout, list))
self.assertEqual(5, len(cart_layout))
print(cart_layout)
for entry in cart_layout:
self.assertTrue('node' in entry)
self.assertTrue('x' in entry)
self.assertTrue('y' in entry)
self.assertTrue(0.0 <= entry['x'] <= 1.1)
self.assertTrue(0.0 <= entry['y'] <= 1.1)
self.assertTrue(entry['node'] in [175, 180, 185, 190, 195])
finally:
shutil.rmtree(temp_dir)
if __name__ == '__main__':
sys.exit(unittest.main())
| 40.041322
| 83
| 0.554076
| 1,058
| 9,690
| 4.787335
| 0.150284
| 0.088845
| 0.027641
| 0.037315
| 0.829418
| 0.784008
| 0.76308
| 0.717868
| 0.67305
| 0.635538
| 0
| 0.021404
| 0.344272
| 9,690
| 241
| 84
| 40.207469
| 0.775732
| 0.022601
| 0
| 0.639594
| 0
| 0
| 0.066505
| 0
| 0
| 0
| 0
| 0
| 0.253807
| 1
| 0.081218
| false
| 0.020305
| 0.045685
| 0
| 0.142132
| 0.005076
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
785345682b65e2102bad10ac7194e53a101fa0e3
| 37
|
py
|
Python
|
backend/admin/views/__init__.py
|
gsw945/flask-bigger
|
cc5ba476c20129a009ad8a8366daf4dc060bd4ac
|
[
"MIT"
] | 29
|
2018-11-13T09:03:29.000Z
|
2021-11-07T20:20:38.000Z
|
backend/admin/views/__init__.py
|
gsw945/flask-bigger
|
cc5ba476c20129a009ad8a8366daf4dc060bd4ac
|
[
"MIT"
] | null | null | null |
backend/admin/views/__init__.py
|
gsw945/flask-bigger
|
cc5ba476c20129a009ad8a8366daf4dc060bd4ac
|
[
"MIT"
] | 21
|
2018-11-14T01:11:24.000Z
|
2021-12-08T09:20:30.000Z
|
# -*- coding: utf-8 -*-
'''admin视图'''
| 18.5
| 23
| 0.459459
| 4
| 37
| 4.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.135135
| 37
| 2
| 24
| 18.5
| 0.5
| 0.810811
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
788b41630b9b5f35dd37ecd1a3387835bcbf60e0
| 8,963
|
py
|
Python
|
bluebottle/assignments/tests/test_tasks.py
|
jayvdb/bluebottle
|
305fea238e6aa831598a8b227223a1a2f34c4fcc
|
[
"BSD-3-Clause"
] | null | null | null |
bluebottle/assignments/tests/test_tasks.py
|
jayvdb/bluebottle
|
305fea238e6aa831598a8b227223a1a2f34c4fcc
|
[
"BSD-3-Clause"
] | null | null | null |
bluebottle/assignments/tests/test_tasks.py
|
jayvdb/bluebottle
|
305fea238e6aa831598a8b227223a1a2f34c4fcc
|
[
"BSD-3-Clause"
] | null | null | null |
import mock
from datetime import timedelta
from django.core import mail
from django.db import connection
from django.utils import timezone
from django.utils.timezone import now
from bluebottle.assignments.models import Applicant
from bluebottle.assignments.tasks import assignment_tasks
from bluebottle.assignments.tests.factories import AssignmentFactory, ApplicantFactory
from bluebottle.clients.utils import LocalTenant
from bluebottle.initiatives.tests.factories import (
InitiativePlatformSettingsFactory, InitiativeFactory
)
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.utils import BluebottleTestCase, JSONAPITestClient
class AssignmentTasksTestCase(BluebottleTestCase):
def setUp(self):
super(AssignmentTasksTestCase, self).setUp()
self.settings = InitiativePlatformSettingsFactory.create(
activity_types=['assignment']
)
self.client = JSONAPITestClient()
self.initiative = InitiativeFactory.create(status='approved')
self.initiative.save()
def test_assignment_reminder_task_deadline(self):
user = BlueBottleUserFactory.create(first_name='Nono')
end = now() + timedelta(days=4)
assignment = AssignmentFactory.create(
owner=user,
status='open',
end_date_type='deadline',
initiative=self.initiative,
date=end
)
ApplicantFactory.create_batch(2, activity=assignment, status='new')
ApplicantFactory.create(activity=assignment, status='accepted')
withdrawn = ApplicantFactory.create(activity=assignment, status='new')
withdrawn.states.withdraw(save=True)
mail.outbox = []
tenant = connection.tenant
assignment_tasks()
with LocalTenant(tenant, clear_tenant=True):
assignment.refresh_from_db()
recipients = [message.to[0] for message in mail.outbox]
for applicant in assignment.contributions.instance_of(Applicant).all():
if applicant.status in ['new', 'accepted']:
self.assertTrue(applicant.user.email in recipients)
else:
self.assertFalse(applicant.user.email in recipients)
self.assertEqual(
mail.outbox[0].subject,
'The deadline for your task "{}" is getting close'.format(assignment.title)
)
def test_assignment_reminder_task_on_date(self):
user = BlueBottleUserFactory.create(first_name='Nono')
end = now() + timedelta(days=4)
assignment = AssignmentFactory.create(
owner=user,
status='open',
end_date_type='on_date',
initiative=self.initiative,
date=end
)
ApplicantFactory.create_batch(2, activity=assignment, status='new')
ApplicantFactory.create(activity=assignment, status='accepted')
withdrawn = ApplicantFactory.create(activity=assignment, status='new')
withdrawn.states.withdraw(save=True)
mail.outbox = []
tenant = connection.tenant
assignment_tasks()
with LocalTenant(tenant, clear_tenant=True):
assignment.refresh_from_db()
recipients = [message.to[0] for message in mail.outbox]
for applicant in assignment.contributions.instance_of(Applicant).all():
if applicant.status in ['new', 'accepted']:
self.assertTrue(applicant.user.email in recipients)
else:
self.assertFalse(applicant.user.email in recipients)
self.assertEqual(
mail.outbox[0].subject,
'"{}" will take place in 5 days!'.format(assignment.title)
)
def test_assignment_reminder_task_twice(self):
user = BlueBottleUserFactory.create(first_name='Nono')
end = now() + timedelta(days=4)
assignment = AssignmentFactory.create(
owner=user,
status='open',
initiative=self.initiative,
date=end,
)
ApplicantFactory.create_batch(3, activity=assignment, status='new')
withdrawn = ApplicantFactory.create(activity=assignment, status='new')
withdrawn.states.withdraw(save=True)
assignment_tasks()
mail.outbox = []
assignment_tasks()
self.assertEqual(len(mail.outbox), 0)
def test_assignment_check_registration_deadline(self):
user = BlueBottleUserFactory.create(first_name='Nono')
deadline = now() - timedelta(days=1)
end = now() + timedelta(days=4)
assignment = AssignmentFactory.create(
owner=user,
status='open',
capacity=3,
end_date_type='on_date',
registration_deadline=deadline.date(),
initiative=self.initiative,
duration=4,
date=end,
)
applicants = ApplicantFactory.create_batch(3, activity=assignment, status='new')
for applicant in applicants:
applicant.states.accept(save=True)
tenant = connection.tenant
assignment_tasks()
with LocalTenant(tenant, clear_tenant=True):
assignment.refresh_from_db()
self.assertEqual(assignment.status, 'full')
def test_assignment_check_start_date(self):
user = BlueBottleUserFactory.create(first_name='Nono')
registration_deadline = now() - timedelta(days=1)
date = now() + timedelta(hours=6)
assignment = AssignmentFactory.create(
owner=user,
status='open',
capacity=3,
registration_deadline=registration_deadline.date(),
initiative=self.initiative,
end_date_type='on_date',
duration=10,
date=date
)
applicants = ApplicantFactory.create_batch(3, activity=assignment, status='new')
for applicant in applicants:
applicant.states.accept(save=True)
tenant = connection.tenant
with mock.patch.object(timezone, 'now', return_value=(timezone.now() + timedelta(hours=7))):
assignment_tasks()
with LocalTenant(tenant, clear_tenant=True):
assignment.refresh_from_db()
self.assertEqual(assignment.status, 'running')
def test_assignment_check_start_date_no_applicants(self):
user = BlueBottleUserFactory.create(first_name='Nono')
deadline = now() - timedelta(days=1)
date = now() - timedelta(hours=2)
assignment = AssignmentFactory.create(
owner=user,
status='open',
capacity=3,
registration_deadline=deadline.date(),
initiative=self.initiative,
duration=10,
date=date
)
tenant = connection.tenant
assignment_tasks()
with LocalTenant(tenant, clear_tenant=True):
assignment.refresh_from_db()
self.assertEqual(assignment.status, 'cancelled')
def test_assignment_check_end_date(self):
user = BlueBottleUserFactory.create(first_name='Nono')
deadline = now() - timedelta(days=4)
date = now() - timedelta(days=2)
assignment = AssignmentFactory.create(
owner=user,
status='open',
capacity=3,
registration_deadline=deadline.date(),
initiative=self.initiative,
date=date,
)
ApplicantFactory.create_batch(3, activity=assignment)
tenant = connection.tenant
assignment_tasks()
with LocalTenant(tenant, clear_tenant=True):
assignment.refresh_from_db()
self.assertEqual(assignment.status, 'succeeded')
for applicant in assignment.applicants:
self.assertEqual(applicant.status, 'succeeded')
def test_assignment_check_end_date_future(self):
user = BlueBottleUserFactory.create(first_name='Nono')
deadline = now() - timedelta(days=4)
date = now() + timedelta(days=2)
assignment = AssignmentFactory.create(
owner=user,
status='open',
capacity=3,
registration_deadline=deadline.date(),
initiative=self.initiative,
date=date,
)
applicants = ApplicantFactory.create_batch(3, activity=assignment)
for applicant in applicants:
applicant.states.accept(save=True)
ApplicantFactory.create_batch(3, activity=assignment)
tenant = connection.tenant
future = timezone.now() + timedelta(days=3)
with mock.patch.object(timezone, 'now', return_value=future):
assignment_tasks()
with LocalTenant(tenant, clear_tenant=True):
assignment.refresh_from_db()
self.assertEqual(assignment.status, 'succeeded')
for applicant in assignment.applicants:
self.assertEqual(applicant.status, 'succeeded')
| 34.473077
| 100
| 0.642196
| 872
| 8,963
| 6.478211
| 0.149083
| 0.031864
| 0.033988
| 0.049566
| 0.790051
| 0.771464
| 0.751637
| 0.751637
| 0.677996
| 0.62365
| 0
| 0.005902
| 0.262747
| 8,963
| 259
| 101
| 34.606178
| 0.848971
| 0
| 0
| 0.703884
| 0
| 0
| 0.035033
| 0
| 0
| 0
| 0
| 0
| 0.067961
| 1
| 0.043689
| false
| 0
| 0.063107
| 0
| 0.11165
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
789b22f887aa45e3116e9e4194f85c5bbddb673f
| 289
|
py
|
Python
|
candemachine/exceptions.py
|
Ricyteach/candemachine
|
0d0baa26aeee358ea6c2fb8148bbe112e36a7fda
|
[
"MIT"
] | null | null | null |
candemachine/exceptions.py
|
Ricyteach/candemachine
|
0d0baa26aeee358ea6c2fb8148bbe112e36a7fda
|
[
"MIT"
] | null | null | null |
candemachine/exceptions.py
|
Ricyteach/candemachine
|
0d0baa26aeee358ea6c2fb8148bbe112e36a7fda
|
[
"MIT"
] | null | null | null |
class CandeError(Exception):
pass
class CandeSerializationError(CandeError):
pass
class CandeDeserializationError(CandeError):
pass
class CandeReadError(CandeError):
pass
class CandePartError(CandeError):
pass
class CandeFormatError(CandePartError):
pass
| 12.565217
| 44
| 0.757785
| 24
| 289
| 9.125
| 0.375
| 0.205479
| 0.347032
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179931
| 289
| 22
| 45
| 13.136364
| 0.924051
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
78a656398a16cf92b1840550a99d0c8c24bbfa30
| 79
|
py
|
Python
|
wetterdienst/dwd/__init__.py
|
kmuehlbauer/wetterdienst
|
85e72ccdbd00f0e8285e1ba24800dfafb81ccd63
|
[
"MIT"
] | 1
|
2021-01-23T22:52:52.000Z
|
2021-01-23T22:52:52.000Z
|
wetterdienst/dwd/__init__.py
|
kmuehlbauer/wetterdienst
|
85e72ccdbd00f0e8285e1ba24800dfafb81ccd63
|
[
"MIT"
] | null | null | null |
wetterdienst/dwd/__init__.py
|
kmuehlbauer/wetterdienst
|
85e72ccdbd00f0e8285e1ba24800dfafb81ccd63
|
[
"MIT"
] | null | null | null |
# Load Pandas DataFrame extension.
import wetterdienst.dwd.pandas # noqa:F401
| 26.333333
| 43
| 0.797468
| 10
| 79
| 6.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043478
| 0.126582
| 79
| 2
| 44
| 39.5
| 0.869565
| 0.531646
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
78c8a373f4941b1a89cd464353930c266a29e398
| 96
|
py
|
Python
|
efocus/__init__.py
|
shimonuri/cmdb
|
cc2640cdc6e6f0bb6efe0e74dab5b75bbc5b6fb6
|
[
"MIT"
] | null | null | null |
efocus/__init__.py
|
shimonuri/cmdb
|
cc2640cdc6e6f0bb6efe0e74dab5b75bbc5b6fb6
|
[
"MIT"
] | null | null | null |
efocus/__init__.py
|
shimonuri/cmdb
|
cc2640cdc6e6f0bb6efe0e74dab5b75bbc5b6fb6
|
[
"MIT"
] | null | null | null |
from . import wrapper
from . import logging_filter
from . import preload
__version__ = "0.1.4"
| 16
| 28
| 0.75
| 14
| 96
| 4.785714
| 0.714286
| 0.447761
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0375
| 0.166667
| 96
| 5
| 29
| 19.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0.052083
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
155085da3a095fac77bdf23ba97f9817c0906c08
| 200
|
py
|
Python
|
__init__.py
|
traits/dynamic_plot
|
666f4dd78de590b6f126429fa217ce401c45f0a3
|
[
"MIT"
] | null | null | null |
__init__.py
|
traits/dynamic_plot
|
666f4dd78de590b6f126429fa217ce401c45f0a3
|
[
"MIT"
] | null | null | null |
__init__.py
|
traits/dynamic_plot
|
666f4dd78de590b6f126429fa217ce401c45f0a3
|
[
"MIT"
] | null | null | null |
import sys
if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
pass
else:
raise Exception("dynamic_plot: Python 3.6 or a more recent version is required.")
from .dynamic_plot import *
| 22.222222
| 85
| 0.71
| 34
| 200
| 4.058824
| 0.705882
| 0.144928
| 0.202899
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03681
| 0.185
| 200
| 8
| 86
| 25
| 0.809816
| 0
| 0
| 0
| 0
| 0
| 0.31
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.166667
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
1551d427c2e1fdc853a1df3c8ff47f46979e93c7
| 182
|
py
|
Python
|
unobase/support/admin.py
|
unomena/unobase
|
175e768afa1608f9f34d1e5a053763ad27db0f7e
|
[
"BSD-3-Clause"
] | null | null | null |
unobase/support/admin.py
|
unomena/unobase
|
175e768afa1608f9f34d1e5a053763ad27db0f7e
|
[
"BSD-3-Clause"
] | null | null | null |
unobase/support/admin.py
|
unomena/unobase
|
175e768afa1608f9f34d1e5a053763ad27db0f7e
|
[
"BSD-3-Clause"
] | null | null | null |
from unobase.support import models
__author__ = 'michael'
from django.contrib import admin
admin.site.register(models.Case)
admin.site.register(models.FrequentlyAskedQuestion)
| 22.75
| 51
| 0.813187
| 22
| 182
| 6.545455
| 0.636364
| 0.125
| 0.236111
| 0.319444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104396
| 182
| 8
| 51
| 22.75
| 0.883436
| 0
| 0
| 0
| 0
| 0
| 0.038251
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
156974bee2f1222ae03c71fb0762fd715537c66c
| 216
|
py
|
Python
|
src/pyrin/cli/core/template/__init__.py
|
wilsonGmn/pyrin
|
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
|
[
"BSD-3-Clause"
] | null | null | null |
src/pyrin/cli/core/template/__init__.py
|
wilsonGmn/pyrin
|
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
|
[
"BSD-3-Clause"
] | null | null | null |
src/pyrin/cli/core/template/__init__.py
|
wilsonGmn/pyrin
|
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
cli core template package.
"""
from pyrin.packaging.base import Package
class CLICoreTemplatePackage(Package):
"""
cli core template package class.
"""
NAME = __name__
| 14.4
| 40
| 0.648148
| 23
| 216
| 5.913043
| 0.652174
| 0.102941
| 0.220588
| 0.323529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005917
| 0.217593
| 216
| 14
| 41
| 15.428571
| 0.798817
| 0.37963
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ecb9df22ecc546090ba5729a9cfb8d1724772548
| 255
|
py
|
Python
|
db/scripts/script_select/select_efetividades.py
|
LeandroLFE/capmon
|
9d1200301628ea4fec0e8ed09d5e9b67a426d923
|
[
"MIT"
] | null | null | null |
db/scripts/script_select/select_efetividades.py
|
LeandroLFE/capmon
|
9d1200301628ea4fec0e8ed09d5e9b67a426d923
|
[
"MIT"
] | null | null | null |
db/scripts/script_select/select_efetividades.py
|
LeandroLFE/capmon
|
9d1200301628ea4fec0e8ed09d5e9b67a426d923
|
[
"MIT"
] | null | null | null |
# Requer atributo e atributo_comp = {"atributo": int (id_atributo), "atributo_comp" : int (id_atributo)}
select_efetividades = lambda : """
Select fator
FROM efetividades
WHERE atributo = :atributo
AND atributo_comp = :atributo_comp
"""
| 36.428571
| 104
| 0.701961
| 29
| 255
| 5.931034
| 0.448276
| 0.27907
| 0.232558
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192157
| 255
| 7
| 105
| 36.428571
| 0.834951
| 0.4
| 0
| 0
| 0
| 0
| 0.743421
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bf0eacddd2853377451624b292038d303779566f
| 81
|
py
|
Python
|
src/rimuc/__init__.py
|
srackham/rimu-py
|
3da67cb362b6d34fd363e9f4ce5e0afb019baa4c
|
[
"MIT"
] | null | null | null |
src/rimuc/__init__.py
|
srackham/rimu-py
|
3da67cb362b6d34fd363e9f4ce5e0afb019baa4c
|
[
"MIT"
] | 4
|
2020-03-24T17:59:43.000Z
|
2021-06-02T00:48:53.000Z
|
src/rimuc/__init__.py
|
srackham/rimu-py
|
3da67cb362b6d34fd363e9f4ce5e0afb019baa4c
|
[
"MIT"
] | null | null | null |
from rimuc.rimuc import main, readResource
from rimuc.resources import resources
| 27
| 42
| 0.851852
| 11
| 81
| 6.272727
| 0.545455
| 0.26087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 81
| 2
| 43
| 40.5
| 0.958333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
170bb4eaeeac53dd43d40e3d448c3de33bba6519
| 219
|
py
|
Python
|
self_finance/front_end/routes/reference.py
|
MaksimDan/self-finance
|
788fe067e6814eacde65ec2b9c7122826a61a89b
|
[
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"X11",
"MS-PL"
] | null | null | null |
self_finance/front_end/routes/reference.py
|
MaksimDan/self-finance
|
788fe067e6814eacde65ec2b9c7122826a61a89b
|
[
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"X11",
"MS-PL"
] | null | null | null |
self_finance/front_end/routes/reference.py
|
MaksimDan/self-finance
|
788fe067e6814eacde65ec2b9c7122826a61a89b
|
[
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"X11",
"MS-PL"
] | null | null | null |
from flask import render_template
from self_finance.front_end import app
def _standard_render():
return render_template("reference.html")
@app.route('/reference')
def reference():
return _standard_render()
| 16.846154
| 44
| 0.767123
| 28
| 219
| 5.714286
| 0.571429
| 0.175
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136986
| 219
| 12
| 45
| 18.25
| 0.846561
| 0
| 0
| 0
| 0
| 0
| 0.109589
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| true
| 0
| 0.285714
| 0.285714
| 0.857143
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
170e4ce72e70f258bdf691e476a876b779e8fc45
| 121
|
py
|
Python
|
cfn_review_bot/error.py
|
biochimia/cfn-review-bot
|
1c8a84b51f7c398c21725cb888a9ab694ddfbb56
|
[
"Apache-2.0"
] | 1
|
2019-04-04T12:09:16.000Z
|
2019-04-04T12:09:16.000Z
|
cfn_review_bot/error.py
|
biochimia/cfn-review-bot
|
1c8a84b51f7c398c21725cb888a9ab694ddfbb56
|
[
"Apache-2.0"
] | null | null | null |
cfn_review_bot/error.py
|
biochimia/cfn-review-bot
|
1c8a84b51f7c398c21725cb888a9ab694ddfbb56
|
[
"Apache-2.0"
] | null | null | null |
'''
Defines `Error`, the base class for all exceptions generated in this package.
'''
class Error(Exception):
pass
| 15.125
| 77
| 0.702479
| 16
| 121
| 5.3125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190083
| 121
| 7
| 78
| 17.285714
| 0.867347
| 0.636364
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
17274e554735111f7b40dfbebb44ca1f4cb0d34b
| 120
|
py
|
Python
|
endpoints/routers/__init__.py
|
tszan/project_skeleton
|
df794e123727c45aab42af2d0cd3e597abd3bd9f
|
[
"Unlicense"
] | 2
|
2022-02-22T20:41:26.000Z
|
2022-02-25T16:26:03.000Z
|
endpoints/routers/__init__.py
|
tszan/project_skeleton
|
df794e123727c45aab42af2d0cd3e597abd3bd9f
|
[
"Unlicense"
] | 1
|
2022-01-27T16:05:31.000Z
|
2022-01-27T16:05:31.000Z
|
endpoints/routers/__init__.py
|
tszan/project_skeleton
|
df794e123727c45aab42af2d0cd3e597abd3bd9f
|
[
"Unlicense"
] | null | null | null |
from flask_restful import Resource
class Home(Resource):
def get(self):
return "Hello, why are you here?!"
| 20
| 42
| 0.683333
| 17
| 120
| 4.764706
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225
| 120
| 6
| 42
| 20
| 0.870968
| 0
| 0
| 0
| 0
| 0
| 0.210084
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
17572c21670b463b41462346a8fee753be1b236c
| 100
|
py
|
Python
|
enthought/mayavi/filters/cell_derivatives.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/mayavi/filters/cell_derivatives.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/mayavi/filters/cell_derivatives.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from __future__ import absolute_import
from mayavi.filters.cell_derivatives import *
| 25
| 45
| 0.85
| 13
| 100
| 6.076923
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11
| 100
| 3
| 46
| 33.333333
| 0.88764
| 0.12
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
17923cc669b3d6e37a0820fad8af5f2adffae4ca
| 61
|
py
|
Python
|
dataent/config/tools.py
|
dataent/dataent
|
c41bd5942ffe5513f4d921c4c0595c84bbc422b4
|
[
"MIT"
] | null | null | null |
dataent/config/tools.py
|
dataent/dataent
|
c41bd5942ffe5513f4d921c4c0595c84bbc422b4
|
[
"MIT"
] | 6
|
2020-03-24T17:15:56.000Z
|
2022-02-10T18:41:31.000Z
|
dataent/config/tools.py
|
dataent/dataent
|
c41bd5942ffe5513f4d921c4c0595c84bbc422b4
|
[
"MIT"
] | null | null | null |
from __future__ import unicode_literals
from dataent import _
| 30.5
| 39
| 0.885246
| 8
| 61
| 6
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114754
| 61
| 2
| 40
| 30.5
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
bd5ad960a3192280c44dddfe3d9acdbbbbcded14
| 113
|
py
|
Python
|
realtime-analysis-with-simple-model/app/__init__.py
|
natanascimento/realtime-image-analysis
|
1df09874e02c59991f5e9cd39d3ad5d09a167fef
|
[
"MIT"
] | null | null | null |
realtime-analysis-with-simple-model/app/__init__.py
|
natanascimento/realtime-image-analysis
|
1df09874e02c59991f5e9cd39d3ad5d09a167fef
|
[
"MIT"
] | null | null | null |
realtime-analysis-with-simple-model/app/__init__.py
|
natanascimento/realtime-image-analysis
|
1df09874e02c59991f5e9cd39d3ad5d09a167fef
|
[
"MIT"
] | null | null | null |
from app.infrastructure.repositories.camera.capture import CameraCapture
def main():
CameraCapture().run()
| 18.833333
| 72
| 0.778761
| 12
| 113
| 7.333333
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115044
| 113
| 5
| 73
| 22.6
| 0.88
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bd91fe8e99e0df0490b864f1ab29fd3c2696704a
| 74
|
py
|
Python
|
Software/qlocktoo/timewords/__init__.py
|
tfeldmann/QlockToo
|
778a955ac84348342db036b1989931c6d9be9242
|
[
"MIT"
] | 1
|
2019-10-12T16:26:25.000Z
|
2019-10-12T16:26:25.000Z
|
Software/qlocktoo/timewords/__init__.py
|
tfeldmann/QlockToo
|
778a955ac84348342db036b1989931c6d9be9242
|
[
"MIT"
] | null | null | null |
Software/qlocktoo/timewords/__init__.py
|
tfeldmann/QlockToo
|
778a955ac84348342db036b1989931c6d9be9242
|
[
"MIT"
] | 1
|
2020-02-02T23:42:55.000Z
|
2020-02-02T23:42:55.000Z
|
from qlocktoo.assets import assets_rc
from .timewords import TimeWordsApp
| 24.666667
| 37
| 0.864865
| 10
| 74
| 6.3
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 74
| 2
| 38
| 37
| 0.954545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
bdab06659f6e1e61c708d46b2c0ccb475f99aa05
| 32
|
py
|
Python
|
ledger/__main__.py
|
Funk66/ledger
|
b06f39281b81cebb75a6c5f92fa3b8e47b65800c
|
[
"MIT"
] | null | null | null |
ledger/__main__.py
|
Funk66/ledger
|
b06f39281b81cebb75a6c5f92fa3b8e47b65800c
|
[
"MIT"
] | 3
|
2021-11-16T06:38:48.000Z
|
2021-11-16T06:43:18.000Z
|
ledger/__main__.py
|
Funk66/ledger
|
b06f39281b81cebb75a6c5f92fa3b8e47b65800c
|
[
"MIT"
] | null | null | null |
from .client import run
run()
| 6.4
| 23
| 0.6875
| 5
| 32
| 4.4
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.21875
| 32
| 4
| 24
| 8
| 0.88
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bdd95548fe506437e03c5f8630769e55e0fd2be5
| 12,556
|
py
|
Python
|
data_preprocessing/cvat_annotation_converter.py
|
Hoclor/CoSADUV-Contextual-Saliency-for-Detecting-Anomalies-in-UAV-Video
|
674b72af15ba8833317b8daa9d1e614ea63151c1
|
[
"MIT"
] | 4
|
2019-07-01T14:55:33.000Z
|
2021-01-18T02:34:38.000Z
|
data_preprocessing/cvat_annotation_converter.py
|
Hoclor/CoSADUV-Contextual-Saliency-for-Detecting-Anomalies-in-UAV-Video
|
674b72af15ba8833317b8daa9d1e614ea63151c1
|
[
"MIT"
] | null | null | null |
data_preprocessing/cvat_annotation_converter.py
|
Hoclor/CoSADUV-Contextual-Saliency-for-Detecting-Anomalies-in-UAV-Video
|
674b72af15ba8833317b8daa9d1e614ea63151c1
|
[
"MIT"
] | null | null | null |
"""A tool to convert annotation files created with CVAT into ground-truth style images
for machine learning. The initial code was copied from:
https://gist.github.com/cheind/9850e35bb08cfe12500942fb8b55531f
originally written for a similar purpose for the tool BeaverDam (which produces json),
and was then adapted for use with CVAT (which produces xml).
"""
import cv2
import xml.etree.ElementTree as ET
import numpy as np
from tqdm import tqdm
# Create a list of BGR colours stored as 3-tuples of uint_8s
colours = [
[255, 0, 0], # Blue
[0, 255, 0], # Green
[0, 0, 255], # Red
[0, 255, 255], # Yellow
[255, 255, 0], # Cyan
[255, 0, 255], # Magenta
[192, 192, 192], # Silver
[0, 0, 128], # Maroon
[0, 128, 128], # Olive
[0, 165, 255], # Orange
]
def draw_annotations(video, annotations, display=False):
tree = ET.parse(args.ann)
root = tree.getroot()
# Create a list of 'track' nodes that are children of the root
tracks = [child for child in root if child.tag == "track"]
# Read the video in as a video object
cap = cv2.VideoCapture(args.video)
# Get a rough count of the number of frames in the video
rough_frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
# Find the name/path of the video, without file type
name_index = -1
while args.video[name_index] != ".":
name_index -= 1
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*"DIVX")
framerate = cap.get(cv2.CAP_PROP_FPS)
(width, height) = (
int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)),
int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)),
)
out = cv2.VideoWriter(
args.video[:name_index] + "_annotated.avi", fourcc, framerate, (width, height)
)
for frame_count in tqdm(range(rough_frame_count)):
# Read the next frame of the video
ret, frame = cap.read()
if not ret:
# Video is done, so break out of the loop
break
# Loop over the track objects. For all that have an annotation for this frame,
# draw a corresponding rectangle with a colour from the colours list
for track in tracks:
# Check that this track has any box nodes left
if len(track) > 0:
# Since the nodes are sorted by frame number, we only have to check the first one
box = track[0]
if int(box.attrib["frame"]) == frame_count:
# Draw the rectangle described by this 'box' node on this frame
# Cast the coordinates to floats, then to ints,
# as the cv2.rectangle function cannot handle float pixel values
# And int(str) cannot handle float strings
x_tl = int(float(box.attrib["xtl"]))
y_tl = int(float(box.attrib["ytl"]))
x_br = int(float(box.attrib["xbr"]))
y_br = int(float(box.attrib["ybr"]))
cv2.rectangle(
frame,
(x_tl, y_tl),
(x_br, y_br),
colours[int(track.attrib["id"]) % len(colours)],
2,
-1,
)
# delete this box from the track,so we can keep
# only checking the first box in the future
track.remove(box)
# Write the frame with boxes
out.write(frame)
# Display the resulting frame
if display:
cv2.imshow("frame", frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
frame_count += 1
# Keep going, as the frame count is not necessarily accurate so we might not be done
while True:
# Read the next frame of the video
ret, frame = cap.read()
if not ret:
# Video is done, so break out of the loop
break
# Loop over the track objects. For all that have an annotation for this frame,
# draw a corresponding rectangle with a colour from the colours list
for track in tracks:
# Check that this track has any box nodes left
if len(track) > 0:
# Since the nodes are sorted by frame number,
# we only have to check the first one
box = track[0]
if int(box.attrib["frame"]) == frame_count:
# Draw the rectangle described by this 'box' node on this frame
# Cast the coordinates to floats, then to ints,
# as the cv2.rectangle function cannot handle float pixel values
# And int(str) cannot handle float strings
x_tl = int(float(box.attrib["xtl"]))
y_tl = int(float(box.attrib["ytl"]))
x_br = int(float(box.attrib["xbr"]))
y_br = int(float(box.attrib["ybr"]))
cv2.rectangle(
frame,
(x_tl, y_tl),
(x_br, y_br),
colours[int(track.attrib["id"]) % len(colours)],
2,
-1,
)
# delete this box from the track,so we can keep
# only checking the first box in the future
track.remove(box)
# Write the frame with boxes
out.write(frame)
# Display the resulting frame
if display:
cv2.imshow("frame", frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
frame_count += 1
# Release everything
cap.release()
out.release()
cv2.destroyAllWindows()
def draw_groundtruth(video, annotations, display=False):
tree = ET.parse(args.ann)
root = tree.getroot()
# Create a list of 'track' nodes that are children of the root
tracks = [child for child in root if child.tag == "track"]
# Read the video in as a video object
cap = cv2.VideoCapture(args.video)
# Get a rough count of the number of frames in the video
rough_frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
# Find the name/path of the video, without file type
name_index = -1
while args.video[name_index] != ".":
name_index -= 1
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*"DIVX")
framerate = cap.get(cv2.CAP_PROP_FPS)
(width, height) = (
int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)),
int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)),
)
out = cv2.VideoWriter(
args.video[:name_index] + "_groundtruth.avi",
fourcc,
framerate,
(width, height),
0,
)
blank_frame = np.zeros((height, width), dtype=np.uint8)
for frame_count in tqdm(range(rough_frame_count)):
# Copy a new blank frame
frame = np.copy(blank_frame)
# Read the next frame but discard it, to check if the video is done yet
ret, _ = cap.read()
if not ret:
# Video is done, so break out of the loop
break
# Loop over the track objects. For all that have an annotation for this frame,
# draw a corresponding rectangle with a colour from the colours list
for track in tracks:
# Check that this track has any box nodes left
if len(track) > 0:
# Since the nodes are sorted by frame number,
# we only have to check the first one
box = track[0]
if int(box.attrib["frame"]) == frame_count:
# Draw the rectangle described by this 'box' node on this frame
# Cast the coordinates to floats, then to ints,
# as the cv2.rectangle function cannot handle float pixel values
# And int(str) cannot handle float strings
x_tl = int(float(box.attrib["xtl"]))
y_tl = int(float(box.attrib["ytl"]))
x_br = int(float(box.attrib["xbr"]))
y_br = int(float(box.attrib["ybr"]))
cv2.rectangle(frame, (x_tl, y_tl), (x_br, y_br), 255, cv2.FILLED)
# delete this box from the track, so we can keep
# only checking the first box in the future
track.remove(box)
# Write the frame with boxes
# Convert to BGR so video can be properly saved
# frame = cv2.cvtColor(frame, cv2.COLOR_GRAY2BGR)
out.write(frame)
# Display the resulting frame
if display:
cv2.imshow("frame", frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
frame_count += 1
# Keep going, as the frame count is not necessarily accurate so we might not be done
while True:
# Copy a new blank frame
frame = np.copy(blank_frame)
# Read the next frame but discard it, to check if the video is done yet
ret, og_frame = cap.read()
if not ret:
# Video is done, so break out of the loop
break
# Loop over the track objects. For all that have an annotation for this frame,
# draw a corresponding rectangle with a colour from the colours list
for track in tracks:
# Check that this track has any box nodes left
if len(track) > 0:
# Since the nodes are sorted by frame number, we only have to check the first one
box = track[0]
if int(box.attrib["frame"]) == frame_count:
# Draw the rectangle described by this 'box' node on this frame
# Cast the coordinates to floats, then to ints,
# as the cv2.rectangle function cannot handle float pixel values
# And int(str) cannot handle float strings
x_tl = int(float(box.attrib["xtl"]))
y_tl = int(float(box.attrib["ytl"]))
x_br = int(float(box.attrib["xbr"]))
y_br = int(float(box.attrib["ybr"]))
cv2.rectangle(frame, (x_tl, y_tl), (x_br, y_br), 255, cv2.FILLED)
# delete this box from the track, so we can keep
# only checking the first box in the future
track.remove(box)
# Write the frame with boxes
out.write(frame)
# Display the resulting frame
if display:
cv2.imshow("frame", frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
frame_count += 1
# Release everything
cap.release()
out.release()
cv2.destroyAllWindows()
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="Draw annotations, either on original videos or as ground-truth saliency maps"
)
parser.add_argument(
"--folder",
"-f",
dest="folder",
help="Folder containing input files. Video and annotation file names must match exactly, with videos as .mp4 or .avi, and annotations as .xml",
required=False,
)
parser.add_argument(
"--video", "-vid", dest="video", help="Input video file", required=False
)
parser.add_argument(
"--annotation", "-ann", dest="ann", help="Dense annotation file", required=False
)
parser.add_argument(
"--bounding_boxes",
"-bb",
dest="drawing_function",
action="store_const",
const=draw_annotations,
default=draw_groundtruth,
)
parser.add_argument("--verbose", "-v", dest="verbose", action="store_true")
args = parser.parse_args()
# Check that either folder was given, or if not then both video and ann was given
if args.folder == None and (args.video == None or args.ann == None):
print(
"Error: invalid inputs given. Either -folder, or both -video and -ann must be specified."
)
if args.folder != None:
# Read all files in the folder and call the appropriate function on each
# video/annotation pair found
# TODO: implement
pass
else:
# Draw bounding boxes on the original video, or ground-truth saliency maps,
# depending on if -bb was specified
args.drawing_function(args.video, args.ann, args.verbose)
| 39.115265
| 151
| 0.564352
| 1,641
| 12,556
| 4.248629
| 0.172456
| 0.025818
| 0.025244
| 0.039013
| 0.764917
| 0.752295
| 0.742542
| 0.742542
| 0.742542
| 0.731354
| 0
| 0.01991
| 0.347961
| 12,556
| 320
| 152
| 39.2375
| 0.831684
| 0.357439
| 0
| 0.666667
| 0
| 0.010256
| 0.077049
| 0
| 0
| 0
| 0.002008
| 0.003125
| 0
| 1
| 0.010256
| false
| 0.005128
| 0.025641
| 0
| 0.035897
| 0.005128
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bdde56a5f3d286d1bafe98ef4b315a28e95bec3c
| 126
|
py
|
Python
|
Tensorflow/Test Project/basic classification.py
|
iggy12345/Neural-Network-Vault
|
01e6826ea674599c847fd8f2128d326fdea2fe44
|
[
"MIT"
] | null | null | null |
Tensorflow/Test Project/basic classification.py
|
iggy12345/Neural-Network-Vault
|
01e6826ea674599c847fd8f2128d326fdea2fe44
|
[
"MIT"
] | null | null | null |
Tensorflow/Test Project/basic classification.py
|
iggy12345/Neural-Network-Vault
|
01e6826ea674599c847fd8f2128d326fdea2fe44
|
[
"MIT"
] | null | null | null |
import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
| 21
| 31
| 0.833333
| 20
| 126
| 5.05
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134921
| 126
| 6
| 32
| 21
| 0.926606
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.8
| 0
| 0.8
| 0.2
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
da503e27ceb13d56ec6f0447a90c2a91b5d5d016
| 91
|
py
|
Python
|
test cases/common/95 dep fallback/gensrc.py
|
NNemec/meson
|
d72a5c14f83253bafaf6b2531442d981ea1df2ed
|
[
"Apache-2.0"
] | null | null | null |
test cases/common/95 dep fallback/gensrc.py
|
NNemec/meson
|
d72a5c14f83253bafaf6b2531442d981ea1df2ed
|
[
"Apache-2.0"
] | null | null | null |
test cases/common/95 dep fallback/gensrc.py
|
NNemec/meson
|
d72a5c14f83253bafaf6b2531442d981ea1df2ed
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
import sys
import shutil
shutil.copyfile(sys.argv[1], sys.argv[2])
| 13
| 41
| 0.725275
| 16
| 91
| 4.125
| 0.6875
| 0.212121
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024691
| 0.10989
| 91
| 6
| 42
| 15.166667
| 0.790123
| 0.21978
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
da731d554915258285d3db92dc37e110a862893f
| 277
|
py
|
Python
|
gitconsensusservice/www.py
|
tedivm/GitConsensusService
|
c4c920eaf39aefdca2fa3d82a92c89e27da46506
|
[
"MIT"
] | 16
|
2018-03-15T10:23:16.000Z
|
2022-01-30T11:21:56.000Z
|
gitconsensusservice/www.py
|
tedivm/GitConsensusService
|
c4c920eaf39aefdca2fa3d82a92c89e27da46506
|
[
"MIT"
] | null | null | null |
gitconsensusservice/www.py
|
tedivm/GitConsensusService
|
c4c920eaf39aefdca2fa3d82a92c89e27da46506
|
[
"MIT"
] | 1
|
2018-07-07T07:45:39.000Z
|
2018-07-07T07:45:39.000Z
|
from flask import Flask, session, redirect, url_for, escape, request, render_template, flash, send_from_directory
from gitconsensusservice import app
import gitconsensusservice.routes.webhooks
@app.route('/')
def index():
return redirect('https://www.gitconsensus.com/')
| 30.777778
| 113
| 0.787004
| 34
| 277
| 6.294118
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104693
| 277
| 8
| 114
| 34.625
| 0.862903
| 0
| 0
| 0
| 0
| 0
| 0.108303
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0.5
| 0.166667
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
da758948e9f436b2b6e80031138a444785186a7f
| 73
|
py
|
Python
|
pushkin/util/__init__.py
|
Nordeus/pushkin
|
39f7057d3eb82c811c5c6b795d8bc7df9352a217
|
[
"MIT"
] | 281
|
2016-03-29T16:36:22.000Z
|
2022-03-13T10:28:10.000Z
|
pushkin/util/__init__.py
|
Nordeus/pushkin
|
39f7057d3eb82c811c5c6b795d8bc7df9352a217
|
[
"MIT"
] | 34
|
2016-04-11T08:48:51.000Z
|
2019-08-17T15:36:15.000Z
|
pushkin/util/__init__.py
|
Nordeus/pushkin
|
39f7057d3eb82c811c5c6b795d8bc7df9352a217
|
[
"MIT"
] | 66
|
2016-04-07T14:29:26.000Z
|
2022-03-30T13:17:38.000Z
|
from . import pool
from . import multiprocesslogging
from . import tools
| 18.25
| 33
| 0.794521
| 9
| 73
| 6.444444
| 0.555556
| 0.517241
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164384
| 73
| 3
| 34
| 24.333333
| 0.95082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
da75b4c5d61b6c1b99ae6b83a45f075920d7ce33
| 100
|
py
|
Python
|
utils/__init__.py
|
zhanglz95/RS-semantic-segmentation-pytorch-past
|
17f714024fa61da14f0b74f076feae27d7a782d6
|
[
"Apache-2.0"
] | 1
|
2021-03-17T10:22:56.000Z
|
2021-03-17T10:22:56.000Z
|
utils/__init__.py
|
zhanglz95/RS-semantic-segmentation-pytorch-past
|
17f714024fa61da14f0b74f076feae27d7a782d6
|
[
"Apache-2.0"
] | null | null | null |
utils/__init__.py
|
zhanglz95/RS-semantic-segmentation-pytorch-past
|
17f714024fa61da14f0b74f076feae27d7a782d6
|
[
"Apache-2.0"
] | 1
|
2021-04-22T02:18:41.000Z
|
2021-04-22T02:18:41.000Z
|
from .augmentation import *
from .optim import *
from .metrics import *
from .transfunction import *
| 25
| 28
| 0.77
| 12
| 100
| 6.416667
| 0.5
| 0.38961
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 100
| 4
| 28
| 25
| 0.905882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
da81441d05bf7ab806931f1d474a95e2c2cbfd48
| 12,251
|
py
|
Python
|
release/stubs.min/Tekla/Structures/ModelInternal.py
|
YKato521/ironpython-stubs
|
b1f7c580de48528490b3ee5791b04898be95a9ae
|
[
"MIT"
] | null | null | null |
release/stubs.min/Tekla/Structures/ModelInternal.py
|
YKato521/ironpython-stubs
|
b1f7c580de48528490b3ee5791b04898be95a9ae
|
[
"MIT"
] | null | null | null |
release/stubs.min/Tekla/Structures/ModelInternal.py
|
YKato521/ironpython-stubs
|
b1f7c580de48528490b3ee5791b04898be95a9ae
|
[
"MIT"
] | null | null | null |
# encoding: utf-8
# module Tekla.Structures.ModelInternal calls itself ModelInternal
# from Tekla.Structures.Model,Version=2017.0.0.0,Culture=neutral,PublicKeyToken=2f04dbe497b71114
# by generator 1.145
# no doc
# no imports
# no functions
# classes
from ModelInternal_parts.AreWeUnitTesting import AreWeUnitTesting
from ModelInternal_parts.BasePoint import BasePoint
from ModelInternal_parts.BentPlateTestingTool import BentPlateTestingTool
from ModelInternal_parts.BentPlateTools import BentPlateTools
from ModelInternal_parts.CDelegateSetter import CDelegateSetter
from ModelInternal_parts.CDelegateWrapper import CDelegateWrapper
from ModelInternal_parts.ChangeManager import ChangeManager
from ModelInternal_parts.ConversionLink import ConversionLink
from ModelInternal_parts.DelegateFake import DelegateFake
from ModelInternal_parts.dotAreaPolygons_t import dotAreaPolygons_t
from ModelInternal_parts.dotAssembly_t import dotAssembly_t
from ModelInternal_parts.dotBaseComponent_t import dotBaseComponent_t
from ModelInternal_parts.dotBasePointData_t import dotBasePointData_t
from ModelInternal_parts.dotBoltGroup_t import dotBoltGroup_t
from ModelInternal_parts.dotBoltPolygon_t import dotBoltPolygon_t
from ModelInternal_parts.dotBoltShapeData_t import dotBoltShapeData_t
from ModelInternal_parts.dotBooleanPart_t import dotBooleanPart_t
from ModelInternal_parts.dotBoolean_t import dotBoolean_t
from ModelInternal_parts.dotCamera_t import dotCamera_t
from ModelInternal_parts.dotChamfer_t import dotChamfer_t
from ModelInternal_parts.dotClash_t import dotClash_t
from ModelInternal_parts.dotClientId_t import dotClientId_t
from ModelInternal_parts.dotClipPlane_t import dotClipPlane_t
from ModelInternal_parts.dotColor_t import dotColor_t
from ModelInternal_parts.dotComponentAttribute_t import dotComponentAttribute_t
from ModelInternal_parts.dotComponentInputObject_t import dotComponentInputObject_t
from ModelInternal_parts.dotContourPoint_t import dotContourPoint_t
from ModelInternal_parts.dotContour_t import dotContour_t
from ModelInternal_parts.dotControlObject_t import dotControlObject_t
from ModelInternal_parts.dotConversionLink_t import dotConversionLink_t
from ModelInternal_parts.dotCreateIFCFromModel_t import dotCreateIFCFromModel_t
from ModelInternal_parts.dotCreateNCFromModel_t import dotCreateNCFromModel_t
from ModelInternal_parts.dotCreateReportFromModel_t import dotCreateReportFromModel_t
from ModelInternal_parts.dotDeformingData_t import dotDeformingData_t
from ModelInternal_parts.dotDrawPolygonSurface_t import dotDrawPolygonSurface_t
from ModelInternal_parts.dotDrawPolyLine_t import dotDrawPolyLine_t
from ModelInternal_parts.dotDrawText_t import dotDrawText_t
from ModelInternal_parts.dotEdgeChamfer_t import dotEdgeChamfer_t
from ModelInternal_parts.dotEdges_t import dotEdges_t
from ModelInternal_parts.dotEnumerator_t import dotEnumerator_t
from ModelInternal_parts.dotFittingOrCutPlane_t import dotFittingOrCutPlane_t
from ModelInternal_parts.dotFormingStates_t import dotFormingStates_t
from ModelInternal_parts.dotGetClipPlanes_t import dotGetClipPlanes_t
from ModelInternal_parts.dotGetProperties_t import dotGetProperties_t
from ModelInternal_parts.dotGraphicPolyLine_t import dotGraphicPolyLine_t
from ModelInternal_parts.dotGridPlane_t import dotGridPlane_t
from ModelInternal_parts.dotGrid_t import dotGrid_t
from ModelInternal_parts.dotGuideline_t import dotGuideline_t
from ModelInternal_parts.dotHierarchicDefinition_t import dotHierarchicDefinition_t
from ModelInternal_parts.dotHierarchicList_t import dotHierarchicList_t
from ModelInternal_parts.dotHierarchicObject_t import dotHierarchicObject_t
from ModelInternal_parts.dotIFC2X3_Application_t import dotIFC2X3_Application_t
from ModelInternal_parts.dotIFC2X3_Organization_t import dotIFC2X3_Organization_t
from ModelInternal_parts.dotIFC2X3_OwnerHistoryChangeAction_t import (
dotIFC2X3_OwnerHistoryChangeAction_t,
)
from ModelInternal_parts.dotIFC2X3_OwnerHistoryState_t import (
dotIFC2X3_OwnerHistoryState_t,
)
from ModelInternal_parts.dotIFC2X3_OwnerHistory_t import dotIFC2X3_OwnerHistory_t
from ModelInternal_parts.dotIFC2X3_ParametricObject_ShapeProfile_t import (
dotIFC2X3_ParametricObject_ShapeProfile_t,
)
from ModelInternal_parts.dotIFC2X3_PersonAndOrganization_t import (
dotIFC2X3_PersonAndOrganization_t,
)
from ModelInternal_parts.dotIFC2X3_Person_t import dotIFC2X3_Person_t
from ModelInternal_parts.dotIFC2X3_Product_t import dotIFC2X3_Product_t
from ModelInternal_parts.dotIntersectionPoints_t import dotIntersectionPoints_t
from ModelInternal_parts.dotIntersectionSolid_t import dotIntersectionSolid_t
from ModelInternal_parts.dotLegFace_t import dotLegFace_t
from ModelInternal_parts.dotLoadClassAttributes_t import dotLoadClassAttributes_t
from ModelInternal_parts.dotLoadCommonAttributes_t import dotLoadCommonAttributes_t
from ModelInternal_parts.dotLoadGroup_t import dotLoadGroup_t
from ModelInternal_parts.dotManipulateObject_t import dotManipulateObject_t
from ModelInternal_parts.dotMaterial_t import dotMaterial_t
from ModelInternal_parts.dotModelCommit_t import dotModelCommit_t
from ModelInternal_parts.dotModelInfoModeEnum import dotModelInfoModeEnum
from ModelInternal_parts.dotModelInfo_t import dotModelInfo_t
from ModelInternal_parts.dotModelObjectType_t import dotModelObjectType_t
from ModelInternal_parts.dotModelObject_t import dotModelObject_t
from ModelInternal_parts.dotModificationStamp_t import dotModificationStamp_t
from ModelInternal_parts.dotModStampCompare_t import dotModStampCompare_t
from ModelInternal_parts.dotModStamp_t import dotModStamp_t
from ModelInternal_parts.dotnetDoubleList_t import dotnetDoubleList_t
from ModelInternal_parts.dotnetEdgeList_t import dotnetEdgeList_t
from ModelInternal_parts.dotnetIntList_t import dotnetIntList_t
from ModelInternal_parts.DotNetModelProxy import DotNetModelProxy
from ModelInternal_parts.dotnetPointList_t import dotnetPointList_t
from ModelInternal_parts.dotnetStringList_t import dotnetStringList_t
from ModelInternal_parts.dotNumberingQuery_t import dotNumberingQuery_t
from ModelInternal_parts.dotNumberingSeries_t import dotNumberingSeries_t
from ModelInternal_parts.dotObjectOperationsEnum import dotObjectOperationsEnum
from ModelInternal_parts.dotObject_t import dotObject_t
from ModelInternal_parts.dotOffset_t import dotOffset_t
from ModelInternal_parts.dotPartLine_t import dotPartLine_t
from ModelInternal_parts.dotPartMark_t import dotPartMark_t
from ModelInternal_parts.dotPart_t import dotPart_t
from ModelInternal_parts.dotPhaseNumbers_t import dotPhaseNumbers_t
from ModelInternal_parts.dotPhase_t import dotPhase_t
from ModelInternal_parts.dotPlane_t import dotPlane_t
from ModelInternal_parts.dotPolygon_t import dotPolygon_t
from ModelInternal_parts.dotPolymeshObject_t import dotPolymeshObject_t
from ModelInternal_parts.dotPolymeshValidateInvalidInfo_t import (
dotPolymeshValidateInvalidInfo_t,
)
from ModelInternal_parts.dotPolymesh_t import dotPolymesh_t
from ModelInternal_parts.dotPosition_t import dotPosition_t
from ModelInternal_parts.dotPourObject_t import dotPourObject_t
from ModelInternal_parts.dotProfile_t import dotProfile_t
from ModelInternal_parts.dotProgressBar_t import dotProgressBar_t
from ModelInternal_parts.dotProjectInfo_t import dotProjectInfo_t
from ModelInternal_parts.dotRebarEndDetailStrip_t import dotRebarEndDetailStrip_t
from ModelInternal_parts.dotRebarGroup_t import dotRebarGroup_t
from ModelInternal_parts.dotRebarHookData_t import dotRebarHookData_t
from ModelInternal_parts.dotRebarMesh_t import dotRebarMesh_t
from ModelInternal_parts.dotRebarProperties_t import dotRebarProperties_t
from ModelInternal_parts.dotRebarPropertyStrip_t import dotRebarPropertyStrip_t
from ModelInternal_parts.dotRebarSetAddition_t import dotRebarSetAddition_t
from ModelInternal_parts.dotRebarSet_t import dotRebarSet_t
from ModelInternal_parts.dotRebarSpacing_t import dotRebarSpacing_t
from ModelInternal_parts.dotRebarSplice_t import dotRebarSplice_t
from ModelInternal_parts.dotRebarSplitter_t import dotRebarSplitter_t
from ModelInternal_parts.dotRebarStrand_t import dotRebarStrand_t
from ModelInternal_parts.dotRebarStrip_t import dotRebarStrip_t
from ModelInternal_parts.dotRebarThreading_t import dotRebarThreading_t
from ModelInternal_parts.dotReferenceModelObjectAttributeEnumerator_t import (
dotReferenceModelObjectAttributeEnumerator_t,
)
from ModelInternal_parts.dotReferenceModelObjectAttribute_t import (
dotReferenceModelObjectAttribute_t,
)
from ModelInternal_parts.dotReferenceModelObject_t import dotReferenceModelObject_t
from ModelInternal_parts.dotReferenceModelRevision_t import dotReferenceModelRevision_t
from ModelInternal_parts.dotReferenceModel_t import dotReferenceModel_t
from ModelInternal_parts.dotReinforcement_t import dotReinforcement_t
from ModelInternal_parts.dotSaveAsWebModel_t import dotSaveAsWebModel_t
from ModelInternal_parts.dotSaveOperation_t import dotSaveOperation_t
from ModelInternal_parts.dotSetGetProperty_t import dotSetGetProperty_t
from ModelInternal_parts.dotSetProperty_t import dotSetProperty_t
from ModelInternal_parts.dotSetTemporaryColors_t import dotSetTemporaryColors_t
from ModelInternal_parts.dotSetTemporaryStates_t import dotSetTemporaryStates_t
from ModelInternal_parts.dotSharingOperation_t import dotSharingOperation_t
from ModelInternal_parts.dotSingleRebar_t import dotSingleRebar_t
from ModelInternal_parts.dotSolid_t import dotSolid_t
from ModelInternal_parts.dotSpacingZone_t import dotSpacingZone_t
from ModelInternal_parts.dotStringProperty_t import dotStringProperty_t
from ModelInternal_parts.dotSurfaceObject_t import dotSurfaceObject_t
from ModelInternal_parts.dotSurfaceTreatment_t import dotSurfaceTreatment_t
from ModelInternal_parts.dotTaskDependency_t import dotTaskDependency_t
from ModelInternal_parts.dotTaskObjectAttacher_t import dotTaskObjectAttacher_t
from ModelInternal_parts.dotTaskWorktype_t import dotTaskWorktype_t
from ModelInternal_parts.dotTask_t import dotTask_t
from ModelInternal_parts.dotTemporaryState import dotTemporaryState
from ModelInternal_parts.dotTemporaryStatesEnum import dotTemporaryStatesEnum
from ModelInternal_parts.dotTemporaryTransparenciesEnum import (
dotTemporaryTransparenciesEnum,
)
from ModelInternal_parts.dotTransformationPlane_t import dotTransformationPlane_t
from ModelInternal_parts.dotUIModelObjectSelector_t import dotUIModelObjectSelector_t
from ModelInternal_parts.dotUIPicker_t import dotUIPicker_t
from ModelInternal_parts.dotUndoOperation_t import dotUndoOperation_t
from ModelInternal_parts.dotViewSelector_t import dotViewSelector_t
from ModelInternal_parts.dotViewVisibilitySettings_t import dotViewVisibilitySettings_t
from ModelInternal_parts.dotView_t import dotView_t
from ModelInternal_parts.dotWeldGeometry_t import dotWeldGeometry_t
from ModelInternal_parts.dotWeld_t import dotWeld_t
from ModelInternal_parts.dotWire_t import dotWire_t
from ModelInternal_parts.DoubleList import DoubleList
from ModelInternal_parts.EventHandlerWrapper import EventHandlerWrapper
from ModelInternal_parts.GeometryImporter import GeometryImporter
from ModelInternal_parts.GeometryTree import GeometryTree
from ModelInternal_parts.ICDelegate import ICDelegate
from ModelInternal_parts.IEventHandler import IEventHandler
from ModelInternal_parts.IntList import IntList
from ModelInternal_parts.ModelExtensions import ModelExtensions
from ModelInternal_parts.ModelObjectFactory import ModelObjectFactory
from ModelInternal_parts.NumberingQueryModeEnum import NumberingQueryModeEnum
from ModelInternal_parts.Operation import Operation
from ModelInternal_parts.PointList import PointList
from ModelInternal_parts.PolygonExtensions import PolygonExtensions
from ModelInternal_parts.RebarSetAction import RebarSetAction
from ModelInternal_parts.Remoter import Remoter
from ModelInternal_parts.ScopedCDelegateSetter import ScopedCDelegateSetter
from ModelInternal_parts.Serializer import Serializer
from ModelInternal_parts.StringList import StringList
from ModelInternal_parts.SurfaceObjectCreator import SurfaceObjectCreator
from ModelInternal_parts.SyncHandler import SyncHandler
from ModelInternal_parts.UDAChanges import UDAChanges
| 61.562814
| 96
| 0.919272
| 1,366
| 12,251
| 7.902635
| 0.150073
| 0.272441
| 0.352571
| 0.291894
| 0.026679
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005138
| 0.062689
| 12,251
| 198
| 97
| 61.873737
| 0.934947
| 0.019019
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.915344
| 0
| 0.915344
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
da847575ffbfbf01189591df5dfaeb376a28f185
| 404
|
py
|
Python
|
django_world/admin.py
|
iamabhishekchakraborty/djangoProject
|
a71be90da2899c5cf17e94404b2056438b52fe35
|
[
"MIT"
] | null | null | null |
django_world/admin.py
|
iamabhishekchakraborty/djangoProject
|
a71be90da2899c5cf17e94404b2056438b52fe35
|
[
"MIT"
] | null | null | null |
django_world/admin.py
|
iamabhishekchakraborty/djangoProject
|
a71be90da2899c5cf17e94404b2056438b52fe35
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Succession,Succession_Seasons,Succession_Casts,Succession_Season_Episodes
# Register your models here.
# admin.site.register(Succession) # The model Succession is abstract so it can't be registered with admin
admin.site.register(Succession_Seasons)
admin.site.register(Succession_Casts)
admin.site.register(Succession_Season_Episodes)
| 44.888889
| 120
| 0.819307
| 53
| 404
| 6.09434
| 0.490566
| 0.111455
| 0.210526
| 0.334365
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116337
| 404
| 8
| 121
| 50.5
| 0.904762
| 0.356436
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e540f8c6d5fba988d4c42de6ea9c1fbacb4b4f7a
| 302
|
py
|
Python
|
unipipeline/brokers/uni_broker_message_manager.py
|
aliaksandr-master/unipipeline
|
d8eac38534172aee59ab5777321cabe67f3779ef
|
[
"MIT"
] | null | null | null |
unipipeline/brokers/uni_broker_message_manager.py
|
aliaksandr-master/unipipeline
|
d8eac38534172aee59ab5777321cabe67f3779ef
|
[
"MIT"
] | 1
|
2021-09-14T13:08:13.000Z
|
2021-09-14T13:08:13.000Z
|
unipipeline/brokers/uni_broker_message_manager.py
|
aliaksandr-master/unipipeline
|
d8eac38534172aee59ab5777321cabe67f3779ef
|
[
"MIT"
] | null | null | null |
class UniBrokerMessageManager:
def reject(self) -> None:
raise NotImplementedError(f'method reject must be specified for class "{type(self).__name__}"')
def ack(self) -> None:
raise NotImplementedError(f'method acknowledge must be specified for class "{type(self).__name__}"')
| 43.142857
| 108
| 0.715232
| 36
| 302
| 5.777778
| 0.5
| 0.076923
| 0.125
| 0.307692
| 0.711538
| 0.711538
| 0.336538
| 0.336538
| 0
| 0
| 0
| 0
| 0.175497
| 302
| 6
| 109
| 50.333333
| 0.835341
| 0
| 0
| 0
| 0
| 0
| 0.44702
| 0.152318
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 0
| 0.6
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
e571dfc8f064be1cb41ad77510b528b26dec92c5
| 1,994
|
py
|
Python
|
nets/vgg.py
|
bubbliiiing/faster-rcnn-tf2
|
c3982016c7c209a3fa71a30facbe53396e6340ee
|
[
"MIT"
] | 133
|
2020-11-23T05:43:08.000Z
|
2022-03-30T08:10:50.000Z
|
nets/vgg.py
|
Whale1024/faster-rcnn-tf2
|
6343860e5d44e8441fa736620762e4c256b27083
|
[
"MIT"
] | 15
|
2020-12-01T12:07:14.000Z
|
2021-09-30T02:27:37.000Z
|
nets/vgg.py
|
Whale1024/faster-rcnn-tf2
|
6343860e5d44e8441fa736620762e4c256b27083
|
[
"MIT"
] | 40
|
2020-11-24T13:01:41.000Z
|
2022-03-30T08:10:53.000Z
|
from tensorflow.keras.layers import (Conv2D, Dense, Flatten, MaxPooling2D,
TimeDistributed)
def VGG16(inputs):
x = Conv2D(64,(3,3),activation = 'relu',padding = 'same',name = 'block1_conv1')(inputs)
x = Conv2D(64,(3,3),activation = 'relu',padding = 'same', name = 'block1_conv2')(x)
x = MaxPooling2D((2,2), strides = (2,2), name = 'block1_pool')(x)
x = Conv2D(128,(3,3),activation = 'relu',padding = 'same',name = 'block2_conv1')(x)
x = Conv2D(128,(3,3),activation = 'relu',padding = 'same',name = 'block2_conv2')(x)
x = MaxPooling2D((2,2),strides = (2,2), name = 'block2_pool')(x)
x = Conv2D(256,(3,3),activation = 'relu',padding = 'same',name = 'block3_conv1')(x)
x = Conv2D(256,(3,3),activation = 'relu',padding = 'same',name = 'block3_conv2')(x)
x = Conv2D(256,(3,3),activation = 'relu',padding = 'same',name = 'block3_conv3')(x)
x = MaxPooling2D((2,2),strides = (2,2), name = 'block3_pool')(x)
# 第四个卷积部分
# 14,14,512
x = Conv2D(512,(3,3),activation = 'relu',padding = 'same', name = 'block4_conv1')(x)
x = Conv2D(512,(3,3),activation = 'relu',padding = 'same', name = 'block4_conv2')(x)
x = Conv2D(512,(3,3),activation = 'relu',padding = 'same', name = 'block4_conv3')(x)
x = MaxPooling2D((2,2),strides = (2,2), name = 'block4_pool')(x)
# 第五个卷积部分
# 7,7,512
x = Conv2D(512,(3,3),activation = 'relu', padding = 'same', name = 'block5_conv1')(x)
x = Conv2D(512,(3,3),activation = 'relu', padding = 'same', name = 'block5_conv2')(x)
x = Conv2D(512,(3,3),activation = 'relu', padding = 'same', name = 'block5_conv3')(x)
return x
def vgg_classifier_layers(x):
# num_rois, 14, 14, 1024 -> num_rois, 7, 7, 2048
x = TimeDistributed(Flatten(name='flatten'))(x)
x = TimeDistributed(Dense(4096, activation='relu'), name='fc1')(x)
x = TimeDistributed(Dense(4096, activation='relu'), name='fc2')(x)
return x
| 49.85
| 94
| 0.591274
| 277
| 1,994
| 4.180505
| 0.176895
| 0.181347
| 0.134715
| 0.17962
| 0.759931
| 0.759931
| 0.759931
| 0.759931
| 0.683938
| 0.683938
| 0
| 0.104337
| 0.202106
| 1,994
| 39
| 95
| 51.128205
| 0.623507
| 0.04012
| 0
| 0.076923
| 0
| 0
| 0.17389
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.076923
| false
| 0
| 0.038462
| 0
| 0.192308
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e57aa2bef618d1871eb73c2b27d8c100f4c7c1b4
| 117
|
py
|
Python
|
genie/cbs.py
|
karawoo/Genie
|
d39451655ec3632df6002c1d73b17dacba2a8720
|
[
"MIT"
] | 10
|
2017-08-31T21:32:18.000Z
|
2022-03-07T21:37:17.000Z
|
genie/cbs.py
|
karawoo/Genie
|
d39451655ec3632df6002c1d73b17dacba2a8720
|
[
"MIT"
] | 216
|
2016-10-24T21:30:12.000Z
|
2022-03-31T15:04:37.000Z
|
genie/cbs.py
|
karawoo/Genie
|
d39451655ec3632df6002c1d73b17dacba2a8720
|
[
"MIT"
] | 12
|
2016-10-21T13:48:06.000Z
|
2020-06-04T19:21:23.000Z
|
from .seg import seg
class cbs(seg):
'''
cbs file type extends from seg files
'''
_fileType = "cbs"
| 14.625
| 40
| 0.589744
| 16
| 117
| 4.25
| 0.625
| 0.205882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.299145
| 117
| 7
| 41
| 16.714286
| 0.829268
| 0.307692
| 0
| 0
| 0
| 0
| 0.046154
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e59a96f9cbef90916ed0e04cd8d6ed7564a75b9b
| 83
|
py
|
Python
|
core/dr_utils/dib_renderer_x/__init__.py
|
weiqi-luo/Self6D-Diff-Renderer
|
1e1caad49f0f8de90a332995814de29261598982
|
[
"Apache-2.0"
] | 90
|
2020-08-15T16:14:45.000Z
|
2022-01-22T10:24:13.000Z
|
core/dr_utils/dib_renderer_x/__init__.py
|
weiqi-luo/Self6D-Diff-Renderer
|
1e1caad49f0f8de90a332995814de29261598982
|
[
"Apache-2.0"
] | 11
|
2020-09-07T17:31:18.000Z
|
2021-11-25T12:07:30.000Z
|
core/dr_utils/dib_renderer_x/__init__.py
|
weiqi-luo/Self6D-Diff-Renderer
|
1e1caad49f0f8de90a332995814de29261598982
|
[
"Apache-2.0"
] | 13
|
2020-09-03T04:25:50.000Z
|
2021-12-23T08:23:33.000Z
|
# NOTE: override the kaolin one
from .renderer.base import Renderer as DIBRenderer
| 27.666667
| 50
| 0.807229
| 12
| 83
| 5.583333
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144578
| 83
| 2
| 51
| 41.5
| 0.943662
| 0.349398
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e5ad6ee6714dfcdaecbb3585508060507bc3d9b4
| 260
|
py
|
Python
|
app/main/errors.py
|
ZxShane/slam_hospital
|
302704b3a188cea07dddfb23595dd75f8d3cd636
|
[
"Apache-2.0"
] | 2
|
2022-03-21T20:43:02.000Z
|
2022-03-21T21:59:16.000Z
|
app/main/errors.py
|
liliangbin/webBot
|
b538dbbf1d05217e52c3713af2aff26bf8692a53
|
[
"Apache-2.0"
] | 1
|
2020-11-17T16:47:19.000Z
|
2021-01-26T10:16:33.000Z
|
app/main/errors.py
|
ZxShane/slam_hospital
|
302704b3a188cea07dddfb23595dd75f8d3cd636
|
[
"Apache-2.0"
] | 1
|
2022-03-21T20:43:04.000Z
|
2022-03-21T20:43:04.000Z
|
from app.main import main
from flask import render_template
@main.app_errorhandler(404)
def page_not_found():
return render_template('404.html'), 404
@main.app_errorhandler(500)
def internal_server_error(e):
return render_template('500.html'), 500
| 20
| 43
| 0.773077
| 39
| 260
| 4.923077
| 0.512821
| 0.21875
| 0.197917
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078947
| 0.123077
| 260
| 12
| 44
| 21.666667
| 0.763158
| 0
| 0
| 0
| 0
| 0
| 0.061538
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 0.75
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
e5af907f4c075a0a78dd76e98c96640ee83b5d8a
| 46
|
py
|
Python
|
destiny_timelost/exceptions.py
|
dmfigol/destiny-timelost
|
ba61bfbfea8b0d4136f64c815b4f6bf37c3b4a5e
|
[
"MIT"
] | null | null | null |
destiny_timelost/exceptions.py
|
dmfigol/destiny-timelost
|
ba61bfbfea8b0d4136f64c815b4f6bf37c3b4a5e
|
[
"MIT"
] | null | null | null |
destiny_timelost/exceptions.py
|
dmfigol/destiny-timelost
|
ba61bfbfea8b0d4136f64c815b4f6bf37c3b4a5e
|
[
"MIT"
] | null | null | null |
class IncorrectSideError(Exception):
pass
| 15.333333
| 36
| 0.782609
| 4
| 46
| 9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152174
| 46
| 2
| 37
| 23
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
e5b37ed1248ab6d9033193e9bfde652e9f214f58
| 77
|
py
|
Python
|
ap/tests/test_request_certs.py
|
oscar-king/A-Decentralised-Digital-Identity-Architecture
|
99d80529d00f135d5de642fc98f817cb289d8b3c
|
[
"MIT"
] | 4
|
2020-10-13T15:47:19.000Z
|
2021-01-10T14:00:57.000Z
|
ap/tests/test_request_certs.py
|
oscar-king/A-Decentralised-Digital-Identity-Architecture
|
99d80529d00f135d5de642fc98f817cb289d8b3c
|
[
"MIT"
] | 1
|
2021-06-02T00:22:25.000Z
|
2021-06-02T00:22:25.000Z
|
ap/tests/test_request_certs.py
|
oscar-king/A-Decentralised-Digital-Identity-Architecture
|
99d80529d00f135d5de642fc98f817cb289d8b3c
|
[
"MIT"
] | 1
|
2020-01-27T14:16:11.000Z
|
2020-01-27T14:16:11.000Z
|
class TestRequest_certs():
def test_request_certs(self):
return
| 15.4
| 33
| 0.688312
| 9
| 77
| 5.555556
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.233766
| 77
| 4
| 34
| 19.25
| 0.847458
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
e5c5696b8bef2a55f03c57b8d36284a7a1f944c2
| 154
|
py
|
Python
|
gspread_pandas/__init__.py
|
andmatt/gspread-pandas
|
a862f995f50217be4e45c1db858e3b901f2b68df
|
[
"BSD-3-Clause"
] | null | null | null |
gspread_pandas/__init__.py
|
andmatt/gspread-pandas
|
a862f995f50217be4e45c1db858e3b901f2b68df
|
[
"BSD-3-Clause"
] | null | null | null |
gspread_pandas/__init__.py
|
andmatt/gspread-pandas
|
a862f995f50217be4e45c1db858e3b901f2b68df
|
[
"BSD-3-Clause"
] | null | null | null |
from .client import Spread, Client
from ._version import __version__, __version_info__
__all__ = ["Spread", "Client", "__version__", "__version_info__"]
| 30.8
| 65
| 0.772727
| 17
| 154
| 5.647059
| 0.411765
| 0.25
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11039
| 154
| 4
| 66
| 38.5
| 0.70073
| 0
| 0
| 0
| 0
| 0
| 0.253247
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e5c871f3f8f4cec7f1ec598959c70b9c56324233
| 173
|
py
|
Python
|
tools/bin/pythonSrc/pychecker-0.8.18/test_input/test25.py
|
YangHao666666/hawq
|
10cff8350f1ba806c6fec64eb67e0e6f6f24786c
|
[
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 450
|
2015-09-05T09:12:51.000Z
|
2018-08-30T01:45:36.000Z
|
tools/bin/pythonSrc/pychecker-0.8.18/test_input/test25.py
|
YangHao666666/hawq
|
10cff8350f1ba806c6fec64eb67e0e6f6f24786c
|
[
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 1,274
|
2015-09-22T20:06:16.000Z
|
2018-08-31T22:14:00.000Z
|
tools/bin/pythonSrc/pychecker-0.8.18/test_input/test25.py
|
YangHao666666/hawq
|
10cff8350f1ba806c6fec64eb67e0e6f6f24786c
|
[
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 278
|
2015-09-21T19:15:06.000Z
|
2018-08-31T00:36:51.000Z
|
'doc'
import sys
class A:
'doc'
z = 1
def x(self): pass
def xxx():
print A.x()
print A.z
print A.a
print A.y()
print sys.lkjsdflksjasdlf
| 10.176471
| 29
| 0.531792
| 29
| 173
| 3.172414
| 0.517241
| 0.26087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00885
| 0.346821
| 173
| 16
| 30
| 10.8125
| 0.80531
| 0
| 0
| 0.166667
| 0
| 0
| 0.034884
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.083333
| 0.083333
| null | null | 0.416667
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
|
0
| 5
|
e5ccafc8059c0671229da4af053e6aac65820444
| 410
|
py
|
Python
|
networks/decoders/__init__.py
|
Yaoyi-Li/HOP-Matting
|
4ac22d92b5432734ffe416cf2c0a99fb730d0c04
|
[
"MIT"
] | 56
|
2020-04-26T16:19:50.000Z
|
2021-12-30T07:20:40.000Z
|
networks/decoders/__init__.py
|
Yaoyi-Li/HOP-Matting
|
4ac22d92b5432734ffe416cf2c0a99fb730d0c04
|
[
"MIT"
] | 5
|
2020-04-27T19:17:17.000Z
|
2021-07-17T13:55:35.000Z
|
networks/decoders/__init__.py
|
Yaoyi-Li/HOP-Matting
|
4ac22d92b5432734ffe416cf2c0a99fb730d0c04
|
[
"MIT"
] | 11
|
2020-04-29T10:01:35.000Z
|
2022-03-31T03:34:50.000Z
|
from .resnet_dec import ResNet_D_Dec, BasicBlock
from .res_localHOP_posEmb_dec import ResLocalHOP_PosEmb_Dec
__all__ = ['res_localHOP_posEmb_decoder_22']
def _res_localHOP_posEmb_dec(block, layers, **kwargs):
model = ResLocalHOP_PosEmb_Dec(block, layers, **kwargs)
return model
def res_localHOP_posEmb_decoder_22(**kwargs):
return _res_localHOP_posEmb_dec(BasicBlock, [2, 3, 3, 2], **kwargs)
| 27.333333
| 71
| 0.785366
| 58
| 410
| 5.034483
| 0.362069
| 0.188356
| 0.291096
| 0.205479
| 0.356164
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022222
| 0.121951
| 410
| 14
| 72
| 29.285714
| 0.788889
| 0
| 0
| 0
| 0
| 0
| 0.073171
| 0.073171
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.125
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
f920a341583ba0552d2d24741d13184d533dc057
| 173
|
py
|
Python
|
app/main.py
|
PythonBiellaGroup/ModernDataEngineering
|
369fcb89d119ccd1d73882e492cf7c5331087d20
|
[
"MIT"
] | 12
|
2021-12-12T22:19:52.000Z
|
2022-03-18T11:45:17.000Z
|
app/main.py
|
PythonBiellaGroup/ModernDataEngineering
|
369fcb89d119ccd1d73882e492cf7c5331087d20
|
[
"MIT"
] | 1
|
2021-02-02T09:21:23.000Z
|
2021-02-02T09:21:23.000Z
|
app/main.py
|
PythonBiellaGroup/ModernDataEngineering
|
369fcb89d119ccd1d73882e492cf7c5331087d20
|
[
"MIT"
] | 7
|
2021-02-01T22:09:14.000Z
|
2021-06-22T08:30:16.000Z
|
# import streamlit.cli
from app.src.launch import app
if __name__ == "__main__":
# streamlit.cli._main_run_clExplicit("./src/launch.py", "streamlit run")
app.run()
| 24.714286
| 76
| 0.705202
| 24
| 173
| 4.625
| 0.541667
| 0.216216
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144509
| 173
| 6
| 77
| 28.833333
| 0.75
| 0.526012
| 0
| 0
| 0
| 0
| 0.101266
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f92538fc2b7784c83c2fb8a696ed36d394f74a8b
| 94
|
py
|
Python
|
test/conftest.py
|
atztogo/aiida-donothing
|
1bd4c8c07213147e82fa32e38e9508c925d87507
|
[
"MIT"
] | null | null | null |
test/conftest.py
|
atztogo/aiida-donothing
|
1bd4c8c07213147e82fa32e38e9508c925d87507
|
[
"MIT"
] | null | null | null |
test/conftest.py
|
atztogo/aiida-donothing
|
1bd4c8c07213147e82fa32e38e9508c925d87507
|
[
"MIT"
] | null | null | null |
"""pytest fixtures."""
import pytest
pytest_plugins = ["aiida.manage.tests.pytest_fixtures"]
| 18.8
| 55
| 0.755319
| 11
| 94
| 6.272727
| 0.636364
| 0.405797
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085106
| 94
| 4
| 56
| 23.5
| 0.802326
| 0.170213
| 0
| 0
| 0
| 0
| 0.472222
| 0.472222
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
008b87796c61d9c7cad8a8c451eb6e712bd0b528
| 242
|
py
|
Python
|
django_twilio/settings.py
|
km-pg/django-twilio
|
d50ead89ca0996f6fe7e1b9359d877637627594e
|
[
"Unlicense"
] | null | null | null |
django_twilio/settings.py
|
km-pg/django-twilio
|
d50ead89ca0996f6fe7e1b9359d877637627594e
|
[
"Unlicense"
] | 10
|
2019-12-26T17:31:31.000Z
|
2022-03-21T22:17:33.000Z
|
django_twilio/settings.py
|
km-pg/django-twilio
|
d50ead89ca0996f6fe7e1b9359d877637627594e
|
[
"Unlicense"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
"""
django_twilio specific settings.
"""
from .utils import discover_twilio_credentials
TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN = discover_twilio_credentials()
| 22
| 69
| 0.801653
| 29
| 242
| 6.172414
| 0.689655
| 0.156425
| 0.27933
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00463
| 0.107438
| 242
| 10
| 70
| 24.2
| 0.824074
| 0.086777
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
00a4d8f0286421d9f4cf38faa6eb4989443c341b
| 25
|
py
|
Python
|
web/web/domain/models/__init__.py
|
michelangelo-prog/wishlist
|
0a17194274c4339425768b9ea08986fcf735efc9
|
[
"MIT"
] | null | null | null |
web/web/domain/models/__init__.py
|
michelangelo-prog/wishlist
|
0a17194274c4339425768b9ea08986fcf735efc9
|
[
"MIT"
] | null | null | null |
web/web/domain/models/__init__.py
|
michelangelo-prog/wishlist
|
0a17194274c4339425768b9ea08986fcf735efc9
|
[
"MIT"
] | null | null | null |
# web/models/__init__.py
| 12.5
| 24
| 0.76
| 4
| 25
| 3.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 25
| 1
| 25
| 25
| 0.652174
| 0.88
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
970ed693f23636178c5bb2e32a7f866dc966fbe4
| 93
|
py
|
Python
|
project/admin.py
|
abrusebas1997/Contractor1.2
|
b8f76e3e48282002b3500353970163e572454dc9
|
[
"MIT"
] | null | null | null |
project/admin.py
|
abrusebas1997/Contractor1.2
|
b8f76e3e48282002b3500353970163e572454dc9
|
[
"MIT"
] | 7
|
2019-12-20T04:52:30.000Z
|
2022-02-10T14:08:29.000Z
|
project/admin.py
|
abrusebas1997/Contractor1.2
|
b8f76e3e48282002b3500353970163e572454dc9
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from project.models import Code
admin.site.register(Code)
| 15.5
| 32
| 0.817204
| 14
| 93
| 5.428571
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11828
| 93
| 5
| 33
| 18.6
| 0.926829
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9742325fc6596f6a1c089f4cbeb1c756bd91db93
| 232
|
py
|
Python
|
utils/common.py
|
OptimusPrimus/dcase2019_task1b
|
321e10affd47ccecc9dd4d2d327e466481f457c9
|
[
"MIT"
] | 8
|
2019-06-30T10:05:33.000Z
|
2022-01-09T20:40:05.000Z
|
utils/common.py
|
OptimusPrimus/dcase2019_task1b
|
321e10affd47ccecc9dd4d2d327e466481f457c9
|
[
"MIT"
] | null | null | null |
utils/common.py
|
OptimusPrimus/dcase2019_task1b
|
321e10affd47ccecc9dd4d2d327e466481f457c9
|
[
"MIT"
] | 3
|
2019-11-06T19:06:53.000Z
|
2020-06-09T16:01:50.000Z
|
import importlib
def load_class(cls, *args, **kwargs):
if cls is None:
return None
module_name, class_name = cls.rsplit(".", 1)
return getattr(importlib.import_module(module_name), class_name)(*args, **kwargs)
| 25.777778
| 85
| 0.685345
| 32
| 232
| 4.78125
| 0.53125
| 0.130719
| 0.196078
| 0.248366
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005291
| 0.185345
| 232
| 8
| 86
| 29
| 0.804233
| 0
| 0
| 0
| 0
| 0
| 0.00431
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9742e9d63f5329ee657a039a5fd1bd1e6a2f3b7f
| 27,643
|
py
|
Python
|
tf3d/losses/box_prediction_losses.py
|
muell-monster/google-research
|
04d2024f4723bc4be3d639a668c19fb1f6a31478
|
[
"Apache-2.0"
] | 2
|
2021-01-06T04:28:23.000Z
|
2021-02-24T13:46:04.000Z
|
tf3d/losses/box_prediction_losses.py
|
Alfaxad/google-research
|
2c0043ecd507e75e2df9973a3015daf9253e1467
|
[
"Apache-2.0"
] | 7
|
2021-11-10T19:44:38.000Z
|
2022-02-10T06:48:39.000Z
|
tf3d/losses/box_prediction_losses.py
|
Alfaxad/google-research
|
2c0043ecd507e75e2df9973a3015daf9253e1467
|
[
"Apache-2.0"
] | 4
|
2021-02-08T10:25:45.000Z
|
2021-04-17T14:46:26.000Z
|
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Object detection box prediction losses."""
import gin
import gin.tf
import tensorflow as tf
from tf3d import standard_fields
from tf3d.losses import utils as loss_utils
from tf3d.utils import batch_utils
from tf3d.utils import box_utils
from tf3d.utils import mask_utils
def _box_rotation_regression_loss(loss_type, is_balanced,
input_boxes_rotation_matrix,
input_boxes_instance_id,
output_boxes_rotation_matrix, delta):
"""Computes regression loss on object rotations."""
def fn():
"""Loss function for when number of input and output boxes is positive."""
if is_balanced:
weights = loss_utils.get_balanced_loss_weights_multiclass(
labels=input_boxes_instance_id)
else:
weights = tf.ones([tf.shape(input_boxes_instance_id)[0], 1],
dtype=tf.float32)
gt_rotation_matrix = tf.reshape(input_boxes_rotation_matrix, [-1, 9])
predicted_rotation_matrix = tf.reshape(output_boxes_rotation_matrix,
[-1, 9])
if loss_type == 'huber':
loss_fn = tf.keras.losses.Huber(
delta=delta, reduction=tf.keras.losses.Reduction.NONE)
elif loss_type == 'absolute_difference':
loss_fn = tf.keras.losses.MeanAbsoluteError(
reduction=tf.keras.losses.Reduction.NONE)
else:
raise ValueError(('Unknown loss type %s.' % loss_type))
rotation_losses = loss_fn(
y_true=gt_rotation_matrix, y_pred=predicted_rotation_matrix)
return tf.reduce_mean(rotation_losses * tf.reshape(weights, [-1]))
cond_input = tf.greater(tf.shape(input_boxes_rotation_matrix)[0], 0)
cond_output = tf.greater(tf.shape(output_boxes_rotation_matrix)[0], 0)
cond = tf.logical_and(cond_input, cond_output)
return tf.cond(cond, fn, lambda: tf.constant(0.0, dtype=tf.float32))
def _box_size_regression_loss(loss_type, is_balanced, input_boxes_length,
input_boxes_height, input_boxes_width,
input_boxes_instance_id, output_boxes_length,
output_boxes_height, output_boxes_width, delta):
"""Computes regression loss on object sizes."""
def fn():
"""Loss function for when number of input and output boxes is positive."""
if is_balanced:
weights = loss_utils.get_balanced_loss_weights_multiclass(
labels=input_boxes_instance_id)
else:
weights = tf.ones([tf.shape(input_boxes_instance_id)[0], 1],
dtype=tf.float32)
gt_length = tf.reshape(input_boxes_length, [-1, 1])
gt_height = tf.reshape(input_boxes_height, [-1, 1])
gt_width = tf.reshape(input_boxes_width, [-1, 1])
predicted_length = tf.reshape(output_boxes_length, [-1, 1])
predicted_height = tf.reshape(output_boxes_height, [-1, 1])
predicted_width = tf.reshape(output_boxes_width, [-1, 1])
predicted_length /= gt_length
predicted_height /= gt_height
predicted_width /= gt_width
predicted_size = tf.concat(
[predicted_length, predicted_height, predicted_width], axis=1)
gt_size = tf.ones_like(predicted_size)
if loss_type == 'huber':
loss_fn = tf.keras.losses.Huber(
delta=delta, reduction=tf.keras.losses.Reduction.NONE)
elif loss_type == 'absolute_difference':
loss_fn = tf.keras.losses.MeanAbsoluteError(
reduction=tf.keras.losses.Reduction.NONE)
else:
raise ValueError(('Unknown loss type %s.' % loss_type))
size_losses = loss_fn(y_true=gt_size, y_pred=predicted_size)
return tf.reduce_mean(size_losses * tf.reshape(weights, [-1]))
cond_input = tf.greater(tf.shape(input_boxes_length)[0], 0)
cond_output = tf.greater(tf.shape(output_boxes_length)[0], 0)
cond = tf.logical_and(cond_input, cond_output)
return tf.cond(cond, fn, lambda: tf.constant(0.0, dtype=tf.float32))
def _box_center_distance_loss(loss_type, is_balanced, input_boxes_center,
input_boxes_instance_id, output_boxes_center,
delta):
"""Computes regression loss on object center locations."""
def fn():
"""Loss function for when number of input and output boxes is positive."""
if is_balanced:
weights = loss_utils.get_balanced_loss_weights_multiclass(
labels=input_boxes_instance_id)
else:
weights = tf.ones([tf.shape(input_boxes_instance_id)[0], 1],
dtype=tf.float32)
gt_center = tf.reshape(input_boxes_center, [-1, 3])
predicted_center = tf.reshape(output_boxes_center, [-1, 3])
if loss_type == 'huber':
loss_fn = tf.keras.losses.Huber(
delta=delta, reduction=tf.keras.losses.Reduction.NONE)
elif loss_type == 'absolute_difference':
loss_fn = tf.keras.losses.MeanAbsoluteError(
reduction=tf.keras.losses.Reduction.NONE)
else:
raise ValueError(('Unknown loss type %s.' % loss_type))
center_losses = loss_fn(y_true=gt_center, y_pred=predicted_center)
return tf.reduce_mean(center_losses * tf.reshape(weights, [-1]))
cond_input = tf.greater(tf.shape(input_boxes_center)[0], 0)
cond_output = tf.greater(tf.shape(output_boxes_center)[0], 0)
cond = tf.logical_and(cond_input, cond_output)
return tf.cond(cond, fn, lambda: tf.constant(0.0, dtype=tf.float32))
def _box_corner_distance_loss(
loss_type, is_balanced, input_boxes_length, input_boxes_height,
input_boxes_width, input_boxes_center, input_boxes_rotation_matrix,
input_boxes_instance_id, output_boxes_length, output_boxes_height,
output_boxes_width, output_boxes_center, output_boxes_rotation_matrix,
delta):
"""Computes regression loss on object corner locations."""
def fn():
"""Loss function for when number of input and output boxes is positive."""
if is_balanced:
weights = loss_utils.get_balanced_loss_weights_multiclass(
labels=input_boxes_instance_id)
else:
weights = tf.ones([tf.shape(input_boxes_instance_id)[0], 1],
dtype=tf.float32)
normalized_box_size = 5.0
predicted_boxes_length = output_boxes_length
predicted_boxes_height = output_boxes_height
predicted_boxes_width = output_boxes_width
predicted_boxes_center = output_boxes_center
predicted_boxes_rotation_matrix = output_boxes_rotation_matrix
gt_boxes_length = input_boxes_length
gt_boxes_height = input_boxes_height
gt_boxes_width = input_boxes_width
gt_boxes_center = input_boxes_center
gt_boxes_rotation_matrix = input_boxes_rotation_matrix
if loss_type in ['normalized_huber', 'normalized_euclidean']:
predicted_boxes_length /= (gt_boxes_length / normalized_box_size)
predicted_boxes_height /= (gt_boxes_height / normalized_box_size)
predicted_boxes_width /= (gt_boxes_width / normalized_box_size)
gt_boxes_length = tf.ones_like(
gt_boxes_length, dtype=tf.float32) * normalized_box_size
gt_boxes_height = tf.ones_like(
gt_boxes_height, dtype=tf.float32) * normalized_box_size
gt_boxes_width = tf.ones_like(
gt_boxes_width, dtype=tf.float32) * normalized_box_size
gt_box_corners = box_utils.get_box_corners_3d(
boxes_length=gt_boxes_length,
boxes_height=gt_boxes_height,
boxes_width=gt_boxes_width,
boxes_rotation_matrix=gt_boxes_rotation_matrix,
boxes_center=gt_boxes_center)
predicted_box_corners = box_utils.get_box_corners_3d(
boxes_length=predicted_boxes_length,
boxes_height=predicted_boxes_height,
boxes_width=predicted_boxes_width,
boxes_rotation_matrix=predicted_boxes_rotation_matrix,
boxes_center=predicted_boxes_center)
corner_weights = tf.tile(weights, [1, 8])
if loss_type in ['huber', 'normalized_huber']:
loss_fn = tf.keras.losses.Huber(
delta=delta, reduction=tf.keras.losses.Reduction.NONE)
elif loss_type in ['normalized_absolute_difference', 'absolute_difference']:
loss_fn = tf.keras.losses.MeanAbsoluteError(
reduction=tf.keras.losses.Reduction.NONE)
else:
raise ValueError(('Unknown loss type %s.' % loss_type))
box_corner_losses = loss_fn(
y_true=tf.reshape(gt_box_corners, [-1, 3]),
y_pred=tf.reshape(predicted_box_corners, [-1, 3]))
return tf.reduce_mean(box_corner_losses * tf.reshape(corner_weights, [-1]))
cond_input = tf.greater(tf.shape(input_boxes_length)[0], 0)
cond_output = tf.greater(tf.shape(output_boxes_length)[0], 0)
cond = tf.logical_and(cond_input, cond_output)
return tf.cond(cond, fn, lambda: tf.constant(0.0, dtype=tf.float32))
def _get_voxels_valid_mask(inputs_1):
"""Returns the mask that removes voxels that are outside objects."""
num_voxels_mask = mask_utils.num_voxels_mask(inputs=inputs_1)
within_objects_mask = mask_utils.voxels_within_objects_mask(inputs=inputs_1)
return tf.logical_and(within_objects_mask, num_voxels_mask)
def _get_voxels_valid_inputs_outputs(inputs_1, outputs_1):
"""Applies the valid mask to input and output voxel tensors."""
valid_mask = _get_voxels_valid_mask(inputs_1=inputs_1)
inputs_1 = mask_utils.apply_mask_to_input_voxel_tensors(
inputs=inputs_1, valid_mask=valid_mask)
mask_utils.apply_mask_to_output_voxel_tensors(
outputs=outputs_1, valid_mask=valid_mask)
return inputs_1, outputs_1, valid_mask
def _box_rotation_regression_loss_on_voxel_tensors_unbatched(
inputs_1, outputs_1, loss_type, delta, is_balanced, is_intermediate):
"""Computes regression loss on predicted object rotation for each voxel."""
inputs_1, outputs_1, valid_mask = _get_voxels_valid_inputs_outputs(
inputs_1=inputs_1, outputs_1=outputs_1)
def loss_fn_unbatched():
"""Loss function."""
if is_intermediate:
output_boxes_rotation_matrix = outputs_1[
standard_fields.DetectionResultFields
.intermediate_object_rotation_matrix_voxels]
else:
output_boxes_rotation_matrix = outputs_1[
standard_fields.DetectionResultFields.object_rotation_matrix_voxels]
return _box_rotation_regression_loss(
loss_type=loss_type,
is_balanced=is_balanced,
input_boxes_rotation_matrix=inputs_1[
standard_fields.InputDataFields.object_rotation_matrix_voxels],
input_boxes_instance_id=inputs_1[
standard_fields.InputDataFields.object_instance_id_voxels],
output_boxes_rotation_matrix=output_boxes_rotation_matrix,
delta=delta)
return tf.cond(
tf.reduce_any(valid_mask),
loss_fn_unbatched, lambda: tf.constant(0.0, dtype=tf.float32))
@gin.configurable(
'box_rotation_regression_loss_on_voxel_tensors',
blacklist=['inputs', 'outputs'])
def box_rotation_regression_loss_on_voxel_tensors(inputs,
outputs,
loss_type,
delta=0.5,
is_balanced=False,
is_intermediate=False):
"""Computes regression loss on object size.
Args:
inputs: A dictionary of tf.Tensors with our input data.
outputs: A dictionary of tf.Tensors with the network output.
loss_type: Loss type.
delta: float, the voxel where the huber loss function changes from a
quadratic to linear.
is_balanced: If True, the per-voxel losses are re-weighted to have equal
total weight for each object instance.
is_intermediate: If True, intermediate tensors are used for computing
the loss.
Returns:
localization_loss: A tf.float32 scalar corresponding to localization loss.
"""
standard_fields.check_input_voxel_fields(inputs=inputs)
standard_fields.check_output_voxel_fields(outputs=outputs)
def fn(inputs_1, outputs_1):
return _box_rotation_regression_loss_on_voxel_tensors_unbatched(
inputs_1=inputs_1,
outputs_1=outputs_1,
loss_type=loss_type,
delta=delta,
is_balanced=is_balanced,
is_intermediate=is_intermediate)
return loss_utils.apply_unbatched_loss_on_voxel_tensors(
inputs=inputs, outputs=outputs, unbatched_loss_fn=fn)
def _box_size_regression_loss_on_voxel_tensors_unbatched(
inputs_1, outputs_1, loss_type, delta, is_balanced, is_intermediate):
"""Computes regression loss on predicted object size for each voxel."""
inputs_1, outputs_1, valid_mask = _get_voxels_valid_inputs_outputs(
inputs_1=inputs_1, outputs_1=outputs_1)
def loss_fn_unbatched():
"""Loss function."""
if is_intermediate:
output_boxes_length = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_length_voxels]
output_boxes_height = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_height_voxels]
output_boxes_width = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_width_voxels]
else:
output_boxes_length = outputs_1[
standard_fields.DetectionResultFields.object_length_voxels]
output_boxes_height = outputs_1[
standard_fields.DetectionResultFields.object_height_voxels]
output_boxes_width = outputs_1[
standard_fields.DetectionResultFields.object_width_voxels]
return _box_size_regression_loss(
loss_type=loss_type,
is_balanced=is_balanced,
input_boxes_length=inputs_1[
standard_fields.InputDataFields.object_length_voxels],
input_boxes_height=inputs_1[
standard_fields.InputDataFields.object_height_voxels],
input_boxes_width=inputs_1[
standard_fields.InputDataFields.object_width_voxels],
input_boxes_instance_id=inputs_1[
standard_fields.InputDataFields.object_instance_id_voxels],
output_boxes_length=output_boxes_length,
output_boxes_height=output_boxes_height,
output_boxes_width=output_boxes_width,
delta=delta)
return tf.cond(
tf.reduce_any(valid_mask),
loss_fn_unbatched, lambda: tf.constant(0.0, dtype=tf.float32))
@gin.configurable(
'box_size_regression_loss_on_voxel_tensors',
blacklist=['inputs', 'outputs'])
def box_size_regression_loss_on_voxel_tensors(inputs,
outputs,
loss_type,
delta=0.5,
is_balanced=False,
is_intermediate=False):
"""Computes regression loss on object size.
Args:
inputs: A dictionary of tf.Tensors with our input data.
outputs: A dictionary of tf.Tensors with the network output.
loss_type: Loss type.
delta: float, the voxel where the huber loss function changes from a
quadratic to linear.
is_balanced: If True, the per-voxel losses are re-weighted to have equal
total weight for each object instance.
is_intermediate: If True, intermediate tensors are used for computing
the loss.
Returns:
localization_loss: A tf.float32 scalar corresponding to localization loss.
"""
standard_fields.check_input_voxel_fields(inputs=inputs)
standard_fields.check_output_voxel_fields(outputs=outputs)
def fn(inputs_1, outputs_1):
return _box_size_regression_loss_on_voxel_tensors_unbatched(
inputs_1=inputs_1,
outputs_1=outputs_1,
loss_type=loss_type,
delta=delta,
is_balanced=is_balanced,
is_intermediate=is_intermediate)
return loss_utils.apply_unbatched_loss_on_voxel_tensors(
inputs=inputs, outputs=outputs, unbatched_loss_fn=fn)
def _box_center_distance_loss_on_voxel_tensors_unbatched(
inputs_1, outputs_1, loss_type, delta, is_balanced, is_intermediate):
"""Computes huber loss on predicted object centers for each voxel."""
inputs_1, outputs_1, valid_mask = _get_voxels_valid_inputs_outputs(
inputs_1=inputs_1, outputs_1=outputs_1)
def loss_fn_unbatched():
"""Loss function."""
if is_intermediate:
output_boxes_center = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_center_voxels]
else:
output_boxes_center = outputs_1[
standard_fields.DetectionResultFields.object_center_voxels]
return _box_center_distance_loss(
loss_type=loss_type,
is_balanced=is_balanced,
input_boxes_center=inputs_1[
standard_fields.InputDataFields.object_center_voxels],
input_boxes_instance_id=inputs_1[
standard_fields.InputDataFields.object_instance_id_voxels],
output_boxes_center=output_boxes_center,
delta=delta)
return tf.cond(
tf.reduce_any(valid_mask),
loss_fn_unbatched, lambda: tf.constant(0.0, dtype=tf.float32))
@gin.configurable(
'box_center_distance_loss_on_voxel_tensors',
blacklist=['inputs', 'outputs'])
def box_center_distance_loss_on_voxel_tensors(inputs,
outputs,
loss_type,
delta=1.0,
is_balanced=False,
is_intermediate=False):
"""Computes huber loss on object center locations.
Args:
inputs: A dictionary of tf.Tensors with our input data.
outputs: A dictionary of tf.Tensors with the network output.
loss_type: Loss type.
delta: float, the voxel where the huber loss function changes from a
quadratic to linear.
is_balanced: If True, the per-voxel losses are re-weighted to have equal
total weight for each object instance.
is_intermediate: If True, intermediate tensors are used for computing
the loss.
Returns:
localization_loss: A tf.float32 scalar corresponding to localization loss.
"""
standard_fields.check_input_voxel_fields(inputs=inputs)
standard_fields.check_output_voxel_fields(outputs=outputs)
def fn(inputs_1, outputs_1):
return _box_center_distance_loss_on_voxel_tensors_unbatched(
inputs_1=inputs_1,
outputs_1=outputs_1,
loss_type=loss_type,
delta=delta,
is_balanced=is_balanced,
is_intermediate=is_intermediate)
return loss_utils.apply_unbatched_loss_on_voxel_tensors(
inputs=inputs, outputs=outputs, unbatched_loss_fn=fn)
def _box_corner_distance_loss_on_voxel_tensors_unbatched(
inputs_1, outputs_1, loss_type, delta, is_balanced, is_intermediate):
"""Computes huber loss on predicted objects for each voxel."""
inputs_1, outputs_1, valid_mask = _get_voxels_valid_inputs_outputs(
inputs_1=inputs_1, outputs_1=outputs_1)
def loss_fn_unbatched():
"""Loss function."""
if is_intermediate:
output_boxes_length = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_length_voxels]
output_boxes_height = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_height_voxels]
output_boxes_width = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_width_voxels]
output_boxes_center = outputs_1[standard_fields.DetectionResultFields
.intermediate_object_center_voxels]
output_boxes_rotation_matrix = outputs_1[
standard_fields.DetectionResultFields
.intermediate_object_rotation_matrix_voxels]
else:
output_boxes_length = outputs_1[
standard_fields.DetectionResultFields.object_length_voxels]
output_boxes_height = outputs_1[
standard_fields.DetectionResultFields.object_height_voxels]
output_boxes_width = outputs_1[
standard_fields.DetectionResultFields.object_width_voxels]
output_boxes_center = outputs_1[
standard_fields.DetectionResultFields.object_center_voxels]
output_boxes_rotation_matrix = outputs_1[
standard_fields.DetectionResultFields.object_rotation_matrix_voxels]
return _box_corner_distance_loss(
loss_type=loss_type,
is_balanced=is_balanced,
input_boxes_length=inputs_1[
standard_fields.InputDataFields.object_length_voxels],
input_boxes_height=inputs_1[
standard_fields.InputDataFields.object_height_voxels],
input_boxes_width=inputs_1[
standard_fields.InputDataFields.object_width_voxels],
input_boxes_center=inputs_1[
standard_fields.InputDataFields.object_center_voxels],
input_boxes_rotation_matrix=inputs_1[
standard_fields.InputDataFields.object_rotation_matrix_voxels],
input_boxes_instance_id=inputs_1[
standard_fields.InputDataFields.object_instance_id_voxels],
output_boxes_length=output_boxes_length,
output_boxes_height=output_boxes_height,
output_boxes_width=output_boxes_width,
output_boxes_center=output_boxes_center,
output_boxes_rotation_matrix=output_boxes_rotation_matrix,
delta=delta)
return tf.cond(
tf.reduce_any(valid_mask),
loss_fn_unbatched, lambda: tf.constant(0.0, dtype=tf.float32))
@gin.configurable(
'box_corner_distance_loss_on_voxel_tensors',
blacklist=['inputs', 'outputs'])
def box_corner_distance_loss_on_voxel_tensors(
inputs,
outputs,
loss_type,
delta=1.0,
is_balanced=False,
is_intermediate=False):
"""Computes regression loss on object corner locations using object tensors.
Args:
inputs: A dictionary of tf.Tensors with our input data.
outputs: A dictionary of tf.Tensors with the network output.
loss_type: Loss type.
delta: float, the voxel where the huber loss function changes from a
quadratic to linear.
is_balanced: If True, the per-voxel losses are re-weighted to have equal
total weight for each object instance.
is_intermediate: If True, intermediate tensors are used for computing
the loss.
Returns:
localization_loss: A tf.float32 scalar corresponding to localization loss.
"""
standard_fields.check_input_voxel_fields(inputs=inputs)
standard_fields.check_output_voxel_fields(outputs=outputs)
def fn(inputs_1, outputs_1):
return _box_corner_distance_loss_on_voxel_tensors_unbatched(
inputs_1=inputs_1,
outputs_1=outputs_1,
loss_type=loss_type,
delta=delta,
is_balanced=is_balanced,
is_intermediate=is_intermediate)
return loss_utils.apply_unbatched_loss_on_voxel_tensors(
inputs=inputs, outputs=outputs, unbatched_loss_fn=fn)
def _box_corner_distance_loss_on_object_tensors(
inputs, outputs, loss_type, delta, is_balanced):
"""Computes huber loss on object corner locations."""
valid_mask_class = tf.greater(
tf.reshape(inputs[standard_fields.InputDataFields.objects_class], [-1]),
0)
valid_mask_instance = tf.greater(
tf.reshape(inputs[standard_fields.InputDataFields.objects_instance_id],
[-1]), 0)
valid_mask = tf.logical_and(valid_mask_class, valid_mask_instance)
def fn():
for field in standard_fields.get_input_object_fields():
if field in inputs:
inputs[field] = tf.boolean_mask(inputs[field], valid_mask)
for field in standard_fields.get_output_object_fields():
if field in outputs:
outputs[field] = tf.boolean_mask(outputs[field], valid_mask)
return _box_corner_distance_loss(
loss_type=loss_type,
is_balanced=is_balanced,
input_boxes_length=inputs[
standard_fields.InputDataFields.objects_length],
input_boxes_height=inputs[
standard_fields.InputDataFields.objects_height],
input_boxes_width=inputs[standard_fields.InputDataFields.objects_width],
input_boxes_center=inputs[
standard_fields.InputDataFields.objects_center],
input_boxes_rotation_matrix=inputs[
standard_fields.InputDataFields.objects_rotation_matrix],
input_boxes_instance_id=inputs[
standard_fields.InputDataFields.objects_instance_id],
output_boxes_length=outputs[
standard_fields.DetectionResultFields.objects_length],
output_boxes_height=outputs[
standard_fields.DetectionResultFields.objects_height],
output_boxes_width=outputs[
standard_fields.DetectionResultFields.objects_width],
output_boxes_center=outputs[
standard_fields.DetectionResultFields.objects_center],
output_boxes_rotation_matrix=outputs[
standard_fields.DetectionResultFields.objects_rotation_matrix],
delta=delta)
return tf.cond(
tf.reduce_any(valid_mask), fn, lambda: tf.constant(0.0, dtype=tf.float32))
@gin.configurable(
'box_corner_distance_loss_on_object_tensors',
blacklist=['inputs', 'outputs'])
def box_corner_distance_loss_on_object_tensors(
inputs,
outputs,
loss_type,
delta=1.0,
is_balanced=False):
"""Computes regression loss on object corner locations using object tensors.
Args:
inputs: A dictionary of tf.Tensors with our input data.
outputs: A dictionary of tf.Tensors with the network output.
loss_type: Loss type.
delta: float, the voxel where the huber loss function changes from a
quadratic to linear.
is_balanced: If True, the per-voxel losses are re-weighted to have equal
total weight for each object instance.
Returns:
localization_loss: A tf.float32 scalar corresponding to localization loss.
"""
def fn(inputs_1, outputs_1):
return _box_corner_distance_loss_on_object_tensors(
inputs=inputs_1,
outputs=outputs_1,
loss_type=loss_type,
delta=delta,
is_balanced=is_balanced)
batch_size = len(inputs[standard_fields.InputDataFields.objects_length])
losses = []
for b in range(batch_size):
inputs_1 = batch_utils.get_batch_size_1_input_objects(inputs=inputs, b=b)
outputs_1 = batch_utils.get_batch_size_1_output_objects(
outputs=outputs, b=b)
cond_input = tf.greater(
tf.shape(inputs_1[standard_fields.InputDataFields.objects_length])[0],
0)
cond_output = tf.greater(
tf.shape(
outputs_1[standard_fields.DetectionResultFields.objects_length])[0],
0)
cond = tf.logical_and(cond_input, cond_output)
# pylint: disable=cell-var-from-loop
loss = tf.cond(cond, lambda: fn(inputs_1=inputs_1, outputs_1=outputs_1),
lambda: tf.constant(0.0, dtype=tf.float32))
# pylint: enable=cell-var-from-loop
losses.append(loss)
return tf.reduce_mean(tf.stack(losses))
| 42.658951
| 80
| 0.709908
| 3,524
| 27,643
| 5.200341
| 0.06328
| 0.043818
| 0.029466
| 0.019644
| 0.845356
| 0.764106
| 0.730929
| 0.716905
| 0.699825
| 0.691313
| 0
| 0.012493
| 0.215281
| 27,643
| 647
| 81
| 42.724884
| 0.832335
| 0.163911
| 0
| 0.620763
| 0
| 0
| 0.023511
| 0.010508
| 0
| 0
| 0
| 0
| 0
| 1
| 0.063559
| false
| 0
| 0.016949
| 0.010593
| 0.144068
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
97727c15c04ff095355a50f389bcf007a10a7f30
| 107
|
py
|
Python
|
medium_multiply/__init__.py
|
yahyatamim/pyidw
|
014344518f40b13b622b780af55975da8bb755ae
|
[
"MIT"
] | 2
|
2022-02-28T17:30:57.000Z
|
2022-03-22T17:29:27.000Z
|
medium_multiply/__init__.py
|
yahyatamim/pyidw
|
014344518f40b13b622b780af55975da8bb755ae
|
[
"MIT"
] | 1
|
2021-08-19T15:33:44.000Z
|
2021-08-22T08:18:39.000Z
|
medium_multiply/__init__.py
|
yahyatamim/pyidw
|
014344518f40b13b622b780af55975da8bb755ae
|
[
"MIT"
] | null | null | null |
# This line of code will allow shorter imports
from medium_multiply.multiplication import Multiplication
| 35.666667
| 58
| 0.841121
| 14
| 107
| 6.357143
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.140187
| 107
| 2
| 59
| 53.5
| 0.967391
| 0.411215
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
97746f649bdb42571ee71d940cfa1db94455b1b3
| 5,723
|
py
|
Python
|
testsuite/array-reg/run.py
|
LongerVision/OpenShadingLanguage
|
30d2a4a089c5c9d521b27519329c205763dfe483
|
[
"BSD-3-Clause"
] | 1,105
|
2015-01-02T20:47:19.000Z
|
2021-01-25T13:20:56.000Z
|
testsuite/array-reg/run.py
|
LongerVision/OpenShadingLanguage
|
30d2a4a089c5c9d521b27519329c205763dfe483
|
[
"BSD-3-Clause"
] | 696
|
2015-01-07T23:42:08.000Z
|
2021-01-25T03:55:08.000Z
|
testsuite/array-reg/run.py
|
LongerVision/OpenShadingLanguage
|
30d2a4a089c5c9d521b27519329c205763dfe483
|
[
"BSD-3-Clause"
] | 248
|
2015-01-05T13:41:28.000Z
|
2021-01-24T23:29:55.000Z
|
#!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_float.tif test_varying_index_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_int.tif test_varying_index_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_string.tif test_varying_index_string")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_matrix.tif test_varying_index_matrix")
outputs.append ("out_varying_index_float.tif")
outputs.append ("out_varying_index_int.tif")
outputs.append ("out_varying_index_string.tif")
outputs.append ("out_varying_index_matrix.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_color.tif test_varying_index_color")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_point.tif test_varying_index_point")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_vector.tif test_varying_index_vector")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_normal.tif test_varying_index_normal")
outputs.append ("out_varying_index_color.tif")
outputs.append ("out_varying_index_point.tif")
outputs.append ("out_varying_index_vector.tif")
outputs.append ("out_varying_index_normal.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_out_of_bounds_index_int.tif test_varying_out_of_bounds_index_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_out_of_bounds_index_float.tif test_varying_out_of_bounds_index_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_out_of_bounds_index_string.tif test_varying_out_of_bounds_index_string")
outputs.append ("out_varying_out_of_bounds_index_int.tif")
outputs.append ("out_varying_out_of_bounds_index_float.tif")
outputs.append ("out_varying_out_of_bounds_index_string.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_ray.tif test_varying_index_ray")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_cube.tif test_varying_index_cube")
outputs.append ("out_varying_index_ray.tif")
outputs.append ("out_varying_index_cube.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_float.tif test_varying_index_varying_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_int.tif test_varying_index_varying_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_point.tif test_varying_index_varying_point")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_normal.tif test_varying_index_varying_normal")
outputs.append ("out_varying_index_varying_float.tif")
outputs.append ("out_varying_index_varying_int.tif")
outputs.append ("out_varying_index_varying_point.tif")
outputs.append ("out_varying_index_varying_normal.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_vector.tif test_varying_index_varying_vector")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_color.tif test_varying_index_varying_color")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_string.tif test_varying_index_varying_string")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_matrix.tif test_varying_index_varying_matrix")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_ray.tif test_varying_index_varying_ray")
outputs.append ("out_varying_index_varying_vector.tif")
outputs.append ("out_varying_index_varying_color.tif")
outputs.append ("out_varying_index_varying_string.tif")
outputs.append ("out_varying_index_varying_matrix.tif")
outputs.append ("out_varying_index_varying_ray.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_float.tif test_uniform_index_varying_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_int.tif test_uniform_index_varying_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_point.tif test_uniform_index_varying_point")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_normal.tif test_uniform_index_varying_normal")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_vector.tif test_uniform_index_varying_vector")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_color.tif test_uniform_index_varying_color")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_string.tif test_uniform_index_varying_string")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_matrix.tif test_uniform_index_varying_matrix")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_ray.tif test_uniform_index_varying_ray")
outputs.append ("out_uniform_index_varying_float.tif")
outputs.append ("out_uniform_index_varying_int.tif")
outputs.append ("out_uniform_index_varying_point.tif")
outputs.append ("out_uniform_index_varying_normal.tif")
outputs.append ("out_uniform_index_varying_vector.tif")
outputs.append ("out_uniform_index_varying_color.tif")
outputs.append ("out_uniform_index_varying_string.tif")
outputs.append ("out_uniform_index_varying_matrix.tif")
outputs.append ("out_uniform_index_varying_ray.tif")
# expect a few LSB failures
failthresh = 0.008
failpercent = 3
| 65.034091
| 140
| 0.814433
| 951
| 5,723
| 4.522608
| 0.065195
| 0.159033
| 0.132527
| 0.129737
| 0.944664
| 0.828645
| 0.750756
| 0.525227
| 0.507556
| 0.488026
| 0
| 0.048734
| 0.089289
| 5,723
| 87
| 141
| 65.781609
| 0.776477
| 0.036694
| 0
| 0
| 0
| 0
| 0.736336
| 0.539314
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c1554a35bab60b73f5aa060ae8181704c33ebdbb
| 289
|
py
|
Python
|
automated_survey/admin.py
|
gaganmac/d4surveyHeroku
|
7331a18cb56422d1f20fb9f1c6ffa178897f9b5f
|
[
"MIT"
] | 55
|
2015-10-01T15:39:05.000Z
|
2021-11-15T20:08:01.000Z
|
automated_survey/admin.py
|
gaganmac/d4surveyHeroku
|
7331a18cb56422d1f20fb9f1c6ffa178897f9b5f
|
[
"MIT"
] | 151
|
2015-08-26T18:21:49.000Z
|
2022-03-23T22:07:42.000Z
|
automated_survey/admin.py
|
gaganmac/d4surveyHeroku
|
7331a18cb56422d1f20fb9f1c6ffa178897f9b5f
|
[
"MIT"
] | 34
|
2015-10-26T05:42:23.000Z
|
2021-04-20T08:00:45.000Z
|
from django.contrib import admin
from .models import Question, QuestionResponse, Survey
# Register for models for use in admin interface
admin.site.register(Question, admin.ModelAdmin)
admin.site.register(QuestionResponse, admin.ModelAdmin)
admin.site.register(Survey, admin.ModelAdmin)
| 32.111111
| 55
| 0.82699
| 37
| 289
| 6.459459
| 0.432432
| 0.112971
| 0.213389
| 0.200837
| 0.267782
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093426
| 289
| 8
| 56
| 36.125
| 0.912214
| 0.15917
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
c17cb0a339ab514cc3f39408d3eba9ae3c247b47
| 168
|
py
|
Python
|
puft/constants/hints.py
|
ryzhovalex/omen
|
c3a36741b40ff28a61c1e62f3e549d39f9847feb
|
[
"MIT"
] | null | null | null |
puft/constants/hints.py
|
ryzhovalex/omen
|
c3a36741b40ff28a61c1e62f3e549d39f9847feb
|
[
"MIT"
] | null | null | null |
puft/constants/hints.py
|
ryzhovalex/omen
|
c3a36741b40ff28a61c1e62f3e549d39f9847feb
|
[
"MIT"
] | null | null | null |
from .enums import (
CLIDatabaseEnum, CLIRunEnum, CLIHelperEnum, HTTPMethodEnum, TurboActionEnum
)
CLIModeEnumUnion = CLIDatabaseEnum | CLIRunEnum | CLIHelperEnum
| 28
| 79
| 0.809524
| 12
| 168
| 11.333333
| 0.75
| 0.367647
| 0.558824
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130952
| 168
| 5
| 80
| 33.6
| 0.931507
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0
| 1
| 0
| 1
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a9b4d86041eed870edb12f00cf0408b19c04986b
| 7,514
|
py
|
Python
|
tests/test_q.py
|
gityoav/pyg-mongo
|
f414b8923562e273f95c51e4cfb47e2c27cd3948
|
[
"MIT"
] | null | null | null |
tests/test_q.py
|
gityoav/pyg-mongo
|
f414b8923562e273f95c51e4cfb47e2c27cd3948
|
[
"MIT"
] | null | null | null |
tests/test_q.py
|
gityoav/pyg-mongo
|
f414b8923562e273f95c51e4cfb47e2c27cd3948
|
[
"MIT"
] | null | null | null |
from pyg_mongo import Q, q, mongo_table
import re
import pytest
regex = re.compile
def D(value):
if isinstance(value, dict):
return {x : D(y) for x, y in value.items()} ### this converts mdict to normal dict
elif isinstance(value, list):
return [D(y) for y in value]
else:
return value
def test_q():
assert D(q.a == 1) == {'a': {'$eq': 1}}
assert D(q.a != 1) == {'a': {'$ne': 1}}
assert D(q.a != [1,2,3]) == {"a": {"$nin": [1, 2, 3]}}
assert D(q.a <= 1) == {'a': {'$lte': 1}}
assert D(q.a >= 1) == {'a': {'$gte': 1}}
assert D(q.a < 1) == {'a': {'$lt': 1}}
assert D(q.a > 1) == {'a': {'$gt': 1}}
assert D((q.a == 1) + (q.b == 2)) == {'$and': [{'a': {'$eq': 1}}, {'b': {'$eq': 2}}]}
assert D(-(q.b == 2)) == {"$not": {"b": {"$eq": 2}}}
assert D(q.a % 2 == 1) == {'a': {'$mod': [2, 1]}}
assert D(-(q.a % 2 == 1)) == {'$not': {'a': {'$mod': [2, 1]}}}
assert D((q.a ==1) + (q.b == 1)) == {'$and': [{'a': {'$eq': 1}}, {'b': {'$eq': 1}}]}
assert D((q.a ==1) & (q.b == 1)) == {'$and': [{'a': {'$eq': 1}}, {'b': {'$eq': 1}}]}
assert D((q.a ==1) - (q.b == 1)) == {'$and': [{'$not': {'b': {'$eq': 1}}}, {'a': {'$eq': 1}}]}
assert D((q.a % 2 == 1)|(q.b == 1)) == {'$or': [{'a': {'$mod': [2, 1]}}, {'b': {'$eq': 1}}]}
assert D((q.a % 2 == 1) & (q.b == 1)) == {'$and': [{'a': {'$mod': [2, 1]}}, {'b': {'$eq': 1}}]}
assert D((q.a % 2 == 1) + (q.b == 1)) == {'$and': [{'a': {'$mod': [2, 1]}}, {'b': {'$eq': 1}}]}
assert D((q.a % 2 == 1) - (q.b == 1)) == {'$and': [{'$not': {'b': {'$eq': 1}}}, {'a': {'$mod': [2, 1]}}]}
assert D(q.a.isinstance(float)) == {"a": {"$type": [1, 19]}}
assert D(-(q.a % 2 == 1)) == {'$not': {'a': {'$mod': [2, 1]}}}
assert D(+(q.a % 2 == 1)) == {'a': {'$mod': [2, 1]}}
assert D(q.a % 2 + q.b == 1) == {'$and': [{'a': {'$not': {'$mod': [2, 0]}}}, {'b': {'$eq': 1}}]}
assert D(q.a % 2 + (q.b == 1)) == {'$and': [{'a': {'$not': {'$mod': [2, 0]}}}, {'b': {'$eq': 1}}]}
assert D(q.a % 2 & (q.b == 1)) == {'$and': [{'a': {'$not': {'$mod': [2, 0]}}}, {'b': {'$eq': 1}}]}
assert D(q.a % 2 - (q.b == 1)) == {'$and': [{'$not': {'b': {'$eq': 1}}}, {'a': {'$not': {'$mod': [2, 0]}}}]}
assert D(~(q.a % 2)) == {'a': {'$mod': [2, 0]}}
assert D(+(q.a % 2)) == {'a': {'$not': {'$mod': [2, 0]}}}
assert str(q.a % 3) == 'mod(a, 3)'
assert D((q.a == 1) | (q.b == 2)) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$eq': 2}}]}
assert D((q.a % 3 == 1) | (q.b == 2)) == {"$or": [{"a": {"$mod": [3, 1]}}, {"b": {"$eq": 2}}]}
assert D(q['some text'] == 1) == {'some text': {'$eq': 1}}
assert D(q.a == re.compile('^test')) == {'a': {'$regex': '^test'}}
assert D(q.a == re.compile('^test', re.IGNORECASE)) == {"a": {"$regex": "^test", "$options": "i"}}
assert D(q.a != re.compile('^test')) == {'a': {'$not': {'$regex': '^test'}}}
assert D(q.a != [1]) == {'a': {'$ne': [1]}}
assert D(q.a == [1]) == {'a': {'$eq': 1}}
assert D(q.a == [[1]]) == {'a': {'$eq': [1]}}
assert D(q.a['b'] == 1) == {'a.b': {'$eq': 1}}
assert D(q.a.b == 1) == {'a.b': {'$eq': 1}}
assert D(+q.a) == {'a': {'$exists': True}}
assert D(q.a.exists) == {'a': {'$exists': True}}
assert D(-q.a) == {'a': {'$exists': False}}
assert D(q.a.not_exists) == {'a': {'$exists': False}}
assert D(q.a == True) == {'a': {'$in': [True, 1]}}
assert D(q.a == False) == {'a': {'$in': [False, 0]}}
assert D(q.a == dict(b=1, c=2)) == {'$and': [{'a.b': {'$eq': 1}}, {'a.c': {'$eq': 2}}]}
assert D(q.a.exists & q.b == 2) == {'$and': [{'a': {'$exists': True}}, {'b': {'$eq': 2}}]}
assert D(q.a.exists | q.b == 2) == {'$or': [{'a': {'$exists': True}}, {'b': {'$eq': 2}}]}
assert D(q.a & q.b == 1) == {'$and': [{'a': {'$exists': True}}, {'b': {'$eq': 1}}]}
assert D(q.a + q.b == 1) == {'$and': [{'a': {'$exists': True}}, {'b': {'$eq': 1}}]}
assert D(q.a | (q.b == 1)) == {'$or': [{'a': {'$exists': True}}, {'b': {'$eq': 1}}]}
assert D(q.a - q.b) == {'$and': [{'a': {'$exists': True}}, {'b': {'$exists': False}}]}
assert D(q.a + q.b) == {'$and': [{'a': {'$exists': True}}, {'b': {'$exists': True}}]}
assert D(q.a - (q.b == 1)) == {'$and': [{'$not': {'b': {'$eq': 1}}}, {'a': {'$exists': True}}]}
assert D(q.a[5:10]) == {'$and': [{'a': {'$gte': 5}}, {'a': {'$lt': 10}}]}
assert D(q.a[5:]) == {'a': {'$gte': 5}}
assert D(q.a[:10]) == {'a': {'$lt': 10}}
assert D(q.a[::] == 1) == {'a': {'$eq': 1}}
assert D(q.a[2]) == {'a': {'$eq': 2}}
assert D(+q.a.b) == {'a.b': {'$exists': True}}
assert D((q.a == 1) | q.b > 1) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$gt': 1}}]}
assert D((q.a == 1) | q.b >= 1) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$gte': 1}}]}
assert D((q.a == 1) | q.b != 1) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$ne': 1}}]}
assert D((q.a == 1) | q.b == 1) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$eq': 1}}]}
assert D((q.a == 1) | q.b <= 1) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$lte': 1}}]}
assert D((q.a == 1) | q.b < 1) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$lt': 1}}]}
def test_q_fails():
with pytest.raises(ValueError):
(q.a == 1) > 2
with pytest.raises(ValueError):
(q.a == 1) >= 2
with pytest.raises(ValueError):
(q.a == 1) < 2
with pytest.raises(ValueError):
(q.a == 1) <= 2
assert D((q.a > 1) & q.b == 2) == {"$and": [{"a": {"$gt": 1}}, {"b": {"$eq": 2}}]}
assert D((q.a > 1) | q.b == 2) == {"$or": [{"a": {"$gt": 1}}, {"b": {"$eq": 2}}]}
def test_Q_with_proxies():
assert D(Q({'hello world': 1}).hello_world == 1) == {"hello world": {"$eq": 1}}
assert D(Q(['hello world']).hello_world == 1) == {"hello world": {"$eq": 1}}
def test_Q_with_keys():
x = Q(['Adam Aaron', 'Beth Brown', 'James Joyce'])
assert D((x.adam_aaron == 1) & (x.JAMES_JOYCE == 2)) == {'$and': [{'Adam Aaron': {'$eq': 1}}, {'James Joyce': {'$eq': 2}}]}
assert sorted(dir(x)) == sorted(['ADAM_AARON',
'Adam Aaron',
'Adam_Aaron',
'BETH_BROWN',
'Beth Brown',
'Beth_Brown',
'JAMES_JOYCE',
'James Joyce',
'James_Joyce',
'adam_aaron',
'beth_brown',
'james_joyce'])
x = Q(['@@Adam%+Aaron', '++Beth---Brown++', '---James%%% Joyce%'])
assert D((x.adam_aaron == 1) & (x.JAMES_JOYCE == 2)) == {'$and': [{'---James%%% Joyce%': {'$eq': 2}}, {'@@Adam%+Aaron': {'$eq': 1}}]}
def test_q_callable():
assert D(q(a = 1, b = 2)) == {'$and': [{'a': {'$eq': 1}}, {'b': {'$eq': 2}}]}
assert D(q(a = 1, b = 2)) == {'$and': [{'a': {'$eq': 1}}, {'b': {'$eq': 2}}]}
assert D(q([q.a == 1, q.b == 2])) == {'$or': [{'a': {'$eq': 1}}, {'b': {'$eq': 2}}]}
def test_q_regex():
t = mongo_table('test', 'test')
t.drop()
t.insert_one(dict(item = 'Test1', value = 1))
t.insert_one(dict(item = 'test2', value = 2))
t.insert_one(dict(item = 'TEST2', value = 3))
assert len(t.inc(item = re.compile('^test'))) == 1
assert len(t.inc(item = re.compile('^test', re.IGNORECASE))) == 3
t.drop()
| 49.761589
| 139
| 0.360527
| 1,136
| 7,514
| 2.353873
| 0.079225
| 0.193717
| 0.215408
| 0.225505
| 0.765146
| 0.717651
| 0.673897
| 0.543381
| 0.500374
| 0.47083
| 0
| 0.042972
| 0.269098
| 7,514
| 150
| 140
| 50.093333
| 0.443918
| 0.004525
| 0
| 0.081967
| 0
| 0
| 0.151037
| 0
| 0
| 0
| 0
| 0
| 0.639344
| 1
| 0.057377
| false
| 0
| 0.02459
| 0
| 0.106557
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e702da51c55eafae57b2b359c2184ae1c870e5ff
| 68
|
py
|
Python
|
python/sandbox/__init__.py
|
geometer/sandbox
|
373ec96e69df76744a19b51f7caa865cbc6b58cd
|
[
"Apache-2.0"
] | 6
|
2020-04-19T11:26:18.000Z
|
2021-06-21T18:42:51.000Z
|
python/sandbox/__init__.py
|
geometer/sandbox
|
373ec96e69df76744a19b51f7caa865cbc6b58cd
|
[
"Apache-2.0"
] | 31
|
2020-04-21T17:24:39.000Z
|
2020-08-27T15:59:12.000Z
|
python/sandbox/__init__.py
|
geometer/sandbox
|
373ec96e69df76744a19b51f7caa865cbc6b58cd
|
[
"Apache-2.0"
] | null | null | null |
from .scene import Scene
from .placement import iterative_placement
| 22.666667
| 42
| 0.852941
| 9
| 68
| 6.333333
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 68
| 2
| 43
| 34
| 0.95
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e71de36e7fe0ebd966ccc163ef6dfc7f79bb4fb2
| 1,276
|
py
|
Python
|
system/functions/date.py
|
u-n-i-c-o-rn/jimi
|
bbd647fa9cd4326305a33a99122d8d8a2614967d
|
[
"Apache-2.0"
] | 1
|
2021-03-14T21:27:51.000Z
|
2021-03-14T21:27:51.000Z
|
system/functions/date.py
|
u-n-i-c-o-rn/jimi
|
bbd647fa9cd4326305a33a99122d8d8a2614967d
|
[
"Apache-2.0"
] | 5
|
2021-04-29T11:16:18.000Z
|
2021-05-02T16:40:01.000Z
|
system/functions/date.py
|
u-n-i-c-o-rn/jimi
|
bbd647fa9cd4326305a33a99122d8d8a2614967d
|
[
"Apache-2.0"
] | null | null | null |
import time
import datetime
def now(milliseconds=False):
if milliseconds:
return time.time() * 1000
return time.time()
def day():
return datetime.datetime.now().strftime('%A')
def year():
return int(datetime.datetime.now().strftime('%Y'))
def month():
return int(datetime.datetime.now().strftime('%m'))
def dt(format="%d-%m-%Y"):
return datetime.datetime.now().strftime(format)
def dateBetween(startDateStr, endDateStr, dateStr=None):
if dateStr == None:
dateStr = datetime.datetime.now().strftime('%H:%M %d-%m-%Y')
startDate = datetime.datetime.strptime(startDateStr, '%H:%M %d-%m-%Y')
endDate = datetime.datetime.strptime(endDateStr, '%H:%M %d-%m-%Y')
date = datetime.datetime.strptime(dateStr, '%H:%M %d-%m-%Y')
return startDate < date < endDate
def timeBetween(startTimeStr, endTimeStr, timeStr=None):
if timeStr == None:
timeStr = datetime.datetime.now().strftime('%H:%M')
startTime = datetime.datetime.strptime(startTimeStr, '%H:%M')
endTime = datetime.datetime.strptime(endTimeStr, '%H:%M')
time = datetime.datetime.strptime(timeStr, '%H:%M')
if startTime > endTime:
return time >= startTime or time <= endTime
else:
return startTime <= time <= endTime
| 31.9
| 74
| 0.657524
| 159
| 1,276
| 5.27673
| 0.245283
| 0.228844
| 0.135876
| 0.193087
| 0.255066
| 0.154946
| 0
| 0
| 0
| 0
| 0
| 0.003791
| 0.173197
| 1,276
| 39
| 75
| 32.717949
| 0.791469
| 0
| 0
| 0
| 0
| 0
| 0.070588
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.225806
| false
| 0
| 0.064516
| 0.129032
| 0.580645
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
99bc3505ff55486cbfded79b4475d68071dee9b9
| 181
|
py
|
Python
|
tests/test_conversions.py
|
lehvitus/eln
|
b78362af20cacffe076bf3dbfd27dcc090e43e39
|
[
"BSD-3-Clause"
] | 2
|
2020-02-05T04:00:32.000Z
|
2020-03-18T02:12:33.000Z
|
tests/test_conversions.py
|
oleoneto/eln
|
b78362af20cacffe076bf3dbfd27dcc090e43e39
|
[
"BSD-3-Clause"
] | 1
|
2020-03-18T02:36:04.000Z
|
2020-03-18T02:36:04.000Z
|
tests/test_conversions.py
|
oleoneto/eln
|
b78362af20cacffe076bf3dbfd27dcc090e43e39
|
[
"BSD-3-Clause"
] | null | null | null |
from click.testing import CliRunner
# from eln.commands.conversions.main import convert
# def test_conversions():
# runner = CliRunner()
# result = runner.invoke(convert)
| 22.625
| 51
| 0.734807
| 21
| 181
| 6.285714
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.165746
| 181
| 7
| 52
| 25.857143
| 0.874172
| 0.740331
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
99c56f50835a677720b53b77e5038bf11849511f
| 86
|
py
|
Python
|
noodles/draw_workflow/__init__.py
|
BvB93/noodles
|
7547471baa18a11b8020c017388a7e208d194ef4
|
[
"Apache-2.0"
] | 22
|
2016-07-26T20:42:08.000Z
|
2022-02-08T16:04:25.000Z
|
noodles/draw_workflow/__init__.py
|
BvB93/noodles
|
7547471baa18a11b8020c017388a7e208d194ef4
|
[
"Apache-2.0"
] | 71
|
2015-12-24T18:44:32.000Z
|
2022-02-11T11:31:08.000Z
|
noodles/draw_workflow/__init__.py
|
BvB93/noodles
|
7547471baa18a11b8020c017388a7e208d194ef4
|
[
"Apache-2.0"
] | 8
|
2016-12-22T10:14:28.000Z
|
2020-06-05T21:01:51.000Z
|
from .draw_workflow import draw_workflow, graph
__all__ = ['draw_workflow', 'graph']
| 21.5
| 47
| 0.767442
| 11
| 86
| 5.363636
| 0.545455
| 0.610169
| 0.576271
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116279
| 86
| 3
| 48
| 28.666667
| 0.776316
| 0
| 0
| 0
| 0
| 0
| 0.209302
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
82218be1186fae9dba583c3db3d51aa6acba58d1
| 38
|
py
|
Python
|
src/dl_plus/__main__.py
|
un-def/dl-plus
|
1f5198043bd0885e666c2880a8486e8075e4a0c2
|
[
"MIT"
] | 30
|
2020-10-24T16:35:48.000Z
|
2021-11-11T11:04:12.000Z
|
src/dl_plus/__main__.py
|
un-def/dl-plus
|
1f5198043bd0885e666c2880a8486e8075e4a0c2
|
[
"MIT"
] | null | null | null |
src/dl_plus/__main__.py
|
un-def/dl-plus
|
1f5198043bd0885e666c2880a8486e8075e4a0c2
|
[
"MIT"
] | 3
|
2020-11-30T07:11:44.000Z
|
2021-01-26T08:05:13.000Z
|
from dl_plus.cli import main
main()
| 7.6
| 28
| 0.736842
| 7
| 38
| 3.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184211
| 38
| 4
| 29
| 9.5
| 0.870968
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
8232e2ba7c239fb84fa8ac9f936ac3905c320bde
| 151
|
py
|
Python
|
adv_cache_tag/tests/__init__.py
|
pgcd/django-adv-cache-tag
|
59671cc94160ba311833affc0619590275e49829
|
[
"MIT"
] | 29
|
2015-01-27T13:04:26.000Z
|
2022-03-30T18:11:20.000Z
|
adv_cache_tag/tests/__init__.py
|
pgcd/django-adv-cache-tag
|
59671cc94160ba311833affc0619590275e49829
|
[
"MIT"
] | 8
|
2015-09-10T10:29:52.000Z
|
2022-03-30T17:33:05.000Z
|
adv_cache_tag/tests/__init__.py
|
pgcd/django-adv-cache-tag
|
59671cc94160ba311833affc0619590275e49829
|
[
"MIT"
] | 6
|
2015-03-10T19:46:19.000Z
|
2021-02-12T07:02:24.000Z
|
from django import VERSION
if VERSION < (1, 6):
# Before django 1.6, Django was not able to find tests in tests/tests.py
from .tests import *
| 25.166667
| 76
| 0.688742
| 26
| 151
| 4
| 0.615385
| 0.038462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0.231788
| 151
| 5
| 77
| 30.2
| 0.862069
| 0.463576
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
823f981dae40e6a5d3229238d634439ab34bee76
| 72
|
py
|
Python
|
brief/__init__.py
|
madre/PersonalWeb
|
27d88a3c6c4f86028887b0455b60eceeeb663e25
|
[
"Apache-2.0"
] | null | null | null |
brief/__init__.py
|
madre/PersonalWeb
|
27d88a3c6c4f86028887b0455b60eceeeb663e25
|
[
"Apache-2.0"
] | null | null | null |
brief/__init__.py
|
madre/PersonalWeb
|
27d88a3c6c4f86028887b0455b60eceeeb663e25
|
[
"Apache-2.0"
] | null | null | null |
#coding=utf-8
"""
__create_time__ = '13-10-29'
__author__ = 'Madre'
"""
| 12
| 28
| 0.638889
| 10
| 72
| 3.7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 0.125
| 72
| 5
| 29
| 14.4
| 0.47619
| 0.861111
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
823f9b13c3264d0462236aea283c12aa66c45463
| 74
|
py
|
Python
|
dtreeviz/__init__.py
|
alitrack/dtreeviz
|
f5d3bcc25ebe87f00cdcb2defb203947283cd08d
|
[
"MIT"
] | 1,905
|
2018-09-29T20:41:19.000Z
|
2022-03-28T07:45:07.000Z
|
dtreeviz/__init__.py
|
alitrack/dtreeviz
|
f5d3bcc25ebe87f00cdcb2defb203947283cd08d
|
[
"MIT"
] | 163
|
2018-09-29T15:57:07.000Z
|
2022-03-30T16:43:05.000Z
|
dtreeviz/__init__.py
|
alitrack/dtreeviz
|
f5d3bcc25ebe87f00cdcb2defb203947283cd08d
|
[
"MIT"
] | 257
|
2018-09-30T21:49:45.000Z
|
2022-03-23T11:41:56.000Z
|
from .version import __version__
from dtreeviz.classifiers import clfviz
| 18.5
| 39
| 0.851351
| 9
| 74
| 6.555556
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121622
| 74
| 3
| 40
| 24.666667
| 0.907692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
41355a13039174c7bfbe3a8ccc6eb4f22b921f59
| 5,872
|
py
|
Python
|
benchmarks/call_benchmark.py
|
usalko/nogil
|
7a480f849f1f12a159a10bb0aa0f3431f24ce5f6
|
[
"0BSD"
] | 1
|
2021-11-19T02:20:24.000Z
|
2021-11-19T02:20:24.000Z
|
benchmarks/call_benchmark.py
|
usalko/nogil
|
7a480f849f1f12a159a10bb0aa0f3431f24ce5f6
|
[
"0BSD"
] | null | null | null |
benchmarks/call_benchmark.py
|
usalko/nogil
|
7a480f849f1f12a159a10bb0aa0f3431f24ce5f6
|
[
"0BSD"
] | null | null | null |
import time
# N = 1000
N = 1000000
UNROLL = 10
loop_delta = 2.0 * N * UNROLL / 1e9
def call0():
pass
def call2(a, b):
pass
def call4(a, b, c, d):
pass
def call4_dflt(a, b, c=3, d=4):
pass
def call_vararg(*args, **kwargs):
pass
def benchmark_loop():
# global loop_delta
start = time.perf_counter()
for _ in range(N):
pass
loop_delta2 = (time.perf_counter() - start - loop_delta) * 1e9
print(f'loop overhead (unaccounted for) {loop_delta2 / (N * UNROLL):.1f} ns')
def benchmark_call0():
start = time.perf_counter()
f = call0
for _ in range(N):
f()
f()
f()
f()
f()
f()
f()
f()
f()
f()
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call0 {delta / (N * UNROLL):.1f} ns')
def benchmark_call2():
start = time.perf_counter()
a, b = 0, 1
f = call2
for _ in range(N):
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call2 {delta / (N * UNROLL):.1f} ns')
def benchmark_call4():
start = time.perf_counter()
f = call4
a, b, c, d = 0, 1, 2, 3
for _ in range(N):
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
f(a, b, c, d)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call4 {delta / (N * UNROLL):.1f} ns')
def benchmark_call4_dflt():
start = time.perf_counter()
f = call4_dflt
a, b = 0, 1
for _ in range(N):
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
f(a, b)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call4_dflt {delta / (N * UNROLL):.1f} ns')
def benchmark_call4_kwd():
start = time.perf_counter()
f = call4
a, b, c, d = 0, 1, 2, 3
for _ in range(N):
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call4_kwd {delta / (N * UNROLL):.1f} ns')
def benchmark_call4_kwd_mismatch():
start = time.perf_counter()
f = call4
a, b, c, d = 0, 1, 2, 3
for _ in range(N):
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
f(a, b, d=d, c=c)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call4_kwd_mismatch {delta / (N * UNROLL):.1f} ns')
def benchmark_call4_vararg_stararg():
start = time.perf_counter()
f = call4
args = (1, 2)
kwargs = {"c": 3, "d": 4}
for _ in range(N):
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call4_vararg_stararg {delta / (N * UNROLL):.1f} ns')
def benchmark_call_vararg_stararg():
start = time.perf_counter()
f = call_vararg
args = ()
kwargs = {}
for _ in range(N):
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call_vararg_stararg {delta / (N * UNROLL):.1f} ns')
def benchmark_call_vararg4_stararg():
start = time.perf_counter()
f = call_vararg
args = (1, 2)
kwargs = {"c": 3, "d": 4}
for _ in range(N):
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
f(*args, **kwargs)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call_vararg4_stararg {delta / (N * UNROLL):.1f} ns')
def benchmark_call_vararg4_kwd():
start = time.perf_counter()
f = call_vararg
a, b, c, d = 0, 1, 2, 3
for _ in range(N):
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
f(a, b, c=c, d=d)
delta = (time.perf_counter() - start - loop_delta) * 1e9
print(f'call_vararg4_kwd {delta / (N * UNROLL):.1f} ns')
def benchmark():
benchmark_loop()
for _ in range(3):
benchmark_call0()
for _ in range(3):
benchmark_call2()
for _ in range(3):
benchmark_call4()
for _ in range(3):
benchmark_call4_dflt()
for _ in range(3):
benchmark_call4_kwd()
for _ in range(3):
benchmark_call4_kwd_mismatch()
for _ in range(3):
benchmark_call4_vararg_stararg()
for _ in range(3):
benchmark_call_vararg_stararg()
for _ in range(3):
benchmark_call_vararg4_stararg()
for _ in range(3):
benchmark_call_vararg4_kwd()
benchmark()
| 24.881356
| 81
| 0.484673
| 955
| 5,872
| 2.852356
| 0.050262
| 0.050661
| 0.066079
| 0.044053
| 0.858297
| 0.828561
| 0.780103
| 0.723201
| 0.631791
| 0.55837
| 0
| 0.033488
| 0.338896
| 5,872
| 236
| 82
| 24.881356
| 0.668212
| 0.004428
| 0
| 0.767442
| 0
| 0
| 0.085216
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.07907
| false
| 0.027907
| 0.004651
| 0
| 0.083721
| 0.051163
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
41a5b6b38108b4168c957b2862040c55b1835d9d
| 360
|
py
|
Python
|
plugins/avro-java/register.py
|
arron-green/pants-avro
|
fda2605cace481e79a8a5027219776af6d896d33
|
[
"Apache-2.0"
] | null | null | null |
plugins/avro-java/register.py
|
arron-green/pants-avro
|
fda2605cace481e79a8a5027219776af6d896d33
|
[
"Apache-2.0"
] | null | null | null |
plugins/avro-java/register.py
|
arron-green/pants-avro
|
fda2605cace481e79a8a5027219776af6d896d33
|
[
"Apache-2.0"
] | null | null | null |
from pants.build_graph.build_file_aliases import BuildFileAliases
from .targets import AvroJava
from .gen import AvroJavaGen
from pants.goal.task_registrar import TaskRegistrar as task
def build_file_aliases():
return BuildFileAliases(targets={'avro_java': AvroJava})
def register_goals():
task(name='avro-java', action=AvroJavaGen).install('gen')
| 27.692308
| 65
| 0.8
| 47
| 360
| 5.957447
| 0.553191
| 0.064286
| 0.114286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108333
| 360
| 12
| 66
| 30
| 0.872274
| 0
| 0
| 0
| 0
| 0
| 0.058333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.5
| 0.125
| 0.875
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
41b065470fffdf9eae5d6c19c821f5e6d4ce2c57
| 3,733
|
py
|
Python
|
lingvo/jax/layers/__init__.py
|
drpngx/lingvo
|
adb50163814fd5dd2f07ac186adaedfe57ba4b2a
|
[
"Apache-2.0"
] | null | null | null |
lingvo/jax/layers/__init__.py
|
drpngx/lingvo
|
adb50163814fd5dd2f07ac186adaedfe57ba4b2a
|
[
"Apache-2.0"
] | null | null | null |
lingvo/jax/layers/__init__.py
|
drpngx/lingvo
|
adb50163814fd5dd2f07ac186adaedfe57ba4b2a
|
[
"Apache-2.0"
] | null | null | null |
# Lint as: python3
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Exposes the public layer functionalities."""
from lingvo.jax.layers.activations import Activation
from lingvo.jax.layers.attentions import AttentionProjection
from lingvo.jax.layers.attentions import causal_mask
from lingvo.jax.layers.attentions import causal_segment_mask
from lingvo.jax.layers.attentions import convert_paddings_to_mask
from lingvo.jax.layers.attentions import DotProductAttention
from lingvo.jax.layers.attentions import PerDimScale
from lingvo.jax.layers.attentions import segment_mask
from lingvo.jax.layers.augmentations import MaskedLmDataAugmenter
from lingvo.jax.layers.conformers import Conformer
from lingvo.jax.layers.convolutions import Conv2D
from lingvo.jax.layers.convolutions import ConvBNAct
from lingvo.jax.layers.convolutions import DepthwiseConv1D
from lingvo.jax.layers.convolutions import LightConv1D
from lingvo.jax.layers.embedding_softmax import PositionalEmbedding
from lingvo.jax.layers.embedding_softmax import SingleShardEmbedding
from lingvo.jax.layers.embedding_softmax import SingleShardFullSoftmax
from lingvo.jax.layers.embedding_softmax import SingleShardSharedEmbeddingSoftmax
from lingvo.jax.layers.flax_wrapper import FlaxModule
from lingvo.jax.layers.linears import Bias
from lingvo.jax.layers.linears import FeedForward
from lingvo.jax.layers.linears import Linear
from lingvo.jax.layers.linears import project_last_dim
from lingvo.jax.layers.ngrammer import get_bigram_ids
from lingvo.jax.layers.ngrammer import Ngrammer
from lingvo.jax.layers.ngrammer import VectorQuantization
from lingvo.jax.layers.ngrammer import VQNgrammer
from lingvo.jax.layers.normalizations import BatchNorm
from lingvo.jax.layers.normalizations import compute_moments
from lingvo.jax.layers.normalizations import LayerNorm
from lingvo.jax.layers.pipeline import LayerwiseShardablePipelined
from lingvo.jax.layers.poolings import GlobalPooling
from lingvo.jax.layers.poolings import Pooling
from lingvo.jax.layers.recurrent import AutodiffCheckpointType
from lingvo.jax.layers.recurrent import recurrent_func
from lingvo.jax.layers.recurrent import recurrent_static
from lingvo.jax.layers.recurrent import scan
from lingvo.jax.layers.repeats import Repeat
from lingvo.jax.layers.resnets import ResNet
from lingvo.jax.layers.resnets import ResNetBlock
from lingvo.jax.layers.stochastics import Dropout
from lingvo.jax.layers.stochastics import StochasticResidual
from lingvo.jax.layers.transformers import compute_attention_masks_for_extend_step
from lingvo.jax.layers.transformers import compute_attention_masks_for_fprop
from lingvo.jax.layers.transformers import StackedTransformer
from lingvo.jax.layers.transformers import StackedTransformerRepeated
from lingvo.jax.layers.transformers import Transformer
from lingvo.jax.layers.transformers import TransformerEncoderDecoder
from lingvo.jax.layers.transformers import TransformerFeedForward
from lingvo.jax.layers.transformers import TransformerFeedForwardMoe
from lingvo.jax.layers.transformers import TransformerLm
| 43.917647
| 82
| 0.835253
| 487
| 3,733
| 6.344969
| 0.318275
| 0.165049
| 0.214563
| 0.313592
| 0.560518
| 0.560518
| 0.173463
| 0.039482
| 0.039482
| 0.039482
| 0
| 0.003531
| 0.08974
| 3,733
| 84
| 83
| 44.440476
| 0.905827
| 0.192874
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
41c45ed05c4758d4e2d6a787be613269792fe8b5
| 354
|
py
|
Python
|
spikey/snn/readout/__init__.py
|
SpikeyCNS/spikey
|
03a49073491974eff01bc017fd8eadb822e13f0d
|
[
"MIT"
] | 4
|
2021-02-25T20:53:41.000Z
|
2022-01-18T15:27:07.000Z
|
spikey/snn/readout/__init__.py
|
SpikeyCNS/spikey
|
03a49073491974eff01bc017fd8eadb822e13f0d
|
[
"MIT"
] | 5
|
2021-03-06T05:35:10.000Z
|
2021-03-31T09:27:57.000Z
|
spikey/snn/readout/__init__.py
|
SpikeyCNS/spikey
|
03a49073491974eff01bc017fd8eadb822e13f0d
|
[
"MIT"
] | null | null | null |
"""
Readout __init__.
"""
try:
from spikey.snn.readout.threshold import Threshold
from spikey.snn.readout.neuron_rates import NeuronRates
from spikey.snn.readout.population_vector import PopulationVector
from spikey.snn.readout.topaction import TopAction
except ImportError as e:
raise ImportError(f"readout/__init__.py failed: {e}")
| 32.181818
| 69
| 0.776836
| 45
| 354
| 5.888889
| 0.511111
| 0.150943
| 0.196226
| 0.301887
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.138418
| 354
| 10
| 70
| 35.4
| 0.868852
| 0.048023
| 0
| 0
| 0
| 0
| 0.094225
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.857143
| 0
| 0.857143
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
41ce532a4040ebb98f597bfd44d50c48154e9a75
| 171
|
py
|
Python
|
avx512-cnnopt/TileLoopGenerator/solver/main.py
|
Mastli/ASPLOS_artifact
|
1a592f7cfb0592f0a786e156a249087b56a4e647
|
[
"BSD-4-Clause"
] | 7
|
2021-05-21T02:01:50.000Z
|
2021-11-22T05:51:22.000Z
|
avx512-cnnopt/TileLoopGenerator/solver/main.py
|
Mastli/ASPLOS_artifact
|
1a592f7cfb0592f0a786e156a249087b56a4e647
|
[
"BSD-4-Clause"
] | null | null | null |
avx512-cnnopt/TileLoopGenerator/solver/main.py
|
Mastli/ASPLOS_artifact
|
1a592f7cfb0592f0a786e156a249087b56a4e647
|
[
"BSD-4-Clause"
] | 3
|
2021-03-27T13:11:21.000Z
|
2021-11-01T15:40:35.000Z
|
from SymbolPool import *
from Tensor import *
from LoopStacker import *
from Test import *
def main():
test_modgen()
if __name__ == "__main__":
main()
| 13.153846
| 26
| 0.649123
| 20
| 171
| 5.1
| 0.55
| 0.294118
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25731
| 171
| 13
| 27
| 13.153846
| 0.80315
| 0
| 0
| 0
| 0
| 0
| 0.046512
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| true
| 0
| 0.5
| 0
| 0.625
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
68c3f71371da194345e2c06a2e4bb2bc19f623aa
| 126
|
py
|
Python
|
skyportal/facility_apis/__init__.py
|
steveschulze/skyportal
|
47e334d71e34e82ff41bd0e32326e4107741e8e6
|
[
"BSD-3-Clause"
] | null | null | null |
skyportal/facility_apis/__init__.py
|
steveschulze/skyportal
|
47e334d71e34e82ff41bd0e32326e4107741e8e6
|
[
"BSD-3-Clause"
] | null | null | null |
skyportal/facility_apis/__init__.py
|
steveschulze/skyportal
|
47e334d71e34e82ff41bd0e32326e4107741e8e6
|
[
"BSD-3-Clause"
] | null | null | null |
from .interface import FollowUpAPI, Listener
from .sedm import SEDMAPI, SEDMListener
from .lt import IOOAPI, IOIAPI, SPRATAPI
| 31.5
| 44
| 0.81746
| 16
| 126
| 6.4375
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126984
| 126
| 3
| 45
| 42
| 0.936364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
68d00b8abf63bb6256ef3652a434e5b648392eca
| 132
|
py
|
Python
|
hello-world/hello_world/__init__.py
|
pyodide/pyodide-examples
|
248f0a1de14ffccf3b1ff541b5965eedc2483051
|
[
"MIT"
] | 1
|
2021-12-27T13:50:25.000Z
|
2021-12-27T13:50:25.000Z
|
hello-world/hello_world/__init__.py
|
pyodide/pyodide-examples
|
248f0a1de14ffccf3b1ff541b5965eedc2483051
|
[
"MIT"
] | null | null | null |
hello-world/hello_world/__init__.py
|
pyodide/pyodide-examples
|
248f0a1de14ffccf3b1ff541b5965eedc2483051
|
[
"MIT"
] | 1
|
2022-02-17T11:10:15.000Z
|
2022-02-17T11:10:15.000Z
|
print("Initializing hello world module")
from .some_funcs import say_hello, repeat_string
__all__ = ["say_hello", "repeat_string"]
| 26.4
| 48
| 0.787879
| 18
| 132
| 5.277778
| 0.722222
| 0.168421
| 0.294737
| 0.421053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106061
| 132
| 4
| 49
| 33
| 0.805085
| 0
| 0
| 0
| 0
| 0
| 0.401515
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
68f82cc3a0add1f60132b1b00586e3e5f7e1c07e
| 149
|
py
|
Python
|
lab2/CmdView.py
|
YevhenKhomenko/crossplatform_labs
|
15bc2268ec699c380c1c78a0bdca7c1bf1b85aa6
|
[
"MIT"
] | null | null | null |
lab2/CmdView.py
|
YevhenKhomenko/crossplatform_labs
|
15bc2268ec699c380c1c78a0bdca7c1bf1b85aa6
|
[
"MIT"
] | null | null | null |
lab2/CmdView.py
|
YevhenKhomenko/crossplatform_labs
|
15bc2268ec699c380c1c78a0bdca7c1bf1b85aa6
|
[
"MIT"
] | null | null | null |
class View:
@staticmethod
def show_message(message):
print(message)
@staticmethod
def get_input():
return input()
| 13.545455
| 30
| 0.604027
| 15
| 149
| 5.866667
| 0.666667
| 0.340909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.308725
| 149
| 10
| 31
| 14.9
| 0.854369
| 0
| 0
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0.142857
| 0.571429
| 0.142857
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ec041b84d5ff3b3b634262773ef8feaafa547730
| 173
|
py
|
Python
|
msp/datasets/__init__.py
|
bilalsp/msp
|
a336e9dfc3aa19352c21de5d3ce90d2b5c6f38c6
|
[
"MIT"
] | 2
|
2021-12-26T02:40:19.000Z
|
2022-01-14T05:44:48.000Z
|
msp/datasets/__init__.py
|
bilalsp/msp
|
a336e9dfc3aa19352c21de5d3ce90d2b5c6f38c6
|
[
"MIT"
] | null | null | null |
msp/datasets/__init__.py
|
bilalsp/msp
|
a336e9dfc3aa19352c21de5d3ce90d2b5c6f38c6
|
[
"MIT"
] | null | null | null |
"""
The :mod:`mps.datasets` module includes utility to generate sample data.
"""
from msp.datasets._samples_generator import make_sparse_data
__all__ = ['make_sparse_data']
| 28.833333
| 72
| 0.786127
| 24
| 173
| 5.25
| 0.791667
| 0.15873
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104046
| 173
| 6
| 73
| 28.833333
| 0.812903
| 0.416185
| 0
| 0
| 1
| 0
| 0.170213
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ec26ce25392b66bace5b04d3ab23d087cf1ac662
| 6,640
|
py
|
Python
|
nntoolbox/sequence/models/encoder.py
|
nhatsmrt/nn-toolbox
|
689b9924d3c88a433f8f350b89c13a878ac7d7c3
|
[
"Apache-2.0"
] | 16
|
2019-07-11T15:57:41.000Z
|
2020-09-08T13:52:45.000Z
|
nntoolbox/sequence/models/encoder.py
|
nhatsmrt/nn-toolbox
|
689b9924d3c88a433f8f350b89c13a878ac7d7c3
|
[
"Apache-2.0"
] | 1
|
2022-01-18T22:21:57.000Z
|
2022-01-18T22:21:57.000Z
|
nntoolbox/sequence/models/encoder.py
|
nhatsmrt/nn-toolbox
|
689b9924d3c88a433f8f350b89c13a878ac7d7c3
|
[
"Apache-2.0"
] | 1
|
2019-08-07T10:07:09.000Z
|
2019-08-07T10:07:09.000Z
|
import torch
from torch import nn, Tensor
from typing import Tuple
from ..components import ResidualRNN
__all__ = ['Encoder', 'RNNEncoder', 'GRUEncoder']
class Encoder(nn.Module):
def __init__(self, input_size, hidden_size, embedding_dim, num_layers, bidirectional, device, pad_token=0, drop_rate=0.1):
super(Encoder, self).__init__()
self._hidden_size = hidden_size
self._input_size = input_size
self._embedding_dim = embedding_dim
self._num_layers = num_layers
self._bidirectional = bidirectional
self._device = device
self._embedding = nn.Embedding(input_size, self._embedding_dim, padding_idx=pad_token)
self._dropout = nn.Dropout(drop_rate)
def forward(self, input: Tensor, states: Tuple[Tensor, ...]) -> Tuple[Tensor, Tuple[Tensor, ...]]:
"""
:param input: (seq_len, batch_size, input_dim)
:param states: internal states of the RNN, each having dimension
(num_layers * num_directions, batch_size, hidden_size)
:return:
output: (seq_len, batch, num_directions * hidden_size)
states: states at final time step, each having dimension
(num_layers * num_directions, batch_size, hidden_size)
"""
raise NotImplementedError
def init_hidden(self, batch_size: int) -> Tuple[Tensor, ...]:
"""
Initialize the first zero hidden state
:param batch_size:
:return: Initial internal states, each of dim (num_layers * num_directions, batch_size, hidden_size)
"""
raise NotImplementedError
class RNNEncoder(Encoder):
def __init__(
self, rnn, input_size, hidden_size, embedding_dim,
num_layers, bidirectional, device, pad_token=0, drop_rate=0.1
):
super(RNNEncoder, self).__init__(
input_size, hidden_size, embedding_dim, num_layers, bidirectional, device, pad_token, drop_rate
)
self.rnn = rnn
def forward(self, input: Tensor, states: Tuple[Tensor, ...]) -> Tuple[Tensor, Tuple[Tensor, ...]]:
embedded = self._dropout(self._embedding(input))
output, hidden = self.rnn(embedded, states)
return output, hidden
class GRUEncoder(RNNEncoder):
def __init__(
self, input_size, hidden_size, embedding_dim, device, bias=False,
num_layers=1, dropout=0, bidirectional=False, pad_token=0, drop_rate=0.1
):
super(GRUEncoder, self).__init__(
nn.GRU(
embedding_dim, hidden_size,
bias=bias, num_layers=num_layers,
dropout=dropout,
bidirectional=bidirectional
),
input_size, hidden_size, embedding_dim, num_layers, bidirectional, device, pad_token, drop_rate
)
def init_hidden(self, batch_size: int) -> Tuple[Tensor, ...]:
"""
Initialize the first zero hidden state
:param batch_size:
:return: Initial hidden state, of dimensision (num_layers * num_directions, batch_size, hidden_size)
"""
first_dim = self._num_layers
if self._bidirectional:
first_dim *= 2
return (torch.zeros(first_dim, batch_size, self._hidden_size, device=self._device),)
class LSTMEncoder(RNNEncoder):
def __init__(
self, input_size, hidden_size, embedding_dim, device, bias=False,
num_layers=1, dropout=0, bidirectional=False, pad_token=0, drop_rate=0.1
):
super(LSTMEncoder, self).__init__(
nn.LSTM(
embedding_dim, hidden_size,
bias=bias, num_layers=num_layers,
dropout=dropout,
bidirectional=bidirectional
),
input_size, hidden_size, embedding_dim, num_layers, bidirectional, device, pad_token, drop_rate
)
def init_hidden(self, batch_size: int) -> Tuple[Tensor, ...]:
"""
Initialize the first zero hidden state
:param batch_size:
:return: Initial hidden state and cell state, each of dim (num_layers * num_directions, batch_size, hidden_size)
"""
first_dim = self._num_layers
if self._bidirectional:
first_dim *= 2
return (
torch.zeros(first_dim, batch_size, self._hidden_size, device=self._device),
torch.zeros(first_dim, batch_size, self._hidden_size, device=self._device)
)
class ResidualRNNEncoder(RNNEncoder):
def __init__(
self, base_rnn, input_size, hidden_size, embedding_dim, device, bias=False,
num_layers=1, dropout=0, bidirectional=False, pad_token=0, drop_rate=0.1
):
super(ResidualRNNEncoder, self).__init__(
ResidualRNN(
base_rnn=base_rnn, input_size=embedding_dim,
bias=bias, num_layers=num_layers,
dropout=dropout,
bidirectional=bidirectional
),
input_size, hidden_size, embedding_dim, num_layers, bidirectional, device, pad_token, drop_rate
)
# class ResidualGRUEncoder(RNNEncoder, GRUEncoder):
# def __init__(
# self, input_size, hidden_size, embedding_dim, device, bias=False,
# num_layers=1, dropout=0, bidirectional=False, pad_token=0, drop_rate=0.1
# ):
# super(ResidualGRUEncoder, self).__init__(
# nn.GRU, input_size, hidden_size, embedding_dim, num_layers, bidirectional,
# device, bias, num_layers, dropout, bidirectional, pad_token, drop_rate
# )
#
# class GRUEncoder(Encoder):
# def __init__(
# self, input_size, hidden_size, embedding_dim, device, bias=False,
# num_layers=1, dropout=0, bidirectional=False, pad_token=0, drop_rate=0.1):
# super(GRUEncoder, self).__init__(
# input_size, hidden_size, embedding_dim,
# num_layers, bidirectional, device, pad_token, drop_rate)
# self._gru = nn.GRU(
# embedding_dim, hidden_size,
# bias=bias, num_layers=num_layers,
# dropout=dropout,
# bidirectional=bidirectional
# )
# # self._gru = ResidualRNN(
# # nn.GRU, input_size=hidden_size,
# # bias=bias, num_layers=num_layers,
# # dropout=dropout,
# # )
# self.to(device)
#
# def forward(self, input: Tensor, hidden: Tensor) -> Tuple[Tensor, Tensor]:
# embedded = self._dropout(self._embedding(input))
# output, hidden = self._gru(embedded, hidden)
# return output, hidden
#
| 38.16092
| 126
| 0.626054
| 752
| 6,640
| 5.194149
| 0.107713
| 0.076037
| 0.071685
| 0.0681
| 0.751408
| 0.72555
| 0.720686
| 0.71915
| 0.71915
| 0.716334
| 0
| 0.006864
| 0.275904
| 6,640
| 173
| 127
| 38.381503
| 0.805532
| 0.345934
| 0
| 0.5
| 0
| 0
| 0.006561
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.113636
| false
| 0
| 0.045455
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ec318f2a5d510ddb8d5b7037fff0c57d1ec7fd4a
| 25
|
py
|
Python
|
GalleryMan/assets/__init__.py
|
0xsapphir3/GalleryMan
|
b04f4ccdbb9004ed9e915d1cd0ddf36ccffe386c
|
[
"MIT"
] | 9
|
2021-08-21T01:05:13.000Z
|
2022-01-26T15:06:32.000Z
|
GalleryMan/assets/__init__.py
|
AsianCat54x/galleryman
|
b04f4ccdbb9004ed9e915d1cd0ddf36ccffe386c
|
[
"MIT"
] | 1
|
2021-08-19T09:42:06.000Z
|
2021-08-19T09:42:06.000Z
|
GalleryMan/assets/__init__.py
|
AsianCat54x/galleryman
|
b04f4ccdbb9004ed9e915d1cd0ddf36ccffe386c
|
[
"MIT"
] | 2
|
2021-08-19T08:13:00.000Z
|
2021-08-24T18:27:10.000Z
|
# Nothing To See Here ._.
| 25
| 25
| 0.68
| 4
| 25
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 25
| 1
| 25
| 25
| 0.8
| 0.92
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ec3bb2c057a7335bc7b7c259d5b3bdf7afe090da
| 36
|
py
|
Python
|
python/user/bot/__init__.py
|
star123good/DAML-Chat-Projectdabl
|
977cf3ae6ac4d283e903e22430962bb03f8a863f
|
[
"Apache-2.0"
] | 1
|
2021-01-07T02:20:58.000Z
|
2021-01-07T02:20:58.000Z
|
python/user/bot/__init__.py
|
star123good/DAML-Chat-Projectdabl
|
977cf3ae6ac4d283e903e22430962bb03f8a863f
|
[
"Apache-2.0"
] | 11
|
2020-03-30T17:54:23.000Z
|
2022-02-26T22:54:04.000Z
|
python/user/bot/__init__.py
|
star123good/DAML-Chat-Projectdabl
|
977cf3ae6ac4d283e903e22430962bb03f8a863f
|
[
"Apache-2.0"
] | 3
|
2020-04-30T19:56:09.000Z
|
2021-04-14T10:15:40.000Z
|
from .user_bot import main
main()
| 7.2
| 26
| 0.722222
| 6
| 36
| 4.166667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.194444
| 36
| 4
| 27
| 9
| 0.862069
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ec43fe0d488358049728fe978556c36abaf5d9bd
| 170
|
py
|
Python
|
vkbottle/api/token_generator/__init__.py
|
homus32/vkbottle
|
8247665ef74835abe0c2c5e5981826540d0ecdb5
|
[
"MIT"
] | 698
|
2019-08-09T17:32:52.000Z
|
2021-07-22T08:30:32.000Z
|
vkbottle/api/token_generator/__init__.py
|
homus32/vkbottle
|
8247665ef74835abe0c2c5e5981826540d0ecdb5
|
[
"MIT"
] | 216
|
2019-08-18T19:22:50.000Z
|
2021-07-30T12:15:17.000Z
|
vkbottle/api/token_generator/__init__.py
|
homus32/vkbottle
|
8247665ef74835abe0c2c5e5981826540d0ecdb5
|
[
"MIT"
] | 268
|
2019-08-10T14:52:04.000Z
|
2021-07-28T07:06:42.000Z
|
from .abc import ABCTokenGenerator, Token
from .consistent import ConsistentTokenGenerator
from .single import SingleTokenGenerator
from .util import get_token_generator
| 34
| 48
| 0.870588
| 19
| 170
| 7.684211
| 0.631579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 170
| 4
| 49
| 42.5
| 0.954248
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
6b899987252b758a6dd30249000acacfb5d5426c
| 32,485
|
py
|
Python
|
flask_app/main.py
|
SamuelHoward/open-source-platform
|
eda201117a66e101c11727242e8bff470cea0385
|
[
"MIT"
] | null | null | null |
flask_app/main.py
|
SamuelHoward/open-source-platform
|
eda201117a66e101c11727242e8bff470cea0385
|
[
"MIT"
] | null | null | null |
flask_app/main.py
|
SamuelHoward/open-source-platform
|
eda201117a66e101c11727242e8bff470cea0385
|
[
"MIT"
] | null | null | null |
# Import necessary modules
from flask import render_template, request, redirect, url_for, flash, Blueprint
from flask_app import app, db
from flask_app.decorators import check_confirmed
from flask_app.models import *
from flask_login import login_required, current_user
from sqlalchemy import or_, and_, func
import random
import requests
# This file includes all main routes (no login related routes)
main = Blueprint('main', __name__)
# Define global variables
orgs_search_results_data = Organizations.query.filter(
Organizations.name.contains(""))
projects_search_results_data = Projects.query.filter(
Projects.description.contains(""))
proj_search_term = None
org_search_term = None
projectsPerPage = 10
orgsPerPage = 10
# Route for home page
@app.route('/')
@app.route('/index')
def index():
# Calculate amount of projects
projsLength = Projects.query.count()
# Calculate amount of organizations
orgsLength = Organizations.query.count()
# Return the static homepage
return render_template(
'index.html', title='Open Source Platform', numProjs=projsLength, numOrgs=orgsLength)
# Route for projects page, includes searching and favoriting projects
@app.route('/projects', methods=['GET', 'POST'])
def projects():
# Pull in the necessary global variables
global projects_search_results_data
global proj_search_term
global projectsPerPage
# Get the page number from request arguments
page = request.args.get('page', 1, type=int)
# Logic for processing project searches
if request.method == 'POST' and 'search_term' in request.form:
# Pull in search term from search form
proj_search_term=request.form['search_term']
# Basic search logic: Look in project parameters for search term
projects_search_results_data = Projects.query.filter(
or_(Projects.description.contains(proj_search_term),
Projects.name.contains(proj_search_term),
Projects.language.contains(proj_search_term),
Projects.owner.contains(proj_search_term),
Projects.source.contains(proj_search_term)))
# Pull in the item per page count, if necessary
if 'per_page' in request.form:
projectsPerPage = int(request.form['per_page'])
# Logic for sorting items by name
if 'sort_by' in request.form and request.form['sort_by'] == 'name':
# Logic for reverse alphabetic search
if 'reverse' in request.form:
projects_search_results_data = projects_search_results_data \
.order_by(Projects.name.desc())
# Logic for standard alphabetic search
else:
projects_search_results_data = projects_search_results_data \
.order_by(Projects.name)
# Logic for sorting items by creation date
elif 'sort_by' in request.form and request.form['sort_by'] == 'created':
# Logic for standard recent search
if 'reverse' in request.form:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(func.date(
Projects.created_time))
# Logic for reverse recent search
else:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(func.date(
Projects \
.created_time).desc())
# Logic for sorting items by number of forks
elif 'sort_by' in request.form and request.form['sort_by'] == 'forks':
# Logic for sorting items by fork count, least first
if 'reverse' in request.form:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(Projects.forks)
# Logic for sorting items by fork count, greatest first
else:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(Projects.forks.desc())
# Logic for sorting items by number of watchers
elif 'sort_by' in request.form \
and request.form['sort_by'] == 'watchers':
# Logic for sorting items by watcher count, least first
if 'reverse' in request.form:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(Projects.watchers)
# Logic for sorting items by watcher count, greatest first
else:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(
Projects.watchers.desc())
# Logic for sorting items by number of issues
elif 'sort_by' in request.form \
and request.form['sort_by'] == 'issues':
# Logic for sorting items by issues count, least first
if 'reverse' in request.form:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(
Projects.open_issues)
# Logic for sorting items by issues count, greatest first
else:
projects_search_results_data = projects_search_results_data \
.filter(Projects.source == 'github') \
.order_by(
Projects \
.open_issues.desc())
# Reset the page after search
page = 1
# Refresh the page after searching
try:
# Render the page for logged-in users
return render_template(
'projects_search.html',
search_results=projects_search_results_data.paginate(
page=page,
per_page=projectsPerPage),
search_term=proj_search_term,
title='OSP | Projects',
favorites=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='project')) \
.with_entities(
Favorites.fav_name))
# If the previous rendering fails, default to anonymous rendering
except:
# Render the page for anonymous users
return render_template(
'projects_search.html',
search_results=projects_search_results_data.paginate(
page=page,
per_page=projectsPerPage),
search_term=proj_search_term,
title='OSP | Projects',
favorites=[])
# Logic for favoriting a project
elif request.method == 'POST' and 'fav_name' in request.form:
# Look for whether this project is already favorited
favorite = Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['fav_name'],
Favorites.fav_type=='project')).first()
# If the favorite does not already exist, continue adding the favorite
if favorite is None:
# Form the Favorites object
new_fav = Favorites(
id=random.randint(-2147483648, 2147483647),
user_id=current_user.id,
fav_name=request.form['fav_name'],
fav_type='project')
# Add and commit the Favorites object
db.session.add(new_fav)
db.session.commit()
# Flash add message
flash('Added ' + request.form['fav_name'] + ' to favorites')
# Refresh the page after favoriting
return redirect(request.path)
# Logic for unfavoriting a project
elif request.method == 'POST' and 'unfav_name' in request.form:
# Look for the Favorite going to be deleted
fav = db.session.query(Favorites).filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['unfav_name'],
Favorites.fav_type=='project')).first()
# Remove the Favorites record and commit
db.session.delete(fav)
db.session.commit()
# Flash delete message
flash('Removed ' + request.form['unfav_name'] + ' from favorites')
# Refresh the page after unfavoriting
return redirect(request.path)
# Render the page for logged-in users and anonymous users
else:
try:
# Render the page for logged-in users
return render_template(
'projects_search.html',
search_results=projects_search_results_data.paginate(
page=page,
per_page=projectsPerPage),
search_term=proj_search_term,
title='OSP | Projects',
favorites=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='project')) \
.with_entities(
Favorites.fav_name))
# If the previous rendering fails, default to anonymous rendering
except:
# Render the page for anonymous users
return render_template(
'projects_search.html',
search_results=projects_search_results_data.paginate(
page=page,
per_page=projectsPerPage),
search_term=proj_search_term,
title='OSP | Projects',
favorites=[])
# Route for the organizations page
@app.route('/organizations', methods=['GET', 'POST'])
def organizations():
# Bring in te necessary global variables
global orgs_search_results_data
global org_search_term
global orgsPerPage
# Bring in the page number from the arguments
page = request.args.get('page', 1, type=int)
# Logic for searching orgs
if request.method == 'POST' and 'search_term' in request.form:
# Bring in the search term from the form
org_search_term=request.form['search_term']
# Perform search by looking for search term in org names
orgs_search_results_data = Organizations.query.filter(
Organizations.name.contains(org_search_term))
# Pull in the item count per page if necessary
if 'per_page' in request.form:
orgsPerPage = int(request.form['per_page'])
# Logic for search by name
if 'name' in request.form:
# Logic for reverse alphabetic search
if 'reverse' in request.form:
orgs_search_results_data = orgs_search_results_data.order_by(
Organizations.name.desc())
# Logic for standard alphabetic search
else:
orgs_search_results_data = orgs_search_results_data.order_by(
Organizations.name)
# Reset the page after search
page = 1
# Calculate search results and org names
search_results=orgs_search_results_data.paginate(
page=page,
per_page=orgsPerPage)
orgNames = [item.name for item in search_results.items]
# Find the projects whose owners are in the search results
projects=Projects.query.filter(Projects.owner.in_(orgNames))
# Refresh the page after search
try:
# Render page for logged-in users
return render_template(
'organizations.html',
search_results=search_results,
search_term=org_search_term,
projects=projects,
title='OSP | Organizations',
favorites=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='org')) \
.with_entities(Favorites.fav_name))
# If the above rendering fails, render the anonymous page
except:
#Render page for anonymous users
return render_template(
'organizations.html',
search_results=search_results,
search_term=org_search_term,
projects=projects,
title='OSP | Organizations',
favorites=[])
# Logic for favoriting an org
if request.method == 'POST' and 'fav_name' in request.form:
# Check if the favorites object already exists
favorite=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['fav_name'],
Favorites.fav_type=='org')).first()
# If the favorite does not already exist, form the Favorites record
if favorite is None:
# Form the favorites record
new_fav = Favorites(
id=random.randint(-2147483648, 2147483647),
user_id=current_user.id,
fav_name=request.form['fav_name'],
fav_type='org')
# Add the favorite and commit it
db.session.add(new_fav)
db.session.commit()
# Flash add message
flash('Added ' + request.form['fav_name'] + ' to favorites')
# Refresh the page after searching
return redirect(request.path)
# Logic for unfavoriting an org
elif request.method == 'POST' and 'unfav_name' in request.form:
# Look for the existing favorites record
fav = db.session.query(Favorites).filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['unfav_name'],
Favorites.fav_type=='org')).first()
# delete the favorite and commit
db.session.delete(fav)
db.session.commit()
# Flash delete message
flash('Removed ' + request.form['unfav_name'] + ' from favorites')
# Refresh the page after unfavoriting
return redirect(request.path)
# Render the page for logged-in users and anonymous users
else:
# Calculate search results and org names
search_results=orgs_search_results_data.paginate(
page=page,
per_page=orgsPerPage)
orgNames = [item.name for item in search_results.items]
# Find the projects whose owners are in the search results
projects=Projects.query.filter(Projects.owner.in_(orgNames))
try:
# Render page for logged-in users
return render_template(
'organizations.html',
search_results=search_results,
search_term=org_search_term,
projects=projects,
title='OSP | Organizations',
favorites=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='org')) \
.with_entities(Favorites.fav_name))
# If the above rendering fails, render the anonymous page
except:
#Render page for anonymous users
return render_template(
'organizations.html',
search_results=search_results,
search_term=org_search_term,
projects=projects,
title='OSP | Organizations',
favorites=[])
# Route for individual project pages
@app.route('/project/<projectName>', methods=['GET', 'POST'])
def project(projectName):
# Logic for favoriting the project
if request.method == 'POST' and 'fav_name' in request.form:
# Look for whether the favorite record already exists
favorite=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['fav_name'],
Favorites.fav_type=='project')).first()
# If the Favorite record does not yet exist, create it
if favorite is None:
# Create the Favorites record
new_fav = Favorites(
id=random.randint(-2147483648, 2147483647),
user_id=current_user.id,
fav_name=request.form['fav_name'],
fav_type='project')
# Flash add message
flash('Added ' + request.form['fav_name'] + ' to favorites')
# Add and commit the Favorites record
db.session.add(new_fav)
db.session.commit()
# Refresh the page after favoriting
return redirect(request.path)
# Logic for unfavoriting the project
elif request.method == 'POST' and 'unfav_name' in request.form:
# Look for the existing Favorites record
fav = db.session.query(Favorites).filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['unfav_name'],
Favorites.fav_type=='project')).first()
# Delete the Favorite and commit
db.session.delete(fav)
db.session.commit()
# Flash delete message
flash('Removed ' + request.form['unfav_name'] + ' from favorites')
# Refresh the page after unfavoriting
return redirect(request.path)
# Try to render the page for this project
try:
# Retrieve the data for the project page
proj = Projects.query.filter(Projects.name==projectName).one()
orgName = Organizations.query.filter(
Organizations.name==proj.owner).one()
projs = Projects.query.filter(Projects.owner==orgName.name)
count = projs.count()
# Render the page for logged-in users
try:
return render_template(
'project.html',
project=proj,
projects=projs,
count=count,
title='OSP | ' + projectName,
favorites=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='project')) \
.with_entities(Favorites.fav_name),
favCount=Favorites.query.filter(
Favorites.fav_name==projectName).count())
# Render the page for anonymous users
except:
return render_template(
'project.html',
project=proj,
projects=projs,
count=count,
title='OSP | ' + projectName,
favorites=[],
favCount=Favorites.query.filter(
Favorites.fav_name==projectName).count())
# If the project does not exist, render the 404 page
except:
return render_template('404.html', title='OSP | 404'), 404
# Route for individual organization pages
@app.route('/org/<orgName>', methods=['GET', 'POST'])
def organization(orgName):
# Logic for favoriting an org
if request.method == 'POST' and 'fav_name' in request.form:
# Look for whether the org exists
favorite=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['fav_name'],
Favorites.fav_type=='org')).first()
# If the favorite does not exist, create it
if favorite is None:
# Create the Favorites record
new_fav = Favorites(
id=random.randint(-2147483648, 2147483647),
user_id=current_user.id,
fav_name=request.form['fav_name'],
fav_type='org')
# Add the favorite and commit it
db.session.add(new_fav)
db.session.commit()
# Flash add message
flash('Added ' + request.form['fav_name'] + ' to favorites')
# Refresh the page after favoriting
return redirect(request.path)
# Logic for unfavoriting the org
elif request.method == 'POST' and 'unfav_name' in request.form:
# Look for the existing Favorites record
fav = db.session.query(Favorites).filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['unfav_name'],
Favorites.fav_type=='org')).first()
# Delete the favorites record and commit
db.session.delete(fav)
db.session.commit()
# Flash delete message
flash('Removed ' + request.form['unfav_name'] + ' from favorites')
# Refresh the page after unfavoriting
return redirect(request.path)
# Logic for favoriting project on org page
elif request.method == 'POST' and 'proj_fav_name' in request.form:
# Look for whether the proj exists
favorite=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['proj_fav_name'],
Favorites.fav_type=='project')).first()
# If the favorite does not exist, create it
if favorite is None:
# Create the Favorites record
new_fav = Favorites(
id=random.randint(-2147483648, 2147483647),
user_id=current_user.id,
fav_name=request.form['proj_fav_name'],
fav_type='project')
# Add the favorite and commit it
db.session.add(new_fav)
db.session.commit()
# Flash add message
flash('Added ' + request.form['proj_fav_name'] + ' to favorites')
# Refresh the page after favoriting
return redirect(request.path)
# Logic for unfavoriting proj on org page
elif request.method == 'POST' and 'proj_unfav_name' in request.form:
# Look for the existing Favorites record
fav = db.session.query(Favorites).filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['proj_unfav_name'],
Favorites.fav_type=='project')).first()
# Delete the favorites record and commit
db.session.delete(fav)
db.session.commit()
# Flash delete message
flash('Removed ' + request.form['proj_unfav_name'] + ' from favorites')
# Refresh the page after unfavoriting
return redirect(request.path)
# Try to render the page for the org
try:
# Retrieve the necessary data
org = Organizations.query.filter(Organizations.name==orgName).one()
projs = Projects.query.filter(Projects.owner==orgName)
# Render the page for logged-in users
try:
return render_template(
'organization.html',
organization=org,
projects=projs,
title='OSP | ' + orgName,
favorites=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='org')) \
.with_entities(Favorites.fav_name),
proj_favs=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='project')) \
.with_entities(Favorites.fav_name),
favCount=Favorites.query.filter(
Favorites.fav_name==orgName).count())
# Render the page for anonymous users
except:
return render_template(
'organization.html',
organization=org,
projects=projs,
title='OSP | ' + orgName,
favorites=[],
proj_favs=[],
favCount=Favorites.query.filter(
Favorites.fav_name==orgName).count())
# If page rendering fails, render the 404 page
except:
return render_template('404.html', title='OSP | 404'), 404
# Route for profile page
@main.route('/profile', methods=['GET', 'POST'])
@login_required
@check_confirmed
def profile():
# Logic for unfavoriting the org
if request.method == 'POST' and 'unfav_name' in request.form:
# Look for the existing Favorites record
fav = db.session.query(Favorites).filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['unfav_name'],
Favorites.fav_type=='org')).first()
# Delete the favorites record and commit
db.session.delete(fav)
db.session.commit()
# Flash delete message
flash('Removed ' + request.form['unfav_name'] + ' from favorites')
# Refresh the page after unfavoriting
return redirect(request.path)
# Logic for unfavoriting proj on org page
elif request.method == 'POST' and 'proj_unfav_name' in request.form:
# Look for the existing Favorites record
fav = db.session.query(Favorites).filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_name==request.form['proj_unfav_name'],
Favorites.fav_type=='project')).first()
# Delete the favorites record and commit
db.session.delete(fav)
db.session.commit()
# Flash delete message
flash('Removed ' + request.form['proj_unfav_name'] + ' from favorites')
# Refresh the page after unfavoriting
return redirect(request.path)
# Find project favorites for current user
favProjs=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='project')) \
.with_entities(
Favorites.fav_name)
# Find favorite projects
projects=db.session.query(Projects).filter(Projects.name.in_(favProjs))
# Find organization favorites for current user
favOrgs=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='org')) \
.with_entities(
Favorites.fav_name)
# Find favorite organizations
organizations=db.session.query(
Organizations).filter(Organizations.name.in_(favOrgs))
# Render the profile for a logged in user
return render_template('profile.html',
name=current_user.name,
title='OSP | Profile',
projects=projects,
organizations=organizations,
favProjsCount=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='project')).count(),
favOrgsCount=Favorites.query.filter(
and_(Favorites.user_id==current_user.id,
Favorites.fav_type=='org')).count(),
favorites=Favorites.query.filter(
Favorites.user_id==current_user.id),
subProjects=Projects.query.all())
# Route for submitting projects
@main.route('/project-submit', methods=['GET', 'POST'])
@login_required
@check_confirmed
def project_submit():
# Logic for submitting github project
if request.method == 'POST':
# Pull in submit term from form
submit_term = request.form['submit_term']
# Use github api to access user's project
item = requests.get(
"https://api.github.com/repos/" + submit_term).json()
# Check if project was found
if "name" not in item:
flash('Project not found on github')
return redirect(url_for('main.project_submit'))
# Check if project is already in database
q = db.session.query(Projects.name).filter(Projects.name==item["name"])
# If the project exists, do not add it again
if db.session.query(q.exists()).scalar():
flash('Project already exists in database')
return redirect(url_for('project', projectName=item["name"]))
# Create the new Project record
new_proj = Projects(
name = item["name"],
url = item["html_url"],
description = item["description"],
source = "github",
owner = item["owner"]["login"],
owner_avatar = item["owner"]["avatar_url"],
language = item["language"],
created_time = item["created_at"],
last_updated = item["updated_at"],
forks = item["forks"],
watchers = item["watchers"],
open_issues = item["open_issues"],
owner_type = item["owner"]["type"])
# Add the project and commit
db.session.add(new_proj)
db.session.commit()
# Logic for adding favorite project
if 'favProj' in request.form:
# Create the Favorites record
new_fav = Favorites(
id=random.randint(-2147483648, 2147483647),
user_id=current_user.id,
fav_name=item["name"],
fav_type='project')
# Add the favorite and commit it
db.session.add(new_fav)
db.session.commit()
# Check if org is already in database
q = db.session.query(Organizations.name).filter(
Organizations.name==item["owner"]["login"])
# If the organization exists, do not add it again
if not db.session.query(q.exists()).scalar():
# Create the new Project record
new_org = Organizations(
name = item["owner"]["login"],
avatar = item["owner"]["avatar_url"],
owner_type = item["owner"]["type"],
url = "https://github.com/" + item["owner"]["login"])
# Add the org and commit
db.session.add(new_org)
db.session.commit()
# flash project and org added message
flash('Project and Organization Added!')
else:
# flash project added message
flash('Project Added!')
# Logic for adding favorite org
if 'favOrg' in request.form:
# Create the Favorites record
new_fav = Favorites(
id=random.randint(-2147483648, 2147483647),
user_id=current_user.id,
fav_name=item["owner"]["login"],
fav_type='org')
# Add the favorite and commit it
db.session.add(new_fav)
db.session.commit()
# Load the manage page
return redirect(url_for('main.project_submit'))
# Render project submit page
return render_template('project-submit.html', title='OSP | Project Submit')
# Route for 404 page
@app.errorhandler(404)
def page_not_found(e):
# Render the 404 page
return render_template('404.html', title='OSP | 404'), 404
| 37.905484
| 93
| 0.565399
| 3,412
| 32,485
| 5.23388
| 0.071805
| 0.042502
| 0.03427
| 0.029511
| 0.783346
| 0.754396
| 0.732893
| 0.706966
| 0.666088
| 0.652145
| 0
| 0.008975
| 0.348315
| 32,485
| 856
| 94
| 37.949766
| 0.834577
| 0.195167
| 0
| 0.723866
| 0
| 0
| 0.086099
| 0.000847
| 0
| 0
| 0
| 0
| 0
| 1
| 0.015779
| false
| 0
| 0.015779
| 0.001972
| 0.096647
| 0.003945
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
6ba4ad801a9aa7d778472b993d995c3148627cc0
| 149
|
py
|
Python
|
telethon/default.py
|
yeung1704/Telethon
|
4562ba9ccfb1aef33facd5ca1a2675705d390e1c
|
[
"MIT"
] | 1
|
2019-07-20T08:28:10.000Z
|
2019-07-20T08:28:10.000Z
|
telethon/default.py
|
yeung1704/Telethon
|
4562ba9ccfb1aef33facd5ca1a2675705d390e1c
|
[
"MIT"
] | null | null | null |
telethon/default.py
|
yeung1704/Telethon
|
4562ba9ccfb1aef33facd5ca1a2675705d390e1c
|
[
"MIT"
] | null | null | null |
"""
Sentinel module to signify that a parameter should use its default value.
Useful when the default value or ``None`` are both valid options.
"""
| 24.833333
| 73
| 0.744966
| 23
| 149
| 4.826087
| 0.913043
| 0.216216
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.174497
| 149
| 5
| 74
| 29.8
| 0.902439
| 0.939597
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
6bff350f518f439e181a5a3b43b8b57339abb3a9
| 96
|
py
|
Python
|
bitmovin_api_sdk/encoding/filters/watermark/customdata/__init__.py
|
jaythecaesarean/bitmovin-api-sdk-python
|
48166511fcb9082041c552ace55a9b66cc59b794
|
[
"MIT"
] | 11
|
2019-07-03T10:41:16.000Z
|
2022-02-25T21:48:06.000Z
|
bitmovin_api_sdk/encoding/filters/watermark/customdata/__init__.py
|
jaythecaesarean/bitmovin-api-sdk-python
|
48166511fcb9082041c552ace55a9b66cc59b794
|
[
"MIT"
] | 8
|
2019-11-23T00:01:25.000Z
|
2021-04-29T12:30:31.000Z
|
bitmovin_api_sdk/encoding/filters/watermark/customdata/__init__.py
|
jaythecaesarean/bitmovin-api-sdk-python
|
48166511fcb9082041c552ace55a9b66cc59b794
|
[
"MIT"
] | 13
|
2020-01-02T14:58:18.000Z
|
2022-03-26T12:10:30.000Z
|
from bitmovin_api_sdk.encoding.filters.watermark.customdata.customdata_api import CustomdataApi
| 48
| 95
| 0.90625
| 12
| 96
| 7
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041667
| 96
| 1
| 96
| 96
| 0.913043
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d41235cfd426754bc747b9f2f6052745a07393cf
| 157
|
py
|
Python
|
main.py
|
James-Leslie/github-actions
|
adb4206f365c879ab5297e52e1153fb93191e190
|
[
"Unlicense"
] | null | null | null |
main.py
|
James-Leslie/github-actions
|
adb4206f365c879ab5297e52e1153fb93191e190
|
[
"Unlicense"
] | null | null | null |
main.py
|
James-Leslie/github-actions
|
adb4206f365c879ab5297e52e1153fb93191e190
|
[
"Unlicense"
] | null | null | null |
def add_two(a, b):
'''Adds two numbers together'''
return a + b
def multiply_two(a, b):
'''Multiplies two numbers together'''
return a * b
| 17.444444
| 41
| 0.605096
| 24
| 157
| 3.875
| 0.458333
| 0.086022
| 0.107527
| 0.516129
| 0.55914
| 0.55914
| 0
| 0
| 0
| 0
| 0
| 0
| 0.254777
| 157
| 8
| 42
| 19.625
| 0.794872
| 0.363057
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
d4249f69da262cb3a39e11f79c9b161bcd9b7173
| 48
|
py
|
Python
|
tests/components/luftdaten/__init__.py
|
domwillcode/home-assistant
|
f170c80bea70c939c098b5c88320a1c789858958
|
[
"Apache-2.0"
] | 30,023
|
2016-04-13T10:17:53.000Z
|
2020-03-02T12:56:31.000Z
|
tests/components/luftdaten/__init__.py
|
jagadeeshvenkatesh/core
|
1bd982668449815fee2105478569f8e4b5670add
|
[
"Apache-2.0"
] | 31,101
|
2020-03-02T13:00:16.000Z
|
2022-03-31T23:57:36.000Z
|
tests/components/luftdaten/__init__.py
|
jagadeeshvenkatesh/core
|
1bd982668449815fee2105478569f8e4b5670add
|
[
"Apache-2.0"
] | 11,956
|
2016-04-13T18:42:31.000Z
|
2020-03-02T09:32:12.000Z
|
"""Define tests for the Luftdaten component."""
| 24
| 47
| 0.729167
| 6
| 48
| 5.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 48
| 1
| 48
| 48
| 0.833333
| 0.854167
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d43249d872053b3e214cf2a595c7a9acd99c13ea
| 134
|
py
|
Python
|
vulture/pipelines.py
|
aksiksi/vulture
|
5b5a198b64e3a4ce2822e71ba148c50e0ea29b9a
|
[
"MIT"
] | null | null | null |
vulture/pipelines.py
|
aksiksi/vulture
|
5b5a198b64e3a4ce2822e71ba148c50e0ea29b9a
|
[
"MIT"
] | null | null | null |
vulture/pipelines.py
|
aksiksi/vulture
|
5b5a198b64e3a4ce2822e71ba148c50e0ea29b9a
|
[
"MIT"
] | null | null | null |
from scrapy.exceptions import DropItem
class DubizzlePipeline(object):
def process_item(self, item, spider):
return item
| 22.333333
| 41
| 0.746269
| 16
| 134
| 6.1875
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186567
| 134
| 5
| 42
| 26.8
| 0.908257
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
d468b4040e163972a066288b8759fdddb7630bcc
| 138
|
py
|
Python
|
nailgun-client/py/__init__.py
|
h4l/nailgun
|
84f3b051e99f7be17260b1cae8da0217be0bb0a4
|
[
"Apache-2.0"
] | 362
|
2017-10-16T18:51:28.000Z
|
2022-03-29T00:44:30.000Z
|
nailgun-client/py/__init__.py
|
h4l/nailgun
|
84f3b051e99f7be17260b1cae8da0217be0bb0a4
|
[
"Apache-2.0"
] | 88
|
2017-10-30T22:52:49.000Z
|
2022-03-04T21:56:39.000Z
|
nailgun-client/py/__init__.py
|
h4l/nailgun
|
84f3b051e99f7be17260b1cae8da0217be0bb0a4
|
[
"Apache-2.0"
] | 89
|
2017-10-16T18:51:29.000Z
|
2022-03-18T00:52:28.000Z
|
# Copyright 2004-2015, Martian Software, Inc.
# Copyright 2017-Present Facebook, Inc.
from ng import NailgunConnection, NailgunException
| 27.6
| 50
| 0.804348
| 16
| 138
| 6.9375
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.099174
| 0.123188
| 138
| 4
| 51
| 34.5
| 0.818182
| 0.586957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
2e17d42191b40ddd586a3685d06dd1dc28ec5c8e
| 262
|
py
|
Python
|
Statistics/Randomgen_1.py
|
Sakthi0722/StatsCalculator
|
f18b8ddb300ccaba796665829ddf20777ff15ed9
|
[
"MIT"
] | 1
|
2021-09-20T18:39:53.000Z
|
2021-09-20T18:39:53.000Z
|
Statistics/Randomgen_1.py
|
Sakthi0722/StatsCalculator
|
f18b8ddb300ccaba796665829ddf20777ff15ed9
|
[
"MIT"
] | null | null | null |
Statistics/Randomgen_1.py
|
Sakthi0722/StatsCalculator
|
f18b8ddb300ccaba796665829ddf20777ff15ed9
|
[
"MIT"
] | 2
|
2021-07-12T18:58:23.000Z
|
2021-07-14T17:47:40.000Z
|
import random
r1 = random.randint(1, 40)
print("Generate a random number without a seed between a range of two numbers - Integer:", r1)
r2 = random.uniform(1, 40)
print("Generate a random number without a seed between a range of two numbers - Decimal:", r2)
| 26.2
| 94
| 0.732824
| 44
| 262
| 4.363636
| 0.477273
| 0.03125
| 0.083333
| 0.166667
| 0.6875
| 0.6875
| 0.6875
| 0.6875
| 0.6875
| 0.6875
| 0
| 0.046296
| 0.175573
| 262
| 9
| 95
| 29.111111
| 0.842593
| 0
| 0
| 0
| 1
| 0
| 0.618321
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0.4
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5cfa15c4217764a7243acf381d48de88ecf54b14
| 90
|
py
|
Python
|
app/album/__init__.py
|
chaosbus/MemorySeepage
|
d72fc9fc1826e9e54cfbe899f65e508ec8ea090f
|
[
"Apache-2.0"
] | null | null | null |
app/album/__init__.py
|
chaosbus/MemorySeepage
|
d72fc9fc1826e9e54cfbe899f65e508ec8ea090f
|
[
"Apache-2.0"
] | null | null | null |
app/album/__init__.py
|
chaosbus/MemorySeepage
|
d72fc9fc1826e9e54cfbe899f65e508ec8ea090f
|
[
"Apache-2.0"
] | null | null | null |
from flask import Blueprint
bp_album = Blueprint('album', __name__)
from . import views
| 15
| 39
| 0.766667
| 12
| 90
| 5.333333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155556
| 90
| 5
| 40
| 18
| 0.842105
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 5
|
5cfb5f7fde73fb94febdbb0039f0e0103831ec8f
| 123
|
py
|
Python
|
BeerChallenge_Scordino_Marco.py
|
Py101/py101-assignments-marcosco
|
f70889899f97a96e1821bbd79c9bcc323e8aa6b0
|
[
"MIT"
] | null | null | null |
BeerChallenge_Scordino_Marco.py
|
Py101/py101-assignments-marcosco
|
f70889899f97a96e1821bbd79c9bcc323e8aa6b0
|
[
"MIT"
] | null | null | null |
BeerChallenge_Scordino_Marco.py
|
Py101/py101-assignments-marcosco
|
f70889899f97a96e1821bbd79c9bcc323e8aa6b0
|
[
"MIT"
] | null | null | null |
from functools import reduce
def fact(n):
fact_lamba = lambda x, y: x * y
return reduce(fact_lamba, range(1,n+1))
| 20.5
| 43
| 0.674797
| 22
| 123
| 3.681818
| 0.636364
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020619
| 0.211382
| 123
| 5
| 44
| 24.6
| 0.814433
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
cf2b77b413257fb41d5d5fa3c9259818e5490edc
| 388
|
py
|
Python
|
s_core/admin.py
|
jrbenriquez/sarimuson2
|
cdaedb130bd7b3ef065e4503228cc1610ae43fda
|
[
"MIT"
] | null | null | null |
s_core/admin.py
|
jrbenriquez/sarimuson2
|
cdaedb130bd7b3ef065e4503228cc1610ae43fda
|
[
"MIT"
] | null | null | null |
s_core/admin.py
|
jrbenriquez/sarimuson2
|
cdaedb130bd7b3ef065e4503228cc1610ae43fda
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models.customer import Customer
from .models.purchase import Purchase
from .models.purchase import PurchaseItem
@admin.register(Customer)
class CustomerAdmin(admin.ModelAdmin):
pass
@admin.register(Purchase)
class PurchaseAdmin(admin.ModelAdmin):
pass
@admin.register(PurchaseItem)
class PurchaseItemAdmin(admin.ModelAdmin):
pass
| 18.47619
| 42
| 0.798969
| 44
| 388
| 7.045455
| 0.363636
| 0.096774
| 0.183871
| 0.154839
| 0.206452
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121134
| 388
| 20
| 43
| 19.4
| 0.909091
| 0
| 0
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.230769
| 0.307692
| 0
| 0.538462
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.