hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cb12f33d54e3b4108ba318c0b12c85eee1246ed8 | 1,263 | py | Python | 10_verify_parentheses_recursion.py | MichaelORegan/52960_MPP_Assignment2_Recursion | 5b7b5b6a9ec0f4505e52ce3e6b9dde6f9c19d37b | [
"Apache-2.0"
] | null | null | null | 10_verify_parentheses_recursion.py | MichaelORegan/52960_MPP_Assignment2_Recursion | 5b7b5b6a9ec0f4505e52ce3e6b9dde6f9c19d37b | [
"Apache-2.0"
] | null | null | null | 10_verify_parentheses_recursion.py | MichaelORegan/52960_MPP_Assignment2_Recursion | 5b7b5b6a9ec0f4505e52ce3e6b9dde6f9c19d37b | [
"Apache-2.0"
] | null | null | null | # https://stackoverflow.com/questions/18007995/recursive-method-for-parentheses-balancing-python
# define the function, string n with (),
# i in n start at 0, counter start at 0
a = "(()()"
print(verify_parentheses(a))
b = "(()"
print(verify_parentheses(b))
c = "(())"
print(verify_parentheses(c))
d = ")(()"
print(ve... | 33.236842 | 96 | 0.669834 | # https://stackoverflow.com/questions/18007995/recursive-method-for-parentheses-balancing-python
# define the function, string n with (),
# i in n start at 0, counter start at 0
def verify_parentheses(n, i=0, counter=0):
# if there is nothing in the string
if i == len(n):
# return 0 balanced True
return ... | 0 | 0 | 0 | 0 | 0 | 780 | 0 | 0 | 22 |
91e093e528512619f8675d6d0cf7088745b79ad3 | 12,472 | py | Python | app/reader.py | rshariffdeen/CPR | 4863c602d3c291611251d4823590e7c7553aa633 | [
"MIT"
] | 26 | 2021-04-07T11:29:13.000Z | 2022-03-28T15:20:38.000Z | app/reader.py | rshariffdeen/CPR | 4863c602d3c291611251d4823590e7c7553aa633 | [
"MIT"
] | null | null | null | app/reader.py | rshariffdeen/CPR | 4863c602d3c291611251d4823590e7c7553aa633 | [
"MIT"
] | 5 | 2021-04-07T18:33:02.000Z | 2021-10-29T23:23:00.000Z | from app import emitter, definitions, values
from six.moves import cStringIO
import os
from pysmt.smtlib.parser import SmtLibParser
def collect_symbolic_expression(log_path):
"""
This function will read the output log of a klee concolic execution and extract symbolic expressions
of variables of in... | 39.719745 | 107 | 0.569596 | import json
import pickle
import re
from app import emitter, definitions, values
from six.moves import cStringIO
import os
from pysmt.smtlib.parser import SmtLibParser
def read_json(file_path):
json_data = None
if os.path.isfile(file_path):
with open(file_path, 'r') as in_file:
content = i... | 0 | 0 | 0 | 0 | 0 | 2,733 | 0 | -30 | 227 |
60fbd717947dcb1d64d92cb125539095585a254e | 875 | py | Python | ServerAPI/controller/model/image_classification.py | catalina-bejan/bachelor-graduation-thesis | e3b1bc67c153199a6188fcf1358dac0279b5b9a7 | [
"MIT"
] | null | null | null | ServerAPI/controller/model/image_classification.py | catalina-bejan/bachelor-graduation-thesis | e3b1bc67c153199a6188fcf1358dac0279b5b9a7 | [
"MIT"
] | null | null | null | ServerAPI/controller/model/image_classification.py | catalina-bejan/bachelor-graduation-thesis | e3b1bc67c153199a6188fcf1358dac0279b5b9a7 | [
"MIT"
] | null | null | null | from keras.models import load_model
export_path_keras = "C:\\Users\\catal\\Facultate\\an4\\licenta\\modele antrenate\\modelBinaryClassificationFoodOrNotfood-VGG16.h5"
model = load_model(export_path_keras)
classtolabel = {'0':'food','1':'notfood'}
| 43.75 | 131 | 0.737143 | import cv2
import numpy as np
from keras.models import load_model
from model.image_classification_class import ImageClassification
export_path_keras = "C:\\Users\\catal\\Facultate\\an4\\licenta\\modele antrenate\\modelBinaryClassificationFoodOrNotfood-VGG16.h5"
model = load_model(export_path_keras)
classtolabel... | 0 | 0 | 0 | 0 | 0 | 501 | 0 | 29 | 93 |
9755f5e7b50aa49441c03b4099cf6b938adf75a5 | 7,139 | py | Python | typing/ui.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | 28 | 2019-11-08T03:09:59.000Z | 2022-03-09T06:59:04.000Z | typing/ui.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | null | null | null | typing/ui.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | 50 | 2019-09-17T15:28:34.000Z | 2022-03-29T09:10:12.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'e:/Code/MyQT/typing/typing.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
| 50.274648 | 114 | 0.688332 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'e:/Code/MyQT/typing/typing.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, F... | 63 | 0 | 0 | 6,822 | 0 | 0 | 0 | 21 | 50 |
9247df721077d723c08d1d772c85af2d677920fb | 161 | py | Python | Beginner/1072.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Beginner/1072.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Beginner/1072.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | N = int(input())
soma = 0
for k in range(N):
X = int(input())
if X >= 10 and X <= 20: soma+=1
print("%d in" % (soma))
print("%d out" % (abs(N-soma)))
| 14.636364 | 35 | 0.496894 | N = int(input())
soma = 0
for k in range(N):
X = int(input())
if X >= 10 and X <= 20: soma+=1
print("%d in" % (soma))
print("%d out" % (abs(N-soma)))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d8e82bf0d960e6552dc03b0df3d962f83baba44 | 2,715 | py | Python | qualipy/utils/object_extraction.py | kwrobert/qualipy | a514e8d2e7d3b24d111556a1af91689ace36af9a | [
"MIT"
] | null | null | null | qualipy/utils/object_extraction.py | kwrobert/qualipy | a514e8d2e7d3b24d111556a1af91689ace36af9a | [
"MIT"
] | null | null | null | qualipy/utils/object_extraction.py | kwrobert/qualipy | a514e8d2e7d3b24d111556a1af91689ace36af9a | [
"MIT"
] | null | null | null | """Python wrapper for the object extraction algorithm found in
https://github.com/assamite/CmCode
"""
import os
import tempfile
from ctypes import cdll, c_char_p, c_bool
def _saliency(image_path, saliency_map_path, saliency_mask_path):
"""Python wrapper for running the saliency detection.
:param image_path:... | 30.166667 | 77 | 0.707919 | """Python wrapper for the object extraction algorithm found in
https://github.com/assamite/CmCode
"""
import os
import tempfile
from ctypes import cdll, c_char_p, c_bool
import cv2
from .utils import file_cache
def _saliency(image_path, saliency_map_path, saliency_mask_path):
"""Python wrapper for running the ... | 0 | 729 | 0 | 0 | 0 | 79 | 0 | -3 | 92 |
1e18cf6bb69a10bca9d87f12289ac734e8051fb2 | 2,228 | py | Python | src/django_sorting_bootstrap/util.py | jayhardee9/django-sorting-bootstrap | c8e1a8a62d7eb316b984c6f1f38a6d35d6055bae | [
"MIT"
] | null | null | null | src/django_sorting_bootstrap/util.py | jayhardee9/django-sorting-bootstrap | c8e1a8a62d7eb316b984c6f1f38a6d35d6055bae | [
"MIT"
] | null | null | null | src/django_sorting_bootstrap/util.py | jayhardee9/django-sorting-bootstrap | c8e1a8a62d7eb316b984c6f1f38a6d35d6055bae | [
"MIT"
] | null | null | null | """Util module."""
import six
from django.db import models
from django.db.models.fields.related import ForeignObjectRel as RelatedObject
from django.forms.forms import pretty_name
from django.utils.encoding import force_str
from django.utils.encoding import force_text
def label_for_field(name, model, return_attr=Fals... | 35.365079 | 84 | 0.572711 | """Util module."""
import six
from django.db import models
from django.db.models.fields.related import ForeignObjectRel as RelatedObject
from django.forms.forms import pretty_name
from django.utils.encoding import force_str
from django.utils.encoding import force_text
def label_for_field(name, model, return_attr=Fals... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8833957eac9f85195044f702cec2b2d76beacc48 | 303 | py | Python | calculator.py | quattrococodrilo/cal | 739f3c36333de2c3915d105eeb164c13e0726913 | [
"MIT"
] | null | null | null | calculator.py | quattrococodrilo/cal | 739f3c36333de2c3915d105eeb164c13e0726913 | [
"MIT"
] | null | null | null | calculator.py | quattrococodrilo/cal | 739f3c36333de2c3915d105eeb164c13e0726913 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
from sys import argv
cal = Calculator(int(argv[1]), int(argv[2]))
print(cal.square())
| 18.9375 | 64 | 0.561056 | class Calculator:
def __init__(self, a, b):
self.a = a
self.b = b
def square(self):
return 'a:{}\nb:{}'.format(self.a*self.a, self.b*self.b)
if __name__ == '__main__':
from sys import argv
cal = Calculator(int(argv[1]), int(argv[2]))
print(cal.square())
| 0 | 0 | 0 | 152 | 0 | 0 | 0 | 0 | 22 |
71e4541950059597eee92bdba38dc1378bb73cf2 | 485 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/longest-substring-of-all-vowels-in-order.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/longest-substring-of-all-vowels-in-order.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/longest-substring-of-all-vowels-in-order.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n)
# Space: O(1)
| 23.095238 | 47 | 0.4 | # Time: O(n)
# Space: O(1)
class Solution(object):
def longestBeautifulSubstring(self, word):
"""
:type word: str
:rtype: int
"""
result = 0
l = cnt = 1
for i in xrange(len(word)-1):
if word[i] > word[i+1]:
l = cnt = 1
... | 0 | 0 | 0 | 434 | 0 | 0 | 0 | 0 | 23 |
2d448f9a1d01616b7380b8a27fb7014df2302d0a | 3,342 | py | Python | server/scraper.py | lkrjangid1/ggsipu_notice | 79bb8f7a1f41a473a4cf37e414002c855c075301 | [
"BSD-3-Clause"
] | 1 | 2021-06-29T17:53:47.000Z | 2021-06-29T17:53:47.000Z | server/scraper.py | lkrjangid1/ggsipu_notice | 79bb8f7a1f41a473a4cf37e414002c855c075301 | [
"BSD-3-Clause"
] | null | null | null | server/scraper.py | lkrjangid1/ggsipu_notice | 79bb8f7a1f41a473a4cf37e414002c855c075301 | [
"BSD-3-Clause"
] | null | null | null | from apscheduler.schedulers.background import BackgroundScheduler
from pyfcm import FCMNotification
from flask import Flask
import pyrebase
from config import config
from keys import api_key
notices = []
push_service = FCMNotification(api_key=api_key)
print("Initialised Push Service")
firebase = pyrebase.initia... | 29.839286 | 118 | 0.607421 | from apscheduler.schedulers.background import BackgroundScheduler
from pyfcm import FCMNotification
from flask import Flask, render_template
from bs4 import BeautifulSoup
import requests
from urllib import parse
import pyrebase
from config import config
from keys import api_key
from collections import OrderedDict
noti... | 0 | 84 | 0 | 0 | 0 | 2,434 | 0 | 36 | 180 |
cbf550b050546a555c04b3a440547431b191443a | 175 | py | Python | zipa/__init__.py | PressLabs/zipa | 69950f803b1c5f6fb7147f67bf2301c58590ba5d | [
"Apache-2.0"
] | 24 | 2015-02-10T15:12:55.000Z | 2017-03-27T15:41:18.000Z | zipa/__init__.py | PressLabs/zipa | 69950f803b1c5f6fb7147f67bf2301c58590ba5d | [
"Apache-2.0"
] | 6 | 2015-03-12T15:54:13.000Z | 2017-07-28T12:48:10.000Z | zipa/__init__.py | presslabs/zipa | 69950f803b1c5f6fb7147f67bf2301c58590ba5d | [
"Apache-2.0"
] | 1 | 2015-03-10T12:13:48.000Z | 2015-03-10T12:13:48.000Z | import sys
from .module import register_module, ModuleImporter
if sys.version_info >= (3, 0):
sys.meta_path.append(ModuleImporter(__name__))
register_module(__name__)
| 17.5 | 51 | 0.777143 | import sys
from .module import register_module, ModuleImporter
if sys.version_info >= (3, 0):
sys.meta_path.append(ModuleImporter(__name__))
register_module(__name__)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f3c97d5816d7252519e6501222b70eca4569e6ad | 6,261 | py | Python | word_replacer.py | Le-onardo/Word-Replacer | 2fcc1beeca4d89849a45d43e9e3940b32d8ee197 | [
"MIT"
] | null | null | null | word_replacer.py | Le-onardo/Word-Replacer | 2fcc1beeca4d89849a45d43e9e3940b32d8ee197 | [
"MIT"
] | null | null | null | word_replacer.py | Le-onardo/Word-Replacer | 2fcc1beeca4d89849a45d43e9e3940b32d8ee197 | [
"MIT"
] | null | null | null | """
A word replacer to make a dumb sentence sound verysmart.
Leonardo Martinho
2017
"""
import API
import argparse
import re
from nltk import pos_tag
import sys
from pathlib2 import Path
def sanitize_for_url(word):
"""
Sanitizing of a word with a regex search string - everything that is not alphanumeric, a space or ... | 34.213115 | 125 | 0.714423 | """
A word replacer to make a dumb sentence sound verysmart.
Leonardo Martinho
2017
"""
import API
import argparse
import re
from nltk import pos_tag
import sys
from pathlib2 import Path
def sanitize_for_url(word):
"""
Sanitizing of a word with a regex search string - everything that is not alphanumeric, a space or ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e2f09641cf2eb48098bb6a49c04aca4130081f7f | 2,682 | pyw | Python | keylogger_final.pyw | andresflorezp/KEYLOGGERS | 50bf0c5ed4cf8b6f31557554295366b49a2564a5 | [
"MIT"
] | null | null | null | keylogger_final.pyw | andresflorezp/KEYLOGGERS | 50bf0c5ed4cf8b6f31557554295366b49a2564a5 | [
"MIT"
] | null | null | null | keylogger_final.pyw | andresflorezp/KEYLOGGERS | 50bf0c5ed4cf8b6f31557554295366b49a2564a5 | [
"MIT"
] | null | null | null | import pyHook, pythoncom
import time, datetime
import win32console
import win32gui
import os
window = win32console.GetConsoleWindow()
win32gui.ShowWindow(window,0)
root_dir = os.path.split(os.path.realpath(__file__))[0]
log_file=os.path.join("C:\\Users\\Solid\\Desktop\\key","log_file.txt")
buffer=""
pause_period=2
la... | 25.542857 | 74 | 0.592095 | import pyHook,pythoncom,sys,logging
import time,datetime
import win32console
import win32gui
import os
window = win32console.GetConsoleWindow()
win32gui.ShowWindow(window,0)
root_dir = os.path.split(os.path.realpath(__file__))[0]
log_file=os.path.join("C:\\Users\\Solid\\Desktop\\key","log_file.txt")
buffer=""
pause_p... | 0 | 0 | 0 | 0 | 0 | 1,909 | 0 | 10 | 113 |
a821e039c41258f9daa91db8b278081ab437dbee | 928 | py | Python | Backend/test/shell.py | AlbatrossBill/COSC4P02Project | c48682c014ab9de4847d46cffc710d386db93c0f | [
"MIT"
] | 4 | 2022-01-15T22:04:06.000Z | 2022-01-24T01:46:46.000Z | Backend/test/shell.py | AlbatrossBill/COSC4P02Project | c48682c014ab9de4847d46cffc710d386db93c0f | [
"MIT"
] | null | null | null | Backend/test/shell.py | AlbatrossBill/COSC4P02Project | c48682c014ab9de4847d46cffc710d386db93c0f | [
"MIT"
] | 1 | 2022-01-24T01:31:57.000Z | 2022-01-24T01:31:57.000Z | import nltk
import os
from sys import platform
path = ""
if platform == "linux" or platform == "linux2":
path = os.path.dirname(os.path.realpath(__file__)).replace("test","data/nltk")
elif platform == "darwin":
path = os.path.dirname(os.path.realpath(__file__)).replace("test","data/nltk")
elif platfor... | 27.294118 | 84 | 0.68319 | import nltk
import string
import requests
import json
from io import StringIO
from html.parser import HTMLParser
import os
import time
from sys import platform
path = ""
if platform == "linux" or platform == "linux2":
path = os.path.dirname(os.path.realpath(__file__)).replace("test","data/nltk")
elif ... | 0 | 0 | 0 | 0 | 0 | 271 | 0 | -19 | 188 |
47c7d774e8e4892f6f712ec9c5fe45be0e8b684c | 2,458 | py | Python | responder.py | kadnan/GmailAutoresponder | 5c7ad29f518e870bef918929cb932ed296cede3c | [
"MIT"
] | 13 | 2016-12-21T16:29:23.000Z | 2021-05-04T07:04:53.000Z | responder.py | kadnan/GmailAutoresponder | 5c7ad29f518e870bef918929cb932ed296cede3c | [
"MIT"
] | null | null | null | responder.py | kadnan/GmailAutoresponder | 5c7ad29f518e870bef918929cb932ed296cede3c | [
"MIT"
] | 8 | 2017-01-30T16:49:15.000Z | 2020-10-14T04:46:02.000Z | from selenium import webdriver
driver = None
driver = webdriver.Firefox()
SENDER = '<SENDER NAME>'
GMAIL_USER = '<Your Gmail ID>'
GMAIL_PASSWORD = '<Your Gmail ID>'
MESSAGE = 'I will get back to you soon. \n Thanks'
MESSAGE = 'I will get back to you soon. \n Thanks'
if __name__ == '__main__':
r_log = login_go... | 22.971963 | 74 | 0.554516 | from selenium import webdriver
from time import sleep
driver = None
driver = webdriver.Firefox()
SENDER = '<SENDER NAME>'
GMAIL_USER = '<Your Gmail ID>'
GMAIL_PASSWORD = '<Your Gmail ID>'
MESSAGE = 'I will get back to you soon. \n Thanks'
MESSAGE = 'I will get back to you soon. \n Thanks'
def access_gmail():
tr... | 0 | 0 | 0 | 0 | 0 | 1,901 | 0 | 1 | 68 |
5c279c9fef6cf0adca549a9977b32043eb636fec | 4,868 | py | Python | storyscript/compiler/semantics/functions/MutationBuilder.py | marqov/storyscript | 4b99ff904305109cfb4310cb504127e2649ba44a | [
"MIT"
] | 1 | 2019-05-06T14:04:40.000Z | 2019-05-06T14:04:40.000Z | storyscript/compiler/semantics/functions/MutationBuilder.py | marqov/storyscript | 4b99ff904305109cfb4310cb504127e2649ba44a | [
"MIT"
] | null | null | null | storyscript/compiler/semantics/functions/MutationBuilder.py | marqov/storyscript | 4b99ff904305109cfb4310cb504127e2649ba44a | [
"MIT"
] | null | null | null | from storyscript.compiler.semantics.functions.Mutation import Mutation
from storyscript.compiler.semantics.types.GenericTypes import GenericType, ListGenericType, MapGenericType, TypeSymbol
from storyscript.compiler.semantics.types.Types import AnyType, BaseType, BooleanType, FloatType, IntType, NoneType, RegExpType, S... | 30.236025 | 79 | 0.573541 | from storyscript.compiler.semantics.functions.Mutation import Mutation
from storyscript.compiler.semantics.types.GenericTypes import \
GenericType, ListGenericType, MapGenericType, TypeSymbol
from storyscript.compiler.semantics.types.Types import AnyType, BaseType, \
BooleanType, FloatType, IntType, NoneType, R... | 0 | 0 | 0 | 0 | 883 | 0 | 0 | 12 | 23 |
e02268a0a359842a6ba9e4f3ac2ad95e395dc605 | 1,039 | py | Python | misc/bot.py | schollz/kiki | 5ed8f5f4b92018912fd6bda3499ad4c5a97ab496 | [
"MIT"
] | 45 | 2018-01-15T01:13:11.000Z | 2022-03-10T18:12:09.000Z | misc/bot.py | schollz/kiki | 5ed8f5f4b92018912fd6bda3499ad4c5a97ab496 | [
"MIT"
] | 7 | 2017-12-30T03:20:31.000Z | 2021-02-25T01:32:27.000Z | misc/bot.py | schollz/kiki | 5ed8f5f4b92018912fd6bda3499ad4c5a97ab496 | [
"MIT"
] | 3 | 2018-01-24T19:25:37.000Z | 2018-12-29T10:30:49.000Z | import json, requests
content = """**My source code:**
```
import json, requests
quote_response = requests.get("https://quotes.schollz.com/subject/friend.json")
quote = quote_response.json()[0]
if len(quote['Name']) == 0:
quote['Name'] = 'Unknown'
content = "<p>{q[Text]}</p><p>- <em>{q[Name]}</em></p>".format(q=quot... | 34.633333 | 79 | 0.662175 | import json, requests
content = """**My source code:**
```
import json, requests
quote_response = requests.get("https://quotes.schollz.com/subject/friend.json")
quote = quote_response.json()[0]
if len(quote['Name']) == 0:
quote['Name'] = 'Unknown'
content = "<p>“{q[Text]}”</p><p>- <em>{q[Name]}</em></p>".format(q=qu... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
78efd463642f69dceb77865e6f397fed1965cdda | 491 | py | Python | tests/radish/steps_german.py | tuxrosi/radish | b21fa751f8dfc4309451476151c810b44975babb | [
"MIT"
] | null | null | null | tests/radish/steps_german.py | tuxrosi/radish | b21fa751f8dfc4309451476151c810b44975babb | [
"MIT"
] | null | null | null | tests/radish/steps_german.py | tuxrosi/radish | b21fa751f8dfc4309451476151c810b44975babb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
| 15.34375 | 76 | 0.647658 | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
from radish import step
@step("Gegeben sei etwas")
def have_a_step(step):
"Given I have a step"
pass
@step("Wenn ich etw... | 0 | 207 | 0 | 0 | 0 | 0 | 0 | 2 | 92 |
0159da13dd902b319b803e84eaf59ce48e0e0232 | 1,642 | py | Python | applications/ConstitutiveModelsApplication/tests/examples/real_cam_clay_example/call_constitutive_model.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/ConstitutiveModelsApplication/tests/examples/real_cam_clay_example/call_constitutive_model.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/ConstitutiveModelsApplication/tests/examples/real_cam_clay_example/call_constitutive_model.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Time control starts
import time as timer
print(timer.ctime())
# Measure process time
t0p = timer.clock()
# Measure wall time
t0w = timer.time()
# Import kratos core and application... | 26.918033 | 134 | 0.733861 | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Time control starts
import time as timer
print(timer.ctime())
# Measure process time
t0p = timer.clock()
# Measure wall time
t0w = timer.time()
def StartTimeMeasuring():
# Measu... | 0 | 0 | 0 | 0 | 0 | 304 | 0 | 0 | 46 |
3de1a01766e56a9e2051fe4a67ccb9096dc5e2ac | 1,603 | py | Python | examples/verbose-example.py | mtzgroup/tcpb-client | 162cecde1652a267ec1e956f16a34dccd539f436 | [
"MIT"
] | null | null | null | examples/verbose-example.py | mtzgroup/tcpb-client | 162cecde1652a267ec1e956f16a34dccd539f436 | [
"MIT"
] | 16 | 2021-02-21T05:24:44.000Z | 2022-03-03T01:05:25.000Z | examples/verbose-example.py | mtzgroup/tcpb-client | 162cecde1652a267ec1e956f16a34dccd539f436 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Basic TCProtobufClient usage
import sys
from tcpb import TCProtobufClient
# Water system
atoms = ["O", "H", "H"]
geom = [
0.00000,
0.00000,
-0.06852,
0.00000,
-0.79069,
0.54370,
0.00000,
0.79069,
0.54370,
]
# Default geom is bohr, but this in angstrom
if le... | 23.925373 | 76 | 0.660636 | #!/usr/bin/env python
# Basic TCProtobufClient usage
import sys
from tcpb import TCProtobufClient
# Water system
atoms = ["O", "H", "H"]
geom = [
0.00000,
0.00000,
-0.06852,
0.00000,
-0.79069,
0.54370,
0.00000,
0.79069,
0.54370,
]
# Default geom is bohr, but this in angstrom
if le... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b0d4b465345f52d8d010f36e5c8bb6d56732210 | 5,036 | py | Python | n26/api.py | sdabbo/python-n26 | c3390a2fc7fd8fca0441532f555e0145994b32a4 | [
"MIT"
] | null | null | null | n26/api.py | sdabbo/python-n26 | c3390a2fc7fd8fca0441532f555e0145994b32a4 | [
"MIT"
] | null | null | null | n26/api.py | sdabbo/python-n26 | c3390a2fc7fd8fca0441532f555e0145994b32a4 | [
"MIT"
] | null | null | null |
url = 'https://api.tech26.de'
# Api class can be imported as a library in order to use it within applications
| 41.966667 | 117 | 0.664615 | import requests
from n26 import config
url = 'https://api.tech26.de'
# Api class can be imported as a library in order to use it within applications
class Api(object):
# constructor accepting None to maintain backward compatibility
def __init__(self, cfg=None):
if not cfg:
cfg = config.ge... | 0 | 0 | 0 | 4,862 | 0 | 0 | 0 | -5 | 66 |
ca7c76933b7d336d63c05542145ea2269123987d | 1,356 | py | Python | watchmen/topic/storage/topic_relation_storage.py | luke0623/watchmen-matryoshka-doll | 77d7929c2d298ec814dd7e89132861da97a55a26 | [
"MIT"
] | null | null | null | watchmen/topic/storage/topic_relation_storage.py | luke0623/watchmen-matryoshka-doll | 77d7929c2d298ec814dd7e89132861da97a55a26 | [
"MIT"
] | null | null | null | watchmen/topic/storage/topic_relation_storage.py | luke0623/watchmen-matryoshka-doll | 77d7929c2d298ec814dd7e89132861da97a55a26 | [
"MIT"
] | null | null | null | # from watchmen.common.storage.engine.storage_engine import get_client
# from watchmen.topic.topic_relationship import TopicRelationship
#
# db = get_client()
#
# topic_relation_collections = db.get_collection('topic_relation_collections')
#
#
# def save_topic_relationship(topic_relation: TopicRelationship):
# resu... | 39.882353 | 120 | 0.756637 | # from watchmen.common.storage.engine.storage_engine import get_client
# from watchmen.topic.topic_relationship import TopicRelationship
#
# db = get_client()
#
# topic_relation_collections = db.get_collection('topic_relation_collections')
#
#
# def save_topic_relationship(topic_relation: TopicRelationship):
# resu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3398cf47cea9385f2b93d0d64e5e1a20763f78d9 | 3,594 | py | Python | snowshu/core/utils.py | pfleischerHU/snowshu | 8008a588b00a0ed8cb28c96c8032c4a8be479b5d | [
"Apache-2.0"
] | 11 | 2020-02-27T23:09:43.000Z | 2022-03-30T08:19:49.000Z | snowshu/core/utils.py | ankur112358/snowshu | f4f596d08e6441a96fe0adcbc699cf7613fc59e0 | [
"Apache-2.0"
] | 66 | 2020-02-20T17:07:20.000Z | 2022-03-18T19:53:20.000Z | snowshu/core/utils.py | ankur112358/snowshu | f4f596d08e6441a96fe0adcbc699cf7613fc59e0 | [
"Apache-2.0"
] | 8 | 2020-02-20T00:29:26.000Z | 2022-03-29T14:59:41.000Z | import re
from importlib import import_module
from typing import TYPE_CHECKING, Any, Type, Union
from snowshu.logger import Logger
if TYPE_CHECKING:
from snowshu.adapters.base_sql_adapter import BaseSQLAdapter
from snowshu.adapters.source_adapters.base_source_adapter import BaseSourceAdapter
from snowshu.... | 34.557692 | 119 | 0.662215 | import os
import re
from importlib import import_module
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional, TextIO, Type, Union
import yaml
from snowshu.logger import Logger
if TYPE_CHECKING:
from snowshu.adapters.base_sql_adapter import BaseSQLAdapter
from snowshu.adapters.source_adapt... | 0 | 0 | 0 | 0 | 0 | 884 | 0 | -1 | 113 |
0e4be924e3a16223cf51a4f2906924797d662264 | 1,181 | py | Python | qubits/tests/test_command_line.py | thespacedoctor/qubits | 3c02ace7226389841c6bb838d045c11bed61a3c2 | [
"MIT"
] | 3 | 2018-09-25T09:32:55.000Z | 2021-11-17T11:35:17.000Z | qubits/tests/test_command_line.py | thespacedoctor/qubits | 3c02ace7226389841c6bb838d045c11bed61a3c2 | [
"MIT"
] | 1 | 2018-03-16T16:04:52.000Z | 2018-03-16T16:04:52.000Z | qubits/tests/test_command_line.py | thespacedoctor/qubits | 3c02ace7226389841c6bb838d045c11bed61a3c2 | [
"MIT"
] | 2 | 2017-07-16T08:23:41.000Z | 2021-02-23T12:49:17.000Z | import os
# SETUP AND TEARDOWN FIXTURE FUNCTIONS FOR THE ENTIRE MODULE
def setUpModule():
"set up test fixtures"
moduleDirectory = os.path.dirname(__file__) + "/../tests"
# SETUP PATHS TO COMMONG DIRECTORIES FOR TEST DATA
global pathToOutputDir, pathToInputDir
pathToInputDir = moduleDirectory + ... | 24.102041 | 63 | 0.676545 | import os
import nose
from qubits import command_line as cl
# SETUP AND TEARDOWN FIXTURE FUNCTIONS FOR THE ENTIRE MODULE
def setUpModule():
"set up test fixtures"
moduleDirectory = os.path.dirname(__file__) + "/../tests"
# SETUP PATHS TO COMMONG DIRECTORIES FOR TEST DATA
global pathToOutputDir, path... | 0 | 0 | 0 | 460 | 0 | 0 | 0 | 6 | 90 |
d9fcfba39ce9b0cc4de68124a0d0567151561b88 | 949 | py | Python | tests/components/gree/common.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | tests/components/gree/common.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 60 | 2020-08-03T07:32:56.000Z | 2022-03-31T06:02:07.000Z | tests/components/gree/common.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Common helpers for gree test cases."""
from unittest.mock import AsyncMock, Mock
def build_device_info_mock(
name="fake-device-1", ipAddress="1.1.1.1", mac="aabbcc112233"
):
"""Build mock device info structure."""
mock = Mock(ip=ipAddress, port=7000, mac=mac)
mock.name = name
return mock
def ... | 26.361111 | 85 | 0.621707 | """Common helpers for gree test cases."""
from unittest.mock import AsyncMock, Mock
def build_device_info_mock(
name="fake-device-1", ipAddress="1.1.1.1", mac="aabbcc112233"
):
"""Build mock device info structure."""
mock = Mock(ip=ipAddress, port=7000, mac=mac)
mock.name = name
return mock
def ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b88c584281f4549b3eec2f2391c130cb0a29fd11 | 383 | py | Python | antistasi_console_log_parser/data/regexes.py | Giddius/Antistasi_Console_Log_Parser | 78f8d1807eb1bde78578c0836110691e286e6935 | [
"MIT"
] | null | null | null | antistasi_console_log_parser/data/regexes.py | Giddius/Antistasi_Console_Log_Parser | 78f8d1807eb1bde78578c0836110691e286e6935 | [
"MIT"
] | null | null | null | antistasi_console_log_parser/data/regexes.py | Giddius/Antistasi_Console_Log_Parser | 78f8d1807eb1bde78578c0836110691e286e6935 | [
"MIT"
] | null | null | null | import re
PLAYER_NAME_AND_ID_REGEX = re.compile(r"[\s\d]\d\:[0123456]\d\:[0123456]\d\sPlayer\s(?P<player_name>(?!headlessclient).*)\s(connected)\s\(id\=(?P<steam_id>\d+)\)", re.IGNORECASE)
CONNECT_REGEX = re.compile(r"^\s?(?P<hour>[0-24]?\d)\:(?P<minute>[0123456]\d)\:(?P<second>[0123456]\d)\sPlayer\s(?P<player_name>... | 54.714286 | 190 | 0.644909 | import re
PLAYER_NAME_AND_ID_REGEX = re.compile(r"[\s\d]\d\:[0123456]\d\:[0123456]\d\sPlayer\s(?P<player_name>(?!headlessclient).*)\s(connected)\s\(id\=(?P<steam_id>\d+)\)", re.IGNORECASE)
CONNECT_REGEX = re.compile(r"^\s?(?P<hour>[0-24]?\d)\:(?P<minute>[0123456]\d)\:(?P<second>[0123456]\d)\sPlayer\s(?P<player_name>... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bd4a98586fcf4264f4c4a9d5624254f4cb4c8da5 | 209 | py | Python | calenderprogram.py | Ratheshprabakar/Python-Programs | fca9d4f0b5f5f5693b3d7e25c6d890f4973dc19e | [
"MIT"
] | 2 | 2019-07-10T06:32:05.000Z | 2019-11-13T07:52:53.000Z | calenderprogram.py | Ratheshprabakar/Python-Programs | fca9d4f0b5f5f5693b3d7e25c6d890f4973dc19e | [
"MIT"
] | null | null | null | calenderprogram.py | Ratheshprabakar/Python-Programs | fca9d4f0b5f5f5693b3d7e25c6d890f4973dc19e | [
"MIT"
] | 1 | 2019-10-12T06:56:13.000Z | 2019-10-12T06:56:13.000Z | #Python program to display calender for particular month
if __name__=='__main__':
main()
| 23.222222 | 56 | 0.717703 | #Python program to display calender for particular month
import calendar
def main():
x=int(input("Enter Month:\t"))
y=int(input("Enter Year:\t"))
print(calendar.month(y,x))
if __name__=='__main__':
main()
| 0 | 0 | 0 | 0 | 0 | 81 | 0 | -6 | 44 |
147dbc6eba3bcf4488dfba6d28ede59cd9ff8496 | 1,718 | py | Python | examples/pybullet/gym/pybullet_envs/ARS/train_ars.py | arocchi/bullet3 | 5183ee51b1bf0fa5c3c3636299bbae0d85bb5c5a | [
"Zlib"
] | null | null | null | examples/pybullet/gym/pybullet_envs/ARS/train_ars.py | arocchi/bullet3 | 5183ee51b1bf0fa5c3c3636299bbae0d85bb5c5a | [
"Zlib"
] | null | null | null | examples/pybullet/gym/pybullet_envs/ARS/train_ars.py | arocchi/bullet3 | 5183ee51b1bf0fa5c3c3636299bbae0d85bb5c5a | [
"Zlib"
] | null | null | null | """TODO(jietan): DO NOT SUBMIT without one-line documentation for train_ars.
blaze build -c opt //experimental/users/jietan/ARS:train_ars
blaze-bin/experimental/users/jietan/ARS/train_ars \
--logdir=/cns/ij-d/home/jietan/experiment/ARS/test1 \
--config_name=MINITAUR_GYM_CONFIG
"""
from __future__ import absolute_impo... | 26.430769 | 87 | 0.718277 | """TODO(jietan): DO NOT SUBMIT without one-line documentation for train_ars.
blaze build -c opt //experimental/users/jietan/ARS:train_ars
blaze-bin/experimental/users/jietan/ARS/train_ars \
--logdir=/cns/ij-d/home/jietan/experiment/ARS/test1 \
--config_name=MINITAUR_GYM_CONFIG
"""
from __future__ import absolute_impo... | 0 | 0 | 0 | 0 | 0 | 887 | 0 | -27 | 113 |
c04c45ad30a303bbe84b500bf7cd221213d8b9ac | 5,885 | py | Python | lab4/traces-driver.py | CaoYuchen/CMU15513 | 753a46c80df238699b316c518b29d114ca19e52d | [
"MIT"
] | 2 | 2022-03-19T21:29:37.000Z | 2022-03-20T16:31:11.000Z | lab4/traces-driver.py | CaoYuchen/CMU15513 | 753a46c80df238699b316c518b29d114ca19e52d | [
"MIT"
] | null | null | null | lab4/traces-driver.py | CaoYuchen/CMU15513 | 753a46c80df238699b316c518b29d114ca19e52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
This file tests student written cachelab traces. It tests them by running
traces on csim-ref and comparing the hits/misses/evictions with the expected
hits/misses/evictions. It also checks if the trace is well formatted.
If run with the -f [tracefile] it only judges whether tracefile is wel... | 29.133663 | 93 | 0.592014 | #!/usr/bin/env python3
'''
This file tests student written cachelab traces. It tests them by running
traces on csim-ref and comparing the hits/misses/evictions with the expected
hits/misses/evictions. It also checks if the trace is well formatted.
If run with the -f [tracefile] it only judges whether tracefile is wel... | 0 | 0 | 0 | 0 | 0 | 1,960 | 0 | -6 | 68 |
3555ffd5cdaeb4bc65bc9f813dc54f6811eb6978 | 3,046 | py | Python | imagenet/imagenet_sis_training_util.py | b-carter/overinterpretation | 211d25c83d97e3238109e5c611c1af696989d3b6 | [
"MIT"
] | 16 | 2021-11-02T09:53:35.000Z | 2022-02-16T11:42:35.000Z | imagenet/imagenet_sis_training_util.py | b-carter/overinterpretation | 211d25c83d97e3238109e5c611c1af696989d3b6 | [
"MIT"
] | 1 | 2021-12-30T17:33:11.000Z | 2021-12-30T17:33:11.000Z | imagenet/imagenet_sis_training_util.py | b-carter/overinterpretation | 211d25c83d97e3238109e5c611c1af696989d3b6 | [
"MIT"
] | 4 | 2021-12-18T12:48:55.000Z | 2022-02-16T09:35:17.000Z | """Util for training on SIS/backselect subsets."""
| 36.698795 | 78 | 0.677282 | """Util for training on SIS/backselect subsets."""
import glob
import numpy as np
import os
import torch
import torchvision
import imagenet_backselect
def _get_basename_without_extension(filepath):
return os.path.basename(filepath).split('.')[0]
class BackselectSubsetsImageNetDataset(torchvision.datasets.Imag... | 0 | 0 | 0 | 2,768 | 0 | 77 | 0 | -32 | 180 |
8188af67924b5573f186e861a45e5998b8cd5c58 | 37,456 | py | Python | commp.py | jkjium/pyMAVEN | 977f1e43145601ce4a61a2e01261858fd4c2be43 | [
"MIT"
] | null | null | null | commp.py | jkjium/pyMAVEN | 977f1e43145601ce4a61a2e01261858fd4c2be43 | [
"MIT"
] | null | null | null | commp.py | jkjium/pyMAVEN | 977f1e43145601ce4a61a2e01261858fd4c2be43 | [
"MIT"
] | null | null | null | import time
import numpy as np
# for testing drun dcall
illab =['/', '+', '?', '*', '&', '$', '\\']
gaps = ['.','-',' ']
# abnormal AA
abaa = ['.','-','*','X','Z','U','B','O','J']
# ambiguous AA
ambaa = ['X','Z','U','B','O']
aafull = ['A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M',... | 43.003444 | 1,153 | 0.46265 | import sys
import os
import time
import math
from itertools import groupby
import operator as op
import numpy as np
from scipy.cluster.hierarchy import dendrogram
from scipy.cluster.hierarchy import linkage
from scipy.cluster.hierarchy import fcluster
import itertools
import inspect
import collections
... | 0 | 0 | 0 | 0 | 231 | 13,553 | 0 | 26 | 984 |
3160d6cb87623716e4abf34ad58c528aaacbfd09 | 1,643 | py | Python | server/modules/friends.py | cs460-group1/chat-server | e7d0f799f401bce8b1b776193e5ad2b3ee8c8bbf | [
"MIT"
] | 1 | 2016-05-03T22:04:07.000Z | 2016-05-03T22:04:07.000Z | server/modules/friends.py | cs460-group1/chat-server | e7d0f799f401bce8b1b776193e5ad2b3ee8c8bbf | [
"MIT"
] | null | null | null | server/modules/friends.py | cs460-group1/chat-server | e7d0f799f401bce8b1b776193e5ad2b3ee8c8bbf | [
"MIT"
] | null | null | null |
"""
Manages friend connections between users.
"""
manager = FriendManager()
| 26.5 | 82 | 0.628728 | from server.modules import accounts
import pickle
"""
Manages friend connections between users.
"""
class FriendManager:
def __init__(self):
try:
with open('friends.pickle', 'rb') as f:
self.friends = pickle.load(f)
except FileNotFoundError:
self.friends = {... | 0 | 0 | 0 | 1,491 | 0 | 0 | 0 | 6 | 66 |
9c5fc9cee19eaf97d1aa2472f728eeff0be3ebd9 | 10,468 | py | Python | ilv/vis_log.py | yuyu2172/ilv | e9d9ca6d3d3c8653ac5b2959193c7ebd2738fa6a | [
"MIT"
] | null | null | null | ilv/vis_log.py | yuyu2172/ilv | e9d9ca6d3d3c8653ac5b2959193c7ebd2738fa6a | [
"MIT"
] | null | null | null | ilv/vis_log.py | yuyu2172/ilv | e9d9ca6d3d3c8653ac5b2959193c7ebd2738fa6a | [
"MIT"
] | null | null | null | import bokeh.plotting
import bokeh.models.layouts
import collections
import numpy as np
import warnings
from ilv.utils import filter_dict
from ilv.utils import list_of_dict_to_dict_of_list
np.random.seed(1)
colors_10_indices = np.random.permutation(10)
colors_255_indices = np.random.permutation(255)
def get_valid_... | 36.989399 | 82 | 0.624475 | import bokeh.plotting
import bokeh.models.layouts
import collections
import numpy as np
import warnings
from ilv.utils import filter_dict
from ilv.utils import list_of_dict_to_dict_of_list
from ilv.utils import moving_average_1d
np.random.seed(1)
colors_10_indices = np.random.permutation(10)
colors_255_indices = np.... | 0 | 0 | 0 | 0 | 0 | 1,841 | 0 | 18 | 48 |
2f2fdfe7bbf693fa943e54c5e6b6a42471543a51 | 5,786 | py | Python | dynaconf/vendor/click/termui.py | sephiartlist/dynaconf | 9c5f60b289c1f0fa3f899f1962a8fe5712c74eab | [
"MIT"
] | 2,293 | 2015-08-14T22:39:31.000Z | 2022-03-31T12:44:49.000Z | dynaconf/vendor/click/termui.py | sephiartlist/dynaconf | 9c5f60b289c1f0fa3f899f1962a8fe5712c74eab | [
"MIT"
] | 676 | 2015-08-20T19:29:56.000Z | 2022-03-31T13:45:51.000Z | dynaconf/vendor/click/termui.py | sephiartlist/dynaconf | 9c5f60b289c1f0fa3f899f1962a8fe5712c74eab | [
"MIT"
] | 255 | 2015-12-02T21:16:33.000Z | 2022-03-20T22:03:46.000Z | _C=True
_B=False
_A=None
visible_prompt_func=input
_ansi_colors={'black':30,'red':31,'green':32,'yellow':33,'blue':34,'magenta':35,'cyan':36,'white':37,'reset':39,'bright_black':90,'bright_red':91,'bright_green':92,'bright_yellow':93,'bright_blue':94,'bright_magenta':95,'bright_cyan':96,'bright_white':97}
_ansi_reset_a... | 42.859259 | 560 | 0.736606 | _C=True
_B=False
_A=None
import inspect,io,itertools,os,struct,sys
from ._compat import DEFAULT_COLUMNS,get_winterm_size,isatty,strip_ansi,WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
from .types... | 0 | 0 | 0 | 0 | 0 | 4,708 | 0 | 140 | 594 |
72e83a7fc117c891a0d942f6a5803722df510fa3 | 5,333 | py | Python | disent/data/groundtruth/_xyobject.py | neonkitchen/disent | 0f45fefea03473690dfdbf48ef83f6e17ca9b8b3 | [
"MIT"
] | null | null | null | disent/data/groundtruth/_xyobject.py | neonkitchen/disent | 0f45fefea03473690dfdbf48ef83f6e17ca9b8b3 | [
"MIT"
] | null | null | null | disent/data/groundtruth/_xyobject.py | neonkitchen/disent | 0f45fefea03473690dfdbf48ef83f6e17ca9b8b3 | [
"MIT"
] | 1 | 2022-01-18T06:43:33.000Z | 2022-01-18T06:43:33.000Z | # ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2021 Nathan Juraj Michlo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Softwar... | 35.317881 | 142 | 0.508532 | # ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2021 Nathan Juraj Michlo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Softwar... | 0 | 235 | 0 | 2,993 | 0 | 0 | 0 | 35 | 90 |
0faa394c0bc104df623c3935921a4a91f036c076 | 1,188 | py | Python | utils.py | MingyuLi19910814/pix2pix-Anime-Sketch-Colorization-Pytorch | 3543190b1116c9d979f8cfc95bdc8f23d49d20e6 | [
"MIT"
] | 1 | 2022-02-15T06:04:40.000Z | 2022-02-15T06:04:40.000Z | utils.py | MingyuLi19910814/pix2pix-Anime-Sketch-Colorization-Pytorch | 3543190b1116c9d979f8cfc95bdc8f23d49d20e6 | [
"MIT"
] | null | null | null | utils.py | MingyuLi19910814/pix2pix-Anime-Sketch-Colorization-Pytorch | 3543190b1116c9d979f8cfc95bdc8f23d49d20e6 | [
"MIT"
] | null | null | null | from torchvision import transforms
from torchvision.datasets import ImageFolder
from torch.utils.data.dataloader import DataLoader
from config import cfg
import os
import shutil
def get_dataloader(path, shuffle=True):
"""
create a Dataloader of the images in the folder
:param path: path containing the imag... | 34.941176 | 76 | 0.636364 | from torchvision import transforms
from torchvision.datasets import ImageFolder
from torch.utils.data.dataloader import DataLoader
from config import cfg
import os
import shutil
def get_dataloader(path, shuffle=True):
"""
create a Dataloader of the images in the folder
:param path: path containing the imag... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
98d3b032d4d7191b2744b3e74cb3ec52eccd9d59 | 26,837 | py | Python | src/telegram.py | chrishasl/SmartNodeMonitorBot | 62a76a6d92ec62cee4b1d95b1e4a71ada1a3ec53 | [
"MIT"
] | null | null | null | src/telegram.py | chrishasl/SmartNodeMonitorBot | 62a76a6d92ec62cee4b1d95b1e4a71ada1a3ec53 | [
"MIT"
] | null | null | null | src/telegram.py | chrishasl/SmartNodeMonitorBot | 62a76a6d92ec62cee4b1d95b1e4a71ada1a3ec53 | [
"MIT"
] | null | null | null | ##
# Part of `SmartNodeMonitorBot`
#
# Copyright 2018 dustinface
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 32.294826 | 113 | 0.592056 | ##
# Part of `SmartNodeMonitorBot`
#
# Copyright 2018 dustinface
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 0 | 0 | 0 | 24,716 | 0 | 0 | 0 | 233 | 445 |
22d2df13043324573ead66b0b22ac1073f674b83 | 3,641 | py | Python | train_predict/load_model_not_exclusions.py | Swarchal/transfer_learning_across_cell_lines | 2e17c37267a1d03d67340fdb99cf9c1c1a0ebe12 | [
"MIT"
] | null | null | null | train_predict/load_model_not_exclusions.py | Swarchal/transfer_learning_across_cell_lines | 2e17c37267a1d03d67340fdb99cf9c1c1a0ebe12 | [
"MIT"
] | null | null | null | train_predict/load_model_not_exclusions.py | Swarchal/transfer_learning_across_cell_lines | 2e17c37267a1d03d67340fdb99cf9c1c1a0ebe12 | [
"MIT"
] | null | null | null | """
module docstring
"""
import os
import sys
import torch
import glob
from random import shuffle
import numpy as np
from PIL import Image
from torch import nn
from torch.autograd import Variable
from torchvision import models, transforms
def load_model(state_dict_path):
"""load a pretrained model"""
model_st... | 33.712963 | 159 | 0.700906 | """
module docstring
"""
import os
import sys
import torch
import glob
from random import shuffle
import numpy as np
from PIL import Image
from skimage import io
from torch import nn
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
from torchvision import models, transforms
import ma... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 38 | 66 |
cecc124801fec60a1ee8a0fb79ecc4941d1c35ac | 341 | py | Python | dp_conceptual_search/api/healthcheck/services.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | 3 | 2018-05-10T16:49:27.000Z | 2022-03-29T15:23:04.000Z | dp_conceptual_search/api/healthcheck/services.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | 2 | 2018-09-20T06:37:27.000Z | 2018-11-12T12:05:08.000Z | dp_conceptual_search/api/healthcheck/services.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | 3 | 2018-06-25T10:48:43.000Z | 2021-04-11T08:01:27.000Z | """
Define an enum of all services to health check
"""
| 24.357143 | 73 | 0.803519 | """
Define an enum of all services to health check
"""
from .healthchecks.healthcheck import HealthCheck
from .healthchecks import ElasticsearchHealthCheck, DpFastTextHealthCheck
from enum import Enum
class Service(Enum):
elasticsearch: HealthCheck = ElasticsearchHealthCheck()
dp_fasttext: HealthCheck = DpF... | 0 | 0 | 0 | 114 | 0 | 0 | 0 | 80 | 91 |
a3d65e4ed8eab5699bf05495b2d748ac709915fb | 1,458 | py | Python | lib/common/error.py | smallstrong0/easy_python | c6794bf290731beb9b3cab94f815880befb37d9b | [
"MIT"
] | 2 | 2020-09-16T09:32:09.000Z | 2021-02-10T12:09:40.000Z | lib/common/error.py | smallstrong0/easy_python | c6794bf290731beb9b3cab94f815880befb37d9b | [
"MIT"
] | null | null | null | lib/common/error.py | smallstrong0/easy_python | c6794bf290731beb9b3cab94f815880befb37d9b | [
"MIT"
] | null | null | null | # ! /usr/bin/env python
# -*- coding: utf-8 -*-
status_0 = dict(status_code=405, reason='Method not allowed.')
status_1 = dict(status_code=404, reason='API not found.')
#
#
| 28.038462 | 65 | 0.638546 | # ! /usr/bin/env python
# -*- coding: utf-8 -*-
from enum import Enum
from tornado.web import HTTPError
status_0 = dict(status_code=405, reason='Method not allowed.')
status_1 = dict(status_code=404, reason='API not found.')
class BMCError(HTTPError):
def __init__(self, error):
if isinstance(error, tupl... | 399 | 0 | 0 | 996 | 0 | 0 | 0 | 12 | 135 |
c4227b0c30d4f78bec2a43c1f846bc4c5aab1df0 | 2,815 | py | Python | model/medical_inpatient_medication.py | IDRISSOUM/hospital_management | 56a768f29269a77bc890d40479a8aacb90867189 | [
"Unlicense"
] | null | null | null | model/medical_inpatient_medication.py | IDRISSOUM/hospital_management | 56a768f29269a77bc890d40479a8aacb90867189 | [
"Unlicense"
] | null | null | null | model/medical_inpatient_medication.py | IDRISSOUM/hospital_management | 56a768f29269a77bc890d40479a8aacb90867189 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of BrowseInfo. See LICENSE file for full copyright and licensing details.
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:s
| 61.195652 | 150 | 0.647957 | # -*- coding: utf-8 -*-
# Part of BrowseInfo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, _
from datetime import date,datetime
class medical_inpatient_medication(models.Model):
_name = 'medical.inpatient.medication'
_rec_name = 'medical_medicament_id'
... | 0 | 0 | 0 | 2,543 | 0 | 0 | 0 | 31 | 68 |
31be14b649c4c5f9b77438eb1c5afdf4d4a29ad6 | 1,995 | py | Python | face-detection.py | twesix-learn/python-opencv | 6adac53f1ebdbe0e1f8b62a03c872571277a06ba | [
"MIT"
] | null | null | null | face-detection.py | twesix-learn/python-opencv | 6adac53f1ebdbe0e1f8b62a03c872571277a06ba | [
"MIT"
] | null | null | null | face-detection.py | twesix-learn/python-opencv | 6adac53f1ebdbe0e1f8b62a03c872571277a06ba | [
"MIT"
] | null | null | null | import cv2 as cv
WIDTH = 400
HEIGHT = 300
ID_WIDTH = 3
ID_HEIGHT = 4
cap = cv.VideoCapture(0)
cap.set(ID_WIDTH, WIDTH)
cap.set(ID_HEIGHT, HEIGHT)
face_engine = cv.CascadeClassifier('data/haarcascades/haarcascade_frontalface_default.xml')
eye_engine = cv.CascadeClassifier('data/haarcascades/haarcascade_eye.xml')
smile... | 33.25 | 113 | 0.542857 | import cv2 as cv
WIDTH = 400
HEIGHT = 300
ID_WIDTH = 3
ID_HEIGHT = 4
cap = cv.VideoCapture(0)
cap.set(ID_WIDTH, WIDTH)
cap.set(ID_HEIGHT, HEIGHT)
face_engine = cv.CascadeClassifier('data/haarcascades/haarcascade_frontalface_default.xml')
eye_engine = cv.CascadeClassifier('data/haarcascades/haarcascade_eye.xml')
smile... | 36 | 0 | 0 | 0 | 0 | 1,553 | 0 | 0 | 23 |
66795b1e7e079f496a683d1ef32c03b15d195ceb | 10,900 | py | Python | Project/find_lane_pixels.py | anastasia-spb/CarND-Advanced-Lane-Lines | d7eef2fccbfb639abb4e8b98b5169f0a45e1d448 | [
"MIT"
] | null | null | null | Project/find_lane_pixels.py | anastasia-spb/CarND-Advanced-Lane-Lines | d7eef2fccbfb639abb4e8b98b5169f0a45e1d448 | [
"MIT"
] | null | null | null | Project/find_lane_pixels.py | anastasia-spb/CarND-Advanced-Lane-Lines | d7eef2fccbfb639abb4e8b98b5169f0a45e1d448 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
def find_good_indexis_in_window(out_img, window_idx, nonzerox, nonzeroy, window_height, current_pos, margin=100,
visu=False):
'''
Calculate good (==nonzero) indices inside sliding window defined by input ... | 38.928571 | 135 | 0.685872 | import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
import find_lane_pixels_convolution
def find_good_indexis_in_window(out_img, window_idx, nonzerox, nonzeroy, window_height, current_pos, margin=100,
visu=False):
'''
Calculate good (==nonzero) indices ins... | 0 | 0 | 0 | 0 | 0 | 497 | 0 | 14 | 45 |
0a968dc3fa12c99cb47ff7c3b761ed573e767f28 | 383 | py | Python | exercicios-Python/desaf79.py | marcelo-py/Exercicios-Python | d654d54821983897dbc377a2d3db97671dd75b5b | [
"MIT"
] | null | null | null | exercicios-Python/desaf79.py | marcelo-py/Exercicios-Python | d654d54821983897dbc377a2d3db97671dd75b5b | [
"MIT"
] | null | null | null | exercicios-Python/desaf79.py | marcelo-py/Exercicios-Python | d654d54821983897dbc377a2d3db97671dd75b5b | [
"MIT"
] | null | null | null | numero = []
while True:
numeros = int(input('Digite um nmero '))
if numeros not in numero:
numero.append(numeros)
numero.sort()
else:
print('Valor duplicado! Ignorado')
sn = str(input('Deseja continuar? [S/N]: '))
while not sn in 'SsNn':
sn = str(input('Deseja continu... | 25.533333 | 52 | 0.569191 | numero = []
while True:
numeros = int(input('Digite um número '))
if numeros not in numero:
numero.append(numeros)
numero.sort()
else:
print('Valor duplicado! Ignorado')
sn = str(input('Deseja continuar? [S/N]: '))
while not sn in 'SsNn':
sn = str(input('Deseja contin... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
adc45c092330ec7b33253166f13e805f32a5f21b | 4,758 | py | Python | Image_preprocess.py | lixuekai2001/Deep-learning-aided-porous-media-hydrodynamic-analysis-and-three-dimensional-reconstruction | 193c9bf8dc0571b4c3f639ad4fd10aef7b0dda10 | [
"Apache-2.0"
] | 3 | 2022-02-17T12:40:37.000Z | 2022-03-24T20:25:52.000Z | Image_preprocess.py | HuysmanWang/Deep-learning-aided-porous-media-hydrodynamic-analysis-and-three-dimensional-reconstruction | 193c9bf8dc0571b4c3f639ad4fd10aef7b0dda10 | [
"Apache-2.0"
] | null | null | null | Image_preprocess.py | HuysmanWang/Deep-learning-aided-porous-media-hydrodynamic-analysis-and-three-dimensional-reconstruction | 193c9bf8dc0571b4c3f639ad4fd10aef7b0dda10 | [
"Apache-2.0"
] | null | null | null | #Any image input no matter what scale it belongs, should through following steps that used for Image segmentation task
#Including two parts:
# 1. Segmentation training set prepare 8000->800->choose 5 label->label me
# 2. Segmentation model predict
########################################
out_folder = 'H:/tmp/DEEP_WA... | 33.744681 | 118 | 0.688525 | #Any image input no matter what scale it belongs, should through following steps that used for Image segmentation task
#Including two parts:
# 1. Segmentation training set prepare 8000->800->choose 5 label->label me
# 2. Segmentation model predict
from PIL import Image
import cv2
import os
import random
import json
... | 306 | 0 | 0 | 0 | 0 | 3,538 | 0 | -51 | 338 |
30f4e51e9457320f48033005baae3d7aa65016b1 | 21,442 | py | Python | test/transforms.py | DefTruth/landmarksaug | 71d978a062e4a7c8fe90ca62c8dff109ea7718e7 | [
"MIT"
] | 56 | 2022-02-08T06:45:02.000Z | 2022-03-27T14:03:08.000Z | test/transforms.py | DefTruth/pylandmarks | 71d978a062e4a7c8fe90ca62c8dff109ea7718e7 | [
"MIT"
] | 9 | 2022-02-15T12:32:34.000Z | 2022-03-31T14:12:06.000Z | test/transforms.py | DefTruth/pylandmarks | 71d978a062e4a7c8fe90ca62c8dff109ea7718e7 | [
"MIT"
] | 8 | 2022-02-15T09:17:51.000Z | 2022-03-27T14:03:08.000Z | # import albumentations
import torchlm
if __name__ == "__main__":
print(torchlm.albumentations_is_available())
test_torchlm_transforms_pipeline()
test_torchlm_transform_mask()
test_torchlm_transform_patches_mixup()
test_torchlm_transform_backgrounds_mixup()
test_torchlm_transf... | 34.752026 | 100 | 0.682725 | import cv2
import numpy as np
import torchvision
# import albumentations
from torch import Tensor
from typing import Tuple
import torchlm
def callable_array_noop(
img: np.ndarray,
landmarks: np.ndarray
) -> Tuple[np.ndarray, np.ndarray]:
# Do some transform here ...
return img.astype(np.uint3... | 0 | 0 | 0 | 0 | 0 | 20,280 | 0 | -11 | 478 |
58f92e5aafd1bca0b5099b6f6ba5284e3b254216 | 15,037 | py | Python | pytest_localstack/session.py | xiang-zhu/pytest-localstack | cc0e3e359e51381e4ccc148f6ca6a8b80aaf0051 | [
"MIT"
] | null | null | null | pytest_localstack/session.py | xiang-zhu/pytest-localstack | cc0e3e359e51381e4ccc148f6ca6a8b80aaf0051 | [
"MIT"
] | null | null | null | pytest_localstack/session.py | xiang-zhu/pytest-localstack | cc0e3e359e51381e4ccc148f6ca6a8b80aaf0051 | [
"MIT"
] | null | null | null | """Run and interact with a Localstack container."""
import logging
import os
import string
logger = logging.getLogger(__name__)
def generate_container_name():
"""Generate a random name for a Localstack container."""
valid_chars = set(string.ascii_letters)
chars = []
while len(chars) < 6:
ne... | 36.67561 | 86 | 0.612489 | """Run and interact with a Localstack container."""
import logging
import os
import string
import time
from copy import copy
from packaging import version
from pytest_localstack import (
constants,
container,
exceptions,
plugin,
service_checks,
utils,
)
logger = logging.getLogger(__name__)
... | 0 | 437 | 0 | 13,881 | 0 | 0 | 0 | 99 | 136 |
4918724c0c4afe3ed2727c4e18a1d4f3b57d1839 | 16,719 | py | Python | scripts/add_doc_comments.py | f0rki/capstone-sys | 83544fb3724732bfdffbc947c9fa348f3a9bedbb | [
"MIT"
] | 2 | 2018-07-21T16:37:18.000Z | 2018-12-13T18:43:09.000Z | scripts/add_doc_comments.py | f0rki/capstone-sys | 83544fb3724732bfdffbc947c9fa348f3a9bedbb | [
"MIT"
] | null | null | null | scripts/add_doc_comments.py | f0rki/capstone-sys | 83544fb3724732bfdffbc947c9fa348f3a9bedbb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Apply a patch that adds Rust doc comments to bindgen-generated Rust source.
To run unittests:
python -m unittest -v add_doc_comments
"""
# pylint: disable=too-few-public-methods
from __future__ import print_function
import argparse
import logging
import re
INDENT_PAT = re.compile(r'... | 29.383128 | 80 | 0.597404 | #!/usr/bin/env python
"""
Apply a patch that adds Rust doc comments to bindgen-generated Rust source.
To run unittests:
python -m unittest -v add_doc_comments
"""
# pylint: disable=too-few-public-methods
from __future__ import print_function
import argparse
import logging
import re
import unittest
INDENT_PAT... | 0 | 0 | 0 | 5,328 | 2,018 | 251 | 0 | -6 | 321 |
e68cbe53b19211abab9194df5d2cd7ba4c98e406 | 310 | py | Python | bench/cacheout.py | scopatz/PyTables | 05a74def785688abd802224a5ba44393a701ebc7 | [
"BSD-3-Clause"
] | 9 | 2021-09-28T05:20:22.000Z | 2022-03-16T11:09:06.000Z | bench/cacheout.py | scopatz/PyTables | 05a74def785688abd802224a5ba44393a701ebc7 | [
"BSD-3-Clause"
] | null | null | null | bench/cacheout.py | scopatz/PyTables | 05a74def785688abd802224a5ba44393a701ebc7 | [
"BSD-3-Clause"
] | 9 | 2018-09-14T02:42:36.000Z | 2021-07-12T02:37:45.000Z | # Program to clean out the filesystem cache
import numpy
a = numpy.arange(1000 * 100 * 125, dtype='f8') # 100 MB of RAM
b = a * 3 # Another 100 MB
# delete the reference to the booked memory
del a
del b
# Do a loop to fully recharge the python interpreter
j = 2
for i in range(1000 * 1000):
j += i * 2
| 22.142857 | 63 | 0.674194 | # Program to clean out the filesystem cache
import numpy
a = numpy.arange(1000 * 100 * 125, dtype='f8') # 100 MB of RAM
b = a * 3 # Another 100 MB
# delete the reference to the booked memory
del a
del b
# Do a loop to fully recharge the python interpreter
j = 2
for i in range(1000 * 1000):
j += i * 2
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cd581c1618f740914bd9b2e1f617f1cae66a455c | 936 | py | Python | load_camera_info_test.py | drewm1980/multi_view_stereo_benchmark | 748bfa1ca09a53f27c95a2bd0c7750831821b85c | [
"MIT"
] | 6 | 2016-10-28T13:58:33.000Z | 2022-03-03T08:29:58.000Z | load_camera_info_test.py | drewm1980/multi_view_stereo_benchmark | 748bfa1ca09a53f27c95a2bd0c7750831821b85c | [
"MIT"
] | null | null | null | load_camera_info_test.py | drewm1980/multi_view_stereo_benchmark | 748bfa1ca09a53f27c95a2bd0c7750831821b85c | [
"MIT"
] | 5 | 2016-10-28T15:33:18.000Z | 2020-10-07T14:57:59.000Z | #!/usr/bin/env python3
# Test code for functions that load halcon intrinsics and extrinsics
testDataPath = Path('data_for_unit_tests/extrinsics_for_testing')
if __name__=='__main__':
test_that_pose_types_are_consistent()
| 44.571429 | 148 | 0.737179 | #!/usr/bin/env python3
# Test code for functions that load halcon intrinsics and extrinsics
from load_camera_info import *
testDataPath = Path('data_for_unit_tests/extrinsics_for_testing')
def test_that_pose_types_are_consistent():
num_cameras = 12
for i in range(num_cameras):
file_path_homogeneous =... | 0 | 0 | 0 | 0 | 0 | 654 | 0 | 9 | 45 |
2425cf1b875c42fe6fcd8c3971fd6883419e2956 | 5,691 | py | Python | dataset/AoDist_dataset.py | priestlab/aorta_houghcircle | ebf87dcc95c96413f345777a9c0d26df8e9bf3fc | [
"Apache-2.0"
] | 2 | 2020-09-05T13:40:01.000Z | 2021-07-05T16:55:27.000Z | dataset/AoDist_dataset.py | priestlab/aorta_houghcircle | ebf87dcc95c96413f345777a9c0d26df8e9bf3fc | [
"Apache-2.0"
] | null | null | null | dataset/AoDist_dataset.py | priestlab/aorta_houghcircle | ebf87dcc95c96413f345777a9c0d26df8e9bf3fc | [
"Apache-2.0"
] | null | null | null | from __future__ import division
import numpy as np
from skimage.exposure import rescale_intensity
from scipy.ndimage import center_of_mass
from dataset.processing import CropResize
##################################################
## resize to (196, 196), then crop down
## to (128, 128), so lose 34 pixels on eac... | 33.674556 | 86 | 0.599192 | from __future__ import division
import numpy as np
from pydicom import dcmread
from pydicom.filebase import DicomBytesIO
from zipfile import ZipFile
from torch.utils.data import Dataset
from skimage.exposure import rescale_intensity
import pandas as pd
from scipy.ndimage import center_of_mass
from dataset.processing... | 0 | 0 | 0 | 2,175 | 0 | 1,641 | 0 | 64 | 201 |
7cce13d6b49c59e064c0b3655e99a28e284fff0a | 572 | py | Python | students/K33401/laboratory_works/Kasatkin_Daniil/LR1/Task_2/server.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 57c0eef5e1f413c7f031ee001d59e5122f990f26 | [
"MIT"
] | 7 | 2021-09-02T08:20:58.000Z | 2022-01-12T11:48:07.000Z | students/K33401/laboratory_works/Kasatkin_Daniil/LR1/Task_2/server.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 57c0eef5e1f413c7f031ee001d59e5122f990f26 | [
"MIT"
] | 76 | 2021-09-17T23:01:50.000Z | 2022-03-18T16:42:03.000Z | students/K33401/laboratory_works/Kasatkin_Daniil/LR1/Task_2/server.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 57c0eef5e1f413c7f031ee001d59e5122f990f26 | [
"MIT"
] | 60 | 2021-09-04T16:47:39.000Z | 2022-03-21T04:41:27.000Z | import socket
import math
server = socket.socket()
host = '127.0.0.1'
port = 8000
server.bind((host, port))
print('Start on:', host, port)
print('URL', (host, port))
server.listen(5)
while True:
conn, (client_host, client_port) = server.accept()
print('Got connection', client_host, client_port)
... | 26 | 66 | 0.631119 | import random
import socket
import time
import math
server = socket.socket()
host = '127.0.0.1'
port = 8000
server.bind((host, port))
print('Start on:', host, port)
print('URL', (host, port))
server.listen(5)
while True:
conn, (client_host, client_port) = server.accept()
print('Got connection', c... | 26 | 0 | 0 | 0 | 0 | 0 | 0 | -18 | 46 |
b9a76f20f5fc597be8673eb5a3fb54a3da5aaf3f | 15,636 | py | Python | playbooks/monitoring/files/sensu_plugins/check_3ware_raid.py | blueboxjesse/ursula | c1318ac84a60110d61df745b744d493b5fc2dabf | [
"MIT"
] | null | null | null | playbooks/monitoring/files/sensu_plugins/check_3ware_raid.py | blueboxjesse/ursula | c1318ac84a60110d61df745b744d493b5fc2dabf | [
"MIT"
] | null | null | null | playbooks/monitoring/files/sensu_plugins/check_3ware_raid.py | blueboxjesse/ursula | c1318ac84a60110d61df745b744d493b5fc2dabf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Author: Hari Sekhon
# Date: 2007-02-20 17:49:00 +0000 (Tue, 20 Feb 2007)
#
# http://github.com/harisekhon
#
# License: see accompanying LICENSE file
#
"""Nagios plugin to test the state of all 3ware raid arrays and/or drives
on all 3ware controllers on the local machine. Requires the t... | 33.197452 | 82 | 0.538309 | #!/usr/bin/env python
#
# Author: Hari Sekhon
# Date: 2007-02-20 17:49:00 +0000 (Tue, 20 Feb 2007)
#
# http://github.com/harisekhon
#
# License: see accompanying LICENSE file
#
"""Nagios plugin to test the state of all 3ware raid arrays and/or drives
on all 3ware controllers on the local machine. Requires the t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7682fc21b3bbaf6bb08a6112976b7e9a85474dba | 380 | py | Python | keras2saved_model.py | tfkeras/food101-cloudml | 1c44a26d65f09c547164b2f00a273ce6854db936 | [
"Apache-2.0"
] | 1 | 2021-06-22T02:16:39.000Z | 2021-06-22T02:16:39.000Z | keras2saved_model.py | tfandkusu/food101-cloudml | 1c44a26d65f09c547164b2f00a273ce6854db936 | [
"Apache-2.0"
] | null | null | null | keras2saved_model.py | tfandkusu/food101-cloudml | 1c44a26d65f09c547164b2f00a273ce6854db936 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import model
import shutil
# Keras
model = model.make()
#
model.load_weights("weight.hdf5")
# TensorFlow
sess = tf.keras.backend.get_session()
# SavedModel
shutil.rmtree("saved_model/",True)
tf.saved_model.simple_save(sess,"saved_model/",
inputs={'input': model.inputs[0]},
outputs={'ou... | 23.75 | 47 | 0.755263 | import tensorflow as tf
import model
import shutil
# Kerasのモデルを読み込む
model = model.make()
# ニューラルの重みを読み込む
model.load_weights("weight.hdf5")
# TensorFlowのセッションを取得
sess = tf.keras.backend.get_session()
# SavedModelを出力
shutil.rmtree("saved_model/",True)
tf.saved_model.simple_save(sess,"saved_model/",
inputs={'input': ... | 102 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d1f46b40ef95bd755439e465f2090b228fc5bbaa | 6,154 | py | Python | examples/tracking_example.py | klecknerlab/muvi | f7731af71d316678f9b52dd8771718d8d97bb02c | [
"Apache-2.0"
] | null | null | null | examples/tracking_example.py | klecknerlab/muvi | f7731af71d316678f9b52dd8771718d8d97bb02c | [
"Apache-2.0"
] | null | null | null | examples/tracking_example.py | klecknerlab/muvi | f7731af71d316678f9b52dd8771718d8d97bb02c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
#
# Copyright 2021 Dustin Kleckner
#
# 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 ... | 32.909091 | 109 | 0.642346 | #!/usr/bin/python3
#
# Copyright 2021 Dustin Kleckner
#
# 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 ... | 0 | 0 | 0 | 960 | 0 | 173 | 0 | 8 | 160 |
80f2f8d660ab42b50770dfc205e7973ace8600d8 | 1,676 | py | Python | tool_parsedata.py | songwzup/PO-sLDA | 27ac5e394c9fbff20d70debb5c9c1b4ace7cf221 | [
"MIT"
] | 1 | 2022-03-18T08:17:27.000Z | 2022-03-18T08:17:27.000Z | tool_parsedata.py | songwzup/PO-sLDA | 27ac5e394c9fbff20d70debb5c9c1b4ace7cf221 | [
"MIT"
] | null | null | null | tool_parsedata.py | songwzup/PO-sLDA | 27ac5e394c9fbff20d70debb5c9c1b4ace7cf221 | [
"MIT"
] | null | null | null | #encoding:utf8
'''
Created on 2016-4-5
@author: hadoop
'''
# t.write(ll[1])
parse_ldac_to_mrslda()
| 35.659574 | 103 | 0.573986 | #encoding:utf8
'''
Created on 2016-4-5
@author: hadoop
'''
import os
def parse_ldac_to_mrslda():
docfile='/home/hadoop/workspace/slda/images/train-data.dat'
labfile='/home/hadoop/workspace/slda/images/train-label.dat'
targetfile='/home/hadoop/workspace/slda/images/train1.txt'
t=open(targetfile,'w... | 0 | 0 | 0 | 0 | 0 | 1,471 | 0 | -12 | 89 |
88160d035b5a9af846936951221a013201a88eff | 394 | py | Python | Tutorial/function.py | amkolhar/PythonBytes | 510da8f589aad52d4ee81da0ef612a2b7f515260 | [
"Apache-2.0"
] | null | null | null | Tutorial/function.py | amkolhar/PythonBytes | 510da8f589aad52d4ee81da0ef612a2b7f515260 | [
"Apache-2.0"
] | null | null | null | Tutorial/function.py | amkolhar/PythonBytes | 510da8f589aad52d4ee81da0ef612a2b7f515260 | [
"Apache-2.0"
] | null | null | null | # Atharv Kolhar
# Python Bytes
"""
Functions
"""
# Definition of Function
# Use of function
c = 10
d = 8
total = add(c, d)
diff = subtract(c, d)
print(total)
print(diff)
e = 30
f = 20
ef_total = add(e, f)
ef_diff = subtract(e, f)
print(ef_total, ef_diff)
# End
| 9.609756 | 27 | 0.606599 | # Atharv Kolhar
# Python Bytes
"""
Functions
"""
# Definition of Function
def add(a:int, b:int):
total = a+ b
return total
def subtract(a:int, b:int):
diff = a - b
return diff
# Use of function
c = 10
d = 8
total = add(c, d)
diff = subtract(c, d)
print(total)
print(diff)
e = 30
f = 20
ef_to... | 0 | 0 | 0 | 0 | 0 | 78 | 0 | 0 | 45 |
68a33c652f6d8b0c509ca0e3cb28e9e29693d8a2 | 1,917 | py | Python | typot/api.py | chakki-works/typot | 8ed20fc2102acccc8703aae4d206d3906f5dca47 | [
"Apache-2.0"
] | 345 | 2017-05-30T10:04:54.000Z | 2022-02-18T07:49:39.000Z | typot/api.py | chakki-works/typot | 8ed20fc2102acccc8703aae4d206d3906f5dca47 | [
"Apache-2.0"
] | 4 | 2017-05-31T00:30:30.000Z | 2017-12-11T17:08:40.000Z | typot/api.py | chakki-works/typot | 8ed20fc2102acccc8703aae4d206d3906f5dca47 | [
"Apache-2.0"
] | 17 | 2017-06-05T10:40:32.000Z | 2020-04-20T09:03:39.000Z | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
version = 1
| 29.953125 | 87 | 0.608764 | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import hug
from typot.pull_request import PullRequest
from typot.spell_checker import SpellChecker
version = 1
@hug.get("/ping", versions=version)
@hug.local()
def ping():
return {"ping": "works fine!"}
@hug.post("/typot", ve... | 0 | 1,427 | 0 | 0 | 0 | 220 | 0 | 33 | 135 |
c6374aa4ae03dfe1b95f657b9e58e878da842161 | 342 | py | Python | Examples/WorkshopCopper12/task2.2.py | pombreda/pyamg | ecd464de4d16e16bc905d84df181025ddf3c1958 | [
"BSD-3-Clause"
] | 1 | 2018-07-03T15:32:01.000Z | 2018-07-03T15:32:01.000Z | Examples/WorkshopCopper12/task2.2.py | pombreda/pyamg | ecd464de4d16e16bc905d84df181025ddf3c1958 | [
"BSD-3-Clause"
] | null | null | null | Examples/WorkshopCopper12/task2.2.py | pombreda/pyamg | ecd464de4d16e16bc905d84df181025ddf3c1958 | [
"BSD-3-Clause"
] | null | null | null | from pyamg import gallery, smoothed_aggregation_solver
from numpy import ones
A = gallery.poisson( (100,100), format='csr')
ml = smoothed_aggregation_solver(A, smooth='simple')
b = ones((A.shape[0],1));
res=[]
x = ml.solve(b, tol=1e-8, residuals=res)
semilogy(res[1:])
xlabel('iteration')
ylabel('residual norm')
show(... | 24.428571 | 54 | 0.722222 | from pyamg import gallery, smoothed_aggregation_solver
from numpy import ones
from pylab import *
A = gallery.poisson( (100,100), format='csr')
ml = smoothed_aggregation_solver(A, smooth='simple')
b = ones((A.shape[0],1));
res=[]
x = ml.solve(b, tol=1e-8, residuals=res)
semilogy(res[1:])
xlabel('iteration')
ylabel('r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
730b9c749493d56b5adb0b6fab1fccd139408f77 | 6,529 | py | Python | nni/algorithms/compression/v2/pytorch/base/pruner.py | ggzhang0071/nni | f4145e62d89c3ca383cf00f2de5dfd2d1025ad92 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | nni/algorithms/compression/v2/pytorch/base/pruner.py | soma2000-lang/nni | eaad98528c7aa714c9848800d607d6aa3bdd531d | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | nni/algorithms/compression/v2/pytorch/base/pruner.py | soma2000-lang/nni | eaad98528c7aa714c9848800d607d6aa3bdd531d | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
_logger = logging.getLogger(__name__)
__all__ = ['Pruner']
| 38.633136 | 120 | 0.613877 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
from typing import Dict, List, Optional, Tuple
import torch
from torch import Tensor
from torch.nn import Module
from .compressor import Compressor, LayerInfo
_logger = logging.getLogger(__name__)
__all__ = ['Pruner']
class P... | 0 | 0 | 0 | 6,170 | 0 | 0 | 0 | 49 | 158 |
ce273ae989e6977b59a1ff8136e89d02aaf7eff5 | 5,019 | py | Python | pcapkit/protocols/link/link.py | binref/PyPCAPKit | 7c5ba2cfa95bdc80a95b53b6669340a8783d2ad9 | [
"BSD-3-Clause"
] | 3 | 2018-01-21T15:22:21.000Z | 2018-06-22T01:27:59.000Z | pcapkit/protocols/link/link.py | binref/PyPCAPKit | 7c5ba2cfa95bdc80a95b53b6669340a8783d2ad9 | [
"BSD-3-Clause"
] | null | null | null | pcapkit/protocols/link/link.py | binref/PyPCAPKit | 7c5ba2cfa95bdc80a95b53b6669340a8783d2ad9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""root link layer protocol
:mod:`pcapkit.protocols.link.link` contains :class:`~pcapkit.protocols.link.link.Link`,
which is a base class for link layer protocols, e.g. :class:`~pcapkit.protocols.link.link.arp.ARP`/InARP,
:class:`~pcapkit.protocols.link.link.ethernet.Ethernet`, :class:`~pcapkit... | 36.635036 | 111 | 0.54214 | # -*- coding: utf-8 -*-
"""root link layer protocol
:mod:`pcapkit.protocols.link.link` contains :class:`~pcapkit.protocols.link.link.Link`,
which is a base class for link layer protocols, e.g. :class:`~pcapkit.protocols.link.link.arp.ARP`/InARP,
:class:`~pcapkit.protocols.link.link.ethernet.Ethernet`, :class:`~pcapkit... | 0 | 882 | 0 | 3,300 | 0 | 0 | 0 | 129 | 165 |
4f4bfd29b9f7d0d5e252d749e44fe22c9f1943ed | 7,375 | py | Python | com/vmware/vapi/metadata_client.py | vishal-12/vsphere-automation-sdk-python | 9cf363971db77ea5a12928eecd5cf5170a7fcd8a | [
"MIT"
] | null | null | null | com/vmware/vapi/metadata_client.py | vishal-12/vsphere-automation-sdk-python | 9cf363971db77ea5a12928eecd5cf5170a7fcd8a | [
"MIT"
] | null | null | null | com/vmware/vapi/metadata_client.py | vishal-12/vsphere-automation-sdk-python | 9cf363971db77ea5a12928eecd5cf5170a7fcd8a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2019 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.vapi.metadata.
#--------------------------------------------------------------------... | 32.777778 | 90 | 0.629017 | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2019 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.vapi.metadata.
#--------------------------------------------------------------------... | 0 | 0 | 0 | 4,931 | 0 | 0 | 0 | 352 | 335 |
863526abc5f761d3e92bc0e0131bd27ecc296fff | 8,991 | py | Python | server/test_levelmodel.py | nissafors/pelletmeter | 290d595d9e9c220dd78c66f0eec34291bb7d8578 | [
"MIT"
] | null | null | null | server/test_levelmodel.py | nissafors/pelletmeter | 290d595d9e9c220dd78c66f0eec34291bb7d8578 | [
"MIT"
] | null | null | null | server/test_levelmodel.py | nissafors/pelletmeter | 290d595d9e9c220dd78c66f0eec34291bb7d8578 | [
"MIT"
] | null | null | null | __copyright__ = "Copyright (C) 2021 Andreas Andersson"
import unittest
TEST_DB = "test_pelletmeter.db"
if __name__ == '__main__':
unittest.main() | 40.683258 | 123 | 0.61784 | __copyright__ = "Copyright (C) 2021 Andreas Andersson"
import unittest, datetime, os
from levelmodel import LevelModel
TEST_DB = "test_pelletmeter.db"
class TestLevelModel(unittest.TestCase):
"""Unit tests for the levelmodel.py module."""
@classmethod
def setUpClass(cls):
cls.ts = TimeStamp()
... | 0 | 45 | 0 | 8,700 | 0 | 0 | 0 | 26 | 68 |
337a62eda4d23e84b4896b6ecb5c612ce2e2d51d | 710 | py | Python | Example1.py | HeartAttack417/labs7 | eb91d91ea6df6aa7166ed49e4f037c8152c8d8bb | [
"MIT"
] | null | null | null | Example1.py | HeartAttack417/labs7 | eb91d91ea6df6aa7166ed49e4f037c8152c8d8bb | [
"MIT"
] | null | null | null | Example1.py | HeartAttack417/labs7 | eb91d91ea6df6aa7166ed49e4f037c8152c8d8bb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
with open('text.txt', 'r', encoding="utf8") as f:
text = f.read()
# .
text = text.replace("!", ".")
text = text.replace("?", ".")
# .
while ".." in text:
text = text.replace("..", ".")
... | 26.296296 | 54 | 0.504225 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
with open('text.txt', 'r', encoding="utf8") as f:
text = f.read()
# Заменить символы конца предложения.
text = text.replace("!", ".")
text = text.replace("?", ".")
# Удалить все многоточия.
while "..... | 202 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00bf1cef38e5cf147ef7f93046993b5ca588c00f | 68,781 | py | Python | cxs/app/reduce/rsvf.py | ajvazquez/CXS338 | fca77807073f75670f2e7a99011dc198cc7c9829 | [
"MIT"
] | 1 | 2021-11-05T02:38:45.000Z | 2021-11-05T02:38:45.000Z | cxs/app/reduce/rsvf.py | ajvazquez/CXS338 | fca77807073f75670f2e7a99011dc198cc7c9829 | [
"MIT"
] | null | null | null | cxs/app/reduce/rsvf.py | ajvazquez/CXS338 | fca77807073f75670f2e7a99011dc198cc7c9829 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
#The MIT CorrelX Correlator
#
#https://github.com/MITHaystack/CorrelX
#Contact: correlX@haystack.mit.edu
#Project leads: Victor Pankratius, Pedro Elosegui Project developer: A.J. Vazquez Alvarez
#
#Copyright 2017 MIT Haystack Observatory
#
#Permission is hereby granted, free of charge, to any person... | 45.250658 | 461 | 0.506971 | #!/usr/bin/python
#
#The MIT CorrelX Correlator
#
#https://github.com/MITHaystack/CorrelX
#Contact: correlX@haystack.mit.edu
#Project leads: Victor Pankratius, Pedro Elosegui Project developer: A.J. Vazquez Alvarez
#
#Copyright 2017 MIT Haystack Observatory
#
#Permission is hereby granted, free of charge, to any person... | 0 | 0 | 0 | 0 | 0 | 43,697 | 0 | 522 | 431 |
694f67498236e96e56dec72f7a6441fdb615599f | 403 | py | Python | baiji/package_version.py | metabolize-forks/baiji | f00c8c3848d826a6d3c931abf970e934bf6b8cdd | [
"Apache-2.0"
] | null | null | null | baiji/package_version.py | metabolize-forks/baiji | f00c8c3848d826a6d3c931abf970e934bf6b8cdd | [
"Apache-2.0"
] | null | null | null | baiji/package_version.py | metabolize-forks/baiji | f00c8c3848d826a6d3c931abf970e934bf6b8cdd | [
"Apache-2.0"
] | null | null | null | # This version number is stored here instead of in `__init__.py` because
# namespace packages and the packages which live inside them can be imported
# in any order, which means their contents are supposed to be identical. If
# their contents differ, Python makes no guarantee about which one is loaded.
#
# See https://... | 44.777778 | 77 | 0.774194 | # This version number is stored here instead of in `__init__.py` because
# namespace packages and the packages which live inside them can be imported
# in any order, which means their contents are supposed to be identical. If
# their contents differ, Python makes no guarantee about which one is loaded.
#
# See https://... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d42e50b9e85d06acf526c6ecaa23b091c78c3a0 | 1,858 | py | Python | cs143sim/constants.py | jvanbrug/cs143sim | 4e510a7669a534b55b606cbe175142104ae4a92c | [
"MIT"
] | null | null | null | cs143sim/constants.py | jvanbrug/cs143sim | 4e510a7669a534b55b606cbe175142104ae4a92c | [
"MIT"
] | null | null | null | cs143sim/constants.py | jvanbrug/cs143sim | 4e510a7669a534b55b606cbe175142104ae4a92c | [
"MIT"
] | null | null | null | """This file contains all constant definitions
.. moduleauthor:: Lan Hongjian <lanhongjianlr@gmail.com>
.. moduleauthor:: Yamei Ou <oym111@gmail.com>
.. moduleauthor:: Samuel Richerd <dondiego152@gmail.com>
.. moduleauthor:: Jan Van Bruggen <jancvanbruggen@gmail.com>
.. moduleauthor:: Junlin Zhang <neicullyn@gmail.com... | 35.056604 | 73 | 0.760495 | """This file contains all constant definitions
.. moduleauthor:: Lan Hongjian <lanhongjianlr@gmail.com>
.. moduleauthor:: Yamei Ou <oym111@gmail.com>
.. moduleauthor:: Samuel Richerd <dondiego152@gmail.com>
.. moduleauthor:: Jan Van Bruggen <jancvanbruggen@gmail.com>
.. moduleauthor:: Junlin Zhang <neicullyn@gmail.com... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a81adf63d72f1a2f989e0139b0e5305ac862b3b5 | 8,062 | py | Python | ekorpkit/io/file.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | 2 | 2021-09-15T04:12:07.000Z | 2022-02-04T02:44:09.000Z | ekorpkit/io/file.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | null | null | null | ekorpkit/io/file.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | null | null | null | import logging
log = logging.getLogger(__name__)
| 32.772358 | 86 | 0.601092 | import logging
import os
import pandas as pd
from glob import glob
from pathlib import Path, PosixPath, WindowsPath
from ekorpkit.utils.func import elapsed_timer
log = logging.getLogger(__name__)
def get_filepaths(
filename_patterns, base_dir=None, recursive=True, verbose=True, **kwargs
):
if isinstance(fil... | 0 | 0 | 0 | 0 | 0 | 7,696 | 0 | 37 | 271 |
7cb3685455f7089c126639294b925b5582275fda | 6,513 | py | Python | t7.py | andreum/user-movie-embedding | 0766b4fa6d61ebaf9994e61ca611dc256cd38a24 | [
"MIT"
] | null | null | null | t7.py | andreum/user-movie-embedding | 0766b4fa6d61ebaf9994e61ca611dc256cd38a24 | [
"MIT"
] | null | null | null | t7.py | andreum/user-movie-embedding | 0766b4fa6d61ebaf9994e61ca611dc256cd38a24 | [
"MIT"
] | null | null | null | #
# andre@corp.insite.com.br
# 2017-10-10
# Codigo que faz regressao simples e encontra embeddings
#
# a ideia aqui e a seguinte:
# - carregar dados do movielens
# - inicializar o embedding de forma aleatoria
# - encontrar os embeddings de filmes e de usuarios que gerem o menor erro possivel
#
from __future__ impo... | 43.42 | 158 | 0.690772 | #
# andre@corp.insite.com.br
# 2017-10-10
# Codigo que faz regressao simples e encontra embeddings
#
# a ideia aqui e a seguinte:
# - carregar dados do movielens
# - inicializar o embedding de forma aleatoria
# - encontrar os embeddings de filmes e de usuarios que gerem o menor erro possivel
#
from __future__ impo... | 0 | 0 | 0 | 0 | 0 | 673 | 0 | 19 | 201 |
3344c70063e2ed3452b6c541f899f38f2108e9af | 14,196 | py | Python | siamese.py | matthias-wright/siamese_architecture | a397847ddf49b2972f96a01696bbe22c70135e0e | [
"MIT"
] | null | null | null | siamese.py | matthias-wright/siamese_architecture | a397847ddf49b2972f96a01696bbe22c70135e0e | [
"MIT"
] | null | null | null | siamese.py | matthias-wright/siamese_architecture | a397847ddf49b2972f96a01696bbe22c70135e0e | [
"MIT"
] | null | null | null | import torch.autograd as autograd
| 46.090909 | 120 | 0.63687 | import torch
import torchvision
import torch.autograd as autograd
import model
import autoencoder
import util
import os
class Siamese:
def __init__(self, in_path_photo=None, in_path_oil=None, autoencoder_path=None, num_epochs=100, batch_size=50,
learning_rate=0.0002, recon_loss_weight=10, penalt... | 0 | 0 | 0 | 14,052 | 0 | 0 | 0 | -46 | 155 |
a18f666f17c04d384b131daed25c2d334ca96769 | 3,218 | py | Python | app.py | kmswlee/ainized-UGATIT | c3d0dc5dbe956de886baf1fa654e33a1249a8443 | [
"MIT"
] | 94 | 2020-03-05T06:55:28.000Z | 2022-01-26T05:29:59.000Z | app.py | kmswlee/ainized-UGATIT | c3d0dc5dbe956de886baf1fa654e33a1249a8443 | [
"MIT"
] | null | null | null | app.py | kmswlee/ainized-UGATIT | c3d0dc5dbe956de886baf1fa654e33a1249a8443 | [
"MIT"
] | 24 | 2020-03-28T02:20:34.000Z | 2022-02-24T17:50:09.000Z | import tensorflow as tf
from flask import Flask
from UGATIT import UGATIT
from main import parse_args
from utils import show_all_variables
with tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) as sess:
args = parse_args()
gan = UGATIT(sess, args)
gan.build_model()
show_all_variables()
... | 34.602151 | 93 | 0.68179 | import io
import numpy as np
import tensorflow as tf
import cv2
from flask import Flask, request, send_file, jsonify
from UGATIT import UGATIT
from main import parse_args
from utils import inverse_transform, show_all_variables, merge
def load_test_data_from_memory(buffer, size):
bytes_as_np_array = np.frombuffe... | 0 | 1,117 | 0 | 0 | 0 | 1,035 | 0 | 29 | 305 |
6c45f3a53a82894dda0e1edb0699c493fc09728a | 1,599 | py | Python | sage/models.py | one-two-four-cee-four-one-plus/sage-project | 2192ef60d8d3330586147a8ca93f899ef346ed42 | [
"WTFPL"
] | null | null | null | sage/models.py | one-two-four-cee-four-one-plus/sage-project | 2192ef60d8d3330586147a8ca93f899ef346ed42 | [
"WTFPL"
] | null | null | null | sage/models.py | one-two-four-cee-four-one-plus/sage-project | 2192ef60d8d3330586147a8ca93f899ef346ed42 | [
"WTFPL"
] | null | null | null | from django.core.files.storage import FileSystemStorage
from django.conf import settings
media_storage = FileSystemStorage(
location=f'{settings.BASE_DIR}/media/',
base_url=f'/media/'
)
| 22.842857 | 70 | 0.618512 | from django.db import models
from django.core.files.storage import FileSystemStorage
from django.conf import settings
class BaseComponent:
@property
def html(self):
raise NotImplementedError()
class Component(models.Model, BaseComponent):
related = models.ManyToManyField('self',
... | 0 | 85 | 0 | 1,066 | 0 | 0 | 0 | 7 | 237 |
f7cef1e63e591ab0850393524c7e1fc080e6cb94 | 1,375 | py | Python | tests/__init__.py | virtdevninja/pyvmomi-ce | c14de2e0cdcb891dbaaf59cd4da5ebbdb05f5f9e | [
"Apache-2.0"
] | 2 | 2015-09-09T16:31:26.000Z | 2015-09-10T06:39:53.000Z | tests/__init__.py | virtdevninja/pyvmomi-ce | c14de2e0cdcb891dbaaf59cd4da5ebbdb05f5f9e | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | virtdevninja/pyvmomi-ce | c14de2e0cdcb891dbaaf59cd4da5ebbdb05f5f9e | [
"Apache-2.0"
] | null | null | null | # VMware vSphere Python SDK
# Copyright (c) 2008-2014 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 32.738095 | 78 | 0.752 | # VMware vSphere Python SDK
# Copyright (c) 2008-2014 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 0 | 0 | 0 | 180 | 0 | 303 | 0 | -44 | 179 |
909b849e9ca7347c9dfc689df554047c11350a7a | 6,271 | py | Python | SetPalette.glyphsPalette/Contents/Resources/plugin.py | mekkablue/SetPalette | 39baace27db97fb8b903b0351b5b2cf7dac5eea0 | [
"Apache-2.0"
] | null | null | null | SetPalette.glyphsPalette/Contents/Resources/plugin.py | mekkablue/SetPalette | 39baace27db97fb8b903b0351b5b2cf7dac5eea0 | [
"Apache-2.0"
] | null | null | null | SetPalette.glyphsPalette/Contents/Resources/plugin.py | mekkablue/SetPalette | 39baace27db97fb8b903b0351b5b2cf7dac5eea0 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from __future__ import division, print_function, unicode_literals
###########################################################################################################
#
#
# Palette Plugin
#
# Read the docs:
# https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Palette
#
... | 33.179894 | 107 | 0.711529 | # encoding: utf-8
from __future__ import division, print_function, unicode_literals
###########################################################################################################
#
#
# Palette Plugin
#
# Read the docs:
# https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Palette
#
... | 0 | 4,738 | 0 | 994 | 0 | 0 | 0 | -3 | 112 |
87ceeddd149b4d0b8dbf81a56d3fa9a84721db55 | 33,855 | py | Python | python/sb_convertFootage.py | simonbjork/sb-nuke-tools | b8ec375199700e77bff7cc50b489a3ac755a6b6a | [
"MIT"
] | null | null | null | python/sb_convertFootage.py | simonbjork/sb-nuke-tools | b8ec375199700e77bff7cc50b489a3ac755a6b6a | [
"MIT"
] | null | null | null | python/sb_convertFootage.py | simonbjork/sb-nuke-tools | b8ec375199700e77bff7cc50b489a3ac755a6b6a | [
"MIT"
] | null | null | null | ################
"""
sb_convertFootage
Simon Bjork
August 2014
bjork.simon@gmail.com
Version 1.3 (May 2015)
Synopsis: Speed up the process of converting footage (Read nodes) to another format/resolution/colorspace/naming convention.
OS: Windows/OSX/Linux
CAUTION: The script uses the Python threading module,... | 37.784598 | 786 | 0.706336 | ################
"""
sb_convertFootage
Simon Bjork
August 2014
bjork.simon@gmail.com
Version 1.3 (May 2015)
Synopsis: Speed up the process of converting footage (Read nodes) to another format/resolution/colorspace/naming convention.
OS: Windows/OSX/Linux
CAUTION: The script uses the Python threading module,... | 0 | 0 | 0 | 26,417 | 0 | 3,745 | 0 | -20 | 178 |
ffbce44dbbcf2ae5cf2f47d62ad647d85dd0e6e4 | 696 | py | Python | quick_seqs.py | mwcotton/Insecttron | d10c21d61ea2324e26cf34a6a81f33baa79dba7e | [
"MIT"
] | null | null | null | quick_seqs.py | mwcotton/Insecttron | d10c21d61ea2324e26cf34a6a81f33baa79dba7e | [
"MIT"
] | null | null | null | quick_seqs.py | mwcotton/Insecttron | d10c21d61ea2324e26cf34a6a81f33baa79dba7e | [
"MIT"
] | null | null | null | import sys
import glob
import bladapter as bl
_, pathin, pathout = sys.argv
top_contigs = bl.load_contigs(pathin)
names = {contig.species:contig.name for contig in top_contigs}
files = {spec:glob.glob('../wgot/fastas/*{}*'.format(spec))[0] for spec in bl.spec_list}
for contig in top_contigs:
whole_file = open(... | 27.84 | 88 | 0.653736 | import sys
import glob
import bladapter as bl
_, pathin, pathout = sys.argv
top_contigs = bl.load_contigs(pathin)
names = {contig.species:contig.name for contig in top_contigs}
files = {spec:glob.glob('../wgot/fastas/*{}*'.format(spec))[0] for spec in bl.spec_list}
for contig in top_contigs:
whole_file = open(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4453bbec8fc4c7b1778dc9808fb9ca3b185d30d4 | 509 | py | Python | gamma/figB_calc.py | Non-random-connectivity-comes-in-pairs/code | 9ee15b731847ea1118747b2fb037943e1dae5419 | [
"MIT"
] | null | null | null | gamma/figB_calc.py | Non-random-connectivity-comes-in-pairs/code | 9ee15b731847ea1118747b2fb037943e1dae5419 | [
"MIT"
] | null | null | null | gamma/figB_calc.py | Non-random-connectivity-comes-in-pairs/code | 9ee15b731847ea1118747b2fb037943e1dae5419 | [
"MIT"
] | null | null | null |
import numpy as np
from scipy.optimize import brentq
import scipy.integrate as integrate
# mu = \int_0^1 x f_ab(x) dx
# Given mu,a what is b?
mu = 0.1
a_ns = []
b_ns = []
for a in np.logspace(np.log10(0.2),np.log10(98),500):
a_ns.append(a)
b = brentq(root_f, 0.5*mu/a, 5*mu/a)
b_ns.append(b)
... | 14.542857 | 60 | 0.628684 |
from gamma_functions import *
import numpy as np
from scipy.optimize import brentq
import scipy.integrate as integrate
# mu = \int_0^1 x f_ab(x) dx
# Given mu,a what is b?
def root_f(b):
return integrate.quad(lambda x: x*fT(x,a,b),0,1)[0] - mu
mu = 0.1
a_ns = []
b_ns = []
for a in np.logspace(np.log10(0.... | 0 | 0 | 0 | 0 | 0 | 55 | 0 | 8 | 46 |
912ae17da58d8634664d9c3570325502c0669043 | 13,619 | py | Python | test/test_dslite.py | halvors/vpp | fdc17b1ae7743bc37d4e08467d0295d6f277ec12 | [
"Apache-2.0"
] | null | null | null | test/test_dslite.py | halvors/vpp | fdc17b1ae7743bc37d4e08467d0295d6f277ec12 | [
"Apache-2.0"
] | null | null | null | test/test_dslite.py | halvors/vpp | fdc17b1ae7743bc37d4e08467d0295d6f277ec12 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from scapy.packet import bind_layers
| 40.775449 | 78 | 0.63896 | #!/usr/bin/env python3
import socket
import unittest
import struct
import random
from framework import tag_fixme_vpp_workers
from framework import VppTestCase, VppTestRunner
import scapy.compat
from scapy.layers.inet import IP, TCP, UDP, ICMP
from scapy.layers.inet import IPerror, TCPerror, UDPerror, ICMPerror
from ... | 0 | 9,094 | 0 | 3,179 | 0 | 0 | 0 | 663 | 621 |
44cc8d89fc2a1a815a7b64929c6e8d64f23faceb | 447 | py | Python | modlist/modlist_utils.py | c0ding/modlist-api | 3a4a471384fb552da0e81ab0adaf25976ab10037 | [
"Apache-2.0"
] | 2 | 2015-01-25T11:41:37.000Z | 2015-04-07T15:20:40.000Z | modlist/modlist_utils.py | c0ding/modlist-api | 3a4a471384fb552da0e81ab0adaf25976ab10037 | [
"Apache-2.0"
] | null | null | null | modlist/modlist_utils.py | c0ding/modlist-api | 3a4a471384fb552da0e81ab0adaf25976ab10037 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__title__ = 'modlist'
__version__ = '0.1'
__author__ = '@c0ding'
__repo__ = 'https://github.com/c0ding/modlist-api'
__license__ = 'Apache v2.0 License'
MODLIST_ENTRYPOINT = 'http://modlist.mcf.li/api/v3/'
def entrypoint(*suffix):
"""
Returns the entrypoint URL for the ... | 22.35 | 52 | 0.695749 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__title__ = 'modlist'
__version__ = '0.1'
__author__ = '@c0ding'
__repo__ = 'https://github.com/c0ding/modlist-api'
__license__ = 'Apache v2.0 License'
MODLIST_ENTRYPOINT = 'http://modlist.mcf.li/api/v3/'
def entrypoint(*suffix):
"""
Returns the entrypoint URL for the ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e99aa9d9881c4715109428f89acb89e7c214151d | 11,392 | py | Python | spotifAI/data/get_new_music_friday_data.py | Vantage-AI/spotifAI | b209da62fceda2e3e371132727231d987bcf510b | [
"MIT"
] | null | null | null | spotifAI/data/get_new_music_friday_data.py | Vantage-AI/spotifAI | b209da62fceda2e3e371132727231d987bcf510b | [
"MIT"
] | 5 | 2022-03-15T14:04:21.000Z | 2022-03-24T23:45:51.000Z | spotifAI/data/get_new_music_friday_data.py | Vantage-AI/spotifAI | b209da62fceda2e3e371132727231d987bcf510b | [
"MIT"
] | null | null | null | """Script that scrapes the global Spotify playlist 'new music friday'.
100 newly released tracks are fetched from the playlist and enriched
with additional features obtained via the Spotify API.
"""
import logging
import waitress # type: ignore
from flask import Flask
if __name__ == "__main__":
FORMAT = "%(a... | 33.804154 | 88 | 0.620787 | """Script that scrapes the global Spotify playlist 'new music friday'.
100 newly released tracks are fetched from the playlist and enriched
with additional features obtained via the Spotify API.
"""
import logging
import time
from datetime import datetime
from typing import List, Tuple
import pandas as pd
import spo... | 0 | 2,658 | 0 | 7,802 | 0 | 0 | 0 | 86 | 200 |
1f9d4b08b3a6c23f093a2ae3474e0b789effb0d5 | 2,747 | py | Python | sparrow-research/app/layoutlmv2_cord_inference.py | katanaml/sparrow | 0d89fceb9b2d7e16a02ce164e3a2f04b0697c09b | [
"Apache-2.0"
] | 21 | 2022-01-14T06:32:32.000Z | 2022-03-31T09:04:28.000Z | sparrow-research/app/layoutlmv2_cord_inference.py | katanaml/sparrow | 0d89fceb9b2d7e16a02ce164e3a2f04b0697c09b | [
"Apache-2.0"
] | 1 | 2022-03-31T11:05:15.000Z | 2022-03-31T15:55:52.000Z | sparrow-research/app/layoutlmv2_cord_inference.py | katanaml/sparrow | 0d89fceb9b2d7e16a02ce164e3a2f04b0697c09b | [
"Apache-2.0"
] | 5 | 2022-01-18T02:13:17.000Z | 2022-03-27T12:29:44.000Z | from datasets import load_dataset
datasets = load_dataset("katanaml/cord")
#
example = datasets["validation"][1]
#
from PIL import Image, ImageDraw, ImageFont
image = Image.open(example['image_path'])
image = image.convert("RGB")
#
from transformers import LayoutLMv2Processor
processor = LayoutLMv2Processor.fr... | 23.478632 | 112 | 0.730615 | from datasets import load_dataset
datasets = load_dataset("katanaml/cord")
#
example = datasets["validation"][1]
#
from PIL import Image, ImageDraw, ImageFont
image = Image.open(example['image_path'])
image = image.convert("RGB")
#
from transformers import LayoutLMv2Processor
processor = LayoutLMv2Processor.fr... | 0 | 0 | 0 | 0 | 0 | 315 | 0 | 0 | 69 |
fddf2d1ed86ad062a9c7a89a9ca59e7c27bdfafb | 13,674 | py | Python | src/icp/apps/modeling/tests.py | project-icp/bee-pollinator-app | 9357755e6d78e1bf8594de1b777d02318bb3e54f | [
"Apache-2.0"
] | 6 | 2016-10-14T18:54:39.000Z | 2021-06-03T21:04:27.000Z | src/icp/apps/modeling/tests.py | project-icp/bee-pollinator-app | 9357755e6d78e1bf8594de1b777d02318bb3e54f | [
"Apache-2.0"
] | 528 | 2016-10-14T17:38:54.000Z | 2022-02-26T10:53:21.000Z | src/icp/apps/modeling/tests.py | project-icp/bee-pollinator-app | 9357755e6d78e1bf8594de1b777d02318bb3e54f | [
"Apache-2.0"
] | 2 | 2016-10-17T18:06:38.000Z | 2020-10-23T09:48:24.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
| 33.108959 | 79 | 0.628638 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.contrib.auth.models import User
from django.test import TestCase
from rest_framework.test import APIClient
class APIAccessTestCase(TestCase):
def setUp(self):
... | 0 | 0 | 0 | 13,395 | 0 | 0 | 0 | 53 | 91 |
d55817cb6dd247124c50009f7db4fb963c585e40 | 93 | py | Python | examples/index.py | pitak3scirpt/line-bot-sdk-python | 37b81a2adb6248b30883d16465b365c800e3b358 | [
"Apache-2.0"
] | null | null | null | examples/index.py | pitak3scirpt/line-bot-sdk-python | 37b81a2adb6248b30883d16465b365c800e3b358 | [
"Apache-2.0"
] | null | null | null | examples/index.py | pitak3scirpt/line-bot-sdk-python | 37b81a2adb6248b30883d16465b365c800e3b358 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
print "Content-type: text/html\n\n"
print "<html>Hello world!</html>"
| 18.6 | 35 | 0.688172 | #!/usr/bin/env python
print "Content-type: text/html\n\n"
print "<html>Hello world!</html>"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c29bcd86e6781ce824c906c328d7722ed0ab4ea3 | 1,260 | py | Python | elo.py | bowersd/elo | 1f072b4630bc78549b32ff90484403341c3169c4 | [
"MIT"
] | null | null | null | elo.py | bowersd/elo | 1f072b4630bc78549b32ff90484403341c3169c4 | [
"MIT"
] | null | null | null | elo.py | bowersd/elo | 1f072b4630bc78549b32ff90484403341c3169c4 | [
"MIT"
] | null | null | null |
def new_result(team1, team2, result):
"""add a new [result, opponent] to team1"""
return team1.append([result, team2])
def spread(e1, e2, c):
"""points spread between e1, e2"""
#recommend c between 25 (football, 10 pts = 1.5 scores) and ~15
return (e1-e2)/c
def pwin(e1, e2):
"""pr... | 28.636364 | 110 | 0.574603 | import numpy as np
def new_result(team1, team2, result):
"""add a new [result, opponent] to team1"""
return team1.append([result, team2])
def spread(e1, e2, c):
"""points spread between e1, e2"""
#recommend c between 25 (football, 10 pts = 1.5 scores) and ~15
return (e1-e2)/c
def pwin... | 0 | 0 | 0 | 0 | 0 | 28 | 0 | -3 | 48 |
3f38845ee93e4c716c401470ab35dcc7255ab24b | 401 | py | Python | tests/integration/test_status.py | isabella232/callisto | 182b9c3a56d13fbb3f8f199a984b4c4be6c17e9f | [
"MIT"
] | 84 | 2020-02-18T14:58:35.000Z | 2022-03-04T22:34:46.000Z | tests/integration/test_status.py | wrike/callisto | 182b9c3a56d13fbb3f8f199a984b4c4be6c17e9f | [
"MIT"
] | 6 | 2020-07-13T19:31:07.000Z | 2022-03-30T15:35:23.000Z | tests/integration/test_status.py | isabella232/callisto | 182b9c3a56d13fbb3f8f199a984b4c4be6c17e9f | [
"MIT"
] | 9 | 2021-03-08T10:17:29.000Z | 2022-03-04T12:21:53.000Z | from __future__ import annotations
| 25.0625 | 73 | 0.745636 | from __future__ import annotations
import pytest
from aiohttp import web
@pytest.mark.asyncio
async def test_status_on_start(run_test_server, aiohttp_test_client):
app, server = await run_test_server()
client = aiohttp_test_client(server)
resp = await client.get('/api/v1/status')
data = await resp.j... | 0 | 303 | 0 | 0 | 0 | 0 | 0 | -6 | 68 |
3400879055ec234e78f4b60dd93f643180827122 | 296 | py | Python | decode.py | keithieopia/numberstation | c20a68f188eeb6283bc95805bfa18a1fddb94ff0 | [
"MIT"
] | null | null | null | decode.py | keithieopia/numberstation | c20a68f188eeb6283bc95805bfa18a1fddb94ff0 | [
"MIT"
] | null | null | null | decode.py | keithieopia/numberstation | c20a68f188eeb6283bc95805bfa18a1fddb94ff0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import sys
print "\n----- DECODE -----"
for line in sys.stdin:
line = line.strip()
for number in line.split(' '):
number = int(number) % 127
char = chr(number)
sys.stdout.write(char)
sys.stdout.flush()
print "\n------------------"
| 16.444444 | 32 | 0.527027 | #!/usr/bin/env python2
import sys
print "\n----- DECODE -----"
for line in sys.stdin:
line = line.strip()
for number in line.split(' '):
number = int(number) % 127
char = chr(number)
sys.stdout.write(char)
sys.stdout.flush()
print "\n------------------"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9604f2646509064a4bddcb064a2563b057233501 | 8,353 | py | Python | bcs-ui/backend/resources/utils/kube_client.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | bcs-ui/backend/resources/utils/kube_client.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | bcs-ui/backend/resources/utils/kube_client.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making PaaS (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | 37.79638 | 118 | 0.682629 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 1,056 | 679 | 0 | 4,281 | 0 | 0 | 0 | 202 | 224 |
a9f34eeba88d12faca320cf39966f610133e0ead | 904 | py | Python | dexp/processing/filters/kernels/wiener.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 16 | 2021-04-21T14:09:19.000Z | 2022-03-22T02:30:59.000Z | dexp/processing/filters/kernels/wiener.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 28 | 2021-04-15T17:43:08.000Z | 2022-03-29T16:08:35.000Z | dexp/processing/filters/kernels/wiener.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 3 | 2022-02-08T17:41:30.000Z | 2022-03-18T15:32:27.000Z | from dexp.utils.backends import Backend
def wiener_kernel(kernel, alpha: float = 1e-3, frequency_domain: bool = False, dtype=None):
"""Computes the Wiener filter for a given kernel and alpha parameter.
Parameters
----------
kernel : kernel
alpha : alpha parameter
frequency_domain : if True th... | 26.588235 | 91 | 0.644912 | from dexp.utils.backends import Backend
def wiener_kernel(kernel, alpha: float = 1e-3, frequency_domain: bool = False, dtype=None):
"""Computes the Wiener filter for a given kernel and alpha parameter.
Parameters
----------
kernel : kernel
alpha : alpha parameter
frequency_domain : if True th... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2738737cdd0170a985bd79b3407572ad27f5a31a | 1,158 | py | Python | products/migrations/0001_initial.py | nkmrohit/python | bd644d51909cda548684b5da98eab998564f3568 | [
"Apache-2.0"
] | null | null | null | products/migrations/0001_initial.py | nkmrohit/python | bd644d51909cda548684b5da98eab998564f3568 | [
"Apache-2.0"
] | null | null | null | products/migrations/0001_initial.py | nkmrohit/python | bd644d51909cda548684b5da98eab998564f3568 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.4 on 2019-01-06 09:12
| 35.090909 | 118 | 0.596718 | # Generated by Django 2.1.4 on 2019-01-06 09:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 0 | 0 | 978 | 0 | 0 | 0 | 41 | 90 |
d32b33501aa89439bebce71f2b22012411383d73 | 7,421 | py | Python | neuralprocesses/coders/aggregate.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | neuralprocesses/coders/aggregate.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | neuralprocesses/coders/aggregate.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null |
from .. import _dispatch
__all__ = [
"RepeatForAggregateInputs",
"SelectFromChannels",
"RepeatForAggregateInputPairs",
"SelectFromDenseCovarianceChannels",
]
| 26.598566 | 88 | 0.623366 | import lab as B
import numpy as np
from plum import convert, Union
from .. import _dispatch
from ..aggregate import Aggregate, AggregateInput
from ..datadims import data_dims
from ..util import (
register_module,
register_composite_coder,
split,
split_dimension,
merge_dimensions,
select,
)
__a... | 0 | 6,499 | 0 | 0 | 0 | 0 | 0 | 158 | 569 |
f47372ef37b490f2d37118ac595c009aadce78a0 | 7,827 | py | Python | tests/ds/test_esa_cci_ftp.py | strawpants/cate | eeef7da204b2f5c6dab1a90cb240aa5158c44513 | [
"MIT"
] | null | null | null | tests/ds/test_esa_cci_ftp.py | strawpants/cate | eeef7da204b2f5c6dab1a90cb240aa5158c44513 | [
"MIT"
] | null | null | null | tests/ds/test_esa_cci_ftp.py | strawpants/cate | eeef7da204b2f5c6dab1a90cb240aa5158c44513 | [
"MIT"
] | 1 | 2019-02-14T13:49:37.000Z | 2019-02-14T13:49:37.000Z | import os
| 41.412698 | 133 | 0.679698 | import os
import os.path
from datetime import datetime
from unittest import TestCase
import cate.core.ds as io
from cate.conf import get_data_stores_path
from cate.core.ds import DATA_STORE_REGISTRY
from cate.ds.esa_cci_ftp import FileSetDataStore, set_default_data_store
class EsaCciFtpTest(TestCase):
def test_s... | 0 | 0 | 0 | 7,458 | 0 | 0 | 0 | 108 | 247 |
5cbc1deb6671805e2ef54871acad6157c762c562 | 837 | py | Python | WGA/insertsizeX.py | lerminin/microbiology-phd-code | 541726c72890a4a46f231388d6b898d9b0b5ad12 | [
"MIT"
] | null | null | null | WGA/insertsizeX.py | lerminin/microbiology-phd-code | 541726c72890a4a46f231388d6b898d9b0b5ad12 | [
"MIT"
] | null | null | null | WGA/insertsizeX.py | lerminin/microbiology-phd-code | 541726c72890a4a46f231388d6b898d9b0b5ad12 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
insert_sizes = []
with open('insertsize.sam', 'rt') as sam:
for sam_line in sam:
try:
sam_parts = sam_line.split('\t')
sam_flags = int(sam_parts[1])
if sam_flags & 2: # read mapped in proper pair
insert_size = int(sam_parts[8])
... | 29.892857 | 64 | 0.630824 | #!/usr/bin/env python3
import math
def get_percentile(sorted_list, percentile):
rank = int(math.ceil(percentile / 100.0 * len(sorted_list)))
if rank == 0:
return sorted_list[0]
return sorted_list[rank - 1]
insert_sizes = []
with open('insertsize.sam', 'rt') as sam:
for sam_line in sam:
... | 0 | 0 | 0 | 0 | 0 | 169 | 0 | -10 | 46 |
973f02acb015b67154a59ae4275f5963c606f987 | 3,346 | py | Python | ObitSystem/Obit/share/scripts/MKPlotSpec.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 5 | 2019-08-26T06:53:08.000Z | 2020-10-20T01:08:59.000Z | ObitSystem/Obit/share/scripts/MKPlotSpec.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | null | null | null | ObitSystem/Obit/share/scripts/MKPlotSpec.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 8 | 2017-08-29T15:12:32.000Z | 2022-03-31T12:16:08.000Z | # Plot Spectrum at a list of positions in a FITS ImageMF
# On either raw (no PBCor) or PBCorImageMF.py PB corrected
name = 'Abell_194' # Base of plot name
inFile = 'Abell_194.fits'; fdisk=0 # Input file on cwd
# Specify positions (name, ra, dec)
srcpos = [ \
('core', '01:26:00.597', '-01:20:43.71'), \... | 30.418182 | 78 | 0.609982 | # Plot Spectrum at a list of positions in a FITS ImageMF
# On either raw (no PBCor) or PBCorImageMF.py PB corrected
name = 'Abell_194' # Base of plot name
inFile = 'Abell_194.fits'; fdisk=0 # Input file on cwd
# Specify positions (name, ra, dec)
srcpos = [ \
('core', '01:26:00.597', '-01:20:43.71'), \... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 22 |
b71d0e7b89e8675ea23c6f697db2da6785182141 | 17,111 | py | Python | grr/server/flows/general/collectors_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/server/flows/general/collectors_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/server/flows/general/collectors_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Test the collector flows.
To reduce the size of this module, additional collector flow tests are split out
into collectors_*_test.py files.
"""
from grr.lib import flags
if __name__ == "__main__":
flags.StartMain(main)
| 39.978972 | 80 | 0.681258 | #!/usr/bin/env python
"""Test the collector flows.
To reduce the size of this module, additional collector flow tests are split out
into collectors_*_test.py files.
"""
import os
import mock
import psutil
from grr import config
from grr.client.client_actions import standard
from grr.lib import flags
from grr.lib im... | 0 | 0 | 0 | 16,010 | 0 | 95 | 0 | 242 | 512 |
598ad46f9ed7a9f341549519393c11cb5213ea01 | 984 | py | Python | app/app.py | mohsenasm/flask-api-demo | f4dae8f063b5ebf2d920f5bd39927adc9e5d3dca | [
"MIT"
] | null | null | null | app/app.py | mohsenasm/flask-api-demo | f4dae8f063b5ebf2d920f5bd39927adc9e5d3dca | [
"MIT"
] | null | null | null | app/app.py | mohsenasm/flask-api-demo | f4dae8f063b5ebf2d920f5bd39927adc9e5d3dca | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
app = create_app()
app.run(port=7654, host='0.0.0.0', debug=True)
| 22.363636 | 91 | 0.677846 | from flask import Flask
from flask_restful import Api
from flask_apispec import FlaskApiSpec
from resources import HelloWorld, Car
from models import db
from resources import CarByName
def create_app():
app = Flask(__name__)
# Config
app.config['SQLALCHEMY_ECHO'] = False
app.config['SECRET_KEY'] = ... | 0 | 0 | 0 | 0 | 0 | 670 | 0 | 53 | 157 |
0c0097cb817d34746c8b64ef5f1efb9b703a758d | 2,384 | py | Python | cert_issuer/revoker.py | bloxberg-org/cert-issuer | 5dbdefaa8423ebf8dffb95c6492fc30ddebfd335 | [
"MIT"
] | 2 | 2019-12-19T18:18:45.000Z | 2019-12-19T18:19:23.000Z | cert_issuer/revoker.py | bloxberg-org/cert-issuer | 5dbdefaa8423ebf8dffb95c6492fc30ddebfd335 | [
"MIT"
] | 13 | 2020-01-14T09:59:06.000Z | 2020-02-16T12:38:26.000Z | cert_issuer/revoker.py | BlockcertsSmartContract/cert-issuer | b5fa4373a5c0ce3ebdf0b409118b95544375ed9b | [
"MIT"
] | 1 | 2021-01-14T10:40:31.000Z | 2021-01-14T10:40:31.000Z | """
Base class for building blockchain transactions to issue Blockchain Certificates.
"""
MAX_TX_RETRIES = 5
| 29.073171 | 111 | 0.663591 | """
Base class for building blockchain transactions to issue Blockchain Certificates.
"""
import logging
import json
from pycoin.serialize import h2b
from cert_issuer.errors import BroadcastError
MAX_TX_RETRIES = 5
def ensure_string(value):
if isinstance(value, str):
return value
return value.decod... | 0 | 0 | 0 | 1,383 | 0 | 687 | 0 | 18 | 182 |
266cfd207d8cf337a6e31a3d4b895f4c95a06a55 | 1,053 | py | Python | bin/dht.py | ChatchaiJ/zabbix-dht22 | d4a01de8ad1649be816253af5fb8e42496202865 | [
"MIT"
] | null | null | null | bin/dht.py | ChatchaiJ/zabbix-dht22 | d4a01de8ad1649be816253af5fb8e42496202865 | [
"MIT"
] | null | null | null | bin/dht.py | ChatchaiJ/zabbix-dht22 | d4a01de8ad1649be816253af5fb8e42496202865 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import time
import Adafruit_DHT
temperature_file = "/tmp/dht.temperature"
humidity_file = "/tmp/dht.humidity"
run_file = "/tmp/dht-run.pid"
sensor = Adafruit_DHT.AM2302
pin = 22
if os.path.isfile(run_file):
pid = read_runpid()
exe = "/proc/{}/exe".format(pid)
if os... | 20.25 | 64 | 0.604938 | #!/usr/bin/python
import os
import sys
import time
import Adafruit_DHT
temperature_file = "/tmp/dht.temperature"
humidity_file = "/tmp/dht.humidity"
run_file = "/tmp/dht-run.pid"
sensor = Adafruit_DHT.AM2302
pin = 22
def write_runpid():
pid = os.getpid()
str = '{}'.format(pid)
file = open(run... | 0 | 0 | 0 | 0 | 0 | 197 | 0 | -11 | 68 |
337cf994ee30b9189011921219057f70a6938217 | 9,157 | py | Python | pypage/_html.py | Superjomn/pypage | 5096af2381c5a901136d390572dd3047c0befb43 | [
"Apache-2.0"
] | 1 | 2018-03-25T13:03:54.000Z | 2018-03-25T13:03:54.000Z | pypage/_html.py | Superjomn/pypage | 5096af2381c5a901136d390572dd3047c0befb43 | [
"Apache-2.0"
] | null | null | null | pypage/_html.py | Superjomn/pypage | 5096af2381c5a901136d390572dd3047c0befb43 | [
"Apache-2.0"
] | null | null | null |
INDENT = ' '
def compile(li):
'''
li: a list
compile and skip duplicate items.
'''
compiled = set()
lines = []
for item in li:
if isinstance(item, Tag):
if item not in compiled:
c = str(item)
lines.append(c)
com... | 29.069841 | 226 | 0.568854 | import os
import sys
import html
from flask import Flask, render_template
INDENT = ' '
def repr_(s):
s = repr(s)
return '"' + s[1:-1] + '"'
class State(object):
gstate = None
def __init__(self):
self.main_queue = []
self.indent = 0
self.stack = [self.main_queue]
... | 0 | 2,183 | 0 | 5,757 | 0 | 195 | 0 | -14 | 250 |
c011c3b5ec8497bf0151fb9c92c2e7101da1fea4 | 1,416 | py | Python | basic/mycore/logmsg.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | basic/mycore/logmsg.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | basic/mycore/logmsg.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: sample
Filter(logname)logname
app.netapp
propagate
log.propagate
"""
import logging
import logging.handlers as handlers
import logging.config as config
__author__ = 'Xiong Neng'
logging.basicConfig(level=logging.INFO,
... | 26.716981 | 97 | 0.639831 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: sample
Filter(logname),只允许来自logname或其子日志的消息通过
app.net是app的子日志
消息传播propagate和分层记录器:消息会传播给父记录器
log.propagate属性获取是否传播标志
"""
import logging
import logging.handlers as handlers
import logging.config as config
__author__ = 'Xiong Neng'
logging... | 372 | 0 | 0 | 187 | 0 | 436 | 0 | 0 | 46 |
ea095a43b4ddfbd4f9d8cec2de95c45d21aeed6f | 1,568 | py | Python | gui_core.py | andycasey/narrowband-fourier-filter | dd7a1f697f95d967262804260430ea3d28595df1 | [
"MIT"
] | null | null | null | gui_core.py | andycasey/narrowband-fourier-filter | dd7a1f697f95d967262804260430ea3d28595df1 | [
"MIT"
] | null | null | null | gui_core.py | andycasey/narrowband-fourier-filter | dd7a1f697f95d967262804260430ea3d28595df1 | [
"MIT"
] | null | null | null | # coding: utf-8
""" Matplotlib figure functionality for the Traits GUI. """
from __future__ import division, print_function
__author__ = "Andy Casey <arc@ast.cam.ac.uk>"
# Third-party
# Editor factories for matplotlib figures
| 30.745098 | 80 | 0.712372 | # coding: utf-8
""" Matplotlib figure functionality for the Traits GUI. """
from __future__ import division, print_function
__author__ = "Andy Casey <arc@ast.cam.ac.uk>"
# Third-party
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.backends.backend_wx import NavigationToolb... | 0 | 0 | 0 | 962 | 0 | 0 | 0 | 174 | 200 |