hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9beb3af02e0bfcd3027ca500a5a12142cae0e066 | 1,762 | py | Python | examples/IrisClassification/predict.py | mlflow/mlflow-torchserve | 91663b630ef12313da3ad821767faf3fc409345b | [
"Apache-2.0"
] | 40 | 2020-11-13T02:08:10.000Z | 2022-03-27T07:41:57.000Z | examples/IrisClassification/predict.py | Ideas2IT/mlflow-torchserve | d6300fb73f16d74ee2c7718c249faf485c4f3b62 | [
"Apache-2.0"
] | 23 | 2020-11-16T11:28:01.000Z | 2021-09-23T11:28:24.000Z | examples/IrisClassification/predict.py | Ideas2IT/mlflow-torchserve | d6300fb73f16d74ee2c7718c249faf485c4f3b62 | [
"Apache-2.0"
] | 15 | 2020-11-13T10:25:25.000Z | 2022-02-01T10:13:20.000Z | import os
import json
import torch
import ast
from argparse import ArgumentParser
from mlflow.deployments import get_deploy_client
if __name__ == "__main__":
parser = ArgumentParser(description="Iris Classifiation Model")
parser.add_argument(
"--target",
type=str,
default="torchser... | 25.536232 | 94 | 0.650397 | import os
import json
import torch
import ast
from argparse import ArgumentParser
from mlflow.deployments import get_deploy_client
def convert_input_to_tensor(data):
data = json.loads(data).get("data")
input_tensor = torch.Tensor(ast.literal_eval(data[0]))
return input_tensor
def predict(parser_args):
... | 773 | 0 | 46 |
9b4cd6cac2f96c8e33cf4dfbdc876f8d09f61578 | 2,215 | py | Python | maskrcnn.py | DinoHub/maskrcnn-benchmark | 1de62203fd4d9857d2e5be355dcb7506bdfe6947 | [
"MIT"
] | 1 | 2019-07-17T03:55:03.000Z | 2019-07-17T03:55:03.000Z | maskrcnn.py | DinoHub/maskrcnn-benchmark | 1de62203fd4d9857d2e5be355dcb7506bdfe6947 | [
"MIT"
] | null | null | null | maskrcnn.py | DinoHub/maskrcnn-benchmark | 1de62203fd4d9857d2e5be355dcb7506bdfe6947 | [
"MIT"
] | null | null | null | import torch
from predictor import COCODemo
from maskrcnn_benchmark.config import cfg
COCO_PERSON_INDEX = 1
if __name__ == '__main__':
import cv2
# import numpy as np
maskrcnn = MaskRCNN()
img_path = '/home/dh/Pictures/studio8-30Nov18/DSC03887.JPG'
img = cv2.imread(img_path)
# masks, bboxes =... | 31.197183 | 142 | 0.57833 | import torch
from predictor import COCODemo
from maskrcnn_benchmark.config import cfg
COCO_PERSON_INDEX = 1
class MaskRCNN(object):
def __init__(self, confidence_threshold=0.7):
cfg.merge_from_file('e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml')
cfg.MODEL.DEVICE
cfg.freeze()
self.model_wr... | 312 | 1,321 | 39 |
f66cbb97c270f0b535ca4ad7e5674286d81a84e8 | 7,751 | py | Python | src/spark/lang/bz.py | jbalint/spark | caccf1cd9122dd4a7dc0f26a57ee4a649056aa6f | [
"CNRI-Jython"
] | 1 | 2015-05-21T20:00:12.000Z | 2015-05-21T20:00:12.000Z | src/spark/lang/bz.py | jbalint/spark | caccf1cd9122dd4a7dc0f26a57ee4a649056aa6f | [
"CNRI-Jython"
] | null | null | null | src/spark/lang/bz.py | jbalint/spark | caccf1cd9122dd4a7dc0f26a57ee4a649056aa6f | [
"CNRI-Jython"
] | null | null | null | #*****************************************************************************#
#* Copyright (c) 2004-2008, SRI International. *#
#* All rights reserved. *#
#* ... | 47.845679 | 110 | 0.631531 | #*****************************************************************************#
#* Copyright (c) 2004-2008, SRI International. *#
#* All rights reserved. *#
#* ... | 1,467 | 376 | 147 |
b57ac56ea7ca46465f388084cf38f73565bb36b1 | 891 | py | Python | auxiliary/expfit/fexpfit.py | zat1gi/stochastic | 24f2b82f7fbe33671d7d6e0c0e8d1417edbe9cad | [
"BSD-3-Clause"
] | null | null | null | auxiliary/expfit/fexpfit.py | zat1gi/stochastic | 24f2b82f7fbe33671d7d6e0c0e8d1417edbe9cad | [
"BSD-3-Clause"
] | 38 | 2016-03-14T15:42:17.000Z | 2016-05-02T22:15:33.000Z | auxiliary/expfit/fexpfit.py | zat1gi/stochastic | 24f2b82f7fbe33671d7d6e0c0e8d1417edbe9cad | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# I read s [slab thickness], a [<sig^2>/<sig^2>], and lamcsig [log-normal lamc],
# generate the real log-normal covariance function, and curve fit an exponential
# to that data, yielding lamcw [Gaussian lamcw]. This allows use of exponential
# covariance with fitted correlation length with only m... | 35.64 | 80 | 0.736251 | #!/usr/bin/env python
# I read s [slab thickness], a [<sig^2>/<sig^2>], and lamcsig [log-normal lamc],
# generate the real log-normal covariance function, and curve fit an exponential
# to that data, yielding lamcw [Gaussian lamcw]. This allows use of exponential
# covariance with fitted correlation length with only m... | 171 | 0 | 46 |
0fb2223e04136b6d5add50420ab01f13e78cab6f | 5,354 | py | Python | helpers/gc_file_helpers.py | ibbad/dna-lceb-web | b4c1d4e121dfea992e072979bfdc0f313c781e32 | [
"Apache-2.0"
] | null | null | null | helpers/gc_file_helpers.py | ibbad/dna-lceb-web | b4c1d4e121dfea992e072979bfdc0f313c781e32 | [
"Apache-2.0"
] | null | null | null | helpers/gc_file_helpers.py | ibbad/dna-lceb-web | b4c1d4e121dfea992e072979bfdc0f313c781e32 | [
"Apache-2.0"
] | null | null | null | """
This module contains the helpers functions for reading genetic code table
information from json file.
"""
import json
# Read the list of genetic codes and associated files in a dictionary.
with open("gc_files/gc_file_associations.json") as gc_directory:
gc_file_associations = json.load(gc_directory)
def cod... | 33.254658 | 80 | 0.603661 | """
This module contains the helpers functions for reading genetic code table
information from json file.
"""
import json
# Read the list of genetic codes and associated files in a dictionary.
with open("gc_files/gc_file_associations.json") as gc_directory:
gc_file_associations = json.load(gc_directory)
def cod... | 0 | 0 | 0 |
eb8ec8f0946f2390c366c75fcc2b4a6433a54953 | 572 | py | Python | master/admin.py | g12mcgov/grantmcgovern.com-V2 | 1fd920c6441dee914585577c5af6f2bc20309586 | [
"Unlicense",
"MIT"
] | 1 | 2015-07-27T22:07:30.000Z | 2015-07-27T22:07:30.000Z | master/admin.py | g12mcgov/grantmcgovern.com-V2 | 1fd920c6441dee914585577c5af6f2bc20309586 | [
"Unlicense",
"MIT"
] | 10 | 2020-02-11T22:43:05.000Z | 2022-03-11T23:13:08.000Z | master/admin.py | g12mcgov/grantmcgovern.com-V2 | 1fd920c6441dee914585577c5af6f2bc20309586 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: grantmcgovern
# @Date: 2015-07-12 15:42:46
# @Email: me@grantmcgovern.com
# @Web: http://grantmcgovern.com
#
# @Last Modified by: grantmcgovern
# @Last Modified time: 2015-07-12 21:20:40
from django.contrib import admin
from models import WorkExperi... | 23.833333 | 56 | 0.730769 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: grantmcgovern
# @Date: 2015-07-12 15:42:46
# @Email: me@grantmcgovern.com
# @Web: http://grantmcgovern.com
#
# @Last Modified by: grantmcgovern
# @Last Modified time: 2015-07-12 21:20:40
from django.contrib import admin
from models import WorkExperi... | 40 | 54 | 46 |
1aa29ea8e7e27d2762e41893de73c8e7fd40483c | 1,088 | py | Python | start-demos/lesson06/scores.py | Andyliwr/PythonStudyLoad | 24d78da61740e310c33c3769c93a207bf0e665c8 | [
"MIT"
] | 1 | 2018-12-11T07:59:44.000Z | 2018-12-11T07:59:44.000Z | start-demos/lesson06/scores.py | Andyliwr/python-learn | 24d78da61740e310c33c3769c93a207bf0e665c8 | [
"MIT"
] | null | null | null | start-demos/lesson06/scores.py | Andyliwr/python-learn | 24d78da61740e310c33c3769c93a207bf0e665c8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*-coding:utf-8*-
# 程序实现的功能:计算分数
student_num = int(input('请输入学生数量: '))
student_name, physics_score, maths_score, history_score = '', 0, 0, 0
all_scores = []
for i in range(student_num):
student_name = input('请输入第 {} 个学生的姓名: '.format(i+1))
physics_score = float(input('请输入 {} 的物理成绩: '.format(st... | 49.454545 | 139 | 0.69761 | #!/usr/bin/env python
#-*-coding:utf-8*-
# 程序实现的功能:计算分数
student_num = int(input('请输入学生数量: '))
student_name, physics_score, maths_score, history_score = '', 0, 0, 0
all_scores = []
for i in range(student_num):
student_name = input('请输入第 {} 个学生的姓名: '.format(i+1))
physics_score = float(input('请输入 {} 的物理成绩: '.format(st... | 0 | 0 | 0 |
92c5e9962b0c3c515e55547f7215a4ab353c3313 | 21,832 | py | Python | proj/pred/app/run_job.py | ElofssonLab/web_topcons2 | 52b9a3ef9ca5e5392cf9b310a52f99e9422172ea | [
"MIT"
] | 1 | 2018-11-07T21:16:13.000Z | 2018-11-07T21:16:13.000Z | proj/pred/app/run_job.py | NBISweden/predictprotein-webserver-topcons2 | 78d4cfbf09b51c928639aea67063340ae4cc8c57 | [
"MIT"
] | 15 | 2019-03-04T14:22:52.000Z | 2022-03-11T14:05:34.000Z | proj/pred/app/run_job.py | NBISweden/predictprotein-webserver-topcons2 | 78d4cfbf09b51c928639aea67063340ae4cc8c57 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Description: run job
# ChangeLog
#
# ChangeLog 2015-02-12
# submit individual sequences to the workflow, so that the result of each
# sequence can be cached and the progress can be shown for a job with many
# sequences
# ChangeLog 2015-03-26
# the tmpdir is rem... | 41.348485 | 111 | 0.579883 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Description: run job
# ChangeLog
#
# ChangeLog 2015-02-12
# submit individual sequences to the workflow, so that the result of each
# sequence can be cached and the progress can be shown for a job with many
# sequences
# ChangeLog 2015-03-26
# the tmpdir is rem... | 17,530 | 0 | 91 |
541933e5eeb34eaaebb9b988a5367b63684e44d8 | 3,004 | py | Python | src/ezdxf/math/__init__.py | mbway/ezdxf | d0b12ed8ddfa2225d11e61120d1f3ef24e4abb9c | [
"MIT"
] | null | null | null | src/ezdxf/math/__init__.py | mbway/ezdxf | d0b12ed8ddfa2225d11e61120d1f3ef24e4abb9c | [
"MIT"
] | null | null | null | src/ezdxf/math/__init__.py | mbway/ezdxf | d0b12ed8ddfa2225d11e61120d1f3ef24e4abb9c | [
"MIT"
] | null | null | null | # Purpose: math and construction tools
# Created: 27.03.2010, 2018 integrated into ezdxf
# Copyright (c) 2010-2020, Manfred Moitzi
# License: MIT License
from .vector import Vector, Vec2, X_AXIS, Y_AXIS, Z_AXIS, NULLVEC
from .construct2d import (
is_close_points, closest_point, convex_hull_2d, intersection_line_lin... | 43.536232 | 117 | 0.750666 | # Purpose: math and construction tools
# Created: 27.03.2010, 2018 integrated into ezdxf
# Copyright (c) 2010-2020, Manfred Moitzi
# License: MIT License
from .vector import Vector, Vec2, X_AXIS, Y_AXIS, Z_AXIS, NULLVEC
from .construct2d import (
is_close_points, closest_point, convex_hull_2d, intersection_line_lin... | 0 | 0 | 0 |
9ba875b6dfa18a6ce87e0ef2c02764f0a2a5e96d | 452 | py | Python | pt-1/sem_3/9.sem3_extra1-even-or-odd.py | lucaszarza/python_coursera-usp-pt1 | eaf8d32ec09b82755f9716237ffadb0cf8d46169 | [
"Apache-2.0"
] | null | null | null | pt-1/sem_3/9.sem3_extra1-even-or-odd.py | lucaszarza/python_coursera-usp-pt1 | eaf8d32ec09b82755f9716237ffadb0cf8d46169 | [
"Apache-2.0"
] | null | null | null | pt-1/sem_3/9.sem3_extra1-even-or-odd.py | lucaszarza/python_coursera-usp-pt1 | eaf8d32ec09b82755f9716237ffadb0cf8d46169 | [
"Apache-2.0"
] | null | null | null |
main()
| 28.25 | 61 | 0.54646 | def main():
print("** Bem-vindo ao separador de pares e impares! **")
n1 = float(input("Digite o primeiro número: "))
n2 = float(input("Digite o segundo número: "))
n3 = float(input("Digite o terceiro número "))
n4 = float(input("Digite o quarto número "))
print("4" if n1 % 2 == 0 else "2"... | 421 | 0 | 22 |
2ea3f10d0aa5cb8c27294023860fcb0ae3084228 | 1,969 | py | Python | Algorithms_easy/1309. Decrypt String from Alphabet to Integer Mapping.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | 4 | 2020-08-11T20:45:15.000Z | 2021-03-12T00:33:34.000Z | Algorithms_easy/1309. Decrypt String from Alphabet to Integer Mapping.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | Algorithms_easy/1309. Decrypt String from Alphabet to Integer Mapping.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | """
1309. Decrypt String from Alphabet to Integer Mapping
Given a string s formed by digits ('0' - '9') and '#' . We want to map s to English lowercase characters as follows:
Characters ('a' to 'i') are represented by ('1' to '9') respectively.
Characters ('j' to 'z') are represented by ('10#' to '26#') respectively. ... | 26.972603 | 116 | 0.492128 | """
1309. Decrypt String from Alphabet to Integer Mapping
Given a string s formed by digits ('0' - '9') and '#' . We want to map s to English lowercase characters as follows:
Characters ('a' to 'i') are represented by ('1' to '9') respectively.
Characters ('j' to 'z') are represented by ('10#' to '26#') respectively. ... | 968 | -12 | 98 |
34312b006528f961803dd6e3e15a2f465e642a4c | 367 | py | Python | Section05_Singleton/SingletonTestability/Database.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | 1 | 2020-10-20T07:41:51.000Z | 2020-10-20T07:41:51.000Z | Section05_Singleton/SingletonTestability/Database.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | null | null | null | Section05_Singleton/SingletonTestability/Database.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | null | null | null | from Section05_Singleton.SingletonTestability.Singleton import Singleton
| 30.583333 | 73 | 0.615804 | from Section05_Singleton.SingletonTestability.Singleton import Singleton
class Database(metaclass=Singleton):
def __init__(self):
self.population = {}
f = open('capitals.txt', 'r')
lines = f.readlines()
for i in range(0, len(lines), 2):
self.population[lines[i].strip()]... | 229 | 15 | 49 |
94d719247220b9c78f22ce9adad4ed0ba748ed29 | 286 | py | Python | example_idr.py | atharva-naik/social_media | 520964efe938fb89d3b1caa64b231ab1a63e6c76 | [
"BSD-3-Clause"
] | 7 | 2020-12-13T13:31:16.000Z | 2020-12-31T12:26:07.000Z | example_idr.py | atharva-naik/social_media | 520964efe938fb89d3b1caa64b231ab1a63e6c76 | [
"BSD-3-Clause"
] | 4 | 2021-04-06T18:41:34.000Z | 2021-09-08T02:52:35.000Z | example_idr.py | atharva-naik/social_media | 520964efe938fb89d3b1caa64b231ab1a63e6c76 | [
"BSD-3-Clause"
] | null | null | null | # to get instagram dms and reply to them
from social_media.instagram.base import InstagramEngine
i = InstagramEngine()
i.login()
profile = i.get_profile('a_the_rva', hard=True)
profile.mount()
messages = profile.get_messages()
for message in messages:
message.reply("I love you!") | 26 | 55 | 0.762238 | # to get instagram dms and reply to them
from social_media.instagram.base import InstagramEngine
i = InstagramEngine()
i.login()
profile = i.get_profile('a_the_rva', hard=True)
profile.mount()
messages = profile.get_messages()
for message in messages:
message.reply("I love you!") | 0 | 0 | 0 |
6d0c3c06a47f9c4b82d0857063e25f6e299fa76d | 1,620 | py | Python | test/test_transient_keras_classifier.py | nswachow/SCST_Python | e1fcad12b5cac2136785c2e5725f9ea1292e8560 | [
"MIT"
] | 1 | 2020-11-19T20:59:06.000Z | 2020-11-19T20:59:06.000Z | test/test_transient_keras_classifier.py | nswachow/SCST_Python | e1fcad12b5cac2136785c2e5725f9ea1292e8560 | [
"MIT"
] | null | null | null | test/test_transient_keras_classifier.py | nswachow/SCST_Python | e1fcad12b5cac2136785c2e5725f9ea1292e8560 | [
"MIT"
] | null | null | null | import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from transient_keras.transient_keras_classifier import TransientKerasClassifier
from test_tools import getTrainDict, getTestSequence
def testKerasSequenceClassifier():
'''
Use randomly generated vector sequences to evaluate... | 31.153846 | 99 | 0.724074 | import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from transient_keras.transient_keras_classifier import TransientKerasClassifier
from test_tools import getTrainDict, getTestSequence
def testKerasSequenceClassifier():
'''
Use randomly generated vector sequences to evaluate... | 0 | 0 | 0 |
e475169a55fac3fd91a7b0a4e2d263cad7216384 | 13,098 | py | Python | vrc_online/session/views.py | IntusFacultas/ERC | b6ac71b6469f1325d5cdbd1761429f33d8a797b1 | [
"Apache-2.0"
] | null | null | null | vrc_online/session/views.py | IntusFacultas/ERC | b6ac71b6469f1325d5cdbd1761429f33d8a797b1 | [
"Apache-2.0"
] | null | null | null | vrc_online/session/views.py | IntusFacultas/ERC | b6ac71b6469f1325d5cdbd1761429f33d8a797b1 | [
"Apache-2.0"
] | null | null | null | import warnings
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib import messages
from django.contrib.auth import (
get_user_model, update_session_auth_hash
)
from django.contrib.auth.forms import (
PasswordResetForm, SetPasswordForm, PasswordChangeFor... | 36.48468 | 86 | 0.621393 | import warnings
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib import messages
from django.contrib.auth import (
get_user_model, update_session_auth_hash
)
from django.contrib.auth.forms import (
PasswordResetForm, SetPasswordForm, PasswordChangeFor... | 9,056 | 32 | 409 |
1357e4f8ed42457bb66767fe96aa7f66d28a41de | 1,863 | py | Python | hass_apps/loader.py | taste66/hass-apps | 93f03a823f0ed8b3b32be5da30c5aaf0fcb1d92a | [
"Apache-2.0"
] | null | null | null | hass_apps/loader.py | taste66/hass-apps | 93f03a823f0ed8b3b32be5da30c5aaf0fcb1d92a | [
"Apache-2.0"
] | null | null | null | hass_apps/loader.py | taste66/hass-apps | 93f03a823f0ed8b3b32be5da30c5aaf0fcb1d92a | [
"Apache-2.0"
] | null | null | null | """
This module contains code that dynamically scans for available apps
at module load time. For all apps found, a loader is generated which,
when called, imports the particular app and behaves like the app
class itself. The loaders are made available as module attributes
under the same name the corresponding app class... | 33.872727 | 75 | 0.70424 | """
This module contains code that dynamically scans for available apps
at module load time. For all apps found, a loader is generated which,
when called, imports the particular app and behaves like the app
class itself. The loaders are made available as module attributes
under the same name the corresponding app class... | 479 | 0 | 46 |
e6be95fb22b49aa360b1f08fbb9c102ecbfb83e2 | 40,892 | py | Python | src/estimagic/optimization/pygmo_optimizers.py | janosg/estimagic | 58e17ff94339076f4b7688b1dbef5685f48157e2 | [
"BSD-3-Clause"
] | 7 | 2019-05-11T07:19:46.000Z | 2019-05-31T07:03:13.000Z | src/estimagic/optimization/pygmo_optimizers.py | janosg/estimagic | 58e17ff94339076f4b7688b1dbef5685f48157e2 | [
"BSD-3-Clause"
] | 14 | 2019-05-04T14:15:52.000Z | 2019-06-10T11:45:27.000Z | src/estimagic/optimization/pygmo_optimizers.py | janosg/estimagic | 58e17ff94339076f4b7688b1dbef5685f48157e2 | [
"BSD-3-Clause"
] | 1 | 2019-05-21T08:44:37.000Z | 2019-05-21T08:44:37.000Z | """Implement pygmo optimizers."""
import warnings
import numpy as np
from estimagic import batch_evaluators
from estimagic.config import IS_PYGMO_INSTALLED
from estimagic.decorators import mark_minimizer
from estimagic.exceptions import NotInstalledError
from estimagic.optimization.algo_options import CONVERGENCE_RELA... | 28.240331 | 91 | 0.667955 | """Implement pygmo optimizers."""
import warnings
import numpy as np
from estimagic import batch_evaluators
from estimagic.config import IS_PYGMO_INSTALLED
from estimagic.decorators import mark_minimizer
from estimagic.exceptions import NotInstalledError
from estimagic.optimization.algo_options import CONVERGENCE_RELA... | 2,617 | 0 | 161 |
1ab0e192b602b245ffc144bb15babe139da70429 | 10,759 | py | Python | src/tela/tela_evento.py | Franco904/sistema-eventos | 4461fb79d21bf17d3f740cd82bb2e2f2fff870ae | [
"MIT"
] | null | null | null | src/tela/tela_evento.py | Franco904/sistema-eventos | 4461fb79d21bf17d3f740cd82bb2e2f2fff870ae | [
"MIT"
] | 2 | 2022-02-02T21:31:43.000Z | 2022-03-05T22:54:10.000Z | src/tela/tela_evento.py | Franco904/sistema-eventos | 4461fb79d21bf17d3f740cd82bb2e2f2fff870ae | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
| 38.701439 | 117 | 0.516684 | import PySimpleGUI as sg
class TelaEvento:
def __init__(self):
self.__window = None
def tela_opcoes(self):
opcao = -1
while opcao == -1:
self.inicializar_opcoes()
button, values = self.__window.read()
if values['0'] or button is None:
... | 10,358 | 391 | 23 |
aa8e80a11374f536d6f8226228fb4e265fc72598 | 7,616 | py | Python | src/python/site-packages/longbow/DoxygenReport.py | rayyagar/LongBow | 0efa9dbf16f8a7f4e71c3f445ce2a68221eaddb2 | [
"BSD-2-Clause"
] | null | null | null | src/python/site-packages/longbow/DoxygenReport.py | rayyagar/LongBow | 0efa9dbf16f8a7f4e71c3f445ce2a68221eaddb2 | [
"BSD-2-Clause"
] | null | null | null | src/python/site-packages/longbow/DoxygenReport.py | rayyagar/LongBow | 0efa9dbf16f8a7f4e71c3f445ce2a68221eaddb2 | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/env python
# Copyright (c) 2015, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source cod... | 37.70297 | 113 | 0.676733 | #! /usr/bin/env python
# Copyright (c) 2015, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source cod... | 3,489 | 0 | 184 |
fd9284c572bc4169504dc1dff7cc22a2b558e89e | 283 | py | Python | Python/2021/Class 2/Student Code/Daksh Leekha/ass4.py | aravg12/summer-of-qode | bd9d11cd6ca41e4b19f25a0248ba25a7582b20e6 | [
"MIT"
] | 14 | 2021-05-30T08:18:59.000Z | 2021-06-08T14:28:18.000Z | Python/2021/Class 2/Student Code/Daksh Leekha/ass4.py | aravg12/summer-of-qode | bd9d11cd6ca41e4b19f25a0248ba25a7582b20e6 | [
"MIT"
] | 3 | 2021-06-02T15:26:16.000Z | 2021-06-06T10:17:39.000Z | Python/2021/Class 2/Student Code/Daksh Leekha/ass4.py | aravg12/summer-of-qode | bd9d11cd6ca41e4b19f25a0248ba25a7582b20e6 | [
"MIT"
] | 47 | 2021-05-26T14:59:12.000Z | 2021-06-12T12:01:57.000Z | while True:
num = float(input("Please enter a number: "))
if num > 10:
print(f"\nYour number, {num}, is more than 10!")
elif num < 10:
print(f"\nYour number, {num}, is less than 10!")
else:
print("\nYour number is equal to 10!")
| 23.583333 | 57 | 0.533569 | while True:
num = float(input("Please enter a number: "))
if num > 10:
print(f"\nYour number, {num}, is more than 10!")
elif num < 10:
print(f"\nYour number, {num}, is less than 10!")
else:
print("\nYour number is equal to 10!")
| 0 | 0 | 0 |
03dbd00a43c371b0681fb38c5b89320067150321 | 572 | py | Python | workflow/migrations/0022_auto_20190830_0126.py | tanmayagarwal/Activity-CE | a49c47053b191ffa5aee9a06e66a7c9644804434 | [
"Apache-2.0"
] | 1 | 2021-07-07T14:39:23.000Z | 2021-07-07T14:39:23.000Z | workflow/migrations/0022_auto_20190830_0126.py | michaelbukachi/Activity | f3d4f4da88ae9539c341ca73cc559b850693d669 | [
"Apache-2.0"
] | null | null | null | workflow/migrations/0022_auto_20190830_0126.py | michaelbukachi/Activity | f3d4f4da88ae9539c341ca73cc559b850693d669 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2 on 2019-08-30 01:26
from django.db import migrations, models
import django.db.models.deletion
| 28.6 | 184 | 0.685315 | # Generated by Django 2.2 on 2019-08-30 01:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workflow', '0021_auto_20190829_0154'),
]
operations = [
migrations.AlterField(
model_name='projec... | 0 | 427 | 23 |
02e37289e35d88f7b49409315dff85e822b7a9f9 | 587 | py | Python | Problemset/chou-shu-lcof/chou-shu-lcof.py | worldwonderer/algorithm | 083178b2d987de7f6020aceca869a353c0b4b1f3 | [
"MIT"
] | 1 | 2021-01-30T01:52:46.000Z | 2021-01-30T01:52:46.000Z | Problemset/chou-shu-lcof/chou-shu-lcof.py | worldwonderer/algorithm | 083178b2d987de7f6020aceca869a353c0b4b1f3 | [
"MIT"
] | 1 | 2021-12-15T14:54:06.000Z | 2021-12-15T14:54:06.000Z | Problemset/chou-shu-lcof/chou-shu-lcof.py | worldwonderer/algorithm | 083178b2d987de7f6020aceca869a353c0b4b1f3 | [
"MIT"
] | 2 | 2021-04-19T03:32:18.000Z | 2021-06-22T07:06:01.000Z |
# @Title: 丑数 (丑数 LCOF)
# @Author: 18015528893
# @Date: 2021-01-26 17:11:46
# @Runtime: 140 ms
# @Memory: 14.9 MB
if __name__ == '__main__':
s = Solution()
s.nthUglyNumber(10)
| 20.964286 | 50 | 0.413969 |
# @Title: 丑数 (丑数 LCOF)
# @Author: 18015528893
# @Date: 2021-01-26 17:11:46
# @Runtime: 140 ms
# @Memory: 14.9 MB
class Solution:
def nthUglyNumber(self, n: int) -> int:
dp = [1] * n
a, b, c = 0, 0, 0
for i in range(1, n):
n2, n3, n5 = 2*dp[a], 3*dp[b], 5*dp[c]
dp[i]... | 357 | -6 | 49 |
120135fbdcf4e9769a193d55918fe3d891a5aa72 | 150 | py | Python | WalletSystem/walletApp/apps.py | BakrFrag/Wallet-System | cc4a1114bc0811ef198ae5bc5689cb8696270e91 | [
"MIT"
] | null | null | null | WalletSystem/walletApp/apps.py | BakrFrag/Wallet-System | cc4a1114bc0811ef198ae5bc5689cb8696270e91 | [
"MIT"
] | null | null | null | WalletSystem/walletApp/apps.py | BakrFrag/Wallet-System | cc4a1114bc0811ef198ae5bc5689cb8696270e91 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 21.428571 | 56 | 0.766667 | from django.apps import AppConfig
class WalletAppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'walletApp'
| 0 | 92 | 23 |
cef608a2677b59679950d1207c29fe7e139a9084 | 125 | py | Python | examples/underscored/class_attribute.py | doboy/Underscore | d98273db3144cda79191d2c90f45d81b6d700b1f | [
"MIT"
] | 7 | 2016-09-23T00:44:05.000Z | 2021-10-04T21:19:12.000Z | examples/underscored/class_attribute.py | jameswu1991/Underscore | d98273db3144cda79191d2c90f45d81b6d700b1f | [
"MIT"
] | 1 | 2016-09-23T00:45:05.000Z | 2019-02-16T19:05:37.000Z | examples/underscored/class_attribute.py | jameswu1991/Underscore | d98273db3144cda79191d2c90f45d81b6d700b1f | [
"MIT"
] | 3 | 2016-09-23T01:13:15.000Z | 2018-07-20T21:22:17.000Z | # class Bar:
# x = 1
#
# print(Bar.x)
(___,) = (1,)
print _.x
(Bar,) = (_,)
| 8.928571 | 16 | 0.384 | # class Bar:
# x = 1
#
# print(Bar.x)
(___,) = (1,)
class _:
__ = ___
(x,) = (__,)
print _.x
(Bar,) = (_,)
| 0 | 17 | 23 |
6460f246a4ce450308dee6dd7392b20d8dd71d9e | 3,612 | py | Python | tainan_scripts/parse_data.py | NCKU-CCS/dengue-fever-website | 6b0df1ffc1b1d9d35178c3de4e1b1190fda452e0 | [
"MIT"
] | null | null | null | tainan_scripts/parse_data.py | NCKU-CCS/dengue-fever-website | 6b0df1ffc1b1d9d35178c3de4e1b1190fda452e0 | [
"MIT"
] | null | null | null | tainan_scripts/parse_data.py | NCKU-CCS/dengue-fever-website | 6b0df1ffc1b1d9d35178c3de4e1b1190fda452e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import requests
import csv
import sys
from datetime import datetime
from geopy.distance import vincenty
import json
def write_csv(file_name, content):
"""write csv"""
with open(file_name, 'w') as output_file:
writer = csv.writer(output_file)
writ... | 31.684211 | 72 | 0.593023 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import requests
import csv
import sys
from datetime import datetime
from geopy.distance import vincenty
import json
def read_csv(file_name):
data = []
with open(file_name, 'r') as input_file:
reader = csv.reader(input_file)
for row in reader:
... | 206 | 0 | 22 |
71843a3646a5e48d45b9b291a93a48dccb1af0e1 | 13,874 | py | Python | copm_spider/sohu/sohu/spiders/bbs_spider.py | tzattack/public_opinion_analysis | ed29e5b53564563ac6233de7d49afdd5ee554920 | [
"MIT"
] | null | null | null | copm_spider/sohu/sohu/spiders/bbs_spider.py | tzattack/public_opinion_analysis | ed29e5b53564563ac6233de7d49afdd5ee554920 | [
"MIT"
] | null | null | null | copm_spider/sohu/sohu/spiders/bbs_spider.py | tzattack/public_opinion_analysis | ed29e5b53564563ac6233de7d49afdd5ee554920 | [
"MIT"
] | null | null | null | import re
import os
import shutil
import scrapy
from sohu.items import BBSItem
bbs_city_url_list = [
"https://bbs.focus.cn/anshan/",
"https://bbs.focus.cn/ankang/",
"https://bbs.focus.cn/anqing/",
"https://bbs.focus.cn/anshun/",
"https://bbs.focus.cn/anyang/",
"https://bbs.focus.cn/aomen/",
... | 36.510526 | 97 | 0.580006 | import re
import os
import shutil
import scrapy
from sohu.items import BBSItem
bbs_city_url_list = [
"https://bbs.focus.cn/anshan/",
"https://bbs.focus.cn/ankang/",
"https://bbs.focus.cn/anqing/",
"https://bbs.focus.cn/anshun/",
"https://bbs.focus.cn/anyang/",
"https://bbs.focus.cn/aomen/",
... | 3,369 | 171 | 23 |
d1be9da0d3bb27cb850edad1c9f791fd833cacbf | 634 | py | Python | faim_sl_tasks/img/intensity/SingleChannelIlluminationFieldCorrectionTask.py | fmi-faim/faim-sl-tasks | 083df91e0f4fff1ae7b9ab50ff5655dd0a747782 | [
"MIT"
] | null | null | null | faim_sl_tasks/img/intensity/SingleChannelIlluminationFieldCorrectionTask.py | fmi-faim/faim-sl-tasks | 083df91e0f4fff1ae7b9ab50ff5655dd0a747782 | [
"MIT"
] | null | null | null | faim_sl_tasks/img/intensity/SingleChannelIlluminationFieldCorrectionTask.py | fmi-faim/faim-sl-tasks | 083df91e0f4fff1ae7b9ab50ff5655dd0a747782 | [
"MIT"
] | null | null | null | import luigi
from tifffile import imread
from faim_sl.MultiFileTask import MultiFileTask
| 26.416667 | 89 | 0.747634 | import luigi
from tifffile import imread
from faim_sl.MultiFileTask import MultiFileTask
class SingleChannelIlluminationFieldCorrectionTask(MultiFileTask):
# Params
in_illumination_field = None
scale = luigi.IntParameter(default=255)
ill_field_img = None
def prepare(self):
self.ill_fie... | 259 | 261 | 23 |
7176bc4205f4322db3c5e7e892b53eb4fd2dc19b | 639 | py | Python | today_problems/211005/2616.py | mangab0159/baekjoon | c5f130d4068ae4a658ddbadf4b1f0cb0a8e00230 | [
"MIT"
] | null | null | null | today_problems/211005/2616.py | mangab0159/baekjoon | c5f130d4068ae4a658ddbadf4b1f0cb0a8e00230 | [
"MIT"
] | null | null | null | today_problems/211005/2616.py | mangab0159/baekjoon | c5f130d4068ae4a658ddbadf4b1f0cb0a8e00230 | [
"MIT"
] | null | null | null | import sys
ifunc, g = lambda: [*map(int, sys.stdin.readline().rstrip().split())], range
n = ifunc()[0]
iList = ifunc()
m = ifunc()[0]
dp = [[-1]*3 for _ in g(n)]
pSum = [0]
aSum = 0
for item in iList:
aSum += item
pSum.append(aSum)
for idx in g(n-1, -1, -1):
for cnt in g(3):
aVal = -1
b... | 17.75 | 76 | 0.458529 | import sys
ifunc, g = lambda: [*map(int, sys.stdin.readline().rstrip().split())], range
n = ifunc()[0]
iList = ifunc()
m = ifunc()[0]
dp = [[-1]*3 for _ in g(n)]
pSum = [0]
aSum = 0
for item in iList:
aSum += item
pSum.append(aSum)
for idx in g(n-1, -1, -1):
for cnt in g(3):
aVal = -1
b... | 0 | 0 | 0 |
916117d928266e5c477f46841db96a70176e9178 | 699 | py | Python | nautobot_chatops_ipfabric/context.py | justinjeffery-ipf/nautobot-plugin-chatops-ipfabric | 67e58e3d251b41227808cabd6120d78411193863 | [
"Apache-2.0"
] | 6 | 2021-11-26T15:50:21.000Z | 2022-01-25T18:36:44.000Z | nautobot_chatops_ipfabric/context.py | justinjeffery-ipf/nautobot-plugin-chatops-ipfabric | 67e58e3d251b41227808cabd6120d78411193863 | [
"Apache-2.0"
] | 21 | 2021-11-30T02:31:40.000Z | 2022-02-17T04:17:36.000Z | nautobot_chatops_ipfabric/context.py | justinjeffery-ipf/nautobot-plugin-chatops-ipfabric | 67e58e3d251b41227808cabd6120d78411193863 | [
"Apache-2.0"
] | 2 | 2022-01-18T17:53:29.000Z | 2022-02-16T16:06:15.000Z | """Functions for caching per-user context."""
import hashlib
from django.core.cache import cache
from . import IPFabricConfig
def _get_cache_key(user: str) -> str:
"""Key generator for the cache, adding the plugin prefix name."""
key_string = "-".join([IPFabricConfig.name, user])
return hashlib.md5(key_st... | 31.772727 | 82 | 0.699571 | """Functions for caching per-user context."""
import hashlib
from django.core.cache import cache
from . import IPFabricConfig
def _get_cache_key(user: str) -> str:
"""Key generator for the cache, adding the plugin prefix name."""
key_string = "-".join([IPFabricConfig.name, user])
return hashlib.md5(key_st... | 0 | 0 | 0 |
cbdd353e24127433a693c7b17b59da30a2b8a103 | 47 | py | Python | giant/__init__.py | lixar/giant | fba966e4389b80b38bee1067ad9173adf4eaa5b5 | [
"MIT"
] | null | null | null | giant/__init__.py | lixar/giant | fba966e4389b80b38bee1067ad9173adf4eaa5b5 | [
"MIT"
] | 2 | 2016-05-26T14:40:07.000Z | 2017-04-13T21:07:16.000Z | giant/__init__.py | lixar/giant | fba966e4389b80b38bee1067ad9173adf4eaa5b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from .giant import giant | 15.666667 | 24 | 0.744681 | #!/usr/bin/env python
from .giant import giant | 0 | 0 | 0 |
48a935e65dd689781f77476b198cac53679ffe77 | 760 | py | Python | SegNet/visualise.py | Edumate696/SemanticSeg | 5dc676abd5c19682e4656d71f6ae6e2d13c1ac26 | [
"MIT"
] | null | null | null | SegNet/visualise.py | Edumate696/SemanticSeg | 5dc676abd5c19682e4656d71f6ae6e2d13c1ac26 | [
"MIT"
] | null | null | null | SegNet/visualise.py | Edumate696/SemanticSeg | 5dc676abd5c19682e4656d71f6ae6e2d13c1ac26 | [
"MIT"
] | null | null | null | import random
from matplotlib import pyplot as plt
plt.style.use("ggplot")
| 31.666667 | 91 | 0.669737 | import random
from matplotlib import pyplot as plt
plt.style.use("ggplot")
def plot_random_sample(X_train, y_train):
# Visualize any random image along with the mask
ix = random.randint(0, len(X_train))
has_mask = y_train[ix].max() > 0 # salt indicator
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=... | 659 | 0 | 23 |
ece77431e149ca3928831e59116063bf668aa7d5 | 521 | py | Python | setup.py | poemdistance/BingTran | 04e097119a574acafc0b28c96941c731aa96f5ad | [
"MIT"
] | 1 | 2020-07-04T03:17:14.000Z | 2020-07-04T03:17:14.000Z | setup.py | poemdistance/BingTran | 04e097119a574acafc0b28c96941c731aa96f5ad | [
"MIT"
] | null | null | null | setup.py | poemdistance/BingTran | 04e097119a574acafc0b28c96941c731aa96f5ad | [
"MIT"
] | 1 | 2021-10-30T15:29:17.000Z | 2021-10-30T15:29:17.000Z | #!/usr/bin/python3
from distutils.core import setup
#from setuptools import setup
from setuptools.command.install import install
import os
setup(
name = "Bing Translate",
version = "1.0",
author = "poemdistance",
author_email = "poemdistance@gmail.com",
url = "",
packages = ['bing'],
cmdcl... | 22.652174 | 53 | 0.650672 | #!/usr/bin/python3
from distutils.core import setup
#from setuptools import setup
from setuptools.command.install import install
import os
class command(install):
def run(self):
print('Coping execution file to /usr/bin')
os.system("cp -v bing/main.py /usr/bin/bing")
install.run(self)
setu... | 124 | 2 | 49 |
63519207c2622bc4ec107b738c5fc96d7820ea32 | 3,109 | py | Python | ykman/cli/util.py | elukewalker/yubikey-manager | 13e5bb323a66aed29f2f865253e6088ac1ec5861 | [
"BSD-2-Clause"
] | null | null | null | ykman/cli/util.py | elukewalker/yubikey-manager | 13e5bb323a66aed29f2f865253e6088ac1ec5861 | [
"BSD-2-Clause"
] | 1 | 2018-05-07T07:34:23.000Z | 2018-05-07T13:44:29.000Z | ykman/cli/util.py | elukewalker/yubikey-manager | 13e5bb323a66aed29f2f865253e6088ac1ec5861 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2015 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 34.164835 | 79 | 0.671277 | # Copyright (c) 2015 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 1,154 | 0 | 144 |
c5e1bdb2fd50c8a247843a31096a4032aab2cf11 | 16,587 | py | Python | Tephigram/Tephigram_From_Radiosonde_By_Date.py | peterwilletts24/Python-Scripts | 975d6b2e2923cbde40d2760eb9574acee2e10388 | [
"MIT"
] | 4 | 2017-05-24T09:14:14.000Z | 2019-01-02T19:20:38.000Z | Tephigram/Tephigram_From_Radiosonde_By_Date.py | peterwilletts24/Python-Scripts | 975d6b2e2923cbde40d2760eb9574acee2e10388 | [
"MIT"
] | null | null | null | Tephigram/Tephigram_From_Radiosonde_By_Date.py | peterwilletts24/Python-Scripts | 975d6b2e2923cbde40d2760eb9574acee2e10388 | [
"MIT"
] | 3 | 2017-05-24T09:14:15.000Z | 2020-09-28T08:32:02.000Z | # Now make a simple example using the custom projection.
import pdb
import sys
import os
import pkg_resources
pkg_resources.require('matplotlib==1.4.0')
import datetime
from dateutil.relativedelta import relativedelta
import re
import math
from matplotlib.ticker import ScalarFormatter, MultipleLocator
from matplotlib... | 44.469169 | 276 | 0.488696 | # Now make a simple example using the custom projection.
import pdb
import sys
import os
import pkg_resources
pkg_resources.require('matplotlib==1.4.0')
import datetime
from dateutil.relativedelta import relativedelta
import re
import math
from matplotlib.ticker import ScalarFormatter, MultipleLocator
from matplotlib... | 275 | 0 | 23 |
28ec7f08b0ef63749cdda909a0cfb1bf3e7ebb8b | 3,100 | py | Python | torchvision/edgeailite/xnn/utils/weights_utils.py | TexasInstruments/vision | abaf29de0798e8e8d3f996dc272cd3c515562695 | [
"BSD-3-Clause"
] | 21 | 2021-10-08T02:47:56.000Z | 2022-03-29T14:17:04.000Z | torchvision/xnn/utils/weights_utils.py | leidi1989/edgeai-torchvision | 94bd2d8a01fac800e7df82dd710b3cc13f9a24ea | [
"BSD-3-Clause"
] | 9 | 2021-11-15T06:43:54.000Z | 2022-03-16T04:47:52.000Z | torchvision/xnn/utils/weights_utils.py | leidi1989/edgeai-torchvision | 94bd2d8a01fac800e7df82dd710b3cc13f9a24ea | [
"BSD-3-Clause"
] | 9 | 2021-11-11T11:17:16.000Z | 2022-03-08T04:26:10.000Z | #################################################################################
# Copyright (c) 2018-2021, Texas Instruments Incorporated - http://www.ti.com
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | 50.819672 | 125 | 0.669677 | #################################################################################
# Copyright (c) 2018-2021, Texas Instruments Incorporated - http://www.ti.com
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | 1,311 | 0 | 23 |
0208465a5d1ab407c0486c21de6f1e5021a8704e | 8,783 | py | Python | MachineLearningPyFiles_DataScience/demo19_kfoldclassificationwine.py | mahnooranjum/Programming_DataScience | f7a4215d4615b3f8460c3a1944a585628cf6930d | [
"MIT"
] | null | null | null | MachineLearningPyFiles_DataScience/demo19_kfoldclassificationwine.py | mahnooranjum/Programming_DataScience | f7a4215d4615b3f8460c3a1944a585628cf6930d | [
"MIT"
] | null | null | null | MachineLearningPyFiles_DataScience/demo19_kfoldclassificationwine.py | mahnooranjum/Programming_DataScience | f7a4215d4615b3f8460c3a1944a585628cf6930d | [
"MIT"
] | null | null | null |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Visualising the results
"""## Get Wine Dataset"""
from sklearn.datasets import load_wine
data = load_wine()
data.keys()
X = data.data
y = data.target
from sklearn.model_selection import KFold
kf = KFold(n_splits=4)
kf.get_n_splits(X)
print(... | 38.52193 | 107 | 0.748036 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def evaluate(y_test, y_pred):
from sklearn.metrics import accuracy_score
print("===== Accuracy Score =====")
print(accuracy_score(y_test, y_pred))
from sklearn.metrics import classification_report
print("===== Accuracy Score =====")
c... | 5,704 | 0 | 344 |
378c076ecb27922a28a5e0f844859a82a4d35191 | 17,070 | py | Python | psl_class.py | shane-kerr/ProSafeLinux | c821a83a036757a52313b93bf7cc9de625a816da | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | psl_class.py | shane-kerr/ProSafeLinux | c821a83a036757a52313b93bf7cc9de625a816da | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | psl_class.py | shane-kerr/ProSafeLinux | c821a83a036757a52313b93bf7cc9de625a816da | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-09-28T10:20:26.000Z | 2019-09-28T10:20:26.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"Main Class to communicate with gs108e and gs105e netgear switches"
import time
import binascii
import pprint
import random
import struct
import socket
import fcntl
import psl_typ
import inspect
import errno
def get_hw_addr(ifname):
"gives the hardware (mac) address of a... | 39.331797 | 80 | 0.587522 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"Main Class to communicate with gs108e and gs105e netgear switches"
import time
import binascii
import pprint
import random
import struct
import socket
import fcntl
import psl_typ
import inspect
import errno
def get_hw_addr(ifname):
"gives the hardware (mac) address of a... | 0 | 0 | 0 |
6975219d67978b32abca1912305f92e399d8929f | 3,596 | py | Python | tests/test_parser.py | ousttrue/cpptypeinfo | 38b219ec5683dbba380e6f5ca2074c1ea0ccfaa9 | [
"MIT"
] | 1 | 2021-03-22T10:19:52.000Z | 2021-03-22T10:19:52.000Z | tests/test_parser.py | ousttrue/cpptypeinfo | 38b219ec5683dbba380e6f5ca2074c1ea0ccfaa9 | [
"MIT"
] | null | null | null | tests/test_parser.py | ousttrue/cpptypeinfo | 38b219ec5683dbba380e6f5ca2074c1ea0ccfaa9 | [
"MIT"
] | null | null | null | import unittest
from cpptypeinfo import (
TypeParser,
Float,
Double,
Bool,
Void,
Int8,
Int16,
Int32,
Int64,
UInt8,
UInt16,
UInt32,
UInt64,
)
from cpptypeinfo.usertype import (Pointer, Array, Field, Struct, Param,
Func... | 39.516484 | 79 | 0.55228 | import unittest
from cpptypeinfo import (
TypeParser,
Float,
Double,
Bool,
Void,
Int8,
Int16,
Int32,
Int64,
UInt8,
UInt16,
UInt32,
UInt64,
)
from cpptypeinfo.usertype import (Pointer, Array, Field, Struct, Param,
Func... | 3,147 | 15 | 52 |
ad6cb13482b4769b31aa3da89de989f9961164ab | 2,631 | py | Python | test.py | Jaiswal-ruhil/SmartSchema | 47c2b525cfbdd8f00a78329667fb4a4cdcf8377c | [
"MIT"
] | null | null | null | test.py | Jaiswal-ruhil/SmartSchema | 47c2b525cfbdd8f00a78329667fb4a4cdcf8377c | [
"MIT"
] | null | null | null | test.py | Jaiswal-ruhil/SmartSchema | 47c2b525cfbdd8f00a78329667fb4a4cdcf8377c | [
"MIT"
] | null | null | null |
# import sys
# sys.path.append("/home/ruhil/Dropbox/projects/python3-SmartSchema/SmartSchema/SmartSchema")
from SmartSchema import SmartSchema
if __name__ == "__main__":
InvoiceSchema = {
"type": "object",
"required": [
"reciver",
"issuer",
"inv_date"
... | 28.290323 | 93 | 0.372102 |
# import sys
# sys.path.append("/home/ruhil/Dropbox/projects/python3-SmartSchema/SmartSchema/SmartSchema")
from SmartSchema import SmartSchema
def reducedqty(inst):
y = 0
for x in inst["qty"]:
y = y + x['qty']
return y
if __name__ == "__main__":
InvoiceSchema = {
"type": "object",
... | 74 | 0 | 23 |
0bc8b29c196877264a4cd5a0acf5df842f160f5d | 16,937 | py | Python | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/subscriber/subscribergxinterface.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/subscriber/subscribergxinterface.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/subscriber/subscribergxinterface.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2016 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 41.109223 | 487 | 0.752908 | #
# Copyright (c) 2008-2016 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 658 | 432 | 141 |
e96950bff16083d411860e5492e2b1dd64d42547 | 249 | py | Python | src/test/resources/org/jenkinsci/plugins/django/simple_test_project/bdd_tests/bdd_settings.py | evili/django-jenkis-plugin | 60931ba3e2bbae8918d99a2d2dbd51d1b10fc5a1 | [
"Apache-2.0"
] | 1 | 2015-03-10T03:01:44.000Z | 2015-03-10T03:01:44.000Z | src/test/resources/org/jenkinsci/plugins/django/simple_test_project/bdd_tests/bdd_settings.py | evili/django-jenkis-plugin | 60931ba3e2bbae8918d99a2d2dbd51d1b10fc5a1 | [
"Apache-2.0"
] | 43 | 2015-03-03T07:25:05.000Z | 2022-03-31T04:14:35.000Z | src/test/resources/org/jenkinsci/plugins/django/simple_test_project/bdd_tests/bdd_settings.py | evili/django-jenkis-plugin | 60931ba3e2bbae8918d99a2d2dbd51d1b10fc5a1 | [
"Apache-2.0"
] | null | null | null | from django_test_deploy.settings import *
INSTALLED_APPS += ('bdd_tests',)
TEST_RUNNER = 'django_behave.runner.DjangoBehaveTestSuiteRunner'
#'django_behave.runner.DjangoBehaveTestSuiteRunner'
#'django_behave.runner.DjangoBehaveOnlyTestSuiteRunner'
| 35.571429 | 64 | 0.851406 | from django_test_deploy.settings import *
INSTALLED_APPS += ('bdd_tests',)
TEST_RUNNER = 'django_behave.runner.DjangoBehaveTestSuiteRunner'
#'django_behave.runner.DjangoBehaveTestSuiteRunner'
#'django_behave.runner.DjangoBehaveOnlyTestSuiteRunner'
| 0 | 0 | 0 |
5d61c18e96146d4ed0c3a487a99ff5f9121130dd | 455 | py | Python | addons/datatask/client/datatask/run.py | aixieluo/giftware | 51166699cf75e3d6029fab47a65b092ad5c9f658 | [
"Apache-2.0"
] | null | null | null | addons/datatask/client/datatask/run.py | aixieluo/giftware | 51166699cf75e3d6029fab47a65b092ad5c9f658 | [
"Apache-2.0"
] | null | null | null | addons/datatask/client/datatask/run.py | aixieluo/giftware | 51166699cf75e3d6029fab47a65b092ad5c9f658 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import worker
import configparser
import os
import sys
import const
cfgpath = os.path.join(const.ROOT_PATH, './config.ini')
conf = configparser.ConfigParser()
conf.read(cfgpath, encoding="utf-8")
tasks = conf.get('main', 'task').split(',')
for code in tasks:
token = co... | 22.75 | 56 | 0.663736 | from datetime import datetime
import worker
import configparser
import os
import sys
import const
cfgpath = os.path.join(const.ROOT_PATH, './config.ini')
conf = configparser.ConfigParser()
conf.read(cfgpath, encoding="utf-8")
tasks = conf.get('main', 'task').split(',')
for code in tasks:
token = co... | 0 | 0 | 0 |
080515e61c43971ada47f3234d130ead2fb49828 | 929 | py | Python | tadpole/template/app/models/auth/relation.py | echoyuanliang/pine | 22175e6aea0ca9b02d6542677b27a690c1501c9c | [
"MIT"
] | 2 | 2017-12-02T07:02:31.000Z | 2020-10-13T02:20:18.000Z | tadpole/template/app/models/auth/relation.py | echoyuanliang/pine | 22175e6aea0ca9b02d6542677b27a690c1501c9c | [
"MIT"
] | null | null | null | tadpole/template/app/models/auth/relation.py | echoyuanliang/pine | 22175e6aea0ca9b02d6542677b27a690c1501c9c | [
"MIT"
] | 1 | 2018-04-23T04:59:38.000Z | 2018-04-23T04:59:38.000Z | #!/usr/bin/env python
# coding: utf-8
"""
create at 2017/11/19 by allen
"""
from datetime import datetime
from app.lib.database import db, Column
user_role = db.Table('user_role',
Column('user_id', db.Integer, db.ForeignKey('user.id')),
Column('role_id', db.Integer, db.F... | 34.407407 | 98 | 0.482239 | #!/usr/bin/env python
# coding: utf-8
"""
create at 2017/11/19 by allen
"""
from datetime import datetime
from app.lib.database import db, Column
user_role = db.Table('user_role',
Column('user_id', db.Integer, db.ForeignKey('user.id')),
Column('role_id', db.Integer, db.F... | 0 | 0 | 0 |
90b1da90b1d33f95ba087a027df383f19ea25f89 | 6,161 | py | Python | holidays/countries/south_africa.py | m-ganko/python-holidays | f0d5a91f8bee8661ef3440bde2302332a364877e | [
"MIT"
] | null | null | null | holidays/countries/south_africa.py | m-ganko/python-holidays | f0d5a91f8bee8661ef3440bde2302332a364877e | [
"MIT"
] | 2 | 2021-06-18T11:50:15.000Z | 2021-07-13T14:29:46.000Z | holidays/countries/south_africa.py | m-ganko/python-holidays | f0d5a91f8bee8661ef3440bde2302332a364877e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | 35.005682 | 79 | 0.546665 | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | 5,209 | 31 | 122 |
55f54c0c1070b2a6f342f324df0835dabe98dfc3 | 767 | py | Python | baitola.py | silvioSCM/Python_estudos-e-arquivos | e1edf24559b8cd0fa7403fd52162d8af37294150 | [
"MIT"
] | null | null | null | baitola.py | silvioSCM/Python_estudos-e-arquivos | e1edf24559b8cd0fa7403fd52162d8af37294150 | [
"MIT"
] | null | null | null | baitola.py | silvioSCM/Python_estudos-e-arquivos | e1edf24559b8cd0fa7403fd52162d8af37294150 | [
"MIT"
] | null | null | null | import time
print('Bem vindo!! eu sou Priscila, a assistente A.I..')
time.sleep(2)
print("Por favor...qual o seu nome?")
seu_nome = input()
time.sleep(3)
print(f"{seu_nome},Você acha que o Júlio é baitola?")
baitola = input(f"Responda 'S' ou 'N'..." )
nao_baitola = (baitola)
print("Calculando......")
time.sleep(3)
pri... | 27.392857 | 67 | 0.674055 | import time
print('Bem vindo!! eu sou Priscila, a assistente A.I..')
time.sleep(2)
print("Por favor...qual o seu nome?")
seu_nome = input()
time.sleep(3)
print(f"{seu_nome},Você acha que o Júlio é baitola?")
baitola = input(f"Responda 'S' ou 'N'..." )
nao_baitola = (baitola)
print("Calculando......")
time.sleep(3)
pri... | 0 | 0 | 0 |
f7cca90e39d1e49138b473e2b3404c20a21d2682 | 967 | py | Python | test/test_self_ref.py | ybrs/mongomodels | 0337480589369dba0135245481439bcd161ef6ab | [
"MIT"
] | 6 | 2015-05-05T18:37:08.000Z | 2022-03-26T04:18:02.000Z | test/test_self_ref.py | ybrs/mongomodels | 0337480589369dba0135245481439bcd161ef6ab | [
"MIT"
] | null | null | null | test/test_self_ref.py | ybrs/mongomodels | 0337480589369dba0135245481439bcd161ef6ab | [
"MIT"
] | null | null | null | import unittest
import pymongo
import logging
logging.basicConfig(level=logging.DEBUG)
from mongomodels import connections, MongoModel, String, Integer, \
Column, or_, ValidationError, Boolean, belongs_to
if __name__ == '__main__':
unittest.main() | 29.30303 | 70 | 0.679421 | import unittest
import pymongo
import logging
logging.basicConfig(level=logging.DEBUG)
from mongomodels import connections, MongoModel, String, Integer, \
Column, or_, ValidationError, Boolean, belongs_to
class Category(MongoModel):
name = Column(String, required=True)
belongs_to('category', rel_column='... | 475 | 135 | 100 |
37b36acd36e98b0d69b09c07782fbb93be932247 | 6,095 | py | Python | agora/graph/__init__.py | oeg-upm/agora-py | 0c7e495a8c7023aaf79ed9dc91ef954f4519f60a | [
"Apache-2.0"
] | null | null | null | agora/graph/__init__.py | oeg-upm/agora-py | 0c7e495a8c7023aaf79ed9dc91ef954f4519f60a | [
"Apache-2.0"
] | 3 | 2018-02-06T17:44:00.000Z | 2021-01-12T06:22:40.000Z | agora/graph/__init__.py | oeg-upm/agora-py | 0c7e495a8c7023aaf79ed9dc91ef954f4519f60a | [
"Apache-2.0"
] | 1 | 2018-05-07T07:30:57.000Z | 2018-05-07T07:30:57.000Z | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Ontology Engineering Group
http://www.oeg-upm.net/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2016 Ontology Engineering Group.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... | 36.065089 | 111 | 0.590156 | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Ontology Engineering Group
http://www.oeg-upm.net/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2016 Ontology Engineering Group.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... | 3,673 | 338 | 100 |
0b9b6bb87bc907d1141e684668a7a503622eb019 | 35,191 | py | Python | mathics/builtin/string/operations.py | skirpichev/Mathics | 318e06dea8f1c70758a50cb2f95c9900150e3a68 | [
"Apache-2.0"
] | 1,920 | 2015-01-06T17:56:26.000Z | 2022-03-24T14:33:29.000Z | mathics/builtin/string/operations.py | skirpichev/Mathics | 318e06dea8f1c70758a50cb2f95c9900150e3a68 | [
"Apache-2.0"
] | 868 | 2015-01-04T06:19:40.000Z | 2022-03-14T13:39:38.000Z | mathics/builtin/string/operations.py | skirpichev/Mathics | 318e06dea8f1c70758a50cb2f95c9900150e3a68 | [
"Apache-2.0"
] | 240 | 2015-01-16T13:31:26.000Z | 2022-03-12T12:52:46.000Z | # -*- coding: utf-8 -*-
"""
Operations on Strings
"""
import re
from mathics.version import __version__ # noqa used in loading to check consistency.
from mathics.builtin.base import (
BinaryOperator,
Builtin,
)
from mathics.core.expression import (
Expression,
Integer,
Integer1,
String,
... | 33.230406 | 136 | 0.555682 | # -*- coding: utf-8 -*-
"""
Operations on Strings
"""
import re
from mathics.version import __version__ # noqa used in loading to check consistency.
from mathics.builtin.base import (
BinaryOperator,
Builtin,
)
from mathics.core.expression import (
Expression,
Integer,
Integer1,
String,
... | 2,006 | 0 | 80 |
a1b8279c46ab312d0fb0144512fd0fc54c45005b | 1,494 | py | Python | PythonAPI/examples/TestBench/older_mixed_files/environment_setup.py | Abanoub-G/carla_0.9.11 | d7f6188fb745409047edc7151cb97c3d20472867 | [
"MIT"
] | null | null | null | PythonAPI/examples/TestBench/older_mixed_files/environment_setup.py | Abanoub-G/carla_0.9.11 | d7f6188fb745409047edc7151cb97c3d20472867 | [
"MIT"
] | null | null | null | PythonAPI/examples/TestBench/older_mixed_files/environment_setup.py | Abanoub-G/carla_0.9.11 | d7f6188fb745409047edc7151cb97c3d20472867 | [
"MIT"
] | null | null | null |
from shapely.geometry import Polygon
import math
import numpy as np
import random
from shapely.geometry import Point
# from shapely.geometry import Polygon
| 21.970588 | 57 | 0.668005 |
from shapely.geometry import Polygon
import math
import numpy as np
import random
from shapely.geometry import Point
# from shapely.geometry import Polygon
def Ticking(world,frame):
# Tick
world.tick()
# Get world snapshot
world_snapshot = world.get_snapshot()
ts = world_snapshot.timestamp
if fra... | 1,220 | 0 | 115 |
6f287737e8f9a92a8575fc5d8732553d4c087291 | 3,155 | py | Python | questions/q139_bst_verification/code.py | aadhityasw/Competitive-Programs | 901a48d35f024a3a87c32a45b7f4531e8004a203 | [
"MIT"
] | null | null | null | questions/q139_bst_verification/code.py | aadhityasw/Competitive-Programs | 901a48d35f024a3a87c32a45b7f4531e8004a203 | [
"MIT"
] | 1 | 2021-05-15T07:56:51.000Z | 2021-05-15T07:56:51.000Z | questions/q139_bst_verification/code.py | aadhityasw/Competitive-Programs | 901a48d35f024a3a87c32a45b7f4531e8004a203 | [
"MIT"
] | null | null | null |
# return True if the given tree is a BST, else return False
from collections import deque
# Tree Node
# Function to Build Tree
if __name__=="__main__":
t=int(input())
for _ in range(0,t):
s=input()
root=buildTree(s)
if isBST(root):
print(1)
el... | 25.039683 | 81 | 0.511886 | def checkLeft(root, val) :
flag = True
if root.left :
flag = flag and (root.data > root.left.data)
if flag :
flag = flag and checkLeft(root.left, root.data)
if flag and root.right :
flag = flag and (root.data < root.right.data) and (root.right.data < val)
... | 2,683 | -10 | 137 |
d3b941e19b6ddb451a64b6b9ad81fe8272333ce5 | 217 | py | Python | library/gcloud_accessor/gcloud.py | anchitarnav/gcloud-resource-cleanup | a3b220f406529df43ffd5afa8adb929c718caba5 | [
"MIT"
] | null | null | null | library/gcloud_accessor/gcloud.py | anchitarnav/gcloud-resource-cleanup | a3b220f406529df43ffd5afa8adb929c718caba5 | [
"MIT"
] | 6 | 2020-04-29T09:09:48.000Z | 2021-04-30T21:13:57.000Z | library/gcloud_accessor/gcloud.py | anchitarnav/gcloud-resource-cleanup | a3b220f406529df43ffd5afa8adb929c718caba5 | [
"MIT"
] | null | null | null | import googleapiclient.discovery
from library.gcloud_accessor.rest_library.gcloud_rest_library import GcloudRestLib
| 24.111111 | 82 | 0.78341 | import googleapiclient.discovery
from library.gcloud_accessor.rest_library.gcloud_rest_library import GcloudRestLib
class Gcloud(GcloudRestLib):
def __init__(self, **kwargs):
super().__init__(**kwargs)
| 43 | 7 | 49 |
1b983f664b2417a2b32581b312bdd6182cc222cb | 171 | py | Python | fixture.py | twocucao/tifa | f703fd27f54000e7d51f06d2456d09cc79e0ab72 | [
"MIT"
] | 71 | 2020-04-16T04:28:45.000Z | 2022-03-31T22:45:11.000Z | fixture.py | twocucao/tifa | f703fd27f54000e7d51f06d2456d09cc79e0ab72 | [
"MIT"
] | 6 | 2021-05-13T06:32:38.000Z | 2022-03-04T01:18:34.000Z | fixture.py | twocucao/tifa | f703fd27f54000e7d51f06d2456d09cc79e0ab72 | [
"MIT"
] | 12 | 2021-05-01T08:43:11.000Z | 2022-03-29T00:58:54.000Z | from tifa.globals import db
from tifa.db.dal import Dal
from tifa.models.system import Staff
dal = Dal(db.session)
dal.add(
Staff,
name="hey tea",
)
dal.commit()
| 15.545455 | 36 | 0.707602 | from tifa.globals import db
from tifa.db.dal import Dal
from tifa.models.system import Staff
dal = Dal(db.session)
dal.add(
Staff,
name="hey tea",
)
dal.commit()
| 0 | 0 | 0 |
b0e5d6ebee8f222cf53308028e793f255e89bf3b | 3,616 | py | Python | shell/shell.py | utep-cs-systems-courses/os-shell-IppikiOukami | 7d2b61d13eda2d395578c50d82891202ed68ae67 | [
"BSD-3-Clause"
] | null | null | null | shell/shell.py | utep-cs-systems-courses/os-shell-IppikiOukami | 7d2b61d13eda2d395578c50d82891202ed68ae67 | [
"BSD-3-Clause"
] | null | null | null | shell/shell.py | utep-cs-systems-courses/os-shell-IppikiOukami | 7d2b61d13eda2d395578c50d82891202ed68ae67 | [
"BSD-3-Clause"
] | null | null | null | import os, sys, re, myIO
# Needs to determine functionality for symbols within commands
runShell()
| 43.047619 | 109 | 0.402102 | import os, sys, re, myIO
# Needs to determine functionality for symbols within commands
def runShell():
while True: #keep active prompt
pid = os.getpid()
os.environ['PS1'] = '$ ' #change PS1 to '$ '
... | 3,426 | 0 | 88 |
bae9ccff64adc2b67bf64577f9cc44d80e9c4ab5 | 744 | py | Python | winix/util/cipher.py | edc1591/python-winix | deb63be7916188ec3a2889ff9325dd16e1c2944b | [
"MIT"
] | 6 | 2019-12-30T14:07:26.000Z | 2021-06-07T04:37:16.000Z | winix/util/cipher.py | edc1591/python-winix | deb63be7916188ec3a2889ff9325dd16e1c2944b | [
"MIT"
] | 3 | 2020-10-13T02:01:09.000Z | 2020-10-26T03:05:20.000Z | winix/util/cipher.py | edc1591/python-winix | deb63be7916188ec3a2889ff9325dd16e1c2944b | [
"MIT"
] | 2 | 2020-10-14T17:41:14.000Z | 2021-03-10T02:24:20.000Z | from base64 import b64decode
from base64 import b64encode
import hashlib
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
| 31 | 68 | 0.670699 | from base64 import b64decode
from base64 import b64encode
import hashlib
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
class AESCipher:
def __init__(self, key):
self.key = key.encode('utf8')
self.iv = b'1234567890abcdef'
... | 456 | -5 | 103 |
394d741759bb8933781763eedcda95d98a758cf1 | 999 | py | Python | gerar_cadastros.py | jwestarb/bazar | 3433e6e554f8335968d3b2a4175fb2f84eee0623 | [
"MIT"
] | null | null | null | gerar_cadastros.py | jwestarb/bazar | 3433e6e554f8335968d3b2a4175fb2f84eee0623 | [
"MIT"
] | null | null | null | gerar_cadastros.py | jwestarb/bazar | 3433e6e554f8335968d3b2a4175fb2f84eee0623 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os, sys
import random
import time
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bazar.settings")
import django
django.setup()
from core.models import Cadastro
for i in range(1, 1000 ):
cad = Cadastro()
cad.senha = i
cad.cpf = generate_cpf()
cad.nome = 'Teste {}'.form... | 27 | 75 | 0.630631 | # -*- coding: utf-8 -*-
import os, sys
import random
import time
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bazar.settings")
import django
django.setup()
from core.models import Cadastro
def strTimeProp(start, end, format, prop):
stime = time.mktime(time.strptime(start, format))
etime = time.mktime(tim... | 543 | 0 | 69 |
a1178d3374263026cb4e256232bb78964f451d98 | 423 | py | Python | openff/evaluator/properties/__init__.py | jaketanderson/openff-evaluator | 68541612fb0dacacc909d02f273c66ae830051d5 | [
"MIT"
] | 14 | 2019-02-01T18:56:58.000Z | 2019-12-10T18:01:38.000Z | openff/evaluator/properties/__init__.py | jaketanderson/openff-evaluator | 68541612fb0dacacc909d02f273c66ae830051d5 | [
"MIT"
] | 168 | 2019-01-31T19:54:11.000Z | 2020-02-05T21:47:00.000Z | openff/evaluator/properties/__init__.py | jaketanderson/openff-evaluator | 68541612fb0dacacc909d02f273c66ae830051d5 | [
"MIT"
] | 4 | 2019-05-01T17:45:24.000Z | 2019-11-11T19:34:28.000Z | from .binding import HostGuestBindingAffinity
from .density import Density, ExcessMolarVolume
from .dielectric import DielectricConstant
from .enthalpy import EnthalpyOfMixing, EnthalpyOfVaporization
from .solvation import SolvationFreeEnergy
__all__ = [
HostGuestBindingAffinity,
Density,
ExcessMolarVolume... | 26.4375 | 62 | 0.813239 | from .binding import HostGuestBindingAffinity
from .density import Density, ExcessMolarVolume
from .dielectric import DielectricConstant
from .enthalpy import EnthalpyOfMixing, EnthalpyOfVaporization
from .solvation import SolvationFreeEnergy
__all__ = [
HostGuestBindingAffinity,
Density,
ExcessMolarVolume... | 0 | 0 | 0 |
02f6b9792df9b33527642307503831fcee4f605d | 3,753 | py | Python | Dr. CovidAI/Dr. CovidAI/flaskblog/pool.py | Shreyas-l/Dr.CovidAI | a09eb779db8d7f38fe4545d3ab71fac8a78f1054 | [
"MIT"
] | null | null | null | Dr. CovidAI/Dr. CovidAI/flaskblog/pool.py | Shreyas-l/Dr.CovidAI | a09eb779db8d7f38fe4545d3ab71fac8a78f1054 | [
"MIT"
] | 1 | 2020-04-13T15:56:55.000Z | 2020-04-13T15:56:55.000Z | Dr. CovidAI/Dr. CovidAI/flaskblog/pool.py | Shreyas-l/CODE19-Pyrocrats | a09eb779db8d7f38fe4545d3ab71fac8a78f1054 | [
"MIT"
] | null | null | null | import random
# import Dataset as ds
from flaskblog import poolData
from flaskblog import DoctorData as doctor
FILTER_THRESHOLD_PERC = 30
POOL_BUFFER_SIZE = 10
POOL_SIZE = 5
# if __name__ == '__main__':
# # add_to_dataset("Powai", 80)
# main()
| 25.705479 | 72 | 0.57021 | import random
# import Dataset as ds
from flaskblog import poolData
from flaskblog import DoctorData as doctor
FILTER_THRESHOLD_PERC = 30
POOL_BUFFER_SIZE = 10
POOL_SIZE = 5
def filterData(Data):
filteredData = {}
for entry in Data:
if Data[entry]["probability"] >= FILTER_THRESHOLD_PERC... | 3,299 | 0 | 175 |
74211b9f44eda3bdfa330383a5572f869c791fd9 | 982 | py | Python | fec/home/templatetags/commissioners.py | rds0751/fec-cms | 833cdac7240d056ed234ed5b503a2407e1fee1ce | [
"CC0-1.0"
] | 47 | 2015-09-09T14:23:30.000Z | 2019-12-29T13:58:41.000Z | fec/home/templatetags/commissioners.py | rds0751/fec-cms | 833cdac7240d056ed234ed5b503a2407e1fee1ce | [
"CC0-1.0"
] | 1,634 | 2015-08-19T16:36:28.000Z | 2018-03-09T18:22:23.000Z | fec/home/templatetags/commissioners.py | rds0751/fec-cms | 833cdac7240d056ed234ed5b503a2407e1fee1ce | [
"CC0-1.0"
] | 27 | 2015-08-20T02:10:13.000Z | 2021-02-14T10:51:18.000Z | import re
from django import template
from home.models import CommissionerPage
from django.db.models import Q
register = template.Library()
@register.inclusion_tag('partials/current-commissioners.html')
| 36.37037 | 102 | 0.744399 | import re
from django import template
from home.models import CommissionerPage
from django.db.models import Q
register = template.Library()
@register.inclusion_tag('partials/current-commissioners.html')
def current_commissioners():
chair_commissioner = CommissionerPage.objects.filter(commissioner_title__startswi... | 754 | 0 | 22 |
98d8c4fd3de07f00c5dfb45fcebc9bed2469f734 | 663 | py | Python | src/visions/core/model/relations.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | src/visions/core/model/relations.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | src/visions/core/model/relations.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | import pandas as pd
import attr
from visions.core.model import TypeRelation
@attr.s(frozen=True)
@attr.s(frozen=True)
| 22.1 | 54 | 0.73454 | import pandas as pd
import attr
from visions.core.model import TypeRelation
def identity_relation(series: pd.Series) -> pd.Series:
return series
@attr.s(frozen=True)
class IdentityRelation(TypeRelation):
inferential = attr.ib(default=False)
transformer = attr.ib(default=identity_relation)
relations... | 141 | 331 | 67 |
310b5cec21158c4c326c81089013a9315b2179fc | 17,955 | py | Python | utils/density_plotting.py | dewyeon/toy2d | e84f1b8b951bb1e85cb38ce5c4aae8734d6ed7de | [
"MIT"
] | 1 | 2022-02-28T12:16:46.000Z | 2022-02-28T12:16:46.000Z | utils/density_plotting.py | dewyeon/toy2d | e84f1b8b951bb1e85cb38ce5c4aae8734d6ed7de | [
"MIT"
] | null | null | null | utils/density_plotting.py | dewyeon/toy2d | e84f1b8b951bb1e85cb38ce5c4aae8734d6ed7de | [
"MIT"
] | null | null | null | import torch
import os
import numpy as np
import math
from einops import rearrange
import logging
logger = logging.getLogger(__name__)
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
_GCONST_ = -0.9189385332046727 # ln(sqrt(2*pi))
def positionalencoding2d(D, H, W):
"""
:param D: dimens... | 44.007353 | 163 | 0.63208 | import torch
import os
import numpy as np
import math
from einops import rearrange
import logging
logger = logging.getLogger(__name__)
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
_GCONST_ = -0.9189385332046727 # ln(sqrt(2*pi))
def get_logp_z(z):
# import pdb; pdb.set_trace()
C = 2
... | 8,085 | 0 | 199 |
e4b233da694ed06213976a63834211a2dbec0e7a | 4,995 | py | Python | gent/math/sampling.py | flywinged/TGL | a567ae717e7f9390eb9a5ce3383e5b796389af05 | [
"MIT"
] | 1 | 2020-06-19T18:59:02.000Z | 2020-06-19T18:59:02.000Z | gent/math/sampling.py | flywinged/TGL | a567ae717e7f9390eb9a5ce3383e5b796389af05 | [
"MIT"
] | 16 | 2020-06-17T22:26:18.000Z | 2020-07-28T21:39:10.000Z | gent/math/sampling.py | flywinged/TGL | a567ae717e7f9390eb9a5ce3383e5b796389af05 | [
"MIT"
] | null | null | null | # # Copyright Clayton Brown 2019. See LICENSE file.
# import numpy
# from types import FunctionType
# from csaps import UnivariateCubicSmoothingSpline
# class ProbabilityDistribution:
# '''
# Function to handle probability distributions.
# Parameters
# ----------
# distributionFun... | 42.692308 | 142 | 0.635035 | # # Copyright Clayton Brown 2019. See LICENSE file.
# import numpy
# from types import FunctionType
# from csaps import UnivariateCubicSmoothingSpline
# class ProbabilityDistribution:
# '''
# Function to handle probability distributions.
# Parameters
# ----------
# distributionFun... | 0 | 0 | 0 |
2e38dfc3cf9121c3e4750bb120c68978804a6342 | 927 | py | Python | server/app/api/__init__.py | chrisng93/restaurant-picker | c21b6da2c13c8a163a4beeaa3317ac793f8674d7 | [
"MIT"
] | 1 | 2017-05-04T14:43:04.000Z | 2017-05-04T14:43:04.000Z | server/app/api/__init__.py | chrisng93/dished. | c21b6da2c13c8a163a4beeaa3317ac793f8674d7 | [
"MIT"
] | 45 | 2017-04-27T03:39:58.000Z | 2017-05-04T02:42:37.000Z | server/app/api/__init__.py | chrisng93/dished. | c21b6da2c13c8a163a4beeaa3317ac793f8674d7 | [
"MIT"
] | null | null | null | """
API core
"""
from functools import wraps
from flask import jsonify
from ..common import core
def create_app():
""" Returns API application instance """
app = core.create_app(__name__, __path__)
# Custom error handlers
# app.errorhandler(ExampleError)(on_example_error)
app.errorhandler(40... | 22.609756 | 76 | 0.582524 | """
API core
"""
from functools import wraps
from flask import jsonify
from ..common import core
def create_app():
""" Returns API application instance """
app = core.create_app(__name__, __path__)
# Custom error handlers
# app.errorhandler(ExampleError)(on_example_error)
app.errorhandler(40... | 532 | 0 | 46 |
c70d51ee1a5f2d449d7b51e44cefe7be13906c2a | 893 | py | Python | coders/coder.py | Thesys-lab/learned-coded-computation | c5c32bcfb7cc4a9f52079f648373e6972c19eff9 | [
"Apache-2.0"
] | 8 | 2019-03-05T02:33:46.000Z | 2020-08-31T00:49:45.000Z | coders/coder.py | Thesys-lab/learned-coded-computation | c5c32bcfb7cc4a9f52079f648373e6972c19eff9 | [
"Apache-2.0"
] | null | null | null | coders/coder.py | Thesys-lab/learned-coded-computation | c5c32bcfb7cc4a9f52079f648373e6972c19eff9 | [
"Apache-2.0"
] | 3 | 2019-03-05T02:33:48.000Z | 2020-06-14T13:52:06.000Z | import torch
import torch.nn as nn
class Coder(nn.Module):
"""
Base class for implementing encoders and decoders. All new encoders and
decoders should derive from this class.
"""
def __init__(self, num_in, num_out, in_dim):
"""
Parameters
----------
num_in: int... | 26.264706 | 75 | 0.539754 | import torch
import torch.nn as nn
class Coder(nn.Module):
"""
Base class for implementing encoders and decoders. All new encoders and
decoders should derive from this class.
"""
def __init__(self, num_in, num_out, in_dim):
"""
Parameters
----------
num_in: int... | 0 | 0 | 0 |
e60ce07d48e510cf4dbd859e7c6dd8de0fbea2d8 | 6,167 | py | Python | nuplan/planning/simulation/planner/abstract_planner.py | motional/nuplan-devkit | e39029e788b17f47f2fcadb774098ef8fbdd0d67 | [
"Apache-2.0"
] | 128 | 2021-12-06T15:41:14.000Z | 2022-03-29T13:16:32.000Z | nuplan/planning/simulation/planner/abstract_planner.py | motional/nuplan-devkit | e39029e788b17f47f2fcadb774098ef8fbdd0d67 | [
"Apache-2.0"
] | 28 | 2021-12-11T08:11:31.000Z | 2022-03-25T02:35:43.000Z | nuplan/planning/simulation/planner/abstract_planner.py | motional/nuplan-devkit | e39029e788b17f47f2fcadb774098ef8fbdd0d67 | [
"Apache-2.0"
] | 14 | 2021-12-11T04:12:26.000Z | 2022-03-24T06:38:30.000Z | import abc
from abc import abstractmethod
from dataclasses import dataclass
from typing import List, Optional, Type, Union
from nuplan.common.actor_state.state_representation import StateSE2
from nuplan.common.maps.abstract_map import AbstractMap
from nuplan.common.maps.maps_datatypes import TrafficLightStatusData
fro... | 46.719697 | 120 | 0.71915 | import abc
from abc import abstractmethod
from dataclasses import dataclass
from typing import List, Optional, Type, Union
from nuplan.common.actor_state.state_representation import StateSE2
from nuplan.common.maps.abstract_map import AbstractMap
from nuplan.common.maps.maps_datatypes import TrafficLightStatusData
fro... | 0 | 0 | 0 |
d4bd060696a338cab4c2219ab5a1f90c55130484 | 1,154 | py | Python | tworaven_apps/solver_interfaces/util_solve.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 20 | 2017-12-11T07:26:06.000Z | 2021-11-22T16:16:20.000Z | tworaven_apps/solver_interfaces/util_solve.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 849 | 2017-10-20T18:21:18.000Z | 2022-02-18T02:45:44.000Z | tworaven_apps/solver_interfaces/util_solve.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 1 | 2020-05-18T06:02:13.000Z | 2020-05-18T06:02:13.000Z | from tworaven_apps.solver_interfaces.util_search import (
SearchAutoSklearn,
SearchCaret,
SearchH2O,
SearchTPOT,
SearchLudwig,
SearchMLJarSupervised,
SearchMLBox,
SearchTwoRavens)
| 30.368421 | 62 | 0.616984 | from tworaven_apps.solver_interfaces.util_search import (
SearchAutoSklearn,
SearchCaret,
SearchH2O,
SearchTPOT,
SearchLudwig,
SearchMLJarSupervised,
SearchMLBox,
SearchTwoRavens)
class Solve(object):
def __init__(self, system, specification,
callback_found: str, c... | 865 | -1 | 76 |
2839540be7e44689389b51080513e8c27c181ad6 | 5,277 | py | Python | util_transform.py | DerekGloudemans/I24-MOTION-examples | cc542e96bf16d9ba3bf971d53faf31ac9d72db42 | [
"MIT"
] | 1 | 2021-06-12T00:53:05.000Z | 2021-06-12T00:53:05.000Z | util_transform.py | DerekGloudemans/I24-MOTION-examples | cc542e96bf16d9ba3bf971d53faf31ac9d72db42 | [
"MIT"
] | null | null | null | util_transform.py | DerekGloudemans/I24-MOTION-examples | cc542e96bf16d9ba3bf971d53faf31ac9d72db42 | [
"MIT"
] | null | null | null | # contains utility functions relevant for image and coordinate transformation
from __future__ import division
from itertools import combinations
import json
import numpy as np
import cv2
def get_best_transform(x,y):
"""
given a set of N points in both x and y space, finds the best (lowest avg error)
... | 32.176829 | 88 | 0.567368 | # contains utility functions relevant for image and coordinate transformation
from __future__ import division
from itertools import combinations
import json
import numpy as np
import cv2
def get_best_transform(x,y):
"""
given a set of N points in both x and y space, finds the best (lowest avg error)
... | 295 | 0 | 23 |
569f8079d548bf4d08ebe4449569ea28cde1fcb4 | 5,434 | py | Python | haros_plugin_pbt_gen/selectors.py | git-afsantos/haros-plugin-pbt | 388c990117f357fa2079be48918fd3486c895597 | [
"MIT"
] | null | null | null | haros_plugin_pbt_gen/selectors.py | git-afsantos/haros-plugin-pbt | 388c990117f357fa2079be48918fd3486c895597 | [
"MIT"
] | 6 | 2019-10-23T08:13:32.000Z | 2020-02-11T18:58:26.000Z | haros_plugin_pbt_gen/selectors.py | git-afsantos/haros-plugin-pbt | 388c990117f357fa2079be48918fd3486c895597 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
# Copyright © 2019 André Santos
###############################################################################
# Imports
###############################################################################
from builtins import map
from builtins import object
from bu... | 29.058824 | 79 | 0.552079 | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
# Copyright © 2019 André Santos
###############################################################################
# Imports
###############################################################################
from builtins import map
from builtins import object
from bu... | 3,567 | 1,018 | 115 |
bc768e2189aa9164745726a107794394ee08e4c1 | 865 | py | Python | development/compare_amino_jsons.py | mriglobal/vorpal | 5dd590863e1831df2020d7a70ccdea7807cb88d1 | [
"MIT"
] | 3 | 2021-08-28T06:51:31.000Z | 2022-02-28T21:59:54.000Z | development/compare_amino_jsons.py | mriglobal/vorpal | 5dd590863e1831df2020d7a70ccdea7807cb88d1 | [
"MIT"
] | null | null | null | development/compare_amino_jsons.py | mriglobal/vorpal | 5dd590863e1831df2020d7a70ccdea7807cb88d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 1 11:46:37 2021
@author: colin
"""
import json
import argparse
import os
parser = argparse.ArgumentParser(description="compare two amino alphabet clusterings")
parser.add_argument('-f', '--files', type=is_file, nargs=2, default=None,
... | 20.116279 | 86 | 0.67052 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 1 11:46:37 2021
@author: colin
"""
import json
import argparse
import os
def is_file(string):
if os.path.isfile(string):
return string
else:
raise ValueError("Not a file")
parser = argparse.ArgumentParser(description="compare two amino alp... | 83 | 0 | 23 |
eb12fc6b29a934d4686d5db491393e262d899e41 | 72 | py | Python | snli/wae-stochastic/gl.py | yq-wen/probabilistic_nlg | 545a0a82eaba005be77d50ad25c6cb7267e16676 | [
"MIT"
] | 28 | 2019-03-03T05:12:51.000Z | 2022-01-15T14:05:39.000Z | snli/wae-stochastic/gl.py | yq-wen/probabilistic_nlg | 545a0a82eaba005be77d50ad25c6cb7267e16676 | [
"MIT"
] | 6 | 2019-07-04T11:39:32.000Z | 2022-02-09T23:29:03.000Z | snli/wae-stochastic/gl.py | sndean/probabilistic_nlg | fab94d63a742951d9e198f3b2a90db87ffa23b8a | [
"MIT"
] | 8 | 2019-04-02T15:36:41.000Z | 2021-05-17T16:02:56.000Z | config_fingerprint = None
config = None
log_writer = None
isTrain = True | 18 | 25 | 0.791667 | config_fingerprint = None
config = None
log_writer = None
isTrain = True | 0 | 0 | 0 |
4807e1c5cb477e1942efc6a13dd78cdc2f0fabe4 | 4,212 | py | Python | cpc_models/WideResNet_Encoder.py | fanld/CPCV2-PyTorch | 01f2f82ef48303b11ba40c2a2af7e35068d1cfc9 | [
"MIT"
] | 11 | 2020-11-01T07:49:15.000Z | 2021-12-30T04:40:50.000Z | cpc_models/WideResNet_Encoder.py | fanld/CPCV2-PyTorch | 01f2f82ef48303b11ba40c2a2af7e35068d1cfc9 | [
"MIT"
] | 4 | 2020-11-01T07:50:16.000Z | 2021-11-02T15:17:08.000Z | cpc_models/WideResNet_Encoder.py | fanld/CPCV2-PyTorch | 01f2f82ef48303b11ba40c2a2af7e35068d1cfc9 | [
"MIT"
] | 3 | 2021-10-17T13:23:36.000Z | 2022-03-01T03:11:30.000Z | # Based on:
# https://github.com/meliketoy/wide-resnet.pytorch/blob/master/networks/wide_resnet.py
import torch
import torch.nn as nn
import torch.nn.functional as F
| 35.694915 | 109 | 0.614672 | # Based on:
# https://github.com/meliketoy/wide-resnet.pytorch/blob/master/networks/wide_resnet.py
import torch
import torch.nn as nn
import torch.nn.functional as F
def norm2d(planes, norm):
if norm == "none":
return nn.Identity()
elif norm == "batch":
return nn.BatchNorm2d(planes)
elif ... | 3,817 | 23 | 202 |
897210b0e9a4c35a4d9e314e95bbaa6310d9eeb9 | 4,297 | py | Python | api/app.py | BojanaZ/SeamlessMDD | 94302cc1d253eb26794e906c9e648c2ea569f851 | [
"MIT"
] | null | null | null | api/app.py | BojanaZ/SeamlessMDD | 94302cc1d253eb26794e906c9e648c2ea569f851 | [
"MIT"
] | 1 | 2021-12-13T20:56:06.000Z | 2021-12-13T20:56:06.000Z | api/app.py | BojanaZ/SeamlessMDD | 94302cc1d253eb26794e906c9e648c2ea569f851 | [
"MIT"
] | null | null | null | import os
from flask import Flask, request, jsonify, make_response
from transformation.generator_handler import GeneratorHandler
from transformation.generators.documents_output_generator import DocumentsOutputGenerator
from transformation.generators.generator_register import GeneratorRegister
from metamodel.model imp... | 38.366071 | 89 | 0.624156 | import os
from flask import Flask, request, jsonify, make_response
from transformation.generator_handler import GeneratorHandler
from transformation.generators.documents_output_generator import DocumentsOutputGenerator
from transformation.generators.generator_register import GeneratorRegister
from metamodel.model imp... | 3,593 | 0 | 23 |
05629dbee3fb53ef7bf67684d32d0d4ea0c3fd42 | 2,693 | py | Python | DataProcess.py | huangzz119/capstone_project2 | 26c994a41dbc7e8e399e090ead19879b7cf9d7d3 | [
"MIT"
] | 7 | 2020-01-22T11:14:05.000Z | 2022-03-28T06:06:30.000Z | DataProcess.py | huangzz119/capstone_project2 | 26c994a41dbc7e8e399e090ead19879b7cf9d7d3 | [
"MIT"
] | null | null | null | DataProcess.py | huangzz119/capstone_project2 | 26c994a41dbc7e8e399e090ead19879b7cf9d7d3 | [
"MIT"
] | 4 | 2020-01-22T11:14:21.000Z | 2021-03-25T07:20:28.000Z | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def date_process(data):
"""
:param data: original data
:return: groups: dict type: key is date and the corresponding intraday volumn size
"""
data_filter = data[data.isna().any(axis=1)]
data_filter["reshape_time"] = pd.to_d... | 23.622807 | 121 | 0.62941 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def date_process(data):
"""
:param data: original data
:return: groups: dict type: key is date and the corresponding intraday volumn size
"""
data_filter = data[data.isna().any(axis=1)]
data_filter["reshape_time"] = pd.to_d... | 0 | 0 | 0 |
c050ef8a1679cc0e58c83984043dd7a24dd0b81c | 1,163 | py | Python | client/utils/notice_player.py | A-Yu-cn/sqq | 29d6127c38d7b9f7e9a8d609fc0448943118e6cb | [
"MIT"
] | null | null | null | client/utils/notice_player.py | A-Yu-cn/sqq | 29d6127c38d7b9f7e9a8d609fc0448943118e6cb | [
"MIT"
] | null | null | null | client/utils/notice_player.py | A-Yu-cn/sqq | 29d6127c38d7b9f7e9a8d609fc0448943118e6cb | [
"MIT"
] | null | null | null | from threading import Thread
from globalFile import GlobalData
import pyaudio
import base64
| 33.228571 | 87 | 0.563199 | from threading import Thread
from globalFile import GlobalData
import pyaudio
import base64
class NoticePlayer(Thread):
def __init__(self):
super(NoticePlayer, self).__init__()
self.chunk_size = 1024
self.audio_format = pyaudio.paInt16
self.channels = 2
self.rate = 32000
... | 1,003 | 6 | 77 |
e666b61555013b0e5b7fee947e9da81fa5dcf415 | 4,602 | py | Python | aether/sdk/drf/serializers.py | eHealthAfrica/aether-django-sdk-library | fc371af89bfed155d465049320f32bf43860d001 | [
"Apache-2.0"
] | 1 | 2020-05-04T21:05:11.000Z | 2020-05-04T21:05:11.000Z | aether/sdk/drf/serializers.py | eHealthAfrica/aether-django-sdk-library | fc371af89bfed155d465049320f32bf43860d001 | [
"Apache-2.0"
] | 3 | 2019-09-30T15:45:43.000Z | 2020-04-29T08:12:37.000Z | aether/sdk/drf/serializers.py | eHealthAfrica/aether-django-sdk-library | fc371af89bfed155d465049320f32bf43860d001 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... | 31.306122 | 94 | 0.676445 | # Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... | 1,883 | 282 | 276 |
2250088bf6a9f45b786e35a18f78e9d2ceb0c736 | 4,249 | py | Python | src/graphing/graph.py | Billlynch/COMP37111 | 40c2baba5b268b517a253e4680fdb1f06816be4a | [
"MIT"
] | null | null | null | src/graphing/graph.py | Billlynch/COMP37111 | 40c2baba5b268b517a253e4680fdb1f06816be4a | [
"MIT"
] | null | null | null | src/graphing/graph.py | Billlynch/COMP37111 | 40c2baba5b268b517a253e4680fdb1f06816be4a | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
import csv
from scipy.optimize import curve_fit
frameDeltas = []
physicsDeltas = []
openGLDeltas = []
drawCallDeltas = []
particleCounts = []
rowCount = 5120
fifth = 1024
with open('analysisResultSpaceOpenCL.csv', newl... | 32.937984 | 174 | 0.718522 | import numpy as np
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
import csv
from scipy.optimize import curve_fit
frameDeltas = []
physicsDeltas = []
openGLDeltas = []
drawCallDeltas = []
particleCounts = []
rowCount = 5120
fifth = 1024
with open('analysisResultSpaceOpenCL.csv', newl... | 0 | 0 | 0 |
d95f10be9e8f582e18ec6e7e2d1e507a625a1202 | 944 | py | Python | tests/__init__.py | hishamnajam/python-wordpress-xmlrpc | 8270a9f629b7d097e59ac5c649f41c8c1ee322a8 | [
"MIT"
] | 218 | 2015-01-12T02:05:07.000Z | 2022-03-27T19:11:10.000Z | tests/__init__.py | kholidfu/python-wordpress-xmlrpc | 7ac0a6e9934fdbf02c2250932e0c026cf530d400 | [
"MIT"
] | 80 | 2015-01-17T18:52:05.000Z | 2022-03-06T18:09:17.000Z | tests/__init__.py | kholidfu/python-wordpress-xmlrpc | 7ac0a6e9934fdbf02c2250932e0c026cf530d400 | [
"MIT"
] | 90 | 2015-01-25T22:41:37.000Z | 2022-02-25T14:20:29.000Z | import os
import unittest
import collections
from wordpress_xmlrpc import Client
from wordpress_xmlrpc.compat import ConfigParser
| 30.451613 | 67 | 0.597458 | import os
import unittest
import collections
from wordpress_xmlrpc import Client
from wordpress_xmlrpc.compat import ConfigParser
class WordPressTestCase(unittest.TestCase):
def setUp(self):
config = ConfigParser()
with open('wp-config.cfg', 'r') as f:
config.readfp(f)
... | 442 | 338 | 25 |
8a96b2526a46d3c7c2a012249d54841cf7b58463 | 2,018 | py | Python | tests/conftest.py | old-rob/cptac | 9b33893dd11c9320628a751c8840783a6ce81957 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | old-rob/cptac | 9b33893dd11c9320628a751c8840783a6ce81957 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | old-rob/cptac | 9b33893dd11c9320628a751c8840783a6ce81957 | [
"Apache-2.0"
] | null | null | null | import pytest
import cptac
import sys
# TODO: figure out what cwd of pytest is
sys.path.insert(0, "cptac/tests/")
from tests.cancer import Cancer
import curses
# Setting autouse=True here makes it so that this method always runs before any tests
@pytest.fixture(scope="session", autouse=True)
def get_datasets_lists():... | 29.676471 | 85 | 0.645193 | import pytest
import cptac
import sys
# TODO: figure out what cwd of pytest is
sys.path.insert(0, "cptac/tests/")
from tests.cancer import Cancer
import curses
# Setting autouse=True here makes it so that this method always runs before any tests
@pytest.fixture(scope="session", autouse=True)
def get_datasets_lists():... | 382 | 0 | 22 |
5246c8ad28a258f334d2822be1fcdafb23d8cfd2 | 2,105 | py | Python | test.py | glongh/research-computer-vision-bg-removal | c91b45f166f8470fb23efa60d3dd7a832786f0c2 | [
"MIT"
] | 1 | 2020-04-13T16:05:23.000Z | 2020-04-13T16:05:23.000Z | test.py | glongh/research-computer-vision-bg-removal | c91b45f166f8470fb23efa60d3dd7a832786f0c2 | [
"MIT"
] | null | null | null | test.py | glongh/research-computer-vision-bg-removal | c91b45f166f8470fb23efa60d3dd7a832786f0c2 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
filename = '33-1.jpg'
img = cv2.imread(filename) # read image
img = cv2.resize(img, (640, 480)) # resize it
img = cv2.blur(img, (3, 3)) # blur to remove noise
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) # BGR to HSV
cv2.namedWindow('Result Image (BGR)') # window to display image
... | 30.071429 | 80 | 0.691686 | import cv2
import numpy as np
def trackbar_callback(self):
pass
filename = '33-1.jpg'
img = cv2.imread(filename) # read image
img = cv2.resize(img, (640, 480)) # resize it
img = cv2.blur(img, (3, 3)) # blur to remove noise
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) # BGR to HSV
cv2.namedWindow('Result Ima... | 16 | 0 | 23 |
f8bdd069fe1ac13cc2e941eb6106286f5268a6cf | 1,029 | py | Python | pdffitx/modeling/core.py | st3107/pdffitx | c746f6dfaf5656e9bb62508a9847c00567b34bbe | [
"BSD-3-Clause"
] | 1 | 2022-03-10T11:59:34.000Z | 2022-03-10T11:59:34.000Z | pdffitx/modeling/core.py | st3107/pdffitx | c746f6dfaf5656e9bb62508a9847c00567b34bbe | [
"BSD-3-Clause"
] | null | null | null | pdffitx/modeling/core.py | st3107/pdffitx | c746f6dfaf5656e9bb62508a9847c00567b34bbe | [
"BSD-3-Clause"
] | 2 | 2020-12-14T18:38:43.000Z | 2022-03-30T00:25:35.000Z | """Core of the PDFfitx."""
from typing import Dict, Union
from diffpy.srfit.equation.builder import EquationFactory
from diffpy.srfit.fitbase import FitRecipe, FitContribution
from diffpy.srfit.fitbase import FitResults
from diffpy.srfit.pdf import PDFGenerator, DebyePDFGenerator
class MyContribution(FitContribution... | 25.097561 | 78 | 0.716229 | """Core of the PDFfitx."""
from typing import Dict, Union
from diffpy.srfit.equation.builder import EquationFactory
from diffpy.srfit.fitbase import FitRecipe, FitContribution
from diffpy.srfit.fitbase import FitResults
from diffpy.srfit.pdf import PDFGenerator, DebyePDFGenerator
class MyContribution(FitContribution... | 265 | 0 | 130 |
2e48961d31368175ff9eb670bb694502f2dadf9f | 8,172 | py | Python | psana/psana/pscalib/geometry/SegGeometryEpixHR2x2V1.py | ZhenghengLi/lcls2 | 94e75c6536954a58c8937595dcac295163aa1cdf | [
"BSD-3-Clause-LBNL"
] | 16 | 2017-11-09T17:10:56.000Z | 2022-03-09T23:03:10.000Z | psana/psana/pscalib/geometry/SegGeometryEpixHR2x2V1.py | ZhenghengLi/lcls2 | 94e75c6536954a58c8937595dcac295163aa1cdf | [
"BSD-3-Clause-LBNL"
] | 6 | 2017-12-12T19:30:05.000Z | 2020-07-09T00:28:33.000Z | psana/psana/pscalib/geometry/SegGeometryEpixHR2x2V1.py | ZhenghengLi/lcls2 | 94e75c6536954a58c8937595dcac295163aa1cdf | [
"BSD-3-Clause-LBNL"
] | 25 | 2017-09-18T20:02:43.000Z | 2022-03-27T22:27:42.000Z | #!/usr/bin/env python
"""
Class :py:class:`SegGeometryEpixHR2x2V1` describes the EpixHR2x2V1 sensor geometry
===================================================================================
In this class we use natural matrix notations like in data array
\n We assume that
\n * sensor consists of 2x2 ASICs has 288 r... | 33.62963 | 111 | 0.580396 | #!/usr/bin/env python
"""
Class :py:class:`SegGeometryEpixHR2x2V1` describes the EpixHR2x2V1 sensor geometry
===================================================================================
In this class we use natural matrix notations like in data array
\n We assume that
\n * sensor consists of 2x2 ASICs has 288 r... | 3,879 | 0 | 202 |
ea37237ae6fa200b3f83ee1cde035eabb1e90dc3 | 597 | py | Python | wltp/__init__.py | ankostis/wltp | c95462cadbcab32d4fc94f8ea8bf9d85a0a3763e | [
"Apache-2.0"
] | 11 | 2017-05-22T18:31:01.000Z | 2021-11-08T12:20:07.000Z | wltp/__init__.py | ankostis/wltp | c95462cadbcab32d4fc94f8ea8bf9d85a0a3763e | [
"Apache-2.0"
] | 11 | 2016-08-09T13:37:13.000Z | 2020-03-31T20:33:20.000Z | wltp/__init__.py | JRCSTU/wltp | 18650f372044371ed994a161a93473a75e76d2a9 | [
"Apache-2.0"
] | 6 | 2017-11-30T10:22:32.000Z | 2020-12-03T14:04:55.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2020 European Commission (JRC);
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
"""
wltp: generate WLTC gear-shifts bas... | 31.421053 | 73 | 0.730318 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2020 European Commission (JRC);
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
"""
wltp: generate WLTC gear-shifts bas... | 0 | 0 | 0 |
293b07eea420cdfc371779e574c4f2ae19015f9c | 6,387 | py | Python | graphene_mongoengine/converter.py | ramarivera/graphene-mongoengine | 1020674233993bba98454b1850f184f7b79a614e | [
"MIT"
] | null | null | null | graphene_mongoengine/converter.py | ramarivera/graphene-mongoengine | 1020674233993bba98454b1850f184f7b79a614e | [
"MIT"
] | null | null | null | graphene_mongoengine/converter.py | ramarivera/graphene-mongoengine | 1020674233993bba98454b1850f184f7b79a614e | [
"MIT"
] | null | null | null | """ Contains conversion logic between Mongoengine Fields and Graphene Types """
from singledispatch import singledispatch
from graphene import (
String, Boolean, Int, Float, List,
ID, Dynamic, Field
)
from graphene.types.json import JSONString
from graphene.types.datetime import DateTime
from mongoengine.fi... | 35.287293 | 90 | 0.7783 | """ Contains conversion logic between Mongoengine Fields and Graphene Types """
from singledispatch import singledispatch
from graphene import (
String, Boolean, Int, Float, List,
ID, Dynamic, Field
)
from graphene.types.json import JSONString
from graphene.types.datetime import DateTime
from mongoengine.fi... | 0 | 0 | 0 |
a91627687f701f1e786a9dfdfc4b5c63f259087e | 1,046 | py | Python | beetsplug/synoindex.py | nnutter/beetsplug-synoupdate | efb871d14e2aab035edd5b1eb84f338bd6c72eaa | [
"MIT"
] | 1 | 2019-08-30T20:08:14.000Z | 2019-08-30T20:08:14.000Z | beetsplug/synoindex.py | nnutter/beets-synoindex | efb871d14e2aab035edd5b1eb84f338bd6c72eaa | [
"MIT"
] | null | null | null | beetsplug/synoindex.py | nnutter/beets-synoindex | efb871d14e2aab035edd5b1eb84f338bd6c72eaa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Updates the Synology (music) index whenever the beets library is changed.
This assumes beets is being run on Synology DiskStation Manager so synoindex is
available. Besides enabling the plugin no configuration is needed.
"""
from subprocess import run
from beets.plugins import BeetsPlugi... | 32.6875 | 79 | 0.681644 | # -*- coding: utf-8 -*-
"""Updates the Synology (music) index whenever the beets library is changed.
This assumes beets is being run on Synology DiskStation Manager so synoindex is
available. Besides enabling the plugin no configuration is needed.
"""
from subprocess import run
from beets.plugins import BeetsPlugi... | 281 | 419 | 23 |
028dcb80f622499343570a62bcd9366252b41849 | 927 | py | Python | tests/app/urls.py | zvolsky/django-smoke-tests | 049a6b92013c78f44c5ec9cb55d9978f391af3d7 | [
"MIT"
] | 17 | 2017-12-04T15:18:16.000Z | 2021-04-22T11:32:25.000Z | tests/app/urls.py | zvolsky/django-smoke-tests | 049a6b92013c78f44c5ec9cb55d9978f391af3d7 | [
"MIT"
] | 19 | 2017-12-28T15:17:46.000Z | 2022-03-30T12:38:16.000Z | tests/app/urls.py | zvolsky/django-smoke-tests | 049a6b92013c78f44c5ec9cb55d9978f391af3d7 | [
"MIT"
] | 8 | 2017-12-28T12:31:09.000Z | 2021-11-01T15:28:23.000Z | from django.conf.urls import url
from .views import (
app_view,
skipped_app_view,
view_with_decorator_with_wraps,
view_with_decorator_without_wraps
)
url_patterns_with_decorator_with_wraps = [
url(
r'^decorator-with-wraps/$', view_with_decorator_with_wraps,
name='decorator_with_wr... | 27.264706 | 98 | 0.740022 | from django.conf.urls import url
from .views import (
app_view,
skipped_app_view,
view_with_decorator_with_wraps,
view_with_decorator_without_wraps
)
url_patterns_with_decorator_with_wraps = [
url(
r'^decorator-with-wraps/$', view_with_decorator_with_wraps,
name='decorator_with_wr... | 0 | 0 | 0 |
32c8006bba7b812dd90dbf00ad7538d247c99ac1 | 377 | py | Python | apps/music/forms.py | deniskrumko/dendynotdead | d1fd8b32cf2065413c19799f45487ed317b85eb1 | [
"MIT"
] | null | null | null | apps/music/forms.py | deniskrumko/dendynotdead | d1fd8b32cf2065413c19799f45487ed317b85eb1 | [
"MIT"
] | null | null | null | apps/music/forms.py | deniskrumko/dendynotdead | d1fd8b32cf2065413c19799f45487ed317b85eb1 | [
"MIT"
] | null | null | null | from django import forms
from ckeditor.widgets import CKEditorWidget
from .models import Track
class TrackForm(forms.ModelForm):
"""Form for ``TrackAdmin`` class."""
| 20.944444 | 61 | 0.62069 | from django import forms
from ckeditor.widgets import CKEditorWidget
from .models import Track
class TrackForm(forms.ModelForm):
"""Form for ``TrackAdmin`` class."""
class Meta:
model = Track
fields = '__all__'
widgets = {
'preview': CKEditorWidget(config_name='preview')... | 0 | 176 | 27 |
5dd1213dd3f73209ea765012dee6ad96ca31a19a | 3,856 | py | Python | intake_informaticslab/datasources/__init__.py | informatics-lab/met_office_datasets | ef0664ab8434be88cbfdd69550ba710ee7b789da | [
"MIT"
] | 5 | 2021-01-27T14:17:59.000Z | 2021-07-09T15:58:24.000Z | intake_informaticslab/datasources/__init__.py | informatics-lab/met_office_datasets | ef0664ab8434be88cbfdd69550ba710ee7b789da | [
"MIT"
] | 6 | 2021-01-22T11:10:54.000Z | 2021-03-09T20:47:31.000Z | intake_informaticslab/datasources/__init__.py | informatics-lab/met_office_datasets | ef0664ab8434be88cbfdd69550ba710ee7b789da | [
"MIT"
] | 4 | 2021-02-02T20:06:04.000Z | 2021-07-14T09:35:21.000Z | import datetime
from intake.catalog.local import YAMLFilesCatalog
from intake.source.base import Schema
from intake_xarray.base import DataSourceMixin
from intake_informaticslab import __version__
from .dataset import MODataset
from .utils import datetime_to_iso_str
DATA_DELAY = 24 + 6 # num hours from current tim... | 29.891473 | 127 | 0.606068 | import datetime
from intake.catalog.local import YAMLFilesCatalog
from intake.source.base import Schema
from intake_xarray.base import DataSourceMixin
from intake_informaticslab import __version__
from .dataset import MODataset
from .utils import datetime_to_iso_str
DATA_DELAY = 24 + 6 # num hours from current tim... | 3,070 | 343 | 95 |
0fc663fadf5973ff1122258488801ebf6e8060b0 | 5,776 | py | Python | opentumblrqt/gui/TumblrTextEdit.py | ialex/opentumblr-qt | 395c5708b7f72d88fa7d13ebf8ba8908c984f045 | [
"MIT"
] | 2 | 2015-01-10T13:42:51.000Z | 2015-08-08T05:11:31.000Z | opentumblrqt/gui/TumblrTextEdit.py | ialex/opentumblr-qt | 395c5708b7f72d88fa7d13ebf8ba8908c984f045 | [
"MIT"
] | null | null | null | opentumblrqt/gui/TumblrTextEdit.py | ialex/opentumblr-qt | 395c5708b7f72d88fa7d13ebf8ba8908c984f045 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from PyQt4 import QtCore, QtGui
'''
Created on 06/11/2009
@author: iAlex
'''
class TumblrTextEdit(QtGui.QVBoxLayout):
'''
Especial Text Editor for Tumblr it allow to create bold,italic,strike text as well
insert links and image it includes a preview
'''
pariente = None
... | 41.855072 | 131 | 0.578947 | #!/usr/bin/python
from PyQt4 import QtCore, QtGui
'''
Created on 06/11/2009
@author: iAlex
'''
class TumblrTextEdit(QtGui.QVBoxLayout):
'''
Especial Text Editor for Tumblr it allow to create bold,italic,strike text as well
insert links and image it includes a preview
'''
pariente = None
... | 4,978 | 0 | 452 |
1d3e218e9ff31fea56897e054ced615bea468069 | 2,114 | py | Python | test/do_not_test_missing_imagedata_rid.py | usr3/docx2python | 3d0cdd6b94388e7dd2318cb61c9bb99da8853b77 | [
"MIT"
] | null | null | null | test/do_not_test_missing_imagedata_rid.py | usr3/docx2python | 3d0cdd6b94388e7dd2318cb61c9bb99da8853b77 | [
"MIT"
] | null | null | null | test/do_not_test_missing_imagedata_rid.py | usr3/docx2python | 3d0cdd6b94388e7dd2318cb61c9bb99da8853b77 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""Skip image element when imagedata r:id cannot be found.
:author: Shay Hill
:created: 11/15/2020
User forky2 sent a docx file with an empty imagedata element:
`<v:imagedata croptop="-65520f" cropbottom="65520f"/>`
Docx2python expects to encounter
`<v:imagedata r:id=... | 39.148148 | 94 | 0.714759 | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""Skip image element when imagedata r:id cannot be found.
:author: Shay Hill
:created: 11/15/2020
User forky2 sent a docx file with an empty imagedata element:
`<v:imagedata croptop="-65520f" cropbottom="65520f"/>`
Docx2python expects to encounter
`<v:imagedata r:id=... | 0 | 0 | 0 |
ce897b0f1465538acdef22b6801865aa62e10c44 | 1,686 | py | Python | lino_book/projects/chooser/models.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 3 | 2016-08-25T05:58:09.000Z | 2019-12-05T11:13:45.000Z | lino_book/projects/chooser/models.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 18 | 2016-11-12T21:38:58.000Z | 2019-12-03T17:54:38.000Z | lino_book/projects/chooser/models.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 9 | 2016-10-15T11:12:33.000Z | 2021-09-22T04:37:37.000Z |
from django.db import models
from lino.api import dd, _
from lino_book.projects.chooser.food import year_in_school, food_choices, food
| 20.560976 | 78 | 0.662515 |
from django.db import models
from lino.api import dd, _
from lino_book.projects.chooser.food import year_in_school, food_choices, food
class Country(dd.Model):
class Meta(object):
verbose_name = _("Country")
verbose_name_plural = _("Countries")
name = models.CharField(max_length=20)
d... | 235 | 1,119 | 184 |
2f0901b8e7b8a26002b250aeeddd07d8dee9922f | 354 | py | Python | Staircase.py | LuisAngelHM/python | a9b9db0e561c4e675c462ee3a30c3326c00b7aa2 | [
"MIT"
] | null | null | null | Staircase.py | LuisAngelHM/python | a9b9db0e561c4e675c462ee3a30c3326c00b7aa2 | [
"MIT"
] | null | null | null | Staircase.py | LuisAngelHM/python | a9b9db0e561c4e675c462ee3a30c3326c00b7aa2 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
tamanio = int(input("Ingresa el numero de escalones: "))
staircase(tamanio) | 23.6 | 60 | 0.567797 | def spaces(n, i):
countSpace= n-i
spaces = " "*countSpace
return spaces
def staircase(n):
for i in range(1, n+1):
cadena = spaces(n,i)
steps = "#"*i
cadena = cadena+steps
print(cadena)
if __name__ == "__main__":
tamanio = int(input("Ingresa el numero de esc... | 193 | 0 | 45 |
fc03f1fc6f9a03d52a977d8f259768d6fb7c0bfc | 469 | py | Python | tests/task_return.py | mfrasca/fibra | c9363f311dc07b43bdfddcbf1f3084290278f535 | [
"Unlicense"
] | null | null | null | tests/task_return.py | mfrasca/fibra | c9363f311dc07b43bdfddcbf1f3084290278f535 | [
"Unlicense"
] | null | null | null | tests/task_return.py | mfrasca/fibra | c9363f311dc07b43bdfddcbf1f3084290278f535 | [
"Unlicense"
] | null | null | null | from __future__ import print_function
import fibra
if __name__ == "__main__":
test()
| 16.172414 | 59 | 0.620469 | from __future__ import print_function
import fibra
def task_y():
print("task_y is starting")
v = yield task_z()
print("task_y received", v, "from task_z, expected 3.")
def task_z():
print("task_z is starting")
yield None
yield None
yield fibra.Return(3)
yield fibra.Return(4)
pri... | 301 | 0 | 69 |
5dbe9653030804a0267511445d68e3214014ec92 | 21 | py | Python | midnight_catalog/templatetags/__init__.py | webadmin87/midnight | b60b3b257b4d633550b82a692f3ea3756c62a0a9 | [
"BSD-3-Clause"
] | 1 | 2015-11-20T12:42:39.000Z | 2015-11-20T12:42:39.000Z | midnight_catalog/templatetags/__init__.py | webadmin87/midnight | b60b3b257b4d633550b82a692f3ea3756c62a0a9 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T21:21:12.000Z | 2021-06-10T17:23:56.000Z | midnight_news/templatetags/__init__.py | webadmin87/midnight | b60b3b257b4d633550b82a692f3ea3756c62a0a9 | [
"BSD-3-Clause"
] | 1 | 2015-11-04T09:23:31.000Z | 2015-11-04T09:23:31.000Z | __author__ = 'anton'
| 10.5 | 20 | 0.714286 | __author__ = 'anton'
| 0 | 0 | 0 |
0a14e0e86e5680630f0fa7fc981299a0bc8afdb2 | 4,132 | py | Python | 033/main.py | joserc87/project-euler | 43b124bfd8085b45642c1b247bb6d949853df1cf | [
"Apache-2.0"
] | null | null | null | 033/main.py | joserc87/project-euler | 43b124bfd8085b45642c1b247bb6d949853df1cf | [
"Apache-2.0"
] | null | null | null | 033/main.py | joserc87/project-euler | 43b124bfd8085b45642c1b247bb6d949853df1cf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import math
""" \brief Calcula tantos primos como se indique y los guarda en un
vector
\param primos Un vector de primos
\param hasta El mayor número que queremos comprobar si es primo. Si
hasta es primo, se añadirá al vector
"""
##############################################... | 28.108844 | 100 | 0.505082 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import math
""" \brief Calcula tantos primos como se indique y los guarda en un
vector
\param primos Un vector de primos
\param hasta El mayor número que queremos comprobar si es primo. Si
hasta es primo, se añadirá al vector
"""
def calcularPrimos (primos, hasta):
cambia=... | 1,741 | 0 | 133 |
89f6e657fa274b97dd90c7e1c2c703a73254c1c0 | 233 | py | Python | tccli/services/postgres/__init__.py | hapsyou/tencentcloud-cli-intl-en | fa8ba71164484f9a2be4b983080a1de08606c0b0 | [
"Apache-2.0"
] | null | null | null | tccli/services/postgres/__init__.py | hapsyou/tencentcloud-cli-intl-en | fa8ba71164484f9a2be4b983080a1de08606c0b0 | [
"Apache-2.0"
] | null | null | null | tccli/services/postgres/__init__.py | hapsyou/tencentcloud-cli-intl-en | fa8ba71164484f9a2be4b983080a1de08606c0b0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from tccli.services.postgres.postgres_client import register_arg
from tccli.services.postgres.postgres_client import get_actions_info
from tccli.services.postgres.postgres_client import AVAILABLE_VERSION_LIST
| 46.6 | 74 | 0.849785 | # -*- coding: utf-8 -*-
from tccli.services.postgres.postgres_client import register_arg
from tccli.services.postgres.postgres_client import get_actions_info
from tccli.services.postgres.postgres_client import AVAILABLE_VERSION_LIST
| 0 | 0 | 0 |
50bba0c4be93ed1e97d0cb63a34b0af81e62ae0f | 3,725 | py | Python | Source/SourceFiles/OP2RigSettings.py | BlenderAddonsArchive/OpenPose-to-Blender-Facial-Capture-Transfer | 1c1cec7a3fa5e4d6195630ecea7b095beefa6417 | [
"MIT"
] | 198 | 2020-04-27T07:52:51.000Z | 2022-03-22T08:08:32.000Z | Source/SourceFiles/OP2RigSettings.py | BlenderAddonsArchive/OpenPose-to-Blender-Facial-Capture-Transfer | 1c1cec7a3fa5e4d6195630ecea7b095beefa6417 | [
"MIT"
] | 14 | 2020-05-15T23:10:08.000Z | 2022-01-07T19:10:13.000Z | Source/SourceFiles/OP2RigSettings.py | BlenderAddonsArchive/OpenPose-to-Blender-Facial-Capture-Transfer | 1c1cec7a3fa5e4d6195630ecea7b095beefa6417 | [
"MIT"
] | 51 | 2020-04-30T12:20:19.000Z | 2022-03-31T10:14:02.000Z | import bpy
#class ListIndex(bpy.types.IntProperty):
#list_index: bpy.props.IntProperty(name = "Index for my_list", default = 0)
# bpy.types.Scene.list_index = IntProperty(name = "Index for my_list", default = 0)
#class MyBoneMapIndex(bpy.types.PropertyGroup):
# use an annotation
#bone_index : bp... | 32.391304 | 105 | 0.624161 | import bpy
class OpenPoseToRigifySettings(bpy.types.PropertyGroup):
facial_capture: bpy.props.BoolProperty(
name="Facial Capture",
description="As We read in the JSON files do we apply facial capture to the character",
default = True
)
body_capture: bpy.props.BoolPrope... | 243 | 2,881 | 75 |
85a884b4b4d4ecc56388feacfb8290520149abeb | 2,229 | py | Python | Shop_platform/users/views.py | Tozman99/Shop_platform | c49a7724882b2f5468877806494319dcd8bd0314 | [
"MIT"
] | 1 | 2021-11-07T08:52:16.000Z | 2021-11-07T08:52:16.000Z | Shop_platform/users/views.py | Tozman99/shop_platform | c49a7724882b2f5468877806494319dcd8bd0314 | [
"MIT"
] | 18 | 2021-03-19T08:51:38.000Z | 2022-03-12T00:38:18.000Z | Shop_platform/users/views.py | Tozman99/Shop_platform | c49a7724882b2f5468877806494319dcd8bd0314 | [
"MIT"
] | null | null | null | from django.shortcuts import render,redirect, get_object_or_404
from .forms import User_Form, Profile_Form
from django.contrib import messages
from django.urls import reverse
from django.contrib.auth.models import User
from django.core.mail import send_mass_mail, send_mail
from Shop_platform.settings import EMAIL_HOST_... | 27.8625 | 189 | 0.736653 | from django.shortcuts import render,redirect, get_object_or_404
from .forms import User_Form, Profile_Form
from django.contrib import messages
from django.urls import reverse
from django.contrib.auth.models import User
from django.core.mail import send_mass_mail, send_mail
from Shop_platform.settings import EMAIL_HOST_... | 1,570 | 0 | 138 |
5fb3742dd84e288161014ef9323e174fdde6bfcc | 706 | py | Python | tests/app/questionnaire/test_location.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | null | null | null | tests/app/questionnaire/test_location.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | 8 | 2020-03-24T15:24:18.000Z | 2022-03-02T04:32:56.000Z | tests/app/questionnaire/test_location.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | null | null | null | import unittest
from app import create_app
from app.questionnaire.location import Location
| 27.153846 | 107 | 0.635977 | import unittest
from app import create_app
from app.questionnaire.location import Location
class TestLocation(unittest.TestCase):
def setUp(self):
self.app = create_app()
self.app.config['SERVER_NAME'] = "test"
self.app_context = self.app.app_context()
self.app_context.push()
... | 519 | 17 | 77 |
7b622b0412e375f260bb2c44c6b1814c2b8ed98d | 16 | py | Python | gscripts/GO/__init__.py | YeoLab/gscripts | ae653d29d0ce82d342f7f6ff5bbeedd27a2e062b | [
"MIT"
] | 12 | 2015-07-10T09:36:49.000Z | 2021-07-06T03:25:04.000Z | gscripts/GO/__init__.py | YeoLab/gscripts | ae653d29d0ce82d342f7f6ff5bbeedd27a2e062b | [
"MIT"
] | 43 | 2015-01-21T20:01:38.000Z | 2021-04-13T17:50:38.000Z | gscripts/GO/__init__.py | YeoLab/gscripts | ae653d29d0ce82d342f7f6ff5bbeedd27a2e062b | [
"MIT"
] | 19 | 2015-05-02T09:33:17.000Z | 2022-02-12T17:08:06.000Z | from GO import * | 16 | 16 | 0.75 | from GO import * | 0 | 0 | 0 |
a7c8ee6f18fd748ac197bfee18d656dc031e9031 | 24,375 | py | Python | src/nti/webhooks/subscriptions.py | NextThought/nti.webhooks | 2015a02fba8d4ca1811a76872a2266c5e85d5728 | [
"Apache-2.0"
] | 1 | 2020-10-20T09:23:57.000Z | 2020-10-20T09:23:57.000Z | src/nti/webhooks/subscriptions.py | NextThought/nti.webhooks | 2015a02fba8d4ca1811a76872a2266c5e85d5728 | [
"Apache-2.0"
] | 7 | 2020-06-23T22:10:37.000Z | 2020-12-04T20:27:45.000Z | src/nti/webhooks/subscriptions.py | NextThought/nti.webhooks | 2015a02fba8d4ca1811a76872a2266c5e85d5728 | [
"Apache-2.0"
] | 1 | 2020-10-28T19:58:12.000Z | 2020-10-28T19:58:12.000Z | # -*- coding: utf-8 -*-
"""
Subscription implementations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import time
from zope import component
from zope.event import notify
from zope.interface import Interface
from zope.interface import im... | 40.490033 | 124 | 0.691282 | # -*- coding: utf-8 -*-
"""
Subscription implementations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import time
from zope import component
from zope.event import notify
from zope.interface import Interface
from zope.interface import im... | 13,661 | 477 | 1,179 |
1a3521b67ae8fecf9df0de38141b6e9fd9b00abe | 833 | py | Python | app/controller/c_convert_text/c_dec_hex.py | SiGae/convert-it_back | 723cf386fdfadfc0c7d9bf14f37b792148ab2b6d | [
"MIT"
] | null | null | null | app/controller/c_convert_text/c_dec_hex.py | SiGae/convert-it_back | 723cf386fdfadfc0c7d9bf14f37b792148ab2b6d | [
"MIT"
] | null | null | null | app/controller/c_convert_text/c_dec_hex.py | SiGae/convert-it_back | 723cf386fdfadfc0c7d9bf14f37b792148ab2b6d | [
"MIT"
] | null | null | null | from typing import List | 23.8 | 48 | 0.456182 | from typing import List
def convert_decimal_to_hex(dec_list: List[int]):
hex_list: List[hex] = list()
for dec in dec_list:
hex_list.append(hex(dec))
response_data = (
{
'isResult' : True,
'code' : 'SUCCESS',
'data' : {
... | 764 | 0 | 46 |